-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Added option hostname to docker service create. This option will allo… #25437
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
Conversation
|
This pull request is failing on build because it depends on the following pull requests: docker-archive-public/docker.engine-api#352 |
|
I could fix the failing-ci if I change hack/vendor.sh to download the swarmkik and engine-api dependencies from my forked versions of these repos. How to proceed? Should I wait for the for the engine-api and swarmkit pull requests to be accepted, or to change the vendor.sh? |
|
@vasil-yordanov only the |
|
@vdemeester I have fixed the formatting, but some check fails. I saw in the logs "Variable with name 'BUILD_DISPLAY_NAME' already exists, current value: '#25437', new value: '#25437'". Is this some issue from build system side or there is something from my side that I have to do? |
|
@vasil-yordanov looks like the error is; |
|
@thaJeztah this error is because the code depends on github.com/docker/engine-api/types/swarm, which is in another github repo, where I have waiting pull request. |
|
@vasil-yordanov what we usually do, is to temporarily include the changes in the vendored code in this PR (you can do separate commits for that); that way the code works, and CI can run. The vendor-CI will complain that you made changes to vendored code that don't match the commit/tag specified in |
|
Thank you @theJeztah for explaining me the process. I will commit vendor. Actually now I noticed that there is such folder in this repo. I was expecting that it is created by hach/vendor.sh during build time, and the dependencies are not kept here, but fetched when needed from the corresponding repo. |
|
@GordonTheTurtle I have checked that I have signed all my commits with git -s except the merges to the master of docker/docker repo which generates automatic commit message. These are my commits from "git reabase -i" command All my commits have been signed when I did the commits, so it seems I do not need to amend the commits. |
|
@vasil-yordanov you should not have merge commits of master in your PR. You should remove the merge commit and rebase, and that will fix the signing issue. |
|
Does anyone has idea why this CI fails? |
|
win2lin is currently having issues (there's a PR to fix that), not sure about windowsRS1, but we can restart. During design review, it's not a problem anyway |
|
@thaJeztah I have implemented the --hostname option to be a template, like --hostname=srv-*, in this case if we create a service with replicas>1 then the hostname will be srv-1, srv-2, ... |
|
I have removed my last commit after some discussion with stevvooe. "We need to be careful about creating a "template" system without thinking about consistent user experience." |
|
Not really sure why hostname would really matter in services (or even normal containers)... but I guess people find reasons. |
4bcc6cf to
495192c
Compare
Indeed, I though they should be the same!
Totally agree. |
@mostolog If only life were so simple!!! Thanks for the feedback! Let's keep bouncing this around so we can get this right. |
|
@thaJeztah We merged the functionality in swarmkit. This PR will likely need to be carried for integration into docker. |
|
@stevvooe, @thaJeztah so since moby/swarmkit#1688 was merged I assume we have to also do our job and merge that one in vendor. |
|
@niau That is the process. Let us know if you need help! |
|
uha @stevvooe I assume that I had really lagged the dogs here. |
|
@niau You can do something like |
This fix revendor swarmkit to 0ec7c6e. Related docker PR and issues: (moby#27567) (moby#25437) (moby#26988) (moby#25644) Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
|
Ok, this PR wasn't actually merged, but possibly @vasil-yordanov rebased/updated his master, and GitHub shows the exact same tree as 80d6d2e, so automatically marks it as "merged", even though nothing was actually merged; |
|
@thaJeztah very true I simply rebased it. In docker/master is still missing the hostname For example here I think what @yongtang did and @vdemeester was only to revendor swarmkit |
|
@niau looks like something went wrong during the rebase, because the change set in this PR is not empty https://github.com/docker/docker/pull/25437/files |
|
Thanks @thaJeztah I assume so. We are missing one commit. I have recommitted it in Vasil's repo, but it does not appear here. It looks like the only option is a new PR. Is it so? |
|
@niau yep, and it would be best to open the PR using a branch (that way, if you change/rebase master, it shouldn't happen again 👼) |
|
@vdemeester @thaJeztah sorry for all the noise I hope that the latest PL is exactly as it should be. It is from a branch, it is rebased and hopefully all tests pass :) |

This pull request is related to issue #24877
- What I did
Added option hostname in docker service create command.
- How I did it
I changed the docker client, updated the ContainerSpec structures in docker/swarm repo, so that this option is serialized to the swarm agents from the clients.
- How to verify it
docker service create --name test --hostname vasko <image_id>
docker exec test.1.<task_id> hostname
- Description for the changelog
This pull request will allow to specify hostname option to the docker service create command.
The same hostname will be set on all containers.
Signed-off-by: Vasil Yordanov vasil.yordanov@gmail.com