fully variable execute nodes

This commit is contained in:
2021-04-27 14:04:22 +02:00
parent 077988e03d
commit 89423edf25
4 changed files with 25 additions and 15 deletions

View File

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