-
Notifications
You must be signed in to change notification settings - Fork 151
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
bake STOPSIGNAL into Dockerfile #44
Conversation
Interesting, had no idea that existed. Looks like it's been there since 2015: https://github.com/moby/moby/blob/4b18f8c4bf63ef27045b79fb110f4b84c1dc1819/CHANGELOG.md#190-2015-11-03 @cirocosta Any thoughts on this? Would it make sense for k8s too? edit: also would you mind doing the DCO process? It's pretty lightweight: https://github.com/concourse/concourse-docker/pull/44/checks?check_run_id=119750704 |
Dockerfile syntax now supports a STOPSIGNAL directive which AFAIK should make the README.md comment on SIGUSR2 redundant https://docs.docker.com/engine/reference/builder/#stopsignal Signed-off-by: Lewis Cowles <[email protected]>
Thank you for 👀 and feedback. DCO Done.
FWIW I've never seen any other application pass this signal via Dockerfile. What it ensures is that |
Hi @Lewiscowles1986 , thanks for the contribution!
Interestingly, it only got to the OCI spec two years later: opencontainers/image-spec#544, in which case,
hmmmmm, it makes sense for those expecting a scale-in / ## Signal to send to the worker container when shutting down.
## Possible values:
##
## - SIGUSR1: land the worker, and
## - SIGUSR2: retire the worker.
##
## Note.: using SIGUSR2 with persistence enabled implies the use of an
## initContainer that removes any data the existed previously under
## `concourse.worker.workDir` as the action of `retire`ing a worker implies
## that no state comes back with it when re-registering.
##
## Ref: https://concourse-ci.org/concourse-worker.html
## Ref: https://concourse-ci.org/worker-internals.html
##
shutdownSignal: SIGUSR2 (see At the execution of the Personally, I prefer the explicitness of telling whatever runs my containers to have a specific behavior, rather than putting that behind the image definition. tl;dr: the Chart would work just fine, but for those who consume the "raw image", it might affect them if they're expecting a |
I wanted to double check if those things I said are really true hahah, here's a table with the results: The lower right is what I mentioned 🤔 does that make sense? Thanks! |
@cirocosta If the worker is shutting down all of its containers and volumes will go away with its container, so shouldn't that pretty much always be a Although, for this use case retiring isn't really aggressive enough. Retiring can take a while and exceed the stop timeout. I'm not sure what signal Docker sends after the timeout, but if it's |
Yeah, that's totally valid when having ephemeral containers like a For those using
In that case, the "going away" is more like a landing as it comes back with the "same" state (just volumes, actually). In the case of the Chart, we allow that if the person wants, although the default is the (yeah, I'd like a lot more to just go ephemeral in any case, but at the moment, it's way easier to use a StatefulSet as a way of getting separate disks attached to your pod and not worry about filling the machine's default disk or consuming all of its bandwidth).
yeahh, that's the case in k8s as well - something like this:
That's true! Do you think that's more reason for concourse/concourse#3600 ?
hmmmm that's interesting - maybe that's something that deserves its own issue 🤔 Do those answers help? thanks!! |
Didn't know they came back with the same disk. That seems kind of janky - does Garden just reap the container depot on start, then? I guess keeping the volumes around is nice, it's just weird that only half of the state remains.
Yep.
Yep. We do have this tracked as concourse/concourse#2827 but we never proposed that as a solution. I'll suggest it there. |
I have no idea what everyone is talking about. Can I be tagged back in specifically if something for me is here. Thanks |
@Lewiscowles1986 LOL. Sorry. I think at this point the change itself is fine, we're just making sure we understand the impact it may have and where it fits on our roadmap. @cirocosta I'm leaning towards merging this as it feels like a more sensible default for Docker, but it sounds like it'd have impact on those using |
@vito sounds good! No changes actually 😁 For those consuming the Chart, everything is transparent - if they configure a specific signal (which we already default to thx! |
👍 merging - thanks @Lewiscowles1986! |
Should I PR the README.md to remove the note about SIGUSR2? |
concourse#44 should make this redundant I hope
#44 should make this redundant I hope
Dockerfile syntax now supports a STOPSIGNAL directive which AFAIK should make the README.md comment on SIGUSR2 redundant https://docs.docker.com/engine/reference/builder/#stopsignal