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

Add support for update order in compose deployments #360

Merged
merged 1 commit into from Aug 1, 2017

Conversation

@akalipetis
Contributor

akalipetis commented Jul 19, 2017

Fixes #346

- What I did

Added support for the "order" key in the "update_config":

    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        order: start-first | stop-first

- How I did it

Added the new key in the Compose V3.4 schema and hooked it with the implementation that already existed for service create/update.

- How to verify it

docker deploy -c docker-compose.yml demo

using this stack:

version: '3.4'

services:
  nginx:
    image: nginx:1.13.1-alpine
    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        order: start-first
    ports:
      - 80:80

This will create a rolling update, even though we're just using 1 replica.

- Description for the changelog

Support for update_config.order: start-first | stop-first in Docker Compose version 3.4.

- A picture of a cute animal (not mandatory but encouraged)

large_smart_squirrel

@akalipetis

This comment has been minimized.

Show comment
Hide comment
@akalipetis

akalipetis Jul 19, 2017

Contributor

/cc @dnephin I have cherry-picked da96115 and also included b882ab3 which (hopefully) rebuilds correctly the binary data.

This PR is based on #358

Contributor

akalipetis commented Jul 19, 2017

/cc @dnephin I have cherry-picked da96115 and also included b882ab3 which (hopefully) rebuilds correctly the binary data.

This PR is based on #358

@dnephin

This comment has been minimized.

Show comment
Hide comment
@dnephin

dnephin Jul 21, 2017

Collaborator

Looks like CI is broken on this PR. We've been having problems with that on a few PRs

Collaborator

dnephin commented Jul 21, 2017

Looks like CI is broken on this PR. We've been having problems with that on a few PRs

@dnephin

Thanks!

There' also a "full test" in loader_test.go that I think should be updated to include this.

@akalipetis

This comment has been minimized.

Show comment
Hide comment
@akalipetis

akalipetis Jul 21, 2017

Contributor

Thanks @dnephin - I'll definitely do that too. In regards to the CI, I thought it was because I had not included the -s flag in one commit and Gordon did not like me 😂

Contributor

akalipetis commented Jul 21, 2017

Thanks @dnephin - I'll definitely do that too. In regards to the CI, I thought it was because I had not included the -s flag in one commit and Gordon did not like me 😂

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Jul 22, 2017

Codecov Report

Merging #360 into master will increase coverage by 0.05%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #360      +/-   ##
==========================================
+ Coverage    46.2%   46.25%   +0.05%     
==========================================
  Files         193      193              
  Lines       16091    16092       +1     
==========================================
+ Hits         7435     7444       +9     
+ Misses       8269     8259      -10     
- Partials      387      389       +2

codecov-io commented Jul 22, 2017

Codecov Report

Merging #360 into master will increase coverage by 0.05%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #360      +/-   ##
==========================================
+ Coverage    46.2%   46.25%   +0.05%     
==========================================
  Files         193      193              
  Lines       16091    16092       +1     
==========================================
+ Hits         7435     7444       +9     
+ Misses       8269     8259      -10     
- Partials      387      389       +2

@GordonTheTurtle GordonTheTurtle removed the dco/no label Jul 22, 2017

@akalipetis

This comment has been minimized.

Show comment
Hide comment
@akalipetis

akalipetis Jul 22, 2017

Contributor

@dnephin added a full-example test, but I still have issues in the following tests:

  • validate - I have changed to schema to include the order key, should I rollback this? This will crash the full example, since it needs v3.4 with order included to work
  • lint - no idea really, when I open the logs they're stuck in the docker version step loading without ever showing anything...
Contributor

akalipetis commented Jul 22, 2017

@dnephin added a full-example test, but I still have issues in the following tests:

  • validate - I have changed to schema to include the order key, should I rollback this? This will crash the full example, since it needs v3.4 with order included to work
  • lint - no idea really, when I open the logs they're stuck in the docker version step loading without ever showing anything...
@akalipetis

This comment has been minimized.

Show comment
Hide comment
@akalipetis

akalipetis Jul 28, 2017

Contributor

@dnephin seems like this was the issue after all 👍 - let me know if there's anything else you'd like me to do 😄

Contributor

akalipetis commented Jul 28, 2017

@dnephin seems like this was the issue after all 👍 - let me know if there's anything else you'd like me to do 😄

@dnephin

This comment has been minimized.

Show comment
Hide comment
@dnephin

dnephin Jul 28, 2017

Collaborator

I think you can remove the WIP from the title now.

Needs a rebase since we merged another PR which added the 3.4 schema. You can ignore the conflicts in bindata.go, just regenerate the file and add that.

Then squash your commits and this should be ready. You can drop the commit from me, it should already be in master.

Collaborator

dnephin commented Jul 28, 2017

I think you can remove the WIP from the title now.

Needs a rebase since we merged another PR which added the 3.4 schema. You can ignore the conflicts in bindata.go, just regenerate the file and add that.

Then squash your commits and this should be ready. You can drop the commit from me, it should already be in master.

Support the "order" key in "update_config" for compose
Signed-off-by: Antonis Kalipetis <akalipetis@gmail.com>

@akalipetis akalipetis changed the title from [WIP] Add support for update order in compose deployments to Add support for update order in compose deployments Jul 28, 2017

@akalipetis

This comment has been minimized.

Show comment
Hide comment
@akalipetis

akalipetis Jul 28, 2017

Contributor

Done 👌

Contributor

akalipetis commented Jul 28, 2017

Done 👌

@dnephin

LGTM

@thaJeztah

LGTM

@thaJeztah thaJeztah merged commit 1cd402b into docker:master Aug 1, 2017

8 checks passed

ci/circleci: cross Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: shellcheck Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: validate Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 50%)
Details
codecov/project 46.25% (+0.05%) compared to 286216d
Details
dco-signed All commits are signed

@GordonTheTurtle GordonTheTurtle added this to the 17.08.0 milestone Aug 1, 2017

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Aug 1, 2017

Member

thanks!

Member

thaJeztah commented Aug 1, 2017

thanks!

@hairyhenderson

This comment has been minimized.

Show comment
Hide comment
@hairyhenderson

hairyhenderson Oct 24, 2017

Contributor

@thaJeztah FYI this is missing in the docs for the update_config field: https://docs.docker.com/compose/compose-file/#update_config - I've logged an issue in the docs repo: docker/docker.github.io#5088

Contributor

hairyhenderson commented Oct 24, 2017

@thaJeztah FYI this is missing in the docs for the update_config field: https://docs.docker.com/compose/compose-file/#update_config - I've logged an issue in the docs repo: docker/docker.github.io#5088

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Oct 24, 2017

Member

@hairyhenderson oh, thanks for spotting that! Looks like I forgot checking for that 😅

Member

thaJeztah commented Oct 24, 2017

@hairyhenderson oh, thanks for spotting that! Looks like I forgot checking for that 😅

@rreinurm rreinurm referenced this pull request Nov 1, 2017

Closed

support for --update-order #530

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment