Skip to content

CI: Switch to latest rockylinux/rockylinux images #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ name: CI

jobs:
build:
name: Build Rocky9 container image
# Upstream rockylinux:9.3 images don't contain systemd, which means /sbin/init fails.
name: Build Rocky Linux 9 container image
# Upstream rockylinux/rockylinux:9 images don't contain systemd, which means /sbin/init fails.
# A workaround of using "/bin/bash -c 'dnf -y install systemd && /sbin/init'"
# as the container command is flaky.
# This job builds an image using the upstream rockylinux:9.3 image which ensures
# This job builds an image using the upstream rockylinux/rockylinux:9 image which ensures
# that the image used for the molecule workflow is always updated.
runs-on: ubuntu-latest
defaults:
Expand All @@ -23,16 +23,16 @@ jobs:
uses: actions/checkout@v4

- name: Build image
run: podman build -t rocky93systemd:latest .
run: podman build -t rocky9systemd:latest .

- name: Save image
run: podman save --output rocky93systemd.docker rocky93systemd:latest
run: podman save --output rocky9systemd.docker rocky9systemd:latest

- name: Upload rocky9 image
uses: actions/upload-artifact@v4
with:
name: rocky93systemd
path: molecule/images/rocky93systemd.docker
name: rocky9systemd
path: molecule/images/rocky9systemd.docker

molecule:
name: Molecule
Expand All @@ -42,8 +42,8 @@ jobs:
fail-fast: false
matrix:
image:
- 'rockylinux:8.9'
- 'localhost/rocky93systemd'
- 'rockylinux/rockylinux:8'
- 'localhost/rocky9systemd'
scenario:
- test1
- test1b
Expand All @@ -61,7 +61,7 @@ jobs:
exclude:
# mariadb package provides /usr/bin/mysql on RL8 which doesn't work with geerlingguy/mysql role
- scenario: test4
image: 'rockylinux:8.9'
image: 'rockylinux/rockylinux:8'

steps:
- name: Check out the codebase.
Expand All @@ -70,14 +70,14 @@ jobs:
- name: Download rocky9 container image
uses: actions/download-artifact@v4
with:
name: rocky93systemd
path: molecule/images/rocky93systemd.docker
if: matrix.image == 'localhost/rocky93systemd'
name: rocky9systemd
path: molecule/images/rocky9systemd.docker
if: matrix.image == 'localhost/rocky9systemd'

- name: Load rocky9 container image
run: podman load --input rocky93systemd.docker/rocky93systemd.docker
run: podman load --input rocky9systemd.docker/rocky9systemd.docker
working-directory: molecule/images
if: matrix.image == 'localhost/rocky93systemd'
if: matrix.image == 'localhost/rocky9systemd'

- name: Set up Python 3.
uses: actions/setup-python@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This Ansible role installs packages and performs configuration to provide an Ope

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.

The minimal image for nodes is a RockyLinux 8 GenericCloud image.
The minimal image for nodes is a Rocky Linux 8 GenericCloud image.

## Role Variables

Expand Down
8 changes: 4 additions & 4 deletions molecule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test15 | 1 | Y | As for #1 but also tests parti

# Local Installation & Running

Local installation on a RockyLinux 8.x machine looks like:
Local installation on a Rocky Linux 8.x machine looks like:

sudo dnf install -y podman
sudo dnf install podman-plugins # required for DNS
Expand All @@ -39,17 +39,17 @@ Local installation on a RockyLinux 8.x machine looks like:
pip install -r molecule/requirements.txt
ansible-galaxy collection install containers.podman:>=1.10.1

Build a RockyLinux 9.3 image with systemd included:
Build a Rocky Linux 9 image with systemd included:

cd ansible-role-openhpc/molecule/images
podman build -t rocky93systemd:latest .
podman build -t rocky9systemd:latest .

Run tests, e.g.:

cd ansible-role-openhpc/
MOLECULE_NO_LOG="false" MOLECULE_IMAGE=rockylinux:8.9 molecule test --all

where the image may be `rockylinux:8.9` or `localhost/rocky93systemd`.
where the image may be `rockylinux:8.9` or `localhost/rocky9systemd`.

Other useful options during development:
- Prevent destroying instances by using `molecule test --destroy never`
Expand Down
2 changes: 1 addition & 1 deletion molecule/images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM rockylinux:9.3
FROM rockylinux/rockylinux:9
RUN dnf install -y systemd && dnf clean all
5 changes: 5 additions & 0 deletions tasks/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@
changed_when: false # so molecule doesn't fail
become: no

- name: Fix permissions on /etc for Munge service
ansible.builtin.file:
mode: g-w
path: /etc

- name: Ensure Munge service is running
service:
name: munge
Expand Down