Add spack based rockylinux 9.3 tester

This commit is contained in:
Matthias Krack 2026-02-17 16:57:03 +01:00
parent 2064daf5fd
commit c44663d83f
4 changed files with 143 additions and 2 deletions

View file

@ -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)

View file

@ -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"]

View file

@ -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

View file

@ -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"""