From c44663d83f4eee1bc688aaa6295e35f44a35778d Mon Sep 17 00:00:00 2001 From: Matthias Krack Date: Tue, 17 Feb 2026 16:57:03 +0100 Subject: [PATCH] Add spack based rockylinux 9.3 tester --- tools/dashboard/dashboard.conf | 7 ++ .../Dockerfile.test_spack_psmp-rockylinux | 80 +++++++++++++++++++ tools/docker/cp2k-ci.conf | 8 ++ tools/docker/generate_dockerfiles.py | 50 +++++++++++- 4 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 tools/docker/Dockerfile.test_spack_psmp-rockylinux diff --git a/tools/dashboard/dashboard.conf b/tools/dashboard/dashboard.conf index 825463cff3..e13cc4a806 100644 --- a/tools/dashboard/dashboard.conf +++ b/tools/dashboard/dashboard.conf @@ -337,6 +337,13 @@ timeout: 170 host: GCP report_url: https://storage.googleapis.com/cp2k-ci/dashboard_spack-psmp-fedora_report.txt +[spack-psmp-rockylinux] +sortkey: 1043 +name: Spack (psmp, rockylinux) +timeout: 170 +host: GCP +report_url: https://storage.googleapis.com/cp2k-ci/dashboard_spack-psmp-rockylinux_report.txt + [spack-psmp-opensuse] sortkey: 1044 name: Spack (psmp, opensuse) diff --git a/tools/docker/Dockerfile.test_spack_psmp-rockylinux b/tools/docker/Dockerfile.test_spack_psmp-rockylinux new file mode 100644 index 0000000000..6ff1c3aa0a --- /dev/null +++ b/tools/docker/Dockerfile.test_spack_psmp-rockylinux @@ -0,0 +1,80 @@ +# +# This file was created by generate_dockerfiles.py. +# Usage: ./spack_cache_start.sh; podman build --network=host --shm-size=1g -f ./Dockerfile.test_spack_psmp-rockylinux ../../ +# + +ARG BASE_IMAGE="rockylinux:9.3" + +###### Stage 1: Build CP2K ###### + +FROM "${BASE_IMAGE}" AS build_cp2k + +RUN dnf -y install dnf-plugins-core && \ + dnf --enablerepo=crb -qy install \ + bzip2 \ + cmake \ + gcc gcc-c++ gcc-fortran \ + git \ + libtool \ + openssl-devel \ + patch \ + python3.11 \ + python3.11-devel \ + python3.11-pip \ + unzip \ + wget \ + xz \ + zlib-devel \ + zlib-static \ + && dnf clean -q all + +RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 + +ARG SPACK_CACHE="s3://spack-cache --s3-endpoint-url=http://localhost:9000" + +# Copy CP2K repository into container +WORKDIR /opt +COPY . cp2k/ + +# Build CP2K dependencies +WORKDIR /opt/cp2k +RUN ./make_cp2k.sh -bd_only -cv psmp -gpu none -gv 11 -mpi mpich -ue -df libxsmm -ef openpmd + +# Build and install CP2K +RUN ./make_cp2k.sh -cv psmp -gv 11 -gpu none -mpi mpich -df libxsmm -ef openpmd + +###### Stage 2: Install CP2K ###### + +FROM "${BASE_IMAGE}" AS install_cp2k + +RUN dnf -y install dnf-plugins-core && \ + dnf --enablerepo=crb -qy install \ + gcc gcc-c++ gcc-fortran \ + python3.11 \ + python3.11-pip \ + && dnf clean -q all + +RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 + +WORKDIR /opt/cp2k + +# Install CP2K dependencies built with spack +COPY --from=build_cp2k /opt/cp2k/spack/spack/opt/spack ./spack/spack/opt/spack + +# Install CP2K +COPY --from=build_cp2k /opt/cp2k/install ./install + +# Install CP2K regression tests +COPY --from=build_cp2k /opt/cp2k/tests ./tests +COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks + +# Install CP2K/Quickstep CI benchmarks +COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI + +# Run CP2K regression test +RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests + +# Create entrypoint and finalise container build +WORKDIR /mnt +ENTRYPOINT ["/opt/cp2k/install/bin/launch"] +CMD ["cp2k", "--help", "--version"] diff --git a/tools/docker/cp2k-ci.conf b/tools/docker/cp2k-ci.conf index 6332fe8741..9794d575a7 100644 --- a/tools/docker/cp2k-ci.conf +++ b/tools/docker/cp2k-ci.conf @@ -400,6 +400,14 @@ nodepools: pool-main build_path: / dockerfile: /tools/docker/Dockerfile.test_spack_psmp-fedora +[spack-psmp-rockylinux] +display_name: Spack (psmp, rockylinux) +tags: weekly-afternoon +cpu: 32 +nodepools: pool-main +build_path: / +dockerfile: /tools/docker/Dockerfile.test_spack_psmp-rockylinux + [spack-psmp-opensuse] display_name: Spack (psmp, opensuse) tags: weekly-afternoon diff --git a/tools/docker/generate_dockerfiles.py b/tools/docker/generate_dockerfiles.py index d89df980e0..4fe7073561 100755 --- a/tools/docker/generate_dockerfiles.py +++ b/tools/docker/generate_dockerfiles.py @@ -116,6 +116,17 @@ def main() -> None: ) ) + with OutputFile(f"Dockerfile.test_spack_psmp-rockylinux", args.check) as f: + f.write( + install_cp2k_spack( + "psmp", + mpi_mode="mpich", + base_image="rockylinux:9.3", + gcc_version=11, + feature_flags="-df libxsmm -ef openpmd", + ) + ) + with OutputFile(f"Dockerfile.test_spack_psmp-4x2", args.check) as f: testopts = f"--mpiranks=4 --ompthreads=2" f.write( @@ -661,6 +672,9 @@ def install_cp2k_spack( gcc_compilers = "g++ gcc gfortran" elif "opensuse/leap" in base_image: gcc_compilers = f"gcc gcc{gcc_version} gcc-c++ gcc{gcc_version}-c++ gcc-fortran gcc{gcc_version}-fortran" + elif "rockylinux" in base_image: + # Rockylinux provides only GCC 11 + gcc_compilers = f"gcc gcc-c++ gcc-fortran" else: gcc_compilers = f"g++ g++-{gcc_version} gcc gcc-{gcc_version} gfortran gfortran-{gcc_version}" # Static CP2K builds use the GCC compiler built with spack @@ -747,7 +761,6 @@ RUN dnf -qy install \ git \ libtool \ make \ - ninja-build \ patch \ perl-core \ pkg-config \ @@ -785,6 +798,29 @@ RUN zypper --non-interactive --quiet ref && \ RUN ln -sf /usr/bin/python3.11 /usr/local/bin/python3 && \ ln -sf /usr/bin/python3.11 /usr/local/bin/python +""" + elif "rockylinux" in base_image: + output += rf""" +RUN dnf -y install dnf-plugins-core && \ + dnf --enablerepo=crb -qy install \ + bzip2 \ + cmake \ + {gcc_compilers} \ + git \ + libtool \ + openssl-devel \ + patch \ + python3.11 \ + python3.11-devel \ + python3.11-pip \ + unzip \ + wget \ + xz \ + zlib-devel \ + zlib-static \ + && dnf clean -q all + +RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 """ elif "ubuntu" in base_image: output += rf""" @@ -801,7 +837,6 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \ libtool-bin \ lsb-release \ make \ - ninja-build \ patch \ pkgconf \ python3 \ @@ -849,6 +884,17 @@ RUN zypper --non-interactive --quiet ref && \ RUN ln -sf /usr/bin/python3.11 /usr/local/bin/python3 && \ ln -sf /usr/bin/python3.11 /usr/local/bin/python +""" + elif "rockylinux" in base_image: + output += rf""" +RUN dnf -y install dnf-plugins-core && \ + dnf --enablerepo=crb -qy install \ + {gcc_compilers} \ + python3.11 \ + python3.11-pip \ + && dnf clean -q all + +RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 """ elif "ubuntu" in base_image: output += rf"""