Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aws-ecs] On MacOS the fromImage filled the trash with content recursively and lock those files in Trash #10858

Closed
olivier-schmitt opened this issue Oct 14, 2020 · 2 comments
Assignees
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@olivier-schmitt
Copy link

I tried to use aws_ecs.ContainerImage.from_asset('..') function to build a Docker image and to use it in a Fargate cluster.

At first, I failed to use this because the path was not correct and I had errors about paths and names being too long.

I fixed the path and went on.

Later on when I tried to empty the trash of my MacOS, I noticed I was not able to do so.

I found out that cdk assets were in the trash and I was not able to delete them.
I tried to remove all docker images related to the CDK and I noticed that the files in Trash seem to be a recursive tree:

image

Reproduction Steps

Probably by using a bad path in fromImage function.

What did you expect to happen?

Not to have such problem with the trash.

What actually happened?

  • the trash says the files are used and I'm not able to delete them using the vairous UI techniques
  • recursive tree of files which does not exists in my codebase

Environment

  • CLI Version : (node:906) ExperimentalWarning: The fs.promises API is experimental
    1.67.0 (build 2b4dd71)
  • Framework Version:
  • Node.js Version: v10.16.3
  • OS : MacOs 10.15.7
  • Language (Version): Python 3.8

Other


This is 🐛 Bug Report

@olivier-schmitt olivier-schmitt added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 14, 2020
@olivier-schmitt olivier-schmitt changed the title [module] On MacOS the fromImage filled the trash with content recursively [aws_ecs] On MacOS the fromImage filled the trash with content recursively and lock those files in Trash Oct 14, 2020
@SomayaB SomayaB changed the title [aws_ecs] On MacOS the fromImage filled the trash with content recursively and lock those files in Trash [aws-ecs] On MacOS the fromImage filled the trash with content recursively and lock those files in Trash Oct 16, 2020
@SomayaB SomayaB added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Oct 16, 2020
@MrArnoldPalmer
Copy link
Contributor

hey @olivier-schmitt, when using fromAsset it's best to use path.resolve(__dirname, ...) when pointing to a file relative to your cdk source. Otherwise the path will be relative to the working directory where synth was run from. You may have discovered this already.

This occurs when you point to a Dockerfile that is in a directory that is a parent of the CDK app. There is a ticket for this here. I'm gonna close in favor of that one.

I reproduced and was able to remove the generated output by running rm -r cdk.out.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants