diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c13daf..7ab02fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,7 @@ name: CI - master jobs: - - test: + molecule: name: Molecule # Workaround: systemd/kernel compatibility issue: # Failed to parse bus message: Invalid argument @@ -24,7 +23,8 @@ jobs: fail-fast: false matrix: image: - - 'rockylinux:8.8' + - 'rockylinux:8.9' + - 'rockylinux:9.3' scenario: - test1 - test1b @@ -47,7 +47,7 @@ jobs: steps: - name: Check out the codebase. - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python 3. uses: actions/setup-python@v4 @@ -56,7 +56,7 @@ jobs: - name: Install test dependencies. run: | - pip3 install -U ansible molecule-podman yamllint ansible-lint + pip3 install -U pip ansible>=2.9.0 molecule-plugins[podman]==23.5.0 yamllint ansible-lint ansible-galaxy collection install containers.podman:>=1.10.1 # otherwise get https://github.com/containers/ansible-podman-collections/issues/428 - name: Display ansible version @@ -75,21 +75,21 @@ jobs: ANSIBLE_FORCE_COLOR: '1' MOLECULE_IMAGE: ${{ matrix.image }} - runonce: + checks: name: Checks - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Check out the codebase. uses: actions/checkout@v3 - name: Set up Python 3. - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.9' - name: Install test dependencies. run: | - pip3 install -U ansible molecule[podman] yamllint ansible-lint + pip3 install -U ansible ansible-lint ansible-galaxy collection install containers.podman:>=1.10.1 # otherwise get https://github.com/containers/ansible-podman-collections/issues/428 - name: Display ansible version diff --git a/defaults/main.yml b/defaults/main.yml index d6f1aab..c806809 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -49,6 +49,19 @@ openhpc_enable: openhpc_extra_repos: [] ohpc_openhpc_repos: + "9": + - name: OpenHPC + file: OpenHPC + description: OpenHPC-3 - Base + baseurl: "http://repos.openhpc.community/OpenHPC/3/EL_9" + gpgcheck: true + gpgkey: https://raw.githubusercontent.com/openhpc/ohpc/v3.0.GA/components/admin/ohpc-release/SOURCES/RPM-GPG-KEY-OpenHPC-3 + - name: OpenHPC-updates + file: OpenHPC + description: OpenHPC-3 - Updates + baseurl: "http://repos.openhpc.community/OpenHPC/3/updates/EL_9" + gpgcheck: true + gpgkey: https://raw.githubusercontent.com/openhpc/ohpc/v3.0.GA/components/admin/ohpc-release/SOURCES/RPM-GPG-KEY-OpenHPC-3 "8": - name: OpenHPC file: OpenHPC @@ -64,6 +77,13 @@ ohpc_openhpc_repos: gpgkey: https://raw.githubusercontent.com/openhpc/ohpc/v2.6.1.GA/components/admin/ohpc-release/SOURCES/RPM-GPG-KEY-OpenHPC-2 ohpc_default_extra_repos: + "9": + - name: epel + file: epel + description: "Extra Packages for Enterprise Linux $releasever - $basearch" + metalink: "https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir" + gpgcheck: true + gpgkey: "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-9" "8": - name: epel file: epel diff --git a/molecule/README.md b/molecule/README.md index fe95788..9fed9a6 100644 --- a/molecule/README.md +++ b/molecule/README.md @@ -42,7 +42,7 @@ Local installation on a RockyLinux 8.x machine looks like: Then to run tests, e.g.:: cd ansible-role-openhpc/ - MOLECULE_IMAGE=rockylinux:8.8 molecule test --all + MOLECULE_IMAGE=rockylinux:8.9 molecule test --all During development you may want to: diff --git a/molecule/test1/molecule.yml b/molecule/test1/molecule.yml index 29d30ca..838d009 100644 --- a/molecule/test1/molecule.yml +++ b/molecule/test1/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -19,7 +19,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -31,7 +31,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test10/molecule.yml b/molecule/test10/molecule.yml index 9601f63..40f305c 100644 --- a/molecule/test10/molecule.yml +++ b/molecule/test10/molecule.yml @@ -8,7 +8,7 @@ platforms: groups: - testohpc_login - initial - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -21,7 +21,7 @@ platforms: groups: - testohpc_compute - initial - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -34,7 +34,7 @@ platforms: groups: - testohpc_compute - initial - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -46,7 +46,7 @@ platforms: pre_build_image: true groups: # NB this is NOT in the "testohpc_compute" so that it isn't added to slurm.conf initially - new - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test11/molecule.yml b/molecule/test11/molecule.yml index de2f7a6..e6abf9b 100644 --- a/molecule/test11/molecule.yml +++ b/molecule/test11/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -21,7 +21,7 @@ platforms: - testohpc_compute - testohpc_compute_orig - testohpc_compute_new - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -34,7 +34,7 @@ platforms: groups: - testohpc_compute - testohpc_compute_orig - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test12/molecule.yml b/molecule/test12/molecule.yml index 29d30ca..838d009 100644 --- a/molecule/test12/molecule.yml +++ b/molecule/test12/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -19,7 +19,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -31,7 +31,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test13/molecule.yml b/molecule/test13/molecule.yml index a64acf2..3faf9e5 100644 --- a/molecule/test13/molecule.yml +++ b/molecule/test13/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_control - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -20,7 +20,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -33,7 +33,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -46,7 +46,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -58,7 +58,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test14/molecule.yml b/molecule/test14/molecule.yml index 29d30ca..838d009 100644 --- a/molecule/test14/molecule.yml +++ b/molecule/test14/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -19,7 +19,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -31,7 +31,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test1b/molecule.yml b/molecule/test1b/molecule.yml index 369a533..d1cbb4a 100644 --- a/molecule/test1b/molecule.yml +++ b/molecule/test1b/molecule.yml @@ -9,7 +9,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -21,7 +21,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test1c/molecule.yml b/molecule/test1c/molecule.yml index f6759fc..1e992a3 100644 --- a/molecule/test1c/molecule.yml +++ b/molecule/test1c/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -19,7 +19,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -31,7 +31,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test2/molecule.yml b/molecule/test2/molecule.yml index cef6d49..f0d8820 100644 --- a/molecule/test2/molecule.yml +++ b/molecule/test2/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -20,7 +20,7 @@ platforms: groups: - testohpc_compute - testohpc_part1 - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -33,7 +33,7 @@ platforms: groups: - testohpc_compute - testohpc_part1 - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -46,7 +46,7 @@ platforms: groups: - testohpc_compute - testohpc_part2 - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -59,7 +59,7 @@ platforms: groups: - testohpc_compute - testohpc_part2 - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test3/molecule.yml b/molecule/test3/molecule.yml index 1e2868c..42d1037 100644 --- a/molecule/test3/molecule.yml +++ b/molecule/test3/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -20,7 +20,7 @@ platforms: groups: - testohpc_compute - testohpc_grp1 - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -33,7 +33,7 @@ platforms: groups: - testohpc_compute - testohpc_grp1 - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -46,7 +46,7 @@ platforms: groups: - testohpc_compute - testohpc_grp2 - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -59,7 +59,7 @@ platforms: groups: - testohpc_compute - testohpc_grp2 - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test4/molecule.yml b/molecule/test4/molecule.yml index 29d30ca..838d009 100644 --- a/molecule/test4/molecule.yml +++ b/molecule/test4/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -19,7 +19,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -31,7 +31,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test5/molecule.yml b/molecule/test5/molecule.yml index 29d30ca..838d009 100644 --- a/molecule/test5/molecule.yml +++ b/molecule/test5/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -19,7 +19,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -31,7 +31,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test6/molecule.yml b/molecule/test6/molecule.yml index b7c0c50..d80f580 100644 --- a/molecule/test6/molecule.yml +++ b/molecule/test6/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test7/molecule.yml b/molecule/test7/molecule.yml index 5b6d4c6..2539406 100644 --- a/molecule/test7/molecule.yml +++ b/molecule/test7/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test8/molecule.yml b/molecule/test8/molecule.yml index a64acf2..3faf9e5 100644 --- a/molecule/test8/molecule.yml +++ b/molecule/test8/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_control - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -20,7 +20,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -33,7 +33,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -46,7 +46,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -58,7 +58,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/molecule/test9/molecule.yml b/molecule/test9/molecule.yml index 15742c0..77f04bd 100644 --- a/molecule/test9/molecule.yml +++ b/molecule/test9/molecule.yml @@ -7,7 +7,7 @@ platforms: pre_build_image: true groups: - testohpc_control - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -20,7 +20,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -33,7 +33,7 @@ platforms: pre_build_image: true groups: - testohpc_login - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -46,7 +46,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp @@ -58,7 +58,7 @@ platforms: pre_build_image: true groups: - testohpc_compute - command: /sbin/init + command: "/bin/bash -c 'dnf -y install systemd && /sbin/init'" # not in RL9 image tmpfs: - /run - /tmp diff --git a/tasks/install.yml b/tasks/install.yml index 435f56a..b7d950d 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -18,11 +18,24 @@ - name: Enable PowerTools repo # NB: doesn't run command `dnf config-manager --set-enabled PowerTools` as can't make that idempotent - lineinfile: + community.general.ini_file: path: /etc/yum.repos.d/Rocky-PowerTools.repo - create: false # raises error if not already installed - regexp: enabled= - line: enabled=1 + section: powertools + option: enabled + value: "1" + create: false + no_extra_spaces: true + when: ansible_distribution_major_version == '8' + +- name: Enable CRB repo + community.general.ini_file: + path: /etc/yum.repos.d/rocky.repo + section: crb + option: enabled + value: "1" + create: false + no_extra_spaces: true + when: ansible_distribution_major_version == '9' - name: Build host-specific list of required slurm packages set_fact: @@ -31,9 +44,9 @@ when: (openhpc_enable.get(item.key, false)) or () - name: Install required slurm packages - yum: + dnf: name: "{{ openhpc_slurm_pkglist | reject('eq', '') }}" - install_weak_deps: false + install_weak_deps: false # avoids getting recommended packages when: openhpc_slurm_pkglist | default(false, true) - name: Install packages from openhpc_packages variable diff --git a/tasks/runtime.yml b/tasks/runtime.yml index 5c925da..b346495 100644 --- a/tasks/runtime.yml +++ b/tasks/runtime.yml @@ -132,6 +132,16 @@ register: ohpc_gres_conf # NB uses restart rather than reload as this is needed in some cases +- name: Template cgroup.conf + # appears to be required even with NO cgroup plugins: https://slurm.schedmd.com/cgroups.html#cgroup_design + template: + src: cgroup.conf.j2 + dest: /etc/slurm/cgroup.conf + mode: "0644" # perms/ownership based off src from ohpc package + owner: root + group: root + when: openhpc_enable.control | default(false) or not openhpc_slurm_configless + - name: Remove local tempfile for slurm.conf templating ansible.builtin.file: path: "{{ _slurm_conf_tmpfile.path }}" diff --git a/templates/cgroup.conf.j2 b/templates/cgroup.conf.j2 new file mode 100644 index 0000000..9186bca --- /dev/null +++ b/templates/cgroup.conf.j2 @@ -0,0 +1,11 @@ +### +# +# Slurm cgroup support configuration file +# +# See man slurm.conf and man cgroup.conf for further +# information on cgroup configuration parameters +#-- +ConstrainCores=yes +ConstrainDevices=yes +ConstrainRAMSpace=yes +ConstrainSwapSpace=yes diff --git a/templates/slurm.conf.j2 b/templates/slurm.conf.j2 index 5e6ce33..ad84610 100644 --- a/templates/slurm.conf.j2 +++ b/templates/slurm.conf.j2 @@ -35,7 +35,7 @@ MpiDefault=none #PluginDir= #PlugStackConfig= #PrivateData=jobs -ProctrackType=proctrack/pgid +ProctrackType=proctrack/linuxproc # TODO: really want cgroup but needs cgroup.conf and workaround for CI #Prolog= #PrologFlags= #PrologSlurmctld=