Skip to content

Commit

Permalink
Add missing deploy.limits.pids (from schema 3.9), deprecate pids_limit
Browse files Browse the repository at this point in the history
compose schema v3.9 added support for `deploy.limits.pids` (through docker/cli@851eeb9),
however, work on compose-spec was already in progress, which lead to changes from
the 3.9 schema to not be included.

This patch adds the missing option and mars the `services.{name}.pids_limit` as
deprecated, similar to comparable limit- and reservation options (`services.{name}.cpus`,
`services.{name}.mem_limit`, `services.{name}.mem_reservation`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah authored and ndeloof committed Dec 3, 2021
1 parent a5a952e commit e8db802
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions deploy.md
Expand Up @@ -143,6 +143,7 @@ services:
limits:
cpus: '0.50'
memory: 50M
pids: 1
reservations:
cpus: '0.25'
memory: 20M
Expand All @@ -156,6 +157,10 @@ services:

`memory` configures a limit or reservation on the amount of memory a container can allocate, set as a string expressing a [byte value](spec.md#specifying-byte-values).

#### pids

`pids_limit` tunes a container’s PIDs limit, set as an integer.

#### devices

`devices` configures reservations of the devices a container can use. It contains a list of reservations, each set as an object with the following parameters: `capabilities`, `driver`, `count`, `device_ids` and `options`.
Expand Down
3 changes: 2 additions & 1 deletion schema/compose-spec.json
Expand Up @@ -519,7 +519,8 @@
"type": "object",
"properties": {
"cpus": {"type": ["number", "string"]},
"memory": {"type": "string"}
"memory": {"type": "string"},
"pids": {"type": "integer"}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
Expand Down
2 changes: 2 additions & 0 deletions spec.md
Expand Up @@ -1425,6 +1425,8 @@ Supported values are platform specific.

### pids_limit

_DEPRECATED: use [deploy.reservations.pids](deploy.md#pids)_

`pids_limit` tunes a container’s PIDs limit. Set to -1 for unlimited PIDs.

```yml
Expand Down

0 comments on commit e8db802

Please sign in to comment.