docker / docker/cli

compose file option discrete_resource_spec fails with "assigned node no longer meets constraints"

Open
#1,805 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area/swarm
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

The service deployment of a compose file defined with the following definition fails with status "assigned node no longer meets constraints" while the cli does not fail

version: "3.5"

services:
  nvidia-test:
    image: nvidia/cuda
    command: nvidia-smi -l
    deploy:
      resources:
        reservations:
          generic_resources:
            - discrete_resource_spec:
                kind: 'gpu'
                value: 2

steps to reproduce
I defined multiple node generic resources named gpu with flags --node-generic-resource gpu=xxxx --node-generic-resource gpu=yyyy
running docker node inspect I can see the defined NamedResourceSpec s
If I run the following command the service is up and running:
docker service create --name my-nvidia-service --generic-resource "gpu=1" nvidia/cuda nvidia-smi -l
but if I do: docker stack deploy --compose-file nvidia-stack.yml my-nvidia-stack
the service does not start with status "assigned node no longer meets constraints"

docker version 18.09.4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the docker stack deploy --compose-file path and compare its handling of the shown generic_resources definition with docker service create --generic-resource. Use docker node inspect to verify the NamedResourceSpec values and reproduce the differing scheduling behavior on Docker 18.09.4. Done means the compose deployment accepts the discrete_resource_spec and starts the service on a suitable node.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.