Skip to content
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

Make Swarm schedule containers on the same node when they are linked together #972

Merged
merged 1 commit into from
Mar 20, 2015

Conversation

aanand
Copy link

@aanand aanand commented Feb 16, 2015

... by specifying all HostConfig at create time. This is required for Swarm integration: the cluster needs to know about config like links and volumes_from at create time so that it can co-schedule containers. This is particularly important because we rely on volumes_from when recreating containers - if the old/intermediate/new containers aren't co-scheduled, they'll fail to start.

Because the ability to specify HostConfig at create time was introduced in Docker 1.4, that's our new minimum version requirement. The install docs have been updated accordingly.

@cpuguy83
Copy link
Contributor

Looks like HostConfig on create has been available since 1.3.0 - https://github.com/docker/docker/blob/v1.3.0/daemon/create.go#L31

@dnephin
Copy link

dnephin commented Feb 16, 2015

Overall I like it.

This is going to conflict pretty heavily with #858, but it should be manageable.

Both this PR and #858 are kind of blocked on #886. Do you know if there is any word on when we'll be able to run the test suite against docker > 1.3 ?

@aanand
Copy link
Author

aanand commented Feb 18, 2015

@cpuguy83 Interesting - looks like this wasn't made official until API version 1.15: http://docs.docker.com/reference/api/docker_remote_api/#v115

@dnephin Yeah, we really need a better setup. I'm looking into it.

@bfirsh bfirsh added this to the 1.2.0 milestone Mar 2, 2015
@aanand aanand force-pushed the set-host-config-at-create-time branch from aabaec1 to 0d4435c Compare March 10, 2015 11:51
@bfirsh bfirsh changed the title Specify all HostConfig at create time Make Swarm schedule containers on the same node which are linked together Mar 13, 2015
@bfirsh bfirsh changed the title Make Swarm schedule containers on the same node which are linked together Make Swarm schedule containers on the same node when they are linked together Mar 13, 2015
@aanand aanand force-pushed the set-host-config-at-create-time branch from 0d4435c to 1918cfb Compare March 13, 2015 15:48
@aanand
Copy link
Author

aanand commented Mar 13, 2015

Rebased.

print(container.name)
else:
service.start_container(container, ports=service_ports, one_off=True)
service.start_container(container)
Copy link

Choose a reason for hiding this comment

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

minor (since it's existing), this is being done in both branches of the is/else, so it should really happen before the branch.

@dnephin
Copy link

dnephin commented Mar 16, 2015

LGTM (assuming there is still some place to run the automated test suite with the new dependency on docker 1.4.1)

@bfirsh
Copy link

bfirsh commented Mar 17, 2015

@dnephin Now testing on Jenkins against multiple Docker versions! Should this not work on Docker <1.4 though? Hm. Seems like it is.

@dnephin
Copy link

dnephin commented Mar 18, 2015

@bfirsh I believe the only issue was the api version change (API_VERSION = '1.15') would require docker 1.3.x, where as wercker was on 1.2.x right? I guess my comment should have said 1.3.x, I got the version wrong.

@zk000133
Copy link

Built Docker Compose from the 'set-host-config-at-create-time' branch.
If I have any exposed ports declared in the docker-compose.yml file, Swarm will complain when doing a compose up: "unable to find a node with port xxxx available"
Scheduling single containers with bind ports on a swarm works.

@aanand aanand force-pushed the set-host-config-at-create-time branch 2 times, most recently from d45980a to 6f9448f Compare March 20, 2015 22:09
This is required for Swarm integration: the cluster needs to know
about config like `links` and `volumes_from` at create time so that it
can co-schedule containers.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
@aanand aanand force-pushed the set-host-config-at-create-time branch from 6f9448f to eef4bc3 Compare March 20, 2015 22:14
@aanand
Copy link
Author

aanand commented Mar 20, 2015

I've reverted the documentation changes. The API version has changed, but 1.3 is still the minimum version. (This is largely irrelevant anyway, as we'll be making 1.6 the minimum in the next release.)

aanand added a commit that referenced this pull request Mar 20, 2015
Make Swarm schedule containers on the same node when they are linked together
@aanand aanand merged commit 5dca6c2 into docker:master Mar 20, 2015
@aanand aanand deleted the set-host-config-at-create-time branch March 20, 2015 22:43
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Make Swarm schedule containers on the same node when they are linked together
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
dnephin added a commit that referenced this pull request Apr 27, 2015
modified the release notes section the first[PR #972]to[PR #1088]
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.

5 participants