[TRAIN and before] Introduce ContainerCpusetCpus

Add a role specific parameter, ContainerCpusetCpus, default to 'all', which
allows to limit the specific CPUs or cores a container can use.
To disable it and rely on container engine default, set it to ''.

Change-Id: I3b669665548668423d4ce7e34262c12903fba522
Related-Bug: #1867357
(cherry picked from commit 85850d8af2)
This commit is contained in:
Emilien Macchi 2020-03-13 11:03:30 -04:00
parent d7cd9268df
commit fec0dfb47d
2 changed files with 15 additions and 1 deletions

View File

@ -131,6 +131,12 @@ parameters:
type: string type: string
tags: tags:
- role_specific - role_specific
ContainerCpusetCpus:
description: Limit the specific CPUs or cores a container can use.
type: string
default: 'all'
tags:
- role_specific
conditions: conditions:
@ -188,9 +194,11 @@ resources:
map_replace: map_replace:
- map_replace: - map_replace:
- vhostuser_socket_group: VhostuserSocketGroup - vhostuser_socket_group: VhostuserSocketGroup
container_cpuset_cpus: ContainerCpusetCpus
- values: {get_param: [RoleParameters]} - values: {get_param: [RoleParameters]}
- values: - values:
VhostuserSocketGroup: {get_param: VhostuserSocketGroup} VhostuserSocketGroup: {get_param: VhostuserSocketGroup}
ContainerCpusetCpus: {get_param: ContainerCpusetCpus}
ContainersCommon: ContainersCommon:
@ -324,7 +332,7 @@ outputs:
pid: host pid: host
privileged: true privileged: true
restart: always restart: always
cpuset_cpus: all cpuset_cpus: {get_attr: [RoleParametersValue, value, container_cpuset_cpus]}
volumes: volumes:
list_concat: list_concat:
- {get_attr: [ContainersCommon, volumes]} - {get_attr: [ContainersCommon, volumes]}

View File

@ -0,0 +1,6 @@
---
features:
- |
Add a role specific parameter, ContainerCpusetCpus, default to 'all', which
allows to limit the specific CPUs or cores a container can use.
To disable it and rely on container engine default, set it to ''.