Skip to content

Commit 2b22867

Browse files
committed
Merge remote-tracking branch 'origin/feat/nodegroups' into HEAD
2 parents 196716f + 175a1c0 commit 2b22867

File tree

8 files changed

+17
-96
lines changed

8 files changed

+17
-96
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
- test11
6060
- test12
6161
- test13
62-
- test14
6362
exclude:
6463
# mariadb package provides /usr/bin/mysql on RL8 which doesn't work with geerlingguy/mysql role
6564
- scenario: test4

molecule/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test1 | 1 | N | 2x compute node, sequential na
1010
test1b | 1 | N | 1x compute node
1111
test1c | 1 | N | 2x compute nodes, nonsequential names
1212
test2 | 2 | N | 4x compute node, sequential names
13-
test3 | 1 | Y | -
13+
test3 | 1 | Y | 4x compute nodes in 2x groups, single partition
1414
test4 | 1 | N | 2x compute node, accounting enabled
1515
test5 | 1 | N | As for #1 but configless
1616
test6 | 1 | N | 0x compute nodes, configless
@@ -21,7 +21,7 @@ test10 | 1 | N | As for #5 but then tries to ad
2121
test11 | 1 | N | As for #5 but then deletes a node (actually changes the partition due to molecule/ansible limitations)
2222
test12 | 1 | N | As for #5 but enabling job completion and testing `sacct -c`
2323
test13 | 1 | N | As for #5 but tests `openhpc_config` variable.
24-
test14 | 1 | N | As for #5 but also tests `extra_nodes` via State=DOWN nodes.
24+
test14 | 1 | N | [removed, extra_nodes removed]
2525
test15 | 1 | Y | As for #5 but also tests `partitions with different name but with the same NodeName`.
2626

2727

molecule/test14/converge.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

molecule/test14/molecule.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

molecule/test14/verify.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

molecule/test3/converge.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
runtime: true
99
openhpc_slurm_control_host: "{{ groups['testohpc_login'] | first }}"
1010
openhpc_nodegroups:
11-
- name: "compute"
11+
- name: grp1
12+
- name: grp2
13+
openhpc_partitions:
14+
- name: compute
1215
groups:
13-
- name: "grp1"
14-
- name: "grp2"
16+
- grp1
17+
- grp2
1518
openhpc_cluster_name: testohpc
1619
tasks:
1720
- name: "Include ansible-role-openhpc"
1821
include_role:
1922
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
20-
21-

tasks/validate.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- openhpc_cluster_name is defined
77
- openhpc_cluster_name != ''
88
fail_msg: openhpc role variables not correctly defined, see detail above
9+
delegate_to: localhost
10+
run_once: true
911

1012
- name: Check no host appears in more than one nodegroup
1113
assert:
@@ -15,9 +17,13 @@
1517
{{ _openhpc_check_hosts | dict2items | rejectattr('value', 'equalto', 1) | items2dict | to_nice_yaml }}
1618
vars:
1719
_openhpc_node_inventory_groups: "{{ openhpc_nodegroups | map(attribute='name') | map('regex_replace', '^', openhpc_cluster_name ~ '_') }}"
18-
_openhpc_check_hosts: "{{ _openhpc_node_inventory_groups | map('extract', groups) | flatten | community.general.counter }}"
20+
_openhpc_check_hosts: "{{ groups | dict2items | list | selectattr('key', 'in', _openhpc_node_inventory_groups) | map(attribute='value') | flatten | community.general.counter }}"
21+
delegate_to: localhost
22+
run_once: true
1923

2024
- name: Fail if configuration is old
2125
assert:
2226
that: openhpc_slurm_partitions is not defined
2327
fail_msg: stackhpc.openhpc parameter openhpc_slurm_partitions has been replaced - see openhpc_nodegroups and openhpc_partitions
28+
delegate_to: localhost
29+
run_once: true

templates/slurm.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ PropagateResourceLimitsExcept=MEMLOCK
146146
Epilog=/etc/slurm/slurm.epilog.clean
147147

148148
# COMPUTE NODES
149-
# OpenHPC default configuration
150149
{% for nodegroup in openhpc_nodegroups %}
150+
# nodegroup: {{ nodegroup.name }}
151151
{% set inventory_group_name = openhpc_cluster_name ~ '_' ~ nodegroup.name %}
152152
{% set inventory_group_hosts = groups.get(inventory_group_name, []) %}
153153
{% if inventory_group_hosts | length > 0 %}
@@ -166,9 +166,9 @@ NodeName={{ hostlist }} {{ '' -}}
166166
ThreadsPerCore={{ first_host_hv['ansible_processor_threads_per_core'] }} {{ '' -}}
167167
{{ nodegroup.node_params | default({}) | dict2parameters }} {{ '' -}}
168168
{% if 'gres' in nodegroup %}Gres={{ ','.join(nodegroup.gres | map(attribute='conf')) }}{% endif %}
169+
169170
{% endfor %}{# hostlists #}
170171
{% endif %}{# 1 or more hosts in inventory #}
171-
172172
NodeSet=nodegroup_{{ nodegroup.name }} Feature=nodegroup_{{ nodegroup.name }}
173173

174174
{% endfor %}

0 commit comments

Comments
 (0)