Inconsistency in docker-compose file parsing?
Open
Nobody has claimed this yet.
area/stack
version/20.10
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
Trying to use gpu support in swarm mode.
When using the given compose file example in swarm mode, (with or without added placement constraint):
version: '3.9'
services:
test:
image: nvidia/cuda:10.2-base
command: nvidia-smi
deploy:
mode: replicated
placement:
constraints:
- node.hostname == gpu0
replicas: 1
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu, utility]
$ docker --version
Docker version 20.10.3, build 48d30b5
$ docker stack deploy --compose-file docker-compose.test.yml gputest
services.test.deploy.resources.reservations Additional property devices is not allowed
The file parses correctly when doing
$ docker-compose -f docker-compose.test.yml up
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the discrepancy with the supplied docker-compose.yml using both docker stack deploy and docker-compose up. Start by tracing the Docker CLI compose-file parsing and swarm deployment validation paths. Done means the documented GPU reservation example is handled consistently, with regression coverage for the reported YAML.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, go
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100