From e8db8022c0b2e3d5eb007d629ff684cbe49a17a4 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 2 Dec 2021 13:18:07 +0100 Subject: [PATCH] Add missing deploy.limits.pids (from schema 3.9), deprecate pids_limit compose schema v3.9 added support for `deploy.limits.pids` (through https://github.com/docker/cli/commit/851eeb9639ddd5186c57db0533ede26964ee27cc), 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 --- deploy.md | 5 +++++ schema/compose-spec.json | 3 ++- spec.md | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/deploy.md b/deploy.md index 9483b740..3203cfc9 100644 --- a/deploy.md +++ b/deploy.md @@ -143,6 +143,7 @@ services: limits: cpus: '0.50' memory: 50M + pids: 1 reservations: cpus: '0.25' memory: 20M @@ -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`. diff --git a/schema/compose-spec.json b/schema/compose-spec.json index 91bdb342..aaca3170 100644 --- a/schema/compose-spec.json +++ b/schema/compose-spec.json @@ -519,7 +519,8 @@ "type": "object", "properties": { "cpus": {"type": ["number", "string"]}, - "memory": {"type": "string"} + "memory": {"type": "string"}, + "pids": {"type": "integer"} }, "additionalProperties": false, "patternProperties": {"^x-": {}} diff --git a/spec.md b/spec.md index 1cc1681a..9a19a908 100644 --- a/spec.md +++ b/spec.md @@ -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