fully variable execute nodes

This commit is contained in:
Thorsten Müller
2021-04-27 14:04:22 +02:00
parent cde1b88a44
commit f38fc82601
4 changed files with 25 additions and 15 deletions

View File

@@ -39,4 +39,5 @@
name: slurm name: slurm
vars: vars:
container_privileged: True container_privileged: True
num_nodes: 3
tags: slurm tags: slurm

View File

@@ -0,0 +1,3 @@
- name: reconfigure slurm
command:
cmd: docker container exec -it slurm-ctl scontrol reconfigure

View File

@@ -47,6 +47,7 @@
loop: loop:
- slurm.conf - slurm.conf
- cgroup.conf - cgroup.conf
notify: reconfigure slurm
tags: [ slurm-config ] tags: [ slurm-config ]
- name: "create docker network to make service discovery work" - name: "create docker network to make service discovery work"
@@ -54,6 +55,16 @@
name: slurm name: slurm
state: present state: present
- set_fact:
slurm_nodes: # default nodes: controller and submit machine
- machine: ctl
image: slurm-slurmctld
- machine: submit1
image: slurm-slurmd
extra_mounts:
- "/home/thoto/job3/:/mnt/:rw"
tags: [ slurm-config ]
# TODO: reserve some address using docker_network_info and assign as aux # TODO: reserve some address using docker_network_info and assign as aux
# address to enable slurmctld to get a static address in order to be # address to enable slurmctld to get a static address in order to be
# reachable from slurm running on docker host to enable submitting jobs. # reachable from slurm running on docker host to enable submitting jobs.
@@ -70,21 +81,17 @@
state: started state: started
detach: True detach: True
cleanup: True cleanup: True
privileged: "{{ container_privileged | ternary(True,False) }}" privileged: "{{ container_privileged | bool }}"
networks_cli_compatible: True networks_cli_compatible: True
vars: vars:
default_mounts: default_mounts:
- /container/volumes/slurm/:/etc/slurm/:rw - /container/volumes/slurm/:/etc/slurm/:rw
- /container/volumes/munge/munge.key:/etc/munge/munge.key:rw - /container/volumes/munge/munge.key:/etc/munge/munge.key:rw
loop: slurm_nodes_all: | # add execute nodes
- machine: ctl {% for i in range(1, 4) -%}
image: slurm-slurmctld {% set _ = slurm_nodes.extend([
- machine: exec1 {'machine':'exec%s'|format(i), 'image': 'slurm-slurmd'}]) -%}
image: slurm-slurmd {%- endfor %}
- machine: exec2 {{ slurm_nodes }}
image: slurm-slurmd loop: "{{slurm_nodes_all}}"
- machine: submit1
image: slurm-slurmd
extra_mounts:
- "/home/thoto/job3/:/mnt/:rw"
tags: [ slurm-config ] tags: [ slurm-config ]

View File

@@ -161,7 +161,6 @@ SlurmdDebug=verbose
# #
# #
# COMPUTE NODES # COMPUTE NODES
NodeName=slurm-exec1 CPUs=1 State=UNKNOWN NodeName=slurm-exec[1-{{num_nodes}}] CPUs=2 CoresPerSocket=2 State=UNKNOWN
NodeName=slurm-exec2 CPUs=1 State=UNKNOWN
NodeName=slurm-submit1 CPUs=1 State=UNKNOWN NodeName=slurm-submit1 CPUs=1 State=UNKNOWN
PartitionName=debug Nodes=slurm-exec1,slurm-exec2 Default=YES MaxTime=INFINITE State=UP PartitionName=debug Nodes=slurm-exec[1-{{num_nodes}}] Default=YES MaxTime=INFINITE State=UP