Sync CI dockerfiles (see #5462) (#5545)

This commit is contained in:
Matthias Krack 2026-07-10 13:46:16 +02:00 committed by GitHub
parent a2edeeb2c6
commit 29578c7298
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 18 deletions

View file

@ -3,14 +3,11 @@
# A stand-alone build in this folder can be performed with:
# podman build --build-arg DEPS_IMAGE=<image id> --shm-size=1g -f build_cp2k_spack.Dockerfile ../../
#
# Author: Matthias Krack (MK)
#
# Stage 2: Build CP2K
ARG BASE_IMAGE=${BASE_IMAGE:-ubuntu:26.04}
ARG DEPS_IMAGE=${DEPS_IMAGE:-}
###### Stage 2: Build CP2K ######
FROM "${DEPS_IMAGE}" AS build_cp2k
# Setup CUDA environment
@ -24,15 +21,17 @@ ENV NUM_PROCS=${NUM_PROCS:-32}
ARG FEATURE_FLAGS
ENV FEATURE_FLAGS=${FEATURE_FLAGS:-}
# Update CP2K files
WORKDIR /opt/cp2k
RUN rm -rf benchmarks cmake data src tests tools
COPY . .
# Build CP2K
WORKDIR /opt/cp2k
COPY ./src ./src
COPY ./data ./data
COPY ./tools/build_utils ./tools/build_utils
COPY ./cmake ./cmake
COPY ./CMakeLists.txt .
RUN ./make_cp2k.sh -cray -cv ${CP2K_VERSION} -uc no -j${NUM_PROCS} ${FEATURE_FLAGS}
###### Stage 3: Install CP2K ######
# Stage 3: Install CP2K
FROM "${BASE_IMAGE}" AS install_cp2k
@ -50,11 +49,11 @@ COPY --from=build_cp2k /opt/cp2k/spack/spack/opt/spack ./spack/spack/opt/spack
COPY --from=build_cp2k /opt/cp2k/install ./install
# Install CP2K regression tests
COPY --from=build_cp2k /opt/cp2k/tests ./tests
COPY ./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
COPY ./benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf

View file

@ -3,8 +3,6 @@
# A stand-alone build in this folder can be performed with:
# podman build --shm-size=1g -f build_deps_spack.Dockerfile ../../
#
# Author: Matthias Krack (MK)
#
# Stage 1: Create a base image providing the dependencies for building a CP2K binary
ARG BASE_IMAGE=${BASE_IMAGE:-ubuntu:26.04}
@ -52,10 +50,10 @@ ENV CP2K_VERSION=${CP2K_VERSION:-psmp}
ARG FEATURE_FLAGS
ENV FEATURE_FLAGS=${FEATURE_FLAGS:-}
# Copy CP2K repository into container
WORKDIR /opt
COPY . cp2k/
# Build CP2K dependencies
WORKDIR /opt/cp2k
COPY ./tools/spack ./tools/spack
COPY ./tools/docker ./tools/docker
COPY ./make_cp2k.sh .
RUN ./make_cp2k.sh -bd_only -cray -cv ${CP2K_VERSION} -uc no -ue -j${NUM_PROCS} ${FEATURE_FLAGS}