-
Notifications
You must be signed in to change notification settings - Fork 134
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
Better signal handling (for Job cancellations) #392
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…I thought it was)
This reverts commit 50a2f2c.
pzeballos
approved these changes
Jun 8, 2023
raylu
reviewed
Jun 8, 2023
zzak
added a commit
to zzak/buildkite-config
that referenced
this pull request
Feb 17, 2024
* https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/releases * https://github.com/buildkite-plugins/artifacts-buildkite-plugin/releases In previous testing of the docker-compose plugin, I found that it handled retries better. There is also buildkite-plugins/docker-compose-buildkite-plugin#392 which addressed a particular issue we had before.
atosbucket
added a commit
to atosbucket/rails-buildkit
that referenced
this pull request
Mar 22, 2024
* https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/releases * https://github.com/buildkite-plugins/artifacts-buildkite-plugin/releases In previous testing of the docker-compose plugin, I found that it handled retries better. There is also buildkite-plugins/docker-compose-buildkite-plugin#392 which addressed a particular issue we had before.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds signal handling on
INT
,TERM
andQUIT
on the command hook script so that the main container is stopped gracefully. It also gets logs for the container if not removed (though technically only strictly necessary for compose v1 as v2 still shows the output until the container is killed).I have tested this with the following ruby code:
Save that file and use docker compose to run the file in a vanilla ruby container. Once it is running, cancel the job.
Without this code, the step cancels immediately, but the main container is still running and (by default) killed during the
pre-exit
hook. Even when usinggraceful-termination
so that the container is stopped instead, you are missing the actual container output since the job was cancelled and then removed (which is now guaranteed by #386).With this code, instead, the container gets sent its corresponding stop signal (as defined in its dockerfile)
Closes #389