privileged container switch

This commit is contained in:
2021-04-26 18:00:40 +02:00
parent 00c2a2a817
commit 077988e03d
5 changed files with 13 additions and 4 deletions

View File

@@ -37,4 +37,6 @@
- name: "setup slurm test environment in docker containers" - name: "setup slurm test environment in docker containers"
import_role: import_role:
name: slurm name: slurm
vars:
container_privileged: True
tags: slurm tags: slurm

View File

@@ -0,0 +1 @@
container_privileged: False

View File

@@ -39,10 +39,10 @@
path: /container/volumes/slurm/ path: /container/volumes/slurm/
state: directory state: directory
- name: copy slurm config - name: upload slurm config
copy: template:
force: true force: true
src: "{{item}}" src: "{{item}}.j2"
dest: "/container/volumes/slurm/{{item}}" dest: "/container/volumes/slurm/{{item}}"
loop: loop:
- slurm.conf - slurm.conf
@@ -70,6 +70,7 @@
state: started state: started
detach: True detach: True
cleanup: True cleanup: True
privileged: "{{ container_privileged | ternary(True,False) }}"
networks_cli_compatible: True networks_cli_compatible: True
vars: vars:
default_mounts: default_mounts:

View File

@@ -36,8 +36,13 @@ MpiDefault=pmix
#PluginDir= #PluginDir=
#PlugStackConfig= #PlugStackConfig=
#PrivateData=jobs #PrivateData=jobs
# ProctrackType=proctrack/cgroup {% if container_privileged -%}
ProctrackType=proctrack/cgroup
{% else -%}
{# when not running privileged docker container, cgroups cannot be used and
jobs fail without comment in any log #}
ProctrackType=proctrack/linuxproc ProctrackType=proctrack/linuxproc
{% endif %}
#Prolog= #Prolog=
#PrologFlags= #PrologFlags=
#PrologSlurmctld= #PrologSlurmctld=