Skip to content

Commit 826eccc

Browse files
committed
add openhpc_login_only_nodes group so can run without login nodes in --limit
1 parent 07da95a commit 826eccc

File tree

8 files changed

+16
-13
lines changed

8 files changed

+16
-13
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ package in the image.
2525
* `control`: whether to enable control host
2626
* `database`: whether to enable slurmdbd
2727
* `batch`: whether to enable compute nodes
28-
* `login`: whether to enable login-only nodes in configless mode (for combined control/login nodes this can be left false)
2928
* `runtime`: whether to enable OpenHPC runtime
3029
* `drain`: whether to drain compute nodes
3130
* `resume`: whether to resume compute nodes
3231

3332
`openhpc_slurmdbd_host`: Optional. Where to deploy slurmdbd if are using this role to deploy slurmdbd, otherwise where an existing slurmdbd is running. This should be the name of a host in your inventory. Set this to `none` to prevent the role from managing slurmdbd. Defaults to `openhpc_slurm_control_host`.
3433

35-
`openhpc_slurm_configless`: Optional, default false. If True then slurm's ["configless" mode](https://slurm.schedmd.com/configless_slurm.html) is used. **NB: Requires Centos8/OpenHPC v2.**
34+
`openhpc_slurm_configless`: Optional, default false. If true then slurm's ["configless" mode](https://slurm.schedmd.com/configless_slurm.html) is used. **NB: Requires Centos8/OpenHPC v2.**
3635

3736
`openhpc_munge_key_path`: Optional, default ''. Define a path for a local file containing a munge key to use, otherwise one will be generated on the slurm control node.
3837

38+
`openhpc_login_only_nodes`: Optional. If using "configless" mode specify the name of an ansible group containing nodes which are login-only nodes (i.e. not also control nodes), if required. These nodes will run `slurmd` to contact the control node for config.
39+
3940
### slurm.conf
4041

4142
`openhpc_slurm_partitions`: list of one or more slurm partitions. Each partition may contain the following values:

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ openhpc_slurmdbd_mysql_username: slurm
3838
openhpc_enable:
3939
control: false
4040
batch: false
41-
login: true
4241
database: false
4342
runtime: false
4443
drain: false
@@ -52,3 +51,4 @@ ohpc_release_repos:
5251
"8": "http://repos.openhpc.community/OpenHPC/2/CentOS_8/x86_64/ohpc-release-2-1.el8.x86_64.rpm" # ohpc v2 for Centos 8
5352
openhpc_slurm_configless: false
5453
openhpc_munge_key: ''
54+
openhpc_login_only_nodes: ''

molecule/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ test4 | 1 | N | 2x compute node, accounting en
1515
test5 | 1 | N | As for #1 but configless
1616
test6 | 1 | N | 0x compute nodes, configless
1717
test7 | 1 | N | 1x compute node, no login node, configless
18+
test8 | 1 | N | 2x compute node, 2x login-only nodes, configless
1819

1920
# Local Installation & Running
2021

molecule/test8/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
- name: "compute"
1717
openhpc_cluster_name: testohpc
1818
openhpc_slurm_configless: true
19+
openhpc_login_only_nodes: 'testohpc_login'
1920

molecule/test8/molecule.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,7 @@ platforms:
7373
- name: net1
7474
provisioner:
7575
name: ansible
76+
# ansible_args:
77+
# - --limit=testohpc-control,testohpc-compute-0
7678
verifier:
7779
name: ansible

tasks/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
when: "openhpc_enable.get(item, false)"
88
tags: always
99

10+
- name: Set slurmd as service for openhpc_login_only_nodes
11+
set_fact:
12+
openhpc_slurm_service: "slurmd"
13+
when: openhpc_login_only_nodes and (openhpc_login_only_nodes in group_names)
14+
1015
- name: Install packages
1116
block:
1217
- include_tasks: install.yml

tasks/runtime.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@
4343
notify:
4444
- Restart Munge service
4545

46-
- name: Set fact for login-only nodes
47-
# needed b/c openhpc_enable doesn't end up in hostvars
48-
set_fact:
49-
openhpc_login_only: "{{ openhpc_enable.login | default(false) | bool }}"
50-
5146
- name: Template slurmdbd.conf
5247
template:
5348
src: slurmdbd.conf.j2
@@ -80,7 +75,7 @@
8075
group: root
8176
mode: 0644
8277
when:
83-
- (openhpc_enable.batch | default(false) | bool) or (openhpc_enable.login | default(false) | bool)
78+
- openhpc_slurm_service == 'slurmd'
8479
- openhpc_slurm_configless
8580
notify:
8681
- Reload SLURM service

templates/slurm.conf.j2

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,9 @@ PartitionName={{part.name}} \
139139

140140

141141
# Define slurmd nodes not in partitions for configless login-only nodes:
142-
{% for node in hostvars %}
143-
{% if hostvars[node].openhpc_login_only %}
142+
{%if openhpc_login_only_nodes %}{% for node in groups[openhpc_login_only_nodes] %}
144143
NodeName={{ node }}
145-
{% endif %}
146-
{% endfor %}{# configless login-only #}
144+
{% endfor %}{% endif %}
147145

148146
# Want nodes that drop out of SLURM's configuration to be automatically
149147
# returned to service when they come back.

0 commit comments

Comments
 (0)