Docker: Use Ubuntu 26.04 for GCC 15 testing (#5022)

This commit is contained in:
SY Wang 2026-03-30 21:14:11 +08:00 committed by GitHub
parent 1814b3554d
commit 08e545abef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 160 additions and 9 deletions

View file

@ -112,42 +112,48 @@ report_url: https://storage.googleapis.com/cp2k-ci/dashboard_spack-openmpi-psmp
[gcc14]
sortkey: 449
name: Ubuntu, GCC 15 (ssmp)
host: GCP
report_url: https://storage.googleapis.com/cp2k-ci/dashboard_gcc15_report.txt
[gcc14]
sortkey: 450
name: Ubuntu, GCC 14 (ssmp)
host: GCP
report_url: https://storage.googleapis.com/cp2k-ci/dashboard_gcc14_report.txt
[gcc13]
sortkey: 450
sortkey: 451
name: Ubuntu, GCC 13 (ssmp)
host: GCP
report_url: https://storage.googleapis.com/cp2k-ci/dashboard_gcc13_report.txt
[gcc12]
sortkey: 451
sortkey: 452
name: Ubuntu, GCC 12 (ssmp)
host: GCP
report_url: https://storage.googleapis.com/cp2k-ci/dashboard_gcc12_report.txt
[gcc11]
sortkey: 452
sortkey: 453
name: Ubuntu, GCC 11 (ssmp)
host: GCP
report_url: https://storage.googleapis.com/cp2k-ci/dashboard_gcc11_report.txt
[gcc10]
sortkey: 453
sortkey: 454
name: Ubuntu, GCC 10 (ssmp)
host: GCP
report_url: https://storage.googleapis.com/cp2k-ci/dashboard_gcc10_report.txt
[gcc9]
sortkey: 454
sortkey: 455
name: Ubuntu, GCC 9 (ssmp)
host: GCP
report_url: https://storage.googleapis.com/cp2k-ci/dashboard_gcc9_report.txt
[gcc8]
sortkey: 455
sortkey: 456
name: Ubuntu, GCC 8 (ssmp)
host: GCP
report_url: https://storage.googleapis.com/cp2k-ci/dashboard_gcc8_report.txt

View file

@ -0,0 +1,130 @@
#
# This file was created by generate_dockerfiles.py.
# Usage: podman build --shm-size=1g -f ./Dockerfile.test_gcc15 ../../
#
FROM ubuntu:26.04
# Add Ubuntu universe repository.
RUN apt-get update -qq && apt-get install -qq --no-install-recommends software-properties-common
RUN add-apt-repository universe
# Install Ubuntu packages.
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && \
apt-get update -qq && apt-get install -qq --no-install-recommends \
cmake \
less \
nano \
make \
ninja-build \
wget \
python3 \
ca-certificates \
gcc-15 \
g++-15 \
gfortran-15 \
libfftw3-dev \
libopenblas-dev \
libint2-dev \
libxc-dev \
libhdf5-dev \
libxsmm-dev \
libspglib-f08-dev \
&& rm -rf /var/lib/apt/lists/*
# Create links in /usr/local/bin to overrule links in /usr/bin.
RUN ln -sf /usr/bin/gcc-15 /usr/local/bin/gcc && \
ln -sf /usr/bin/g++-15 /usr/local/bin/g++ && \
ln -sf /usr/bin/gfortran-15 /usr/local/bin/gfortran
# Use toolchain to install DBCSR.
# Install requirements for the toolchain.
WORKDIR /opt/cp2k-toolchain
COPY ./tools/toolchain/install_requirements*.sh ./
RUN ./install_requirements.sh ubuntu:26.04
# Install the toolchain.
RUN mkdir scripts
COPY ./tools/toolchain/scripts/VERSION \
./tools/toolchain/scripts/parse_if.py \
./tools/toolchain/scripts/tool_kit.sh \
./tools/toolchain/scripts/common_vars.sh \
./tools/toolchain/scripts/signal_trap.sh \
./tools/toolchain/scripts/get_openblas_arch.sh \
./tools/toolchain/scripts/generate_cmake_options.sh \
./scripts/
COPY ./tools/toolchain/install_cp2k_toolchain.sh .
RUN ./install_cp2k_toolchain.sh \
--mpi-mode=no \
--with-dbcsr \
--with-gcc=system \
--with-cmake=system \
--with-ninja=system \
--with-openblas=system \
--with-libxc=no \
--with-libint=no \
--with-fftw=no \
--with-libxsmm=no \
--with-spglib=no \
--with-libvori=no \
--dry-run \
--list-cmake-options=no
# Dry-run leaves behind config files for the followup install scripts.
# This breaks up the lengthy installation into smaller build steps.
COPY ./tools/toolchain/scripts/stage0/ ./scripts/stage0/
RUN ./scripts/stage0/install_stage0.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage1/ ./scripts/stage1/
RUN ./scripts/stage1/install_stage1.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage2/ ./scripts/stage2/
RUN ./scripts/stage2/install_stage2.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage3/ ./scripts/stage3/
RUN ./scripts/stage3/install_stage3.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage4/ ./scripts/stage4/
RUN ./scripts/stage4/install_stage4.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage5/ ./scripts/stage5/
RUN ./scripts/stage5/install_stage5.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage6/ ./scripts/stage6/
RUN ./scripts/stage6/install_stage6.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage7/ ./scripts/stage7/
RUN ./scripts/stage7/install_stage7.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage8/ ./scripts/stage8/
RUN ./scripts/stage8/install_stage8.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage9/ ./scripts/stage9/
RUN ./scripts/stage9/install_stage9.sh && rm -rf ./build
# Install CP2K sources.
WORKDIR /opt/cp2k
COPY ./src ./src
COPY ./data ./data
COPY ./tools/build_utils ./tools/build_utils
COPY ./cmake ./cmake
COPY ./CMakeLists.txt .
# Compile CP2K.
COPY ./tools/docker/scripts/build_cp2k.sh .
RUN ./build_cp2k.sh ubuntu ssmp
# Run regression tests.
ARG TESTOPTS=""
COPY ./tests ./tests
COPY ./tools/docker/scripts/test_regtest.sh ./
RUN /bin/bash -o pipefail -c " \
TESTOPTS='${TESTOPTS}' \
./test_regtest.sh ubuntu ssmp |& tee report.log && \
rm -rf regtesting"
# Output the report if the image is old and was therefore pulled from the build cache.
CMD cat $(find ./report.log -mmin +10) | sed '/^Summary:/ s/$/ (cached)/'
ENTRYPOINT []
#EOF

View file

@ -3,7 +3,7 @@
# Usage: ./spack_cache_start.sh; podman build --network=host --shm-size=1g -f ./Dockerfile.test_spack_psmp-gcc15 ../../
#
ARG BASE_IMAGE="ubuntu:24.04"
ARG BASE_IMAGE="ubuntu:26.04"
###### Stage 1: Build CP2K dependencies ######

View file

@ -269,6 +269,14 @@ nodepools: pool-main
build_path: /
dockerfile: /tools/docker/Dockerfile.test_gcc14
[gcc15]
display_name: Ubuntu, GCC 15 (ssmp)
tags: daily
cpu: 32
nodepools: pool-main
build_path: /
dockerfile: /tools/docker/Dockerfile.test_gcc15
[doxygen]
display_name: Doxygen generation
tags: daily

View file

@ -69,11 +69,13 @@ def main() -> None:
with OutputFile(
f"Dockerfile.test_spack_psmp-gcc{gcc_version}", args.check
) as f:
base_image = "ubuntu:26.04" if gcc_version > 14 else "ubuntu:24.04"
f.write(
install_cp2k_spack(
"psmp",
mpi_mode="mpich",
gcc_version=gcc_version,
base_image=base_image,
feature_flags="-ef openpmd",
)
)
@ -189,7 +191,7 @@ def main() -> None:
f.write(install_deps_toolchain())
f.write(coverage())
for gcc_version in 8, 9, 10, 11, 12, 13, 14:
for gcc_version in 8, 9, 10, 11, 12, 13, 14, 15:
with OutputFile(f"Dockerfile.test_gcc{gcc_version}", args.check) as f:
# Skip some tests due to bug in LDA_C_PMGB06 functional in libxc <5.2.0.
testopts = "--skipdir=QS/regtest-rs-dhft" if gcc_version == 8 else ""
@ -434,7 +436,12 @@ def install_deps_toolchain(
# ======================================================================================
def install_deps_ubuntu(gcc_version: int = 13) -> str:
base_image = "ubuntu:24.04" if gcc_version > 8 else "ubuntu:20.04"
if gcc_version > 14:
base_image = "ubuntu:26.04"
elif gcc_version > 8:
base_image = "ubuntu:24.04"
else:
base_image = "ubuntu:20.04"
output = f"\nFROM {base_image}\n"
if gcc_version > 13: