Skip to content

Commit

Permalink
Add Generic Resources
Browse files Browse the repository at this point in the history
Signed-off-by: Renaud Gaubert <rgaubert@nvidia.com>
  • Loading branch information
Renaud Gaubert committed Dec 1, 2017
1 parent b024050 commit 3c5eb9c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions compose/compose-file/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,14 @@ services:
reservations:
cpus: '0.0001'
memory: 20M
generic_resources:
- discrete_resource_spec:
kind: 'gpu'
value: 2
- discrete_resource_spec:
kind: 'ssd'
value: 1
```

The topics below describe available options to set resource constraints on
Expand All @@ -691,6 +699,23 @@ If you have further questions, please refer to the discussion on the GitHub
issue [docker/compose/4513](https://github.com/docker/compose/issues/4513){: target="_blank" class="_"}.
{: .important}

##### Generic Resources

Generic resources are a way to select the kind of nodes your task can land on.

In a swarm cluster, nodes can advertise Generic resources as Discrete values or
as Named values such as SSD=3 or GPU=UID1, GPU=UID2, ...

The Generic resources on a service allows you to request for a number of these
Generic resources advertised by swarm nodes and have your tasks land on nodes
with enough available resources to statisfy your request.

If you requested Named Generic resource(s), the resources selected will be
exposed in your container through the use of environment variables.
E.g: `DOCKER_RESOURCE_GPU=UID1,UID2`

You can only set the `generic_resources` field for reservations.

##### Out Of Memory Exceptions (OOME)

If your services or containers attempt to use more memory than the system has
Expand Down

0 comments on commit 3c5eb9c

Please sign in to comment.