Skip to content

Commit 9f9eb9e

Browse files
authored
Merge pull request #147 from stackhpc/ci/podman
Use podman as molecule driver
2 parents 3e44e8c + 6c6b417 commit 9f9eb9e

30 files changed

+102
-231
lines changed

.ansible-lint

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
skip_list:
22
- '106' # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern'
33
- 'fqcn-builtins'
4+
- 'key-order'
5+
- 'name[missing]'
6+
warn_list:
7+
- 'deprecated-module'

.github/workflows/ci.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
# See:
2020
# - https://bugzilla.redhat.com/show_bug.cgi?id=190144
2121
# - https://github.com/systemd/systemd/pull/16424
22-
runs-on: ubuntu-18.04
22+
runs-on: ubuntu-20.04
2323
strategy:
2424
fail-fast: false
2525
matrix:
2626
image:
2727
- 'centos:7'
28-
- 'rockylinux:8.5'
28+
- 'rockylinux:8.6'
2929
scenario:
3030
- test1
3131
- test1b
@@ -43,7 +43,6 @@ jobs:
4343
- test12
4444
- test13
4545
- test14
46-
- test15
4746

4847
exclude:
4948
- image: 'centos:7'
@@ -71,15 +70,17 @@ jobs:
7170

7271
steps:
7372
- name: Check out the codebase.
74-
uses: actions/checkout@v2
73+
uses: actions/checkout@v3
7574

7675
- name: Set up Python 3.
77-
uses: actions/setup-python@v2
76+
uses: actions/setup-python@v4
7877
with:
79-
python-version: '3.x'
78+
python-version: '3.9'
8079

8180
- name: Install test dependencies.
82-
run: pip3 install -U ansible molecule[docker] docker yamllint ansible-lint
81+
run: |
82+
pip3 install -U ansible molecule[podman] yamllint ansible-lint
83+
ansible-galaxy collection install containers.podman:>=1.10.1 # otherwise get https://github.com/containers/ansible-podman-collections/issues/428
8384
8485
- name: Display ansible version
8586
run: ansible --version
@@ -102,15 +103,17 @@ jobs:
102103
runs-on: ubuntu-20.04
103104
steps:
104105
- name: Check out the codebase.
105-
uses: actions/checkout@v2
106+
uses: actions/checkout@v3
106107

107108
- name: Set up Python 3.
108-
uses: actions/setup-python@v2
109+
uses: actions/setup-python@v4
109110
with:
110-
python-version: '3.x'
111+
python-version: '3.9'
111112

112113
- name: Install test dependencies.
113-
run: pip3 install -U ansible molecule[docker] docker yamllint ansible-lint
114+
run: |
115+
pip3 install -U ansible molecule[podman] yamllint ansible-lint
116+
ansible-galaxy collection install containers.podman:>=1.10.1 # otherwise get https://github.com/containers/ansible-podman-collections/issues/428
114117
115118
- name: Display ansible version
116119
run: ansible --version

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This Ansible role installs packages and performs configuration to provide an Ope
66

77
As a role it must be used from a playbook, for which a simple example is given below. This approach means it is totally modular with no assumptions about available networks or any cluster features except for some hostname conventions. Any desired cluster fileystem or other required functionality may be freely integrated using additional Ansible roles or other approaches.
88

9-
The minimal image for nodes is a Centos7 or Centos8 cloud image. These use OpenHPC v1 and v2 respectively. Centos8/OpenHPCv2 is generally preferred as it provides additional functionality for Slurm, compilers, MPI and transport libraries.
9+
The minimal image for nodes is a CentOS 7 or RockyLinux 8 GenericCloud image. These use OpenHPC v1 and v2 respectively. Centos8/OpenHPCv2 is generally preferred as it provides additional functionality for Slurm, compilers, MPI and transport libraries.
1010

1111
## Role Variables
1212

meta/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ galaxy_info:
1111
min_ansible_version: 2.5.0
1212
platforms:
1313
- name: EL
14-
versions:
15-
- 7
14+
versions: ['7', '8']
1615
galaxy_tags:
1716
- openhpc
1817
- slurm

molecule/README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,27 @@ test11 | 1 | N | As for #5 but then deletes a n
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.
2424
test14 | 1 | N | As for #5 but also tests `extra_nodes` via State=DOWN nodes.
25-
test15 | 1 | N | No compute nodes.
25+
2626

2727
# Local Installation & Running
2828

2929
Local installation on a RockyLinux 8.x machine looks like:
3030

31-
sudo yum install -y gcc python3-pip python3-devel openssl-devel python3-libselinux
32-
sudo yum install -y yum-utils
33-
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
34-
sudo yum install -y docker-ce docker-ce-cli containerd.io
35-
sudo yum install -y iptables
36-
sudo systemctl start docker
37-
sudo usermod -aG docker ${USER}
38-
sudo usermod -aG docker rocky
39-
newgrp docker
40-
docker run hello-world # test docker works without sudo
41-
31+
sudo dnf install -y podman
4232
sudo yum install -y git
4333
git clone [email protected]:stackhpc/ansible-role-openhpc.git
4434
cd ansible-role-openhpc/
45-
python3 -m venv venv
35+
python3.9 -m venv venv
4636
. venv/bin/activate
4737
pip install -U pip
4838
pip install -r molecule/requirements.txt
39+
ansible-galaxy collection install containers.podman:>=1.10.1
4940

5041
Then to run tests, e.g.::
5142

5243
cd ansible-role-openhpc/
5344
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=rockylinux:8.5 molecule test --all
45+
MOLECULE_IMAGE=rockylinux:8.6 molecule test --all
5546

5647
**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.
5748

molecule/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pip
22
setuptools
3-
molecule[docker,lint,ansible]
3+
molecule[podman,lint,ansible]
44
ansible>=2.9.0

molecule/test1/molecule.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
name: single partition, group is partition
32
driver:
4-
name: docker
3+
name: podman
54
platforms:
65
- name: testohpc-login-0
76
image: ${MOLECULE_IMAGE}
@@ -14,8 +13,7 @@ platforms:
1413
- /tmp
1514
volumes:
1615
- /sys/fs/cgroup:/sys/fs/cgroup:ro
17-
networks:
18-
- name: net1
16+
network: net1
1917
- name: testohpc-compute-0
2018
image: ${MOLECULE_IMAGE}
2119
pre_build_image: true
@@ -27,8 +25,7 @@ platforms:
2725
- /tmp
2826
volumes:
2927
- /sys/fs/cgroup:/sys/fs/cgroup:ro
30-
networks:
31-
- name: net1
28+
network: net1
3229
- name: testohpc-compute-1
3330
image: ${MOLECULE_IMAGE}
3431
pre_build_image: true
@@ -40,8 +37,7 @@ platforms:
4037
- /tmp
4138
volumes:
4239
- /sys/fs/cgroup:/sys/fs/cgroup:ro
43-
networks:
44-
- name: net1
40+
network: net1
4541
provisioner:
4642
name: ansible
4743
verifier:

molecule/test10/molecule.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
name: single partition, group is partition
32
driver:
4-
name: docker
3+
name: podman
54
platforms:
65
- name: testohpc-login-0
76
image: ${MOLECULE_IMAGE}
@@ -15,8 +14,7 @@ platforms:
1514
- /tmp
1615
volumes:
1716
- /sys/fs/cgroup:/sys/fs/cgroup:ro
18-
networks:
19-
- name: net1
17+
network: net1
2018
- name: testohpc-compute-0
2119
image: ${MOLECULE_IMAGE}
2220
pre_build_image: true
@@ -29,8 +27,7 @@ platforms:
2927
- /tmp
3028
volumes:
3129
- /sys/fs/cgroup:/sys/fs/cgroup:ro
32-
networks:
33-
- name: net1
30+
network: net1
3431
- name: testohpc-compute-1
3532
image: ${MOLECULE_IMAGE}
3633
pre_build_image: true
@@ -43,8 +40,7 @@ platforms:
4340
- /tmp
4441
volumes:
4542
- /sys/fs/cgroup:/sys/fs/cgroup:ro
46-
networks:
47-
- name: net1
43+
network: net1
4844
- name: testohpc-compute-2
4945
image: ${MOLECULE_IMAGE}
5046
pre_build_image: true
@@ -56,8 +52,7 @@ platforms:
5652
- /tmp
5753
volumes:
5854
- /sys/fs/cgroup:/sys/fs/cgroup:ro
59-
networks:
60-
- name: net1
55+
network: net1
6156
provisioner:
6257
name: ansible
6358
verifier:

molecule/test11/molecule.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
name: single partition, group is partition
32
driver:
4-
name: docker
3+
name: podman
54
platforms:
65
- name: testohpc-login-0
76
image: ${MOLECULE_IMAGE}
@@ -14,8 +13,7 @@ platforms:
1413
- /tmp
1514
volumes:
1615
- /sys/fs/cgroup:/sys/fs/cgroup:ro
17-
networks:
18-
- name: net1
16+
network: net1
1917
- name: testohpc-compute-0
2018
image: ${MOLECULE_IMAGE}
2119
pre_build_image: true
@@ -29,8 +27,7 @@ platforms:
2927
- /tmp
3028
volumes:
3129
- /sys/fs/cgroup:/sys/fs/cgroup:ro
32-
networks:
33-
- name: net1
30+
network: net1
3431
- name: testohpc-compute-1
3532
image: ${MOLECULE_IMAGE}
3633
pre_build_image: true
@@ -43,8 +40,7 @@ platforms:
4340
- /tmp
4441
volumes:
4542
- /sys/fs/cgroup:/sys/fs/cgroup:ro
46-
networks:
47-
- name: net1
43+
network: net1
4844
provisioner:
4945
name: ansible
5046
verifier:

molecule/test12/molecule.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
name: single partition, group is partition
32
driver:
4-
name: docker
3+
name: podman
54
platforms:
65
- name: testohpc-login-0
76
image: ${MOLECULE_IMAGE}
@@ -14,8 +13,7 @@ platforms:
1413
- /tmp
1514
volumes:
1615
- /sys/fs/cgroup:/sys/fs/cgroup:ro
17-
networks:
18-
- name: net1
16+
network: net1
1917
docker_networks:
2018
- name: net1
2119
driver_options:
@@ -31,8 +29,7 @@ platforms:
3129
- /tmp
3230
volumes:
3331
- /sys/fs/cgroup:/sys/fs/cgroup:ro
34-
networks:
35-
- name: net1
32+
network: net1
3633
- name: testohpc-compute-1
3734
image: ${MOLECULE_IMAGE}
3835
pre_build_image: true
@@ -44,8 +41,7 @@ platforms:
4441
- /tmp
4542
volumes:
4643
- /sys/fs/cgroup:/sys/fs/cgroup:ro
47-
networks:
48-
- name: net1
44+
network: net1
4945
provisioner:
5046
name: ansible
5147
verifier:

molecule/test13/molecule.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
name: single partition, group is partition
32
driver:
4-
name: docker
3+
name: podman
54
platforms:
65
- name: testohpc-control
76
image: ${MOLECULE_IMAGE}
@@ -14,8 +13,7 @@ platforms:
1413
- /tmp
1514
volumes:
1615
- /sys/fs/cgroup:/sys/fs/cgroup:ro
17-
networks:
18-
- name: net1
16+
network: net1
1917

2018
- name: testohpc-login-0
2119
image: ${MOLECULE_IMAGE}
@@ -28,8 +26,7 @@ platforms:
2826
- /tmp
2927
volumes:
3028
- /sys/fs/cgroup:/sys/fs/cgroup:ro
31-
networks:
32-
- name: net1
29+
network: net1
3330

3431
- name: testohpc-login-1
3532
image: ${MOLECULE_IMAGE}
@@ -42,8 +39,7 @@ platforms:
4239
- /tmp
4340
volumes:
4441
- /sys/fs/cgroup:/sys/fs/cgroup:ro
45-
networks:
46-
- name: net1
42+
network: net1
4743

4844
- name: testohpc-compute-0
4945
image: ${MOLECULE_IMAGE}
@@ -56,8 +52,7 @@ platforms:
5652
- /tmp
5753
volumes:
5854
- /sys/fs/cgroup:/sys/fs/cgroup:ro
59-
networks:
60-
- name: net1
55+
network: net1
6156
- name: testohpc-compute-1
6257
image: ${MOLECULE_IMAGE}
6358
pre_build_image: true
@@ -69,8 +64,7 @@ platforms:
6964
- /tmp
7065
volumes:
7166
- /sys/fs/cgroup:/sys/fs/cgroup:ro
72-
networks:
73-
- name: net1
67+
network: net1
7468
provisioner:
7569
name: ansible
7670
# ansible_args:

0 commit comments

Comments
 (0)