Skip to content

Implement Node property in Inspect container response introduces by swarm - #383

Merged
KostyaSha merged 1 commit into
docker-java:masterfrom
Baqend:add-swarm-support
Nov 7, 2017
Merged

Implement Node property in Inspect container response introduces by swarm#383
KostyaSha merged 1 commit into
docker-java:masterfrom
Baqend:add-swarm-support

Conversation

@fbuecklers

Copy link
Copy Markdown
Contributor

Implement the Node property returned by the docker swarm api
https://docs.docker.com/swarm/api/swarm-api/

I also like to implement the docker list command, wich respond with all available nodes in swarm, but the api is currently not implementation freindly as described in issue:
docker-archive/classicswarm#1214

So i delay the implementaion until the api is improved.

Review on Reviewable

@KostyaSha

Copy link
Copy Markdown
Member

@marcuslinke should we mix swarm and docker APIs in dockerClient, or create separate objects?

@fbuecklers

Copy link
Copy Markdown
Contributor Author

I think we can keep the implementation in the same object, since the swarm API is just a proxy of the docker API, with some very small additions and modifications.
There is also no native docker cli to talk with swarm. And in perspective of maintanace and that swarm is the native way to work with docker clusters we should keep the implementation together.
A list of all currently modifications made by swarm is available at: https://docs.docker.com/swarm/api/swarm-api/.

We currently have a swarm cluster near production ready and the java client works very well with the swarm manager.

@marcuslinke

Copy link
Copy Markdown
Contributor

@KostyaSha I agree with @fbuecklers in general, but the main point is to have working tests against a running swarm manager. But what about different swarm versions then? Currently we have no concept for testing against different docker engine/swarm versions. Related: #337.

@KostyaSha

Copy link
Copy Markdown
Member

@marcuslinke that what i described in email :) Imho docker-java needs 'its' module with DinD tests.

@marcuslinke marcuslinke added this to the 3.1.0 milestone Jan 30, 2016
@marcuslinke

Copy link
Copy Markdown
Contributor

Related to issue #395

@codecov-io

codecov-io commented Feb 25, 2016

Copy link
Copy Markdown

Codecov Report

Merging #383 into master will increase coverage by 0.36%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #383      +/-   ##
==========================================
+ Coverage   61.58%   61.95%   +0.36%     
==========================================
  Files         411      411              
  Lines        8172     8182      +10     
  Branches      530      530              
==========================================
+ Hits         5033     5069      +36     
+ Misses       2838     2813      -25     
+ Partials      301      300       -1
Impacted Files Coverage Δ
...ckerjava/api/command/InspectContainerResponse.java 83.78% <100%> (+2.53%) ⬆️
...com/github/dockerjava/netty/InvocationBuilder.java 91.78% <0%> (+0.91%) ⬆️
...ava/netty/handler/FramedResponseStreamHandler.java 87.93% <0%> (+3.44%) ⬆️
.../github/dockerjava/core/command/EventsCmdImpl.java 52% <0%> (+12%) ⬆️
...ava/com/github/dockerjava/jaxrs/EventsCmdExec.java 90.9% <0%> (+18.18%) ⬆️
...om/github/dockerjava/netty/exec/EventsCmdExec.java 90.9% <0%> (+18.18%) ⬆️
...ain/java/com/github/dockerjava/api/model/Node.java 93.75% <0%> (+93.75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8902e32...dd9f01d. Read the comment docs.

@fbuecklers

Copy link
Copy Markdown
Contributor Author

Any chance to see this pull request in the 3.0.0 release?
We need this small addition to work with our swarm cluster, we must currently always rebase this additions onto the master.

@laissandrade

Copy link
Copy Markdown

We are also using this changes to use docker-java with swarm cluster. Any change this will be available in the 3.0.0 release?

@igr

igr commented May 12, 2016

Copy link
Copy Markdown
Contributor

Hey guys, any chance for this to go in the 3.0?

@KostyaSha

Copy link
Copy Markdown
Member

@marcuslinke maybe we can merge without tests and allow users testing it? :D

@KostyaSha KostyaSha closed this May 12, 2016
@KostyaSha KostyaSha reopened this May 12, 2016
@KostyaSha

Copy link
Copy Markdown
Member

3.0.0 was already merged, so 3.1.0 sounds good enough. Hope swarm API become more stable now :)

@gesellix

Copy link
Copy Markdown
Contributor

Please note that with the upcoming Docker 1.12 (remote api 1.24) Swarm will be included. Maybe the api will become more stable then.

See https://docs.docker.com/:

As of v1.12.0-rc1, Engine includes swarm mode container orchestration features.

@KostyaSha

KostyaSha commented Jun 20, 2016

Copy link
Copy Markdown
Member

https://twitter.com/docker/status/744940786899292161
#BIGNEWS: @docker Engine 1.12 now available w/ built-in container #orchestration! goo.gl/fDdLnl #DockerCon

That probably would be good point to start with :) But they banned HostConfig and it would require reviewing API updates and code again :(

@KostyaSha

Copy link
Copy Markdown
Member

Advisory: The Swarm mode feature included in Docker Engine 1.12 is a release candidate feature and might be subject to non backward-compatible changes. Some functionality may change before the feature becomes generally available.

from https://docs.docker.com/engine/swarm/

@KostyaSha

Copy link
Copy Markdown
Member

Live stream is happening!

@fbuecklers

fbuecklers commented Nov 3, 2017

Copy link
Copy Markdown
Contributor Author

I have brought my pull request up to date and add some test cases.
It will solve #931 #761 #762 #459 and a few more which are already closed as duplicates.

I have also added an event test for the other node property. Did we wont to merge them? There are of cause the issue with the other case variant and swarm seems to behave differently on inspect and at the events API for the same property values!
Note that the node property only exists in swarm-classic and not in swarm mode. That's why I'm referencing the swarm-mode issues here as well. They are mislabeled ;-).

@KostyaSha
KostyaSha merged commit 03c4586 into docker-java:master Nov 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants