Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Generic Resources #5416

Merged
merged 1 commit into from
Dec 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions compose/compose-file/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,14 @@ services:
reservations:
cpus: '0.25'
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 @@ -707,6 +715,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 request Named Generic resource(s), the resources selected are
exposed in your container through the use of environment variables.
E.g: `DOCKER_RESOURCE_GPU=UID1,UID2`

You can only set the `generic_resources` resources' reservations field.

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

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