8000 fix(docker): get container logs even on error by mmaeng · Pull Request #214 · aws-cloudformation/cloudformation-cli-python-plugin · GitHub
[go: up one dir, main page]

Skip to content

fix(docker): get container logs even on error #214

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

Closed
wants to merge 6 commits into from

Conversation

mmaeng
Copy link
Contributor
@mmaeng mmaeng commented Nov 4, 2022

Closes #211

On docker container error auto_remove=True would not return container output. Switched to remove=True in docker.client.containers.run for slightly less robust container removal but much better logging.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mmaeng mmaeng requested review from ericzbeard and kddejong November 4, 2022 04:14
@mmaeng mmaeng mentioned this pull request Nov 4, 2022
Copy link
Contributor
@kddejong kddejong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little torn on this change. Can you put in more details about what this change means?

If I'm reading correctly if for some reason my process crashes then the container won't be removed anymore?

@mmaeng
Copy link
Contributor Author
mmaeng commented Nov 4, 2022

That is correct. If the container exits with an error the container would not be removed so further investigation can be carried out.

Copy link
@ericzbeard ericzbeard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will work, based on my testing when I had the issue with space running out on the device. I think we have to get rid of auto_remove.

Copy link
Contributor
@kddejong kddejong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this process wrapped in the same process that prevents cancelling it?

Also I think at its current version @ericzbeard is correct this won't capture the error he is talking about.

@kddejong
Copy link
Contributor
kddejong commented Nov 8, 2022

I'm still super torn on this PR. I prefer auto_remove and this is a workaround because of an issue with docker-py to cover a very specific case which is a container not starting (in this case the disk being full). I'm just not sure the value is there to do this change.

mmaeng and others added 4 commits November 8, 2022 15:21
…Windows (aws-cloudformation#208)

* When on windows will not use os.geteuid() but root:root, also if call fails it will add warning message

* Change test for docker no euid to work on Windows
…multi-os (aws-cloudformation#215)

* Update github actions to latest version and test on all branches/PR

* Added default line ending to LF on git checkout

* Remove Python 3.10 from testing, fails for macos and windows

* added precommit caching and pip caching

* Add noop CI job for requirements
@mmaeng
Copy link
Contributor Author
mmaeng commented Nov 8, 2022

Let me clean up this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker errors are hidden
4 participants
0