-
Notifications
You must be signed in to change notification settings - Fork 615
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
Support the init for container spec #2350
Conversation
Please sign your commits following these rules: $ git clone -b "init-support" [email protected]:AliyunContainerService/swarmkit.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f Amending updates the existing PR. You DO NOT need to open a new one. |
62e6533
to
f605901
Compare
Codecov Report
@@ Coverage Diff @@
## master #2350 +/- ##
==========================================
+ Coverage 59.96% 60.08% +0.12%
==========================================
Files 128 128
Lines 26183 26185 +2
==========================================
+ Hits 15701 15734 +33
+ Misses 9092 9061 -31
Partials 1390 1390 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@denverdino how will this be used by Docker?
Still need some change int the docker/cli and moby/moby, the user interface should be in the docker service create --init ... It is similar to docker run --init Thnaks |
Sounds like a reasonable feature to me, and it contributes to parity with the Docker API. It would be useful to add a tracker issue for this in cc @aluzzardi @thaJeztah WDYT? |
Sure, will do. And this PR is related to #2173 |
api/specs.proto
Outdated
@@ -293,6 +293,11 @@ message ContainerSpec { | |||
// task will exit and a new task will be rescheduled elsewhere. A container | |||
// is considered unhealthy after `Retries` number of consecutive failures. | |||
HealthConfig healthcheck = 16; | |||
|
|||
// Run a custom init inside the container, if null, use the daemon's configured settings | |||
oneof init{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a space between init
and {`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed and thanks
Yes, I have no problem adding this for services 👍
Yes; I linked this PR already to the "epic", moby/moby#25303, but it's best to have an issue in moby/moby tracking it as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@denverdino can you squash your two commits into one, and open a tracking issue in moby/moby and link back to this PR? We can merge this PR then.
Signed-off-by: Li Yi <[email protected]>
9324d0a
to
fe60f09
Compare
Thanks, the issue is opened in moby/moby#34529, and commits are rebased and squashed. |
Why is this field a |
@denverdino can you please reply to @stevvooe's concern above? In particular, there should be a comment about what the field does, as well as why this can't be a regular boolean. Since this is a feature in progress, we should make these changes sooner rather than later. cc @thaJeztah |
From https://github.com/moby/moby/blob/master/api/types/container/host_config.go So, we need to tell if the int is set or not. That is why we need oneof. Your thought? Thanks |
Signed-off-by: David Sheets <[email protected]>
@denverdino That is not the correct use of To tell you the trust, this doesn't need to be a pointer. The default of |
@stevvooe my understanding is if the daemon flag is set, the default value will be the changed. Then if the init flag is not set in the container/service, it use the daemon's configured settings E.g. when the init flag in daemon is true, if the init flag of container/service is null, the real value will be true. if the init flag of container/service is false, the real value will be false. Your thought? |
@denverdino This is an incorrect use of |
@stevvooe this was vendored already in moby, and (I think) part of the 17.09 release/rc's is that a problem? (the option itself is not exposed yet in the Docker API) |
@thaJeztah This needs to be removed immediately. This is not the correct use of If our focus is on quality, we need to commit to it and ensure stuff like this doesn't slip through review. I brought this up over two weeks ago. If this can't be done by a current contributor, I'll submit a PR to revert this commit so we can avoid releasing with a broken use of |
I think that's the best short term solution ping @andrewhsu FYI ^^ |
…-support" This reverts commit 3882d21, reversing changes made to 6716ddf. Signed-off-by: Anshul Pundir <[email protected]>
…port" (#2383) This reverts commit 3882d21, reversing changes made to 6716ddf. Signed-off-by: Anshul Pundir <[email protected]>
@stevvooe @thaJeztah That is fine, I adjust that with new PR #2386, pls take a look. |
…-support" (moby#2383) This reverts commit 3882d21, reversing changes made to 6716ddf. Signed-off-by: Anshul Pundir <[email protected]>
Add the optional init flag in container spec for init feature since Docker v1.13
Signed-off-by: Li Yi [email protected]