Skip to content

Commit d61c937

Browse files
committed
Merge branch 'master' into fix/state_save_locn
2 parents fd43578 + 1c08015 commit d61c937

File tree

7 files changed

+75
-14
lines changed

7 files changed

+75
-14
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
- test12
4444
- test13
4545
- test14
46+
- test15
4647

4748
exclude:
4849
- image: 'centos:7'
@@ -65,6 +66,8 @@ jobs:
6566
scenario: test13
6667
- image: 'centos:7'
6768
scenario: test14
69+
- image: 'centos:7'
70+
scenario: test15
6871

6972
steps:
7073
- name: Check out the codebase.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ package in the image.
4141

4242
### slurm.conf
4343

44-
`openhpc_slurm_partitions`: list of one or more slurm partitions. Each partition may contain the following values:
44+
`openhpc_slurm_partitions`: Optional. List of one or more slurm partitions, default `[]`. Each partition may contain the following values:
4545
* `groups`: If there are multiple node groups that make up the partition, a list of group objects can be defined here.
4646
Otherwise, `groups` can be omitted and the following attributes can be defined in the partition object:
4747
* `name`: The name of the nodes within this group.
@@ -57,9 +57,8 @@ package in the image.
5757
For each group (if used) or partition any nodes in an ansible inventory group `<cluster_name>_<group_name>` will be added to the group/partition. Note that:
5858
- Nodes may have arbitrary hostnames but these should be lowercase to avoid a mismatch between inventory and actual hostname.
5959
- Nodes in a group are assumed to be homogenous in terms of processor and memory.
60-
- An inventory group may be empty, but if it is not then the play must contain at least one node from it (used to set processor information).
60+
- An inventory group may be empty or missing, but if it is not then the play must contain at least one node from it (used to set processor information).
6161
- Nodes may not appear in more than one group.
62-
- A group/partition definition which does not have either a corresponding inventory group or a `extra_nodes` will raise an error.
6362

6463
`openhpc_job_maxtime`: A maximum time job limit in hours, minutes and seconds. The default is `24:00:00`.
6564

molecule/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ 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 | | As for #5 but also tests `extra_nodes` via State=DOWN nodes.
24+
test14 | 1 | N | As for #5 but also tests `extra_nodes` via State=DOWN nodes.
25+
test15 | 1 | N | No compute nodes.
2526

2627
# Local Installation & Running
2728

@@ -51,8 +52,9 @@ Then to run tests, e.g.::
5152

5253
cd ansible-role-openhpc/
5354
MOLECULE_IMAGE=centos:7 molecule test --all # NB some won't work as require OpenHPC v2.x (-> CentOS 8.x) features - see `.github/workflows/ci.yml`
54-
MOLECULE_IMAGE=centos:8.2.2004 molecule test --all
55-
MOLECULE_IMAGE=centos:8.3.2011 molecule test --all
55+
MOLECULE_IMAGE=rockylinux:8.5 molecule test --all
56+
57+
**NB:** If the host network has an MTU smaller than 1500 (the docker default), check `molecule.yml` for the relevant test contains `DOCKER_MTU`, then prepend `DOCKER_MTU=<mtu>` to your command. If you have already run molecule you will need to destroy the instances and run `docker network prune` before retrying.
5658

5759
During development you may want to:
5860

molecule/test15/converge.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
tasks:
5+
- name: "Include ansible-role-openhpc"
6+
include_role:
7+
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
8+
vars:
9+
openhpc_enable:
10+
control: "{{ inventory_hostname in groups['testohpc_control'] }}"
11+
batch: false
12+
runtime: true
13+
openhpc_slurm_control_host: "{{ groups['testohpc_control'] | first }}"
14+
openhpc_slurm_partitions:
15+
- name: n/a
16+
openhpc_cluster_name: testohpc
17+
openhpc_slurm_configless: true
18+

molecule/test15/molecule.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: single partition, group is partition
3+
driver:
4+
name: docker
5+
platforms:
6+
- name: testohpc-control
7+
image: ${MOLECULE_IMAGE}
8+
pre_build_image: true
9+
groups:
10+
- testohpc_control
11+
command: /sbin/init
12+
tmpfs:
13+
- /run
14+
- /tmp
15+
volumes:
16+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
17+
networks:
18+
- name: net1
19+
docker_networks:
20+
- name: net1
21+
driver_options:
22+
com.docker.network.driver.mtu: ${DOCKER_MTU:-1500} # 1500 is docker default
23+
provisioner:
24+
name: ansible
25+
verifier:
26+
name: ansible

molecule/test15/verify.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
3+
- name: Check slurm hostlist
4+
hosts: testohpc_control
5+
tasks:
6+
- name: Get slurm partition info
7+
command: sinfo --noheader --format="%P,%a,%l,%D,%t,%N" # using --format ensures we control whitespace
8+
register: sinfo
9+
- name:
10+
assert: # PARTITION AVAIL TIMELIMIT NODES STATE NODELIST
11+
that: "sinfo.stdout_lines == ['n/a*,up,60-00:00:00,0,n/a,']"
12+
fail_msg: "FAILED - actual value: {{ sinfo.stdout_lines }}"

tasks/runtime.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
2-
- name: Fail if openhpc_slurm_control_host or openhpc_cluster_name or openhpc_slurm_partitions are undefined
3-
fail:
4-
msg: "Undefined openhpc_slurm_control_host or openhpc_cluster_name or openhpc_slurm_partitions, or latter is empty."
5-
when:
6-
openhpc_slurm_control_host == none or
7-
openhpc_cluster_name == none or
8-
openhpc_slurm_partitions | length == 0
9-
2+
- name: Check openhpc_slurm_control_host, openhpc_cluster_name or openhpc_slurm_partitions exist
3+
assert:
4+
that:
5+
- openhpc_slurm_control_host is defined
6+
- openhpc_cluster_name is defined
7+
- openhpc_cluster_name != ''
8+
- openhpc_slurm_partitions is defined
9+
fail_msg: "Undefined openhpc_slurm_control_host, openhpc_cluster_name or openhpc_slurm_partitions."
10+
1011
- name: Fail if configless mode selected when not on Centos 8
1112
fail:
1213
msg: "openhpc_slurm_configless = True requires Centos8 / OpenHPC v2"

0 commit comments

Comments
 (0)