Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
matrix:
image:
- 'centos:8.2.2004'
- 'centos:8.3.2011'
- 'centos:7'
scenario:
- test1
Expand All @@ -23,6 +24,10 @@ jobs:
- test2
- test3
- test4
- test5
exclude:
- image: 'centos:7'
scenario: test5

steps:
- name: Check out the codebase.
Expand Down
6 changes: 3 additions & 3 deletions molecule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ Molecule tests for the role.

# Test Matrix

Test options "flow down" through table unless changed.
Test options in "Other" column flow down through table unless changed.

Test | # Partitions | Groups in partitions? | Other
--- | --- | --- | ---
test1 | 1 | N | 2x compute node, sequential names (default test)
test1 | 1 | N | 2x compute node, sequential names (default test), config on all nodes
test1b | 1 | N | 1x compute node
test1c | 1 | N | 2x compute nodes, nonsequential names
test2 | 2 | N | 4x compute node, sequential names
test3 | 1 | Y | -
test4 | 1 | N | 2x compute node, accounting enabled

test5 | 1 | N | As for #1 but configless

# Local Installation & Running

Expand Down
22 changes: 22 additions & 0 deletions molecule/test5/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******

Requirements
============

* Docker Engine

Install
=======

Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.

.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site

.. code-block:: bash

$ python3 -m pip install 'molecule[docker]'
19 changes: 19 additions & 0 deletions molecule/test5/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Converge
hosts: all
tasks:
- name: "Include ansible-role-openhpc"
include_role:
name: "ansible-role-openhpc/"
vars:
openhpc_enable:
control: "{{ inventory_hostname in groups['testohpc_login'] }}"
batch: "{{ inventory_hostname in groups['testohpc_compute'] }}"
runtime: true
openhpc_slurm_service_enabled: true
openhpc_slurm_control_host: "{{ groups['testohpc_login'] | first }}"
openhpc_slurm_partitions:
- name: "compute"
openhpc_cluster_name: testohpc
openhpc_slurm_configless: true

48 changes: 48 additions & 0 deletions molecule/test5/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: single partition, group is partition
driver:
name: docker
platforms:
- name: testohpc-login-0
image: ${MOLECULE_IMAGE}
pre_build_image: true
groups:
- testohpc_login
command: /sbin/init
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
networks:
- name: net1
- name: testohpc-compute-0
image: ${MOLECULE_IMAGE}
pre_build_image: true
groups:
- testohpc_compute
command: /sbin/init
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
networks:
- name: net1
- name: testohpc-compute-1
image: ${MOLECULE_IMAGE}
pre_build_image: true
groups:
- testohpc_compute
command: /sbin/init
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
networks:
- name: net1
provisioner:
name: ansible
verifier:
name: ansible
12 changes: 12 additions & 0 deletions molecule/test5/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---

- name: Check slurm hostlist
hosts: testohpc_login
tasks:
- name: Get slurm partition info
command: sinfo --noheader --format="%P,%a,%l,%D,%t,%N" # using --format ensures we control whitespace
register: sinfo
- name:
assert: # PARTITION AVAIL TIMELIMIT NODES STATE NODELIST
that: "sinfo.stdout_lines == ['compute*,up,60-00:00:00,2,idle,testohpc-compute-[0-1]']"
fail_msg: "FAILED - actual value: {{ sinfo.stdout_lines }}"
9 changes: 8 additions & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
include_vars:
file: "ohpc-{{ ansible_facts.packages['ohpc-release'][0]['version'] }}"

- name: Find CentOS8 PowerTools repo
find:
paths: /etc/yum.repos.d
patterns: CentOS-*PowerTools.repo
register: powertools
when: ansible_distribution_major_version == "8"

- name: Enable CentOS8 PowerTools repo
# NB: doesn't run command `dnf config-manager --set-enabled PowerTools` as can't make that idempotent
lineinfile:
path: /etc/yum.repos.d/CentOS-PowerTools.repo
path: "{{ powertools.files[0].path }}" # 8.2: /etc/yum.repos.d/CentOS-PowerTools.repo 8.3: /etc/yum.repos.d/CentOS-Linux-PowerTools.repo
create: false # raises error if not already installed
regexp: enabled=
line: enabled=1
Expand Down