You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Duncan Grant <no...@github.com> on 2016/06/01 13:51:21 UTC

[jclouds/jclouds-labs] Use container host ip not manager ip for populating node metadata. (#277)

When providing node ip in metadata jclouds was using the
ip of the docker manager which was fine for docker machine
but fails when using a swarm cluster.  This uses the ip returned
from docker.

Currently the live tests for docker pass against a machine provisioning using docker/docker-machine. However they fail when run against a swarm cluster.  This is because the wrong ip address is used to test ssh access to the node.  This change will make the tests in SshToCustomPortLiveTest.java pass.

I haven't set up a docker overlay network so I don't know if the tests in NetworkApiLiveTest.java pass but all other live tests pass against swarm.  
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs/pull/277

-- Commit Summary --

  * Use container host ip not manager ip

-- File Changes --

    M docker/src/main/java/org/jclouds/docker/compute/functions/ContainerToNodeMetadata.java (24)
    M docker/src/main/java/org/jclouds/docker/domain/Container.java (18)
    A docker/src/main/java/org/jclouds/docker/domain/Node.java (63)
    M docker/src/test/java/org/jclouds/docker/compute/functions/ContainerToNodeMetadataTest.java (1)
    M docker/src/test/java/org/jclouds/docker/internal/DockerTestUtils.java (3)

-- Patch Links --

https://github.com/jclouds/jclouds-labs/pull/277.patch
https://github.com/jclouds/jclouds-labs/pull/277.diff

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/277

Re: [jclouds/jclouds-labs] Use container host ip not manager ip for populating node metadata. (#277)

Posted by Andrew Donald Kennedy <no...@github.com>.
@andreaturli this is another PR required for Docker Swarm compatibility. The change is pretty simple, and should also be easy to port to master, I think. Can you take a look, please?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/277#issuecomment-223188235

Re: [jclouds/jclouds-labs] Use container host ip not manager ip for populating node metadata. (#277)

Posted by Andrea Turli <no...@github.com>.
Closed #277.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/277#event-682926168

Re: [jclouds/jclouds-labs] Use container host ip not manager ip for populating node metadata. (#277)

Posted by Andrea Turli <no...@github.com>.
Lgtm. I wonder how many differences/gaps there are between docker engine API and dovker swarm API. Should we consider a jclouds-docker-swarm provider based on the jclouds-docker(-engine) api or simply extend the jclouds-docker provider? @gkrvlt and @nacx, any thoughts on this?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/277#issuecomment-223288525

Re: [jclouds/jclouds-labs] Use container host ip not manager ip for populating node metadata. (#277)

Posted by Andrew Donald Kennedy <no...@github.com>.
@andreaturli I think the only conflict is that `DockerTestUtils.java` doesn't exist in 1.9.x yet, everything else should merge OK. I'm happy for the `DockerTestUtils` change to be ignored here.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/277#issuecomment-223977022

Re: [jclouds/jclouds-labs] Use container host ip not manager ip for populating node metadata. (#277)

Posted by Andrew Donald Kennedy <no...@github.com>.
@andreaturli It's not that Swarm has a _different_ API, it's just that using Swarm instead of Docker Engine as the target API endpoint surfaces different aspects of the JSON requests and responses, which we didn't need most of the time for plain Docker usage scenarios. Docker are committed to keeping the APIs compatible at the moment, although there is a proposal open to add a few extra calls here https://github.com/docker/swarm/issues/2134

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/277#issuecomment-223319981

Re: [jclouds/jclouds-labs] Use container host ip not manager ip for populating node metadata. (#277)

Posted by Andrew Donald Kennedy <no...@github.com>.
Thanks @andreaturli @duncangrant 

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/277#issuecomment-223980387

Re: [jclouds/jclouds-labs] Use container host ip not manager ip for populating node metadata. (#277)

Posted by Andrea Turli <no...@github.com>.
thx @duncangrant, merged at [master](http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/7e55ad79)

do you need to back-port this patch to 1.9.x branch as well? I think there are conflicts when trying to cherry-pick the same commit.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/277#issuecomment-223975121

Re: [jclouds/jclouds-labs] Use container host ip not manager ip for populating node metadata. (#277)

Posted by Andrea Turli <no...@github.com>.
ok backported at [1.9.x](http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/2033e639)

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/277#issuecomment-223978616

Re: [jclouds/jclouds-labs] Use container host ip not manager ip for populating node metadata. (#277)

Posted by Andrea Turli <no...@github.com>.
lgtm, merging

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/277#issuecomment-223971079