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

Add v3.8 schema support #7217

Merged
merged 5 commits into from
Feb 10, 2020

Conversation

aiordache
Copy link
Contributor

@aiordache aiordache commented Feb 6, 2020

Add v3.8 schema support

  • Update version mappings
  • Limit service scale to 'max_replicas_per_node'
$ cat docker-compose.yaml
version: "3.8"
services:
  test:
    image: nginx
    deploy:
      mode: replicated
      replicas: 3
      placement:
        max_replicas_per_node: 2
$ docker-compose --compatibility up -d
WARNING: Scale is limited to 2 ('max_replicas_per_node' field).
Creating network "schema_default" with the default driver
Creating schema_test_1 ... done
Creating schema_test_2 ... done
$ docker ps        
CONTAINER ID        IMAGE                 COMMAND                  CREATED              STATUS              PORTS                              NAMES
fc6510771d3a        nginx                 "nginx -g 'daemon of…"   41 seconds ago      Up 41 seconds       80/tcp                             schema_test_1
464e98b579f4        nginx                 "nginx -g 'daemon of…"   41 seconds ago      Up 41 seconds       80/tcp                             schema_test_2

Signed-off-by: Anca Iordache anca.iordache@docker.com

Resolves #6530

Copy link
Member

@rumpl rumpl left a comment

Choose a reason for hiding this comment

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

LGTM

compose/const.py Outdated
@@ -74,4 +76,5 @@
API_VERSIONS[COMPOSEFILE_V3_5]: '17.06.0',
API_VERSIONS[COMPOSEFILE_V3_6]: '18.02.0',
API_VERSIONS[COMPOSEFILE_V3_7]: '18.06.0',
API_VERSIONS[COMPOSEFILE_V3_8]: '19.03.0',
Copy link
Contributor

Choose a reason for hiding this comment

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

as both COMPOSEFILE_V3_7 and COMPOSEFILE_V3_8 == '1.38' doesn't this override API_VERSIONS['1.28'] just being set to '18.06.0' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, but I guess this mapping is more for us to easily view the minimum version needed for each compose file.

compose/const.py Outdated
@@ -57,6 +58,7 @@
COMPOSEFILE_V3_5: '1.30',
COMPOSEFILE_V3_6: '1.36',
COMPOSEFILE_V3_7: '1.38',
COMPOSEFILE_V3_8: '1.40',
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I misunderstand this constant, but afaik 3.8 do not add any new field to require an API upgrade vs 3.7, does it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I set it back to 1.38. This should be the minimum API version we need for the v3.8 schema.

 - service scale bounded by 'max_replicas_per_node' field

Signed-off-by: Anca Iordache <anca.iordache@docker.com>
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
Copy link
Contributor

@ulyssessouza ulyssessouza left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Compose schema version 3.8 support
4 participants