Description
Hi!
Tracking
What ?
I'm opening up this issue to track and discuss support of Generic Resources in docker.
The motivation for swarmkit's Generic Resources is to be able to support "user defined" node level resources, unknown to docker (i.e: GPU, FPGA, ...).
More details can be found here
Objectives
- Integrate Generic Resources in docker (API, CLI, Compose)
- Discuss about API integration for:
- How to advertise Generic Resources
- How to request Generic Resources
Non-Objectives
- Solve how generic resources allocations are to be:
- discover resources (e.g: how many GPUs, what kind of GPUs)
- enforced (e.g: how do you expose GPUs inside a container)
- isolated (e.g: how do you make sure the container does not have access to other GPUs)
- Solve how to filter at the resources level (e.g: I want one GPU with X amount of memory)
- Solve how cluster-level generic resources should be advertised (e.g: pool of licenses)
Advertising Generic Resources at the Node Level
Swarmkit currently expects that each node advertise it's own Generic Resources through the executor's Describe "function" as part of the NodeDescription
's resources.
CLI wise, after briefly talking about it in the swarmkit PR we had two solutions:
- Advertise them like lables (
docker node update --add-generic-resource
) - Have the user specify them in his dockerd through command line arguments and the corresponding mapping in the config file
docker node update
can only be run on a manager and the second option seems to allow for a plugin system (later).
It seemed to be a better fit and is the way I implemented it in this PR.
Info
We were also hoping to have the docker daemon to advertise these through /info
Advertising Generic Resources at the Service Level
This is pretty straightforward as the only change needed is to add a GenericResource field to the Request field and add a CLI argument.
Do these steps seem reasonable ?
What do you think about resource advertising though the dockerd CLI ?
Summon @aaronlehmann, @dongluochen, @aluzzardi, @thaJeztah
Thanks!
Renaud Gaubert