gianarb / orbiter

Orbiter is an opensource docker swarm autoscaler
Apache License 2.0
501 stars 54 forks source link

Autoscaling destroy all previous container on first action #41

Closed mbovo closed 7 years ago

mbovo commented 7 years ago

Using docker 17.06 very first action performed by orbiter will destroy all previous running containers instead scaling up or down.

Server:
 Version:      17.06.0-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:21:56 2017
 OS/Arch:      linux/amd64
 Experimental: false

The effect: when docker first receive a request with old api signature will apply an operation of "service update" with new replica value. This actually will scale up/down as requested AND will restart all previous running containers with the update policy defined. In case there was only one previous container running this lead to a service unavailability during restarts

The cause: API changes from github.com/docker/docker 1.13.1 used by orbiter and the latest used by docker 17.06. Latest version has a different signature on method ServiceInspectWithRaw ( line 17 here ) adding new parameter of type types.ServiceInspectOptions ( godoc )

Solution proposed is to update docker client lib and change call to ServiceInspectWithRaw method. @gianarb I'm preparing a pull request but this changed could potentially impact other aspects or functionalities.

gianarb commented 7 years ago

Wow this is big. Thanks for this issue. @fntlnz can you follow this? As you know I am on vacation but I am happy to have this problem fixed asap. I will review and merge as soon as you can submit something @mbovo

fntlnz commented 7 years ago

@mbovo please be aware of this issue https://github.com/moby/moby/issues/33989 while updating the client library

fntlnz commented 7 years ago

Good catch BTW

gianarb commented 7 years ago

Fixed https://github.com/gianarb/orbiter/pull/46