Skip to content

Add v3.8 schema support - #7217

Merged
ulyssessouza merged 5 commits into
docker:masterfrom
aiordache:compose_v3.8_schema_support
Feb 10, 2020
Merged

Add v3.8 schema support#7217
ulyssessouza merged 5 commits into
docker:masterfrom
aiordache:compose_v3.8_schema_support

Conversation

@aiordache

@aiordacheaiordache commented Feb 6, 2020

Copy link
Copy Markdown
Contributor

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

@rumplrumpl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment threadcompose/const.py Outdated
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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.

Comment threadcompose/config/config.py
Comment threadcompose/const.py Outdated
COMPOSEFILE_V3_5: '1.30',
COMPOSEFILE_V3_6: '1.36',
COMPOSEFILE_V3_7: '1.38',
COMPOSEFILE_V3_8: '1.40',

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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.

Anca Iordache added 4 commits February 7, 2020 13:50
 - 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>
@aiordache
aiordacheforce-pushed the compose_v3.8_schema_support branch from 596de14 to 02d8e9eCompareFebruary 7, 2020 12:50
Signed-off-by: Anca Iordache <anca.iordache@docker.com>

@ulyssessouzaulyssessouza left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compose schema version 3.8 support

4 participants

@aiordache@rumpl@ndeloof@ulyssessouza