diff --git a/tools/docker/Dockerfile.test_aiida b/tools/docker/Dockerfile.test_aiida index d636211af3..aee914accd 100644 --- a/tools/docker/Dockerfile.test_aiida +++ b/tools/docker/Dockerfile.test_aiida @@ -59,16 +59,27 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install test for aiida. -WORKDIR /workspace +# Install CP2K using local.sdbg. +WORKDIR /workspace/cp2k +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.sdbg ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=sdbg &> /dev/null || true )" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh +# Run test for aiida. +COPY ./tools/docker/scripts/test_aiida.sh . +RUN ./test_aiida.sh 2>&1 | tee report.log -COPY ./tools/docker/scripts/install_aiida.sh . -RUN ./install_aiida.sh - -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_aiida.sh ./ -CMD ["./ci_entrypoint.sh", "./test_aiida.sh"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_ase b/tools/docker/Dockerfile.test_ase index 783a1806ff..cb059faebf 100644 --- a/tools/docker/Dockerfile.test_ase +++ b/tools/docker/Dockerfile.test_ase @@ -59,16 +59,27 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install test for ase. -WORKDIR /workspace +# Install CP2K using local.sdbg. +WORKDIR /workspace/cp2k +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.sdbg ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=sdbg &> /dev/null || true )" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh +# Run test for ase. +COPY ./tools/docker/scripts/test_ase.sh . +RUN ./test_ase.sh 2>&1 | tee report.log -COPY ./tools/docker/scripts/install_ase.sh . -RUN ./install_ase.sh - -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_ase.sh ./ -CMD ["./ci_entrypoint.sh", "./test_ase.sh"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_conventions b/tools/docker/Dockerfile.test_conventions index bd5c560367..794c5f1db8 100644 --- a/tools/docker/Dockerfile.test_conventions +++ b/tools/docker/Dockerfile.test_conventions @@ -59,16 +59,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install test for conventions. -WORKDIR /workspace +# Install CP2K using local_warn.psmp. +WORKDIR /workspace/cp2k +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_warn.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_warn VERSION=psmp &> /dev/null || true )" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh +# Run test for conventions. +COPY ./arch/Linux-x86-64-gfortran.dumpast ./arch/ +COPY ./tools/conventions ./tools/conventions +WORKDIR ./tools/conventions +RUN /bin/bash -ec " \ + source /opt/cp2k-toolchain/install/setup && \ + ./test_conventions.sh |& tee report.log" -COPY ./tools/docker/scripts/install_conventions.sh . -RUN ./install_conventions.sh - -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_conventions.sh ./ -CMD ["./ci_entrypoint.sh", "./test_conventions.sh"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_coverage-pdbg b/tools/docker/Dockerfile.test_coverage-pdbg index 934c105fdc..98077d94f7 100644 --- a/tools/docker/Dockerfile.test_coverage-pdbg +++ b/tools/docker/Dockerfile.test_coverage-pdbg @@ -59,19 +59,27 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install coverage test for pdbg. -WORKDIR /workspace +# Install CP2K using local_coverage.pdbg. +WORKDIR /workspace/cp2k +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_coverage.pdbg ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_coverage VERSION=pdbg &> /dev/null || true )" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh +# Run coverage test for pdbg. +COPY ./tools/docker/scripts/test_coverage.sh . +RUN ./test_coverage.sh "pdbg" 2>&1 | tee report.log -COPY ./tools/docker/scripts/install_coverage.sh . -RUN ./install_coverage.sh - -COPY ./tools/docker/scripts/install_regtest.sh . -RUN ./install_regtest.sh local_coverage pdbg - -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_coverage.sh ./ -CMD ["./ci_entrypoint.sh", "./test_coverage.sh", "pdbg"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_coverage-sdbg b/tools/docker/Dockerfile.test_coverage-sdbg index aaab26d384..34a16f1a6f 100644 --- a/tools/docker/Dockerfile.test_coverage-sdbg +++ b/tools/docker/Dockerfile.test_coverage-sdbg @@ -59,19 +59,27 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install coverage test for sdbg. -WORKDIR /workspace +# Install CP2K using local_coverage.sdbg. +WORKDIR /workspace/cp2k +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_coverage.sdbg ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_coverage VERSION=sdbg &> /dev/null || true )" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh +# Run coverage test for sdbg. +COPY ./tools/docker/scripts/test_coverage.sh . +RUN ./test_coverage.sh "sdbg" 2>&1 | tee report.log -COPY ./tools/docker/scripts/install_coverage.sh . -RUN ./install_coverage.sh - -COPY ./tools/docker/scripts/install_regtest.sh . -RUN ./install_regtest.sh local_coverage sdbg - -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_coverage.sh ./ -CMD ["./ci_entrypoint.sh", "./test_coverage.sh", "sdbg"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_cuda_A100 b/tools/docker/Dockerfile.test_cuda_A100 index 4e37b0bfcf..a6fe080501 100644 --- a/tools/docker/Dockerfile.test_cuda_A100 +++ b/tools/docker/Dockerfile.test_cuda_A100 @@ -71,31 +71,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local_cuda.psmp. +# Install CP2K using local_cuda.psmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local_cuda.psmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local_cuda VERSION=psmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_cuda.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_cuda VERSION=psmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local_cuda' 'psmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local_cuda' 'psmp' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_cuda_P100 b/tools/docker/Dockerfile.test_cuda_P100 index e8d326ab90..f2f45d35fc 100644 --- a/tools/docker/Dockerfile.test_cuda_P100 +++ b/tools/docker/Dockerfile.test_cuda_P100 @@ -71,31 +71,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local_cuda.psmp. +# Install CP2K using local_cuda.psmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local_cuda.psmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local_cuda VERSION=psmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_cuda.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_cuda VERSION=psmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local_cuda' 'psmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local_cuda' 'psmp' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_cuda_V100 b/tools/docker/Dockerfile.test_cuda_V100 index dc8e1ba640..eb4bfd73c9 100644 --- a/tools/docker/Dockerfile.test_cuda_V100 +++ b/tools/docker/Dockerfile.test_cuda_V100 @@ -71,31 +71,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local_cuda.psmp. +# Install CP2K using local_cuda.psmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local_cuda.psmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local_cuda VERSION=psmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_cuda.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_cuda VERSION=psmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local_cuda' 'psmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local_cuda' 'psmp' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_doxygen b/tools/docker/Dockerfile.test_doxygen index ed45851715..41020ede78 100644 --- a/tools/docker/Dockerfile.test_doxygen +++ b/tools/docker/Dockerfile.test_doxygen @@ -5,16 +5,25 @@ FROM ubuntu:20.04 -# Install test for doxygen. -WORKDIR /workspace - -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh - +# Install dependencies. +WORKDIR /workspace/cp2k COPY ./tools/docker/scripts/install_doxygen.sh . RUN ./install_doxygen.sh -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_doxygen.sh ./ -CMD ["./ci_entrypoint.sh", "./test_doxygen.sh"] +# Install sources. +ARG GIT_COMMIT_SHA +COPY ./src ./src +COPY ./exts ./exts +COPY ./data ./data +COPY ./tools ./tools +COPY ./Makefile . +RUN bash -c "if [ -n "${GIT_COMMIT_SHA}" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi" + +# Run test for doxygen. +COPY ./tools/docker/scripts/test_doxygen.sh . +RUN ./test_doxygen.sh 2>&1 | tee report.log + +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_fedora-psmp b/tools/docker/Dockerfile.test_fedora-psmp index c6ae09d84f..b4765c5268 100644 --- a/tools/docker/Dockerfile.test_fedora-psmp +++ b/tools/docker/Dockerfile.test_fedora-psmp @@ -59,31 +59,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local.psmp. +# Install CP2K using local.psmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local.psmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local VERSION=psmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=psmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local' 'psmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local' 'psmp' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_gcc10 b/tools/docker/Dockerfile.test_gcc10 index 8e92767ba1..a6d97e472a 100644 --- a/tools/docker/Dockerfile.test_gcc10 +++ b/tools/docker/Dockerfile.test_gcc10 @@ -85,31 +85,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local.ssmp. +# Install CP2K using local.ssmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local' 'ssmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local' '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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_gcc7 b/tools/docker/Dockerfile.test_gcc7 index e41fb78faf..f37985896f 100644 --- a/tools/docker/Dockerfile.test_gcc7 +++ b/tools/docker/Dockerfile.test_gcc7 @@ -85,31 +85,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local.ssmp. +# Install CP2K using local.ssmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local' 'ssmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local' '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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_gcc8 b/tools/docker/Dockerfile.test_gcc8 index 7102423827..caa6373feb 100644 --- a/tools/docker/Dockerfile.test_gcc8 +++ b/tools/docker/Dockerfile.test_gcc8 @@ -85,31 +85,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local.ssmp. +# Install CP2K using local.ssmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local' 'ssmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local' '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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_gcc9 b/tools/docker/Dockerfile.test_gcc9 index 96c9c088b9..fc2d21e12b 100644 --- a/tools/docker/Dockerfile.test_gcc9 +++ b/tools/docker/Dockerfile.test_gcc9 @@ -85,31 +85,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local.ssmp. +# Install CP2K using local.ssmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local' 'ssmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local' '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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_gromacs b/tools/docker/Dockerfile.test_gromacs index 936331a3af..b1d853ff57 100644 --- a/tools/docker/Dockerfile.test_gromacs +++ b/tools/docker/Dockerfile.test_gromacs @@ -59,16 +59,27 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install test for gromacs. -WORKDIR /workspace +# Install CP2K using local.sdbg. +WORKDIR /workspace/cp2k +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.sdbg ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=sdbg &> /dev/null || true )" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh +# Run test for gromacs. +COPY ./tools/docker/scripts/test_gromacs.sh . +RUN ./test_gromacs.sh 2>&1 | tee report.log -COPY ./tools/docker/scripts/install_gromacs.sh . -RUN ./install_gromacs.sh - -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_gromacs.sh ./ -CMD ["./ci_entrypoint.sh", "./test_gromacs.sh"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_hip_cuda_A100 b/tools/docker/Dockerfile.test_hip_cuda_A100 index 4b07de84f0..9f0ae7c23d 100644 --- a/tools/docker/Dockerfile.test_hip_cuda_A100 +++ b/tools/docker/Dockerfile.test_hip_cuda_A100 @@ -149,31 +149,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local_hip.psmp. +# Install CP2K using local_hip.psmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local_hip.psmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local_hip VERSION=psmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_hip.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_hip VERSION=psmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local_hip' 'psmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local_hip' 'psmp' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_hip_cuda_P100 b/tools/docker/Dockerfile.test_hip_cuda_P100 index f52c0f8b02..354ef84eaf 100644 --- a/tools/docker/Dockerfile.test_hip_cuda_P100 +++ b/tools/docker/Dockerfile.test_hip_cuda_P100 @@ -149,31 +149,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local_hip.psmp. +# Install CP2K using local_hip.psmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local_hip.psmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local_hip VERSION=psmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_hip.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_hip VERSION=psmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local_hip' 'psmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local_hip' 'psmp' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_hip_cuda_V100 b/tools/docker/Dockerfile.test_hip_cuda_V100 index 2c9e764789..a950c45d12 100644 --- a/tools/docker/Dockerfile.test_hip_cuda_V100 +++ b/tools/docker/Dockerfile.test_hip_cuda_V100 @@ -149,31 +149,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local_hip.psmp. +# Install CP2K using local_hip.psmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local_hip.psmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local_hip VERSION=psmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_hip.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_hip VERSION=psmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local_hip' 'psmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local_hip' 'psmp' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_hip_rocm_Mi100 b/tools/docker/Dockerfile.test_hip_rocm_Mi100 index 22601255ec..9d3dee088b 100644 --- a/tools/docker/Dockerfile.test_hip_rocm_Mi100 +++ b/tools/docker/Dockerfile.test_hip_rocm_Mi100 @@ -75,31 +75,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local_hip.psmp. +# Install CP2K using local_hip.psmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local_hip.psmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local_hip VERSION=psmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_hip.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_hip VERSION=psmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local_hip' 'psmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local_hip' 'psmp' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_hip_rocm_Mi50 b/tools/docker/Dockerfile.test_hip_rocm_Mi50 index 5f42ba1980..151735fb44 100644 --- a/tools/docker/Dockerfile.test_hip_rocm_Mi50 +++ b/tools/docker/Dockerfile.test_hip_rocm_Mi50 @@ -75,31 +75,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local_hip.psmp. +# Install CP2K using local_hip.psmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local_hip.psmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local_hip VERSION=psmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_hip.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_hip VERSION=psmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local_hip' 'psmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local_hip' 'psmp' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_i-pi b/tools/docker/Dockerfile.test_i-pi index 6594ca8635..984c0ae0bf 100644 --- a/tools/docker/Dockerfile.test_i-pi +++ b/tools/docker/Dockerfile.test_i-pi @@ -59,16 +59,27 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install test for i-pi. -WORKDIR /workspace +# Install CP2K using local.sdbg. +WORKDIR /workspace/cp2k +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.sdbg ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=sdbg &> /dev/null || true )" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh +# Run test for i-pi. +COPY ./tools/docker/scripts/test_i-pi.sh . +RUN ./test_i-pi.sh 2>&1 | tee report.log -COPY ./tools/docker/scripts/install_i-pi.sh . -RUN ./install_i-pi.sh - -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_i-pi.sh ./ -CMD ["./ci_entrypoint.sh", "./test_i-pi.sh"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_i386 b/tools/docker/Dockerfile.test_i386 index 03f623f2b4..edfc00c27c 100644 --- a/tools/docker/Dockerfile.test_i386 +++ b/tools/docker/Dockerfile.test_i386 @@ -85,31 +85,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local.ssmp. +# Install CP2K using local.ssmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local' 'ssmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local' '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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_manual b/tools/docker/Dockerfile.test_manual index 685f3d8927..37e53d54c0 100644 --- a/tools/docker/Dockerfile.test_manual +++ b/tools/docker/Dockerfile.test_manual @@ -59,16 +59,32 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install test for manual. -WORKDIR /workspace +# Install CP2K using local.psmp. +WORKDIR /workspace/cp2k +ARG GIT_COMMIT_SHA +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + if [ -n "${GIT_COMMIT_SHA}" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi && \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + make -j ARCH=local VERSION=psmp && \ + rm -rf lib obj exe/local/*_unittest.psmp" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh +# Generate manual. +COPY ./tools/manual ./tools/manual +COPY ./tools/input_editing ./tools/input_editing +COPY ./tools/docker/scripts/test_manual.sh . +RUN ./test_manual.sh 2>&1 | tee report.log -COPY ./tools/docker/scripts/install_manual.sh . -RUN ./install_manual.sh - -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_manual.sh ./ -CMD ["./ci_entrypoint.sh", "./test_manual.sh"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_minimal b/tools/docker/Dockerfile.test_minimal index 82e5e27806..5f163b8eb6 100644 --- a/tools/docker/Dockerfile.test_minimal +++ b/tools/docker/Dockerfile.test_minimal @@ -59,30 +59,30 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for minimal.sdbg. +# Install CP2K using minimal.sdbg. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils COPY ./arch/minimal.sdbg /workspace/cp2k/arch/ -RUN /bin/bash -c "echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=minimal VERSION=sdbg &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=minimal VERSION=sdbg &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'minimal' 'sdbg' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'minimal' 'sdbg' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_openmpi-psmp b/tools/docker/Dockerfile.test_openmpi-psmp index 6f42736e4b..9f8e6a0249 100644 --- a/tools/docker/Dockerfile.test_openmpi-psmp +++ b/tools/docker/Dockerfile.test_openmpi-psmp @@ -59,31 +59,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local.psmp. +# Install CP2K using local.psmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local.psmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local VERSION=psmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=psmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local' 'psmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local' 'psmp' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_pdbg b/tools/docker/Dockerfile.test_pdbg index 9763774590..ce69ba8c98 100644 --- a/tools/docker/Dockerfile.test_pdbg +++ b/tools/docker/Dockerfile.test_pdbg @@ -59,31 +59,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local.pdbg. +# Install CP2K using local.pdbg. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local.pdbg ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local VERSION=pdbg &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.pdbg ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=pdbg &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local' 'pdbg' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local' 'pdbg' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_performance b/tools/docker/Dockerfile.test_performance index c0acbc339f..87fbe11c86 100644 --- a/tools/docker/Dockerfile.test_performance +++ b/tools/docker/Dockerfile.test_performance @@ -59,20 +59,30 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install performance test for local. -WORKDIR /workspace +# Install CP2K using local.psmp. +WORKDIR /workspace/cp2k +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=psmp &> /dev/null || true )" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh - -COPY ./tools/docker/scripts/install_performance.sh . -RUN ./install_performance.sh "local" - -COPY ./tools/docker/scripts/ci_entrypoint.sh \ - ./tools/docker/scripts/test_performance.sh \ +# Run performance test for local. +COPY ./benchmarks ./benchmarks +COPY ./tools/docker/scripts/test_performance.sh \ ./tools/docker/scripts/plot_performance.py \ ./ +RUN ./test_performance.sh "local" 2>&1 | tee report.log -CMD ["./ci_entrypoint.sh", "./test_performance.sh", "local"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_performance_cuda_A100 b/tools/docker/Dockerfile.test_performance_cuda_A100 index b1ac999897..07b8431b0e 100644 --- a/tools/docker/Dockerfile.test_performance_cuda_A100 +++ b/tools/docker/Dockerfile.test_performance_cuda_A100 @@ -71,20 +71,30 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install performance test for local_cuda. -WORKDIR /workspace +# Install CP2K using local_cuda.psmp. +WORKDIR /workspace/cp2k +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_cuda.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_cuda VERSION=psmp &> /dev/null || true )" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh - -COPY ./tools/docker/scripts/install_performance.sh . -RUN ./install_performance.sh "local_cuda" - -COPY ./tools/docker/scripts/ci_entrypoint.sh \ - ./tools/docker/scripts/test_performance.sh \ +# Run performance test for local_cuda. +COPY ./benchmarks ./benchmarks +COPY ./tools/docker/scripts/test_performance.sh \ ./tools/docker/scripts/plot_performance.py \ ./ +RUN ./test_performance.sh "local_cuda" 2>&1 | tee report.log -CMD ["./ci_entrypoint.sh", "./test_performance.sh", "local_cuda"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_performance_cuda_P100 b/tools/docker/Dockerfile.test_performance_cuda_P100 index 48cd21b3af..dc2f4d5c37 100644 --- a/tools/docker/Dockerfile.test_performance_cuda_P100 +++ b/tools/docker/Dockerfile.test_performance_cuda_P100 @@ -71,20 +71,30 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install performance test for local_cuda. -WORKDIR /workspace +# Install CP2K using local_cuda.psmp. +WORKDIR /workspace/cp2k +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_cuda.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_cuda VERSION=psmp &> /dev/null || true )" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh - -COPY ./tools/docker/scripts/install_performance.sh . -RUN ./install_performance.sh "local_cuda" - -COPY ./tools/docker/scripts/ci_entrypoint.sh \ - ./tools/docker/scripts/test_performance.sh \ +# Run performance test for local_cuda. +COPY ./benchmarks ./benchmarks +COPY ./tools/docker/scripts/test_performance.sh \ ./tools/docker/scripts/plot_performance.py \ ./ +RUN ./test_performance.sh "local_cuda" 2>&1 | tee report.log -CMD ["./ci_entrypoint.sh", "./test_performance.sh", "local_cuda"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_performance_cuda_V100 b/tools/docker/Dockerfile.test_performance_cuda_V100 index 1930d8354f..ac912ded70 100644 --- a/tools/docker/Dockerfile.test_performance_cuda_V100 +++ b/tools/docker/Dockerfile.test_performance_cuda_V100 @@ -71,20 +71,30 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install performance test for local_cuda. -WORKDIR /workspace +# Install CP2K using local_cuda.psmp. +WORKDIR /workspace/cp2k +COPY ./Makefile . +COPY ./src ./src +COPY ./exts ./exts +COPY ./tools/build_utils ./tools/build_utils +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local_cuda.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local_cuda VERSION=psmp &> /dev/null || true )" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh - -COPY ./tools/docker/scripts/install_performance.sh . -RUN ./install_performance.sh "local_cuda" - -COPY ./tools/docker/scripts/ci_entrypoint.sh \ - ./tools/docker/scripts/test_performance.sh \ +# Run performance test for local_cuda. +COPY ./benchmarks ./benchmarks +COPY ./tools/docker/scripts/test_performance.sh \ ./tools/docker/scripts/plot_performance.py \ ./ +RUN ./test_performance.sh "local_cuda" 2>&1 | tee report.log -CMD ["./ci_entrypoint.sh", "./test_performance.sh", "local_cuda"] +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_psmp b/tools/docker/Dockerfile.test_psmp index 35b0302b22..4648387520 100644 --- a/tools/docker/Dockerfile.test_psmp +++ b/tools/docker/Dockerfile.test_psmp @@ -59,31 +59,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local.psmp. +# Install CP2K using local.psmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local.psmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local VERSION=psmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.psmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=psmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local' 'psmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local' 'psmp' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_python b/tools/docker/Dockerfile.test_python index 73a553a588..287a841890 100644 --- a/tools/docker/Dockerfile.test_python +++ b/tools/docker/Dockerfile.test_python @@ -5,16 +5,25 @@ FROM ubuntu:20.04 -# Install test for python. -WORKDIR /workspace - -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh - +# Install dependencies. +WORKDIR /workspace/cp2k COPY ./tools/docker/scripts/install_python.sh . RUN ./install_python.sh -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_python.sh ./ -CMD ["./ci_entrypoint.sh", "./test_python.sh"] +# Install sources. +ARG GIT_COMMIT_SHA +COPY ./src ./src +COPY ./exts ./exts +COPY ./data ./data +COPY ./tools ./tools +COPY ./Makefile . +RUN bash -c "if [ -n "${GIT_COMMIT_SHA}" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi" + +# Run test for python. +COPY ./tools/docker/scripts/test_python.sh . +RUN ./test_python.sh 2>&1 | tee report.log + +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_sdbg b/tools/docker/Dockerfile.test_sdbg index d8b762867f..23c3dde04c 100644 --- a/tools/docker/Dockerfile.test_sdbg +++ b/tools/docker/Dockerfile.test_sdbg @@ -59,31 +59,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local.sdbg. +# Install CP2K using local.sdbg. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local.sdbg ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local VERSION=sdbg &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.sdbg ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=sdbg &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local' 'sdbg' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local' 'sdbg' |& 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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/Dockerfile.test_ssmp b/tools/docker/Dockerfile.test_ssmp index 6ebea918b1..526635785d 100644 --- a/tools/docker/Dockerfile.test_ssmp +++ b/tools/docker/Dockerfile.test_ssmp @@ -59,31 +59,31 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \ ./scripts/ RUN ./scripts/generate_arch_files.sh && rm -rf ./build -# Install regression test for local.ssmp. +# Install CP2K using local.ssmp. WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA COPY ./Makefile . COPY ./src ./src COPY ./exts ./exts COPY ./tools/build_utils ./tools/build_utils -RUN /bin/bash -c "mkdir -p arch \ - && ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ \ - && echo 'Compiling cp2k...' \ - && if [ -n \"${GIT_COMMIT_SHA}\" ] ; then echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" - -# Run regression tests. -ARG TESTOPTS +RUN /bin/bash -c " \ + mkdir -p arch && \ + ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/ && \ + echo 'Compiling cp2k...' && \ + source /opt/cp2k-toolchain/install/setup && \ + ( make -j ARCH=local VERSION=ssmp &> /dev/null || true )" COPY ./data ./data COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting -COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local' 'ssmp' 2>&1 | tee report.txt -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) +# Run regression tests. +ARG TESTOPTS +COPY ./tools/docker/scripts/test_regtest.sh ./ +RUN /bin/bash -c " \ + TESTOPTS="${TESTOPTS}" \ + ./test_regtest.sh 'local' '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 +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF diff --git a/tools/docker/build_test.sh b/tools/docker/build_test.sh deleted file mode 100755 index 85788a1443..0000000000 --- a/tools/docker/build_test.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -if (($# < 1)); then - echo "usage: build_test.sh [additional-args]" - echo "example: build_test.sh python" - exit 1 -fi - -set -e -TESTNAME=$1 -shift -echo "Building ${TESTNAME} ..." - -set -x -${DOCKER:-docker} build -t "img_cp2k_test_${TESTNAME}" "$@" -f "Dockerfile.test_${TESTNAME}" . - -#EOF diff --git a/tools/docker/generate_dockerfiles.py b/tools/docker/generate_dockerfiles.py index 1be5b92afa..c6246836c6 100755 --- a/tools/docker/generate_dockerfiles.py +++ b/tools/docker/generate_dockerfiles.py @@ -54,116 +54,197 @@ def main() -> None: with OutputFile(f"Dockerfile.test_hip_rocm_{gpu_ver}", args.check) as f: f.write(toolchain_hip_rocm(gpu_ver=gpu_ver) + regtest("psmp", "local_hip")) - for name in "aiida", "ase", "conventions", "gromacs", "i-pi", "manual": + with OutputFile(f"Dockerfile.test_conventions", args.check) as f: + f.write(toolchain_full() + conventions()) + + with OutputFile(f"Dockerfile.test_manual", args.check) as f: + f.write(toolchain_full() + manual()) + + for name in "aiida", "ase", "gromacs", "i-pi": with OutputFile(f"Dockerfile.test_{name}", args.check) as f: - f.write(toolchain_full() + generic_test(name)) + f.write(toolchain_full() + test_3rd_party(name)) - for name in "doxygen", "python": + for name in "python", "doxygen": with OutputFile(f"Dockerfile.test_{name}", args.check) as f: - f.write("\nFROM ubuntu:20.04\n" + generic_test(name)) - - -# ====================================================================================== -def generic_test(name: str) -> str: - return fr""" -# Install test for {name}. -WORKDIR /workspace - -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh - -COPY ./tools/docker/scripts/install_{name}.sh . -RUN ./install_{name}.sh - -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_{name}.sh ./ -CMD ["./ci_entrypoint.sh", "./test_{name}.sh"] - -#EOF -""" + f.write(test_without_build(name)) # ====================================================================================== def regtest(version: str, arch: str = "local") -> str: - if arch.startswith("local"): - copy_arch_file = "" - arch_file = f"/opt/cp2k-toolchain/install/arch/{arch}.{version}" - link_arch_file = f"mkdir -p arch \\\n && ln -vs {arch_file} ./arch/ \\\n && " - else: - copy_arch_file = f"\nCOPY ./arch/{arch}.{version} /workspace/cp2k/arch/" - link_arch_file = "" - - return fr""" -# Install regression test for {arch}.{version}. -WORKDIR /workspace/cp2k - -# Build binary in a separate layer to improve cache hit rate. -ARG GIT_COMMIT_SHA -COPY ./Makefile . -COPY ./src ./src -COPY ./exts ./exts -COPY ./tools/build_utils ./tools/build_utils{copy_arch_file} -RUN /bin/bash -c "{link_arch_file}echo 'Compiling cp2k...' \ - && if [ -n \"${{GIT_COMMIT_SHA}}\" ] ; then echo "git:\${{GIT_COMMIT_SHA::7}}" > REVISION; fi \ - && source /opt/cp2k-toolchain/install/setup \ - && ( make -j ARCH={arch} VERSION={version} &> /dev/null || true )" - + return ( + install_cp2k(version=version, arch=arch, prod=False) + + fr""" # Run regression tests. ARG TESTOPTS -COPY ./data ./data -COPY ./tests ./tests -COPY ./tools/regtesting ./tools/regtesting COPY ./tools/docker/scripts/test_regtest.sh ./ -RUN TESTOPTS="${{TESTOPTS}}" ./test_regtest.sh '{arch}' '{version}' 2>&1 | tee report.txt - -# Output the report if the image was pulled from the build cache. -CMD cat $(find ./report.txt -mmin +3) - -#EOF +RUN /bin/bash -c " \ + TESTOPTS="${{TESTOPTS}}" \ + ./test_regtest.sh '{arch}' '{version}' |& tee report.log && \ + rm -rf regtesting" """ + + print_cached_report() + ) # ====================================================================================== def performance(arch: str = "local") -> str: - return fr""" -# Install performance test for {arch}. -WORKDIR /workspace - -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh - -COPY ./tools/docker/scripts/install_performance.sh . -RUN ./install_performance.sh "{arch}" - -COPY ./tools/docker/scripts/ci_entrypoint.sh \ - ./tools/docker/scripts/test_performance.sh \ + return ( + install_cp2k(version="psmp", arch=arch, prod=False) + + fr""" +# Run performance test for {arch}. +COPY ./benchmarks ./benchmarks +COPY ./tools/docker/scripts/test_performance.sh \ ./tools/docker/scripts/plot_performance.py \ ./ +RUN ./test_performance.sh "{arch}" 2>&1 | tee report.log +""" + + print_cached_report() + ) -CMD ["./ci_entrypoint.sh", "./test_performance.sh", "{arch}"] + +# ====================================================================================== +def coverage(version: str) -> str: + return ( + install_cp2k(version=version, arch="local_coverage", prod=False) + + fr""" +# Run coverage test for {version}. +COPY ./tools/docker/scripts/test_coverage.sh . +RUN ./test_coverage.sh "{version}" 2>&1 | tee report.log +""" + + print_cached_report() + ) + + +# ====================================================================================== +def conventions() -> str: + return ( + install_cp2k(version="psmp", arch="local_warn", prod=False) + + fr""" +# Run test for conventions. +COPY ./arch/Linux-x86-64-gfortran.dumpast ./arch/ +COPY ./tools/conventions ./tools/conventions +WORKDIR ./tools/conventions +RUN /bin/bash -ec " \ + source /opt/cp2k-toolchain/install/setup && \ + ./test_conventions.sh |& tee report.log" +""" + + print_cached_report() + ) + + +# ====================================================================================== +def manual() -> str: + return ( + install_cp2k(version="psmp", arch="local", prod=True) # prod has REVISION set + + fr""" +# Generate manual. +COPY ./tools/manual ./tools/manual +COPY ./tools/input_editing ./tools/input_editing +COPY ./tools/docker/scripts/test_manual.sh . +RUN ./test_manual.sh 2>&1 | tee report.log +""" + + print_cached_report() + ) + + +# ====================================================================================== +def test_3rd_party(name: str) -> str: + return ( + install_cp2k(version="sdbg", arch="local", prod=False) + + fr""" +# Run test for {name}. +COPY ./tools/docker/scripts/test_{name}.sh . +RUN ./test_{name}.sh 2>&1 | tee report.log +""" + + print_cached_report() + ) + + +# ====================================================================================== +def test_without_build(name: str) -> str: + return ( + fr""" +FROM ubuntu:20.04 + +# Install dependencies. +WORKDIR /workspace/cp2k +COPY ./tools/docker/scripts/install_{name}.sh . +RUN ./install_{name}.sh + +# Install sources. +ARG GIT_COMMIT_SHA +COPY ./src ./src +COPY ./exts ./exts +COPY ./data ./data +COPY ./tools ./tools +COPY ./Makefile . +RUN bash -c "if [ -n "${{GIT_COMMIT_SHA}}" ] ; then echo "git:\${{GIT_COMMIT_SHA::7}}" > REVISION; fi" + +# Run test for {name}. +COPY ./tools/docker/scripts/test_{name}.sh . +RUN ./test_{name}.sh 2>&1 | tee report.log +""" + + print_cached_report() + ) + + +# ====================================================================================== +def print_cached_report() -> str: + return r""" +# Output the report if the image is old and was therefore pulled from the build cache. +CMD cat $(find ./report.log -mmin +3) | sed '/^Summary:/ s/$/ (cached)/' #EOF """ # ====================================================================================== -def coverage(version: str) -> str: +def install_cp2k(version: str, arch: str, prod: bool) -> str: + input_lines = [] + run_lines = [] + + if prod: + input_lines.append("ARG GIT_COMMIT_SHA") + run_lines.append( + 'if [ -n "${GIT_COMMIT_SHA}" ] ; then' + ' echo "git:\${GIT_COMMIT_SHA::7}" > REVISION; fi' + ) + + input_lines.append("COPY ./Makefile .") + input_lines.append("COPY ./src ./src") + input_lines.append("COPY ./exts ./exts") + input_lines.append("COPY ./tools/build_utils ./tools/build_utils") + + if arch.startswith("local"): + arch_file = f"/opt/cp2k-toolchain/install/arch/{arch}.{version}" + run_lines.append("mkdir -p arch") + run_lines.append(f"ln -vs {arch_file} ./arch/") + else: + input_lines.append(f"COPY ./arch/{arch}.{version} /workspace/cp2k/arch/") + + run_lines.append("echo 'Compiling cp2k...'") + run_lines.append("source /opt/cp2k-toolchain/install/setup") + + if prod: + run_lines.append(f"make -j ARCH={arch} VERSION={version}") + run_lines.append(f"rm -rf lib obj exe/{arch}/*_unittest.{version}") + else: + run_lines.append( + f"( make -j ARCH={arch} VERSION={version} &> /dev/null || true )" + ) + + input_block = "\n".join(input_lines) + run_block = " && \\\n ".join(run_lines) + return fr""" -# Install coverage test for {version}. -WORKDIR /workspace - -COPY ./tools/docker/scripts/install_basics.sh . -RUN ./install_basics.sh - -COPY ./tools/docker/scripts/install_coverage.sh . -RUN ./install_coverage.sh - -COPY ./tools/docker/scripts/install_regtest.sh . -RUN ./install_regtest.sh local_coverage {version} - -COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_coverage.sh ./ -CMD ["./ci_entrypoint.sh", "./test_coverage.sh", "{version}"] - -#EOF +# Install CP2K using {arch}.{version}. +WORKDIR /workspace/cp2k +{input_block} +RUN /bin/bash -c " \ + {run_block}" +COPY ./data ./data +COPY ./tests ./tests +COPY ./tools/regtesting ./tools/regtesting """ diff --git a/tools/docker/run_test.sh b/tools/docker/run_test.sh deleted file mode 100755 index a42ae9c53a..0000000000 --- a/tools/docker/run_test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -if (($# < 1)); then - echo "usage: run_test.sh [additional-docker-run-args]" - echo "example: run_test.sh python" - exit 1 -fi - -set -e -TESTNAME=$1 -shift -echo "Running ${TESTNAME} ..." - -CP2K_LOCAL=$(realpath ../../) -set -x - -# SYS_PTRACE needed by LeakSanitizer. -${DOCKER:-docker} run -i --init --rm --cap-add=SYS_PTRACE --shm-size=1g \ - --volume "${CP2K_LOCAL}:/mnt/cp2k/:ro" \ - "$@" "img_cp2k_test_${TESTNAME}" - -#EOF diff --git a/tools/docker/run_test_master.sh b/tools/docker/run_test_master.sh deleted file mode 100755 index 03540639c5..0000000000 --- a/tools/docker/run_test_master.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -if (($# < 1)); then - echo "usage: run_test_master.sh [additional-docker-run-args]" - echo "example: run_test_master.sh python" - exit 1 -fi - -set -e -TESTNAME=$1 -shift - -GIT_BRANCH="master" -GIT_REF="origin/master" -echo "Running ${TESTNAME} on Branch ${GIT_BRANCH} (ref: ${GIT_REF})..." - -set -x - -# SYS_PTRACE needed by LeakSanitizer. -${DOCKER:-docker} run -i --init --rm --cap-add=SYS_PTRACE --shm-size=1g \ - -e "GIT_BRANCH=${GIT_BRANCH}" -e "GIT_REF=${GIT_REF}" \ - "$@" "img_cp2k_test_${TESTNAME}" - -#EOF diff --git a/tools/docker/run_test_pr.sh b/tools/docker/run_test_pr.sh deleted file mode 100755 index c425f165b0..0000000000 --- a/tools/docker/run_test_pr.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -l -# -*- coding: utf-8 -*- -# author: Tiziano Müller, Ole Schütt - -set -o errexit -set -o nounset -set -o pipefail - -if [[ $# -lt 2 ]]; then - echo "usage: $0 [optional-docker-run-arguments]" - echo "example: $0 python 506" - exit 1 -fi - -TESTNAME=$1 -PR_NUMBER=$2 -shift 2 - -GIT_BRANCH="pull/${PR_NUMBER}/merge" -GIT_REF=$(curl -s "https://api.github.com/repos/cp2k/cp2k/pulls/${PR_NUMBER}" | jq -r '.merge_commit_sha') - -echo "Running ${TESTNAME} on Branch ${GIT_BRANCH} (ref: ${GIT_REF})..." - -set -o xtrace - -# SYS_PTRACE needed by LeakSanitizer. -${DOCKER:-docker} run -i --init --rm --cap-add=SYS_PTRACE \ - -e "GIT_BRANCH=${GIT_BRANCH}" -e "GIT_REF=${GIT_REF}" \ - "$@" "img_cp2k_test_${TESTNAME}" - -#EOF diff --git a/tools/docker/scripts/ci_entrypoint.sh b/tools/docker/scripts/ci_entrypoint.sh deleted file mode 100755 index 8bf2ddab71..0000000000 --- a/tools/docker/scripts/ci_entrypoint.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -set -eo pipefail -ulimit -c 0 # Disable core dumps as they can take a very long time to write. - -# Calculate checksums of critical files. -CHECKSUMS=/workspace/checksums.md5 -shopt -s nullglob # ignore missing files -md5sum /workspace/cp2k/Makefile \ - /workspace/cp2k/tools/build_utils/* \ - /workspace/cp2k/arch/local* \ - > $CHECKSUMS -shopt -u nullglob - -# Get cp2k sources. -if [ -n "${GIT_REF}" ]; then - echo -e "\n========== Fetching Git Commit ==========" - cd /workspace/cp2k - git fetch --quiet origin "${GIT_BRANCH}" - git checkout --quiet "${GIT_REF}" - git submodule update --init --recursive - git --no-pager log -1 --pretty='%nCommitSHA: %H%nCommitTime: %ci%nCommitAuthor: %an%nCommitSubject: %s%n' - -elif [ -d /mnt/cp2k ]; then - echo -e "\n========== Copying Changed Files ==========" - # We can't rely on timestamps as they depend on the git checkout time. - # Hence, we use checksums despite the IO because a full rebuild would be even more costly. - rsync --checksum \ - --delete \ - --executability \ - --verbose \ - --recursive \ - --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.py[cod]" \ - --exclude="__pycache__" \ - --exclude="/obj/" \ - --exclude="/lib/" \ - --exclude="/exe/" \ - --exclude="/regtesting/" \ - --exclude="/arch/local*" \ - --exclude="/tools/toolchain/build/" \ - --exclude="/tools/toolchain/install/" \ - /mnt/cp2k/ /workspace/cp2k/ -else - echo "Neither GIT_REF nor /mnt/cp2k found - aborting." - exit 255 -fi - -if ! md5sum --status --check ${CHECKSUMS}; then - echo -e "\n========== Cleaning Build Cache ==========" - cd /workspace/cp2k - make distclean -fi - -# Run actual test. -echo -e "\n========== Running Test ==========" -cd /workspace -if ! "$@"; then - echo -e "\nSummary: Test had non-zero exit status.\nStatus: FAILED" -fi - -#EOF diff --git a/tools/docker/scripts/install_aiida.sh b/tools/docker/scripts/install_aiida.sh deleted file mode 100755 index ed9ef8e4a5..0000000000 --- a/tools/docker/scripts/install_aiida.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -# install Ubuntu packages -apt-get update -qq -export DEBIAN_FRONTEND=noninteractive -export DEBCONF_NONINTERACTIVE_SEEN=true -apt-get install -qq --no-install-recommends \ - python3-setuptools \ - python3-wheel \ - python3-pip \ - python3-dev \ - postgresql \ - rabbitmq-server \ - sudo \ - ssh -rm -rf /var/lib/apt/lists/* - -# Some buggy Python packages open utf8 files in text mode. -# As a workaround we set locale.getpreferredencoding() to utf8. -export LANG="en_US.UTF-8" LANGUAGE="en_US:en" LC_ALL="en_US.UTF-8" - -# install dependencies of aiida-cp2k -cd /opt/ -git clone --quiet https://github.com/aiidateam/aiida-cp2k.git -pip3 install --quiet './aiida-cp2k/[test]' -pip3 uninstall --quiet --yes aiida-cp2k - -# create ubuntu user with sudo powers -adduser --disabled-password --gecos "" ubuntu -echo "ubuntu ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers - -# shellcheck disable=SC1091 -source /opt/cp2k-toolchain/install/setup - -# link mpi executables into path -MPI_INSTALL_DIR=$(dirname "$(command -v mpirun)") -for i in "${MPI_INSTALL_DIR}"/*; do ln -sf "$i" /usr/bin/; done - -# setup arch files -cd /workspace/cp2k/arch -ln -vs /opt/cp2k-toolchain/install/arch/local* . - -# pre-build cp2k -cd /workspace/cp2k -echo -n "Warming cache by trying to compile... " -if make -j VERSION=pdbg &> /dev/null; then - echo "done." -else - echo "failed." -fi -rm -rf lib exe - -#EOF diff --git a/tools/docker/scripts/install_ase.sh b/tools/docker/scripts/install_ase.sh deleted file mode 100755 index c29c040dfb..0000000000 --- a/tools/docker/scripts/install_ase.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -# install python packages -apt-get update -qq -apt-get install -qq --no-install-recommends \ - python3 \ - python3-dev \ - python3-pip \ - python3-wheel \ - python3-setuptools \ - build-essential -rm -rf /var/lib/apt/lists/* - -# install python packages -pip3 install --quiet numpy scipy matplotlib flask - -# clone ase reprository -git clone --quiet --depth=1 --single-branch -b master https://gitlab.com/ase/ase.git /opt/ase - -# shellcheck disable=SC1091 -source /opt/cp2k-toolchain/install/setup - -# setup arch files -cd /workspace/cp2k/arch -ln -vs /opt/cp2k-toolchain/install/arch/local* . - -# pre-build cp2k -cd /workspace/cp2k -echo -n "Warming cache by trying to compile... " -if make -j VERSION=pdbg &> /dev/null; then - echo "done." -else - echo "failed." -fi -rm -rf lib exe - -#EOF diff --git a/tools/docker/scripts/install_basics.sh b/tools/docker/scripts/install_basics.sh deleted file mode 100755 index c6f43ea5d6..0000000000 --- a/tools/docker/scripts/install_basics.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -if grep -q -e "Ubuntu" -e "Debian" /etc/os-release; then - echo -n "Installing Ubuntu packages... " - apt-get update -qq - apt-get install -qq --no-install-recommends \ - ca-certificates \ - git \ - less \ - nano \ - python3 \ - rsync \ - wget - rm -rf /var/lib/apt/lists/* - echo "done." - -elif grep -q "Fedora" /etc/os-release; then - echo -n "Installing Fedora packages... " - dnf -qy install \ - ca-certificates \ - git \ - less \ - nano \ - python3 \ - rsync \ - wget - dnf -q clean all - echo "done." - -else - echo "Unknown Linux distribution." - exit 1 - -fi - -# clone cp2k repository -echo -n "Cloning cp2k repository... " -git clone --quiet --recursive --single-branch -b master https://github.com/cp2k/cp2k.git /workspace/cp2k -echo "done." - -#EOF diff --git a/tools/docker/scripts/install_conventions.sh b/tools/docker/scripts/install_conventions.sh deleted file mode 100755 index aeb56ca4f7..0000000000 --- a/tools/docker/scripts/install_conventions.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -# shellcheck disable=SC1091 -source /opt/cp2k-toolchain/install/setup - -# setup arch files -cd /workspace/cp2k/arch -ln -vs /opt/cp2k-toolchain/install/arch/local* . - -# pre-build cp2k -cd /workspace/cp2k/tools/conventions -echo -n "Warming cache by trying to run test_conventions.sh... " -if ./test_conventions.sh &> /dev/null; then - echo "done." -else - echo "failed." -fi - -rm -rf ../lib/ ../exe/ - -#EOF diff --git a/tools/docker/scripts/install_coverage.sh b/tools/docker/scripts/install_coverage.sh deleted file mode 100755 index 792bbf6ae5..0000000000 --- a/tools/docker/scripts/install_coverage.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -lcov_version="1.15" -lcov_sha256="c1cda2fa33bec9aa2c2c73c87226cfe97de0831887176b45ee523c5e30f8053a" - -# LCOV dependencies -apt-get update -qq -apt-get install -qq --no-install-recommends \ - libperlio-gzip-perl \ - libjson-perl -rm -rf /var/lib/apt/lists/* - -cd /tmp -wget -q "https://www.cp2k.org/static/downloads/lcov-${lcov_version}.tar.gz" -echo "${lcov_sha256} lcov-${lcov_version}.tar.gz" | sha256sum --check -tar -xzf "lcov-${lcov_version}.tar.gz" -cd "lcov-${lcov_version}" -make install > make.log 2>&1 -cd .. -rm -rf "lcov-${lcov_version}.tar.gz" "lcov-${lcov_version}" diff --git a/tools/docker/scripts/install_doxygen.sh b/tools/docker/scripts/install_doxygen.sh index 1192ed94bc..76392e5ccc 100755 --- a/tools/docker/scripts/install_doxygen.sh +++ b/tools/docker/scripts/install_doxygen.sh @@ -4,7 +4,11 @@ # install Ubuntu packages apt-get update -qq -apt-get install -qq --no-install-recommends doxygen graphviz make +apt-get install -qq --no-install-recommends \ + doxygen \ + graphviz \ + make \ + python3 rm -rf /var/lib/apt/lists/* #EOF diff --git a/tools/docker/scripts/install_formatting.sh b/tools/docker/scripts/install_formatting.sh deleted file mode 100755 index 66c33ee616..0000000000 --- a/tools/docker/scripts/install_formatting.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -# install Ubuntu packages -apt-get update -qq -apt-get install -qq --no-install-recommends \ - libfindbin-libs-perl \ - build-essential \ - make \ - perl \ - python3-{pip,setuptools,wheel,dev} \ - nodejs \ - clang-format - -rm -rf /var/lib/apt/lists/* - -# install python packages -pip3 install pre-commit - -# register the pre-commit hooks -cd /workspace/cp2k -pre-commit install --install-hooks - -#EOF diff --git a/tools/docker/scripts/install_gromacs.sh b/tools/docker/scripts/install_gromacs.sh deleted file mode 100755 index 37c58c0c94..0000000000 --- a/tools/docker/scripts/install_gromacs.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -# clone gromacs reprository -git clone --quiet --depth=1 --single-branch -b master https://gitlab.com/gromacs/gromacs.git /opt/gromacs - -# shellcheck disable=SC1091 -source /opt/cp2k-toolchain/install/setup - -# setup arch files -cd /workspace/cp2k/arch -ln -vs /opt/cp2k-toolchain/install/arch/local* . - -# pre-build libcp2k -cd /workspace/cp2k -echo -n "Warming cache by trying to compile libcp2k... " -if make -j VERSION=pdbg libcp2k &> /dev/null; then - echo "done." -else - echo "failed." -fi -rm -rf lib exe - -#EOF diff --git a/tools/docker/scripts/install_i-pi.sh b/tools/docker/scripts/install_i-pi.sh deleted file mode 100755 index 38261f5552..0000000000 --- a/tools/docker/scripts/install_i-pi.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -# install Ubuntu packages -apt-get update -qq -apt-get install -qq --no-install-recommends \ - python3 \ - python3-pip \ - python3-wheel \ - python3-setuptools -rm -rf /var/lib/apt/lists/* - -# install python packages -pip3 install --quiet numpy - -# clone i-pi repository -git clone --quiet --depth=1 --single-branch -b master https://github.com/i-pi/i-pi.git /opt/i-pi - -# shellcheck disable=SC1091 -source /opt/cp2k-toolchain/install/setup - -# setup arch files -cd /workspace/cp2k/arch -ln -vs /opt/cp2k-toolchain/install/arch/local* . - -# pre-build cp2k -cd /workspace/cp2k -echo -n "Warming cache by trying to compile... " -if make -j VERSION=pdbg &> /dev/null; then - echo "done." -else - echo "failed." -fi -rm -rf lib exe - -#EOF diff --git a/tools/docker/scripts/install_manual.sh b/tools/docker/scripts/install_manual.sh deleted file mode 100755 index 9533f5d38d..0000000000 --- a/tools/docker/scripts/install_manual.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -# install Ubuntu packages -apt-get update -qq -apt-get install -qq --no-install-recommends \ - default-jre-headless \ - libsaxonhe-java -rm -rf /var/lib/apt/lists/* - -# shellcheck disable=SC1091 -source /opt/cp2k-toolchain/install/setup - -# setup arch files -cd /workspace/cp2k/arch -ln -vs /opt/cp2k-toolchain/install/arch/local* . - -# pre-build cp2k -cd /workspace/cp2k -echo -n "Warming cache by trying to compile... " -if make -j VERSION=psmp &> /dev/null; then - echo "done." -else - echo "failed." -fi -rm -rf lib exe - -#EOF diff --git a/tools/docker/scripts/install_performance.sh b/tools/docker/scripts/install_performance.sh deleted file mode 100755 index fe44110b25..0000000000 --- a/tools/docker/scripts/install_performance.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -if (($# != 1)); then - echo "Usage: install_performance.sh " - exit 1 -fi - -ARCH=$1 - -# setup arch files -cd /workspace/cp2k/arch -ln -vs /opt/cp2k-toolchain/install/arch/local* . - -# shellcheck disable=SC1091 -source /opt/cp2k-toolchain/install/setup - -# pre-build cp2k -cd /workspace/cp2k -echo -n "Warming cache by trying to compile cp2k... " -if make -j ARCH="${ARCH}" VERSION="psmp" &> /dev/null; then - echo 'done.' -else - echo 'failed.' -fi - -rm -rf lib exe - -#EOF diff --git a/tools/docker/scripts/install_python.sh b/tools/docker/scripts/install_python.sh index d5b1b8c02b..d12ab18e71 100755 --- a/tools/docker/scripts/install_python.sh +++ b/tools/docker/scripts/install_python.sh @@ -5,6 +5,7 @@ # install Ubuntu packages apt-get update -qq apt-get install -qq --no-install-recommends \ + ca-certificates \ libpython3-stdlib \ python3 \ python3-pip \ @@ -13,7 +14,8 @@ apt-get install -qq --no-install-recommends \ python3-dev \ build-essential \ golang \ - unzip + unzip \ + wget rm -rf /var/lib/apt/lists/* # install python packages @@ -25,9 +27,7 @@ pip3 install --quiet \ mypy==0.902 # download inputs for minimax_to_fortran_source.py -cd /workspace/cp2k/tools/minimax_tools wget -q https://www.cp2k.org/static/downloads/1_xData.zip echo "7be2e56d83d0cb17683bbc8ab85dae1dc9a9c937e1dc1bad1514857938e687cb 1_xData.zip" | sha256sum --check -unzip -q -d 1_xData 1_xData.zip #EOF diff --git a/tools/docker/scripts/install_regtest.sh b/tools/docker/scripts/install_regtest.sh deleted file mode 100755 index 12cd3ead09..0000000000 --- a/tools/docker/scripts/install_regtest.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# author: Ole Schuett - -if (($# != 2)); then - echo "Usage: install_regtest.sh " - exit 1 -fi - -ARCH=$1 -VERSION=$2 - -# setup arch files -cd /workspace/cp2k/arch || exit 1 -ln -vs /opt/cp2k-toolchain/install/arch/local* . - -# shellcheck disable=SC1091 -source /opt/cp2k-toolchain/install/setup - -# Make OpenMPI happy. -if command -v ompi_info &> /dev/null; then - TESTOPTS="-mpiexec 'mpiexec --bind-to none --allow-run-as-root' ${TESTOPTS}" - export OMPI_MCA_plm_rsh_agent=/bin/false -fi - -# pre-build cp2k -cd /workspace/cp2k || exit 1 -echo -n "Warming cache by trying to compile... " -if make -j ARCH="${ARCH}" VERSION="${VERSION}" &> /dev/null; then - echo "done." -else - echo "failed." -fi - -# remove binaries to reduce image size -rm -rf lib exe "regtesting/${ARCH}/${VERSION}"/TEST-* - -#EOF diff --git a/tools/docker/scripts/prod_entrypoint.sh b/tools/docker/scripts/prod_entrypoint.sh new file mode 100755 index 0000000000..50d28a18e8 --- /dev/null +++ b/tools/docker/scripts/prod_entrypoint.sh @@ -0,0 +1,22 @@ +#!/bin/bash -e + +# author: Ole Schuett + +if (($# < 2)); then + echo "Usage: prod_entrypoint.sh " + exit 1 +fi + +ARCH=$1 +VERSION=$2 +shift 2 + +# shellcheck disable=SC1091 +source /opt/cp2k-toolchain/install/setup +export PATH="/workspace/cp2k/exe/${ARCH}:${PATH}" +ln -s "./cp2k.${VERSION}" "/workspace/cp2k/exe/${ARCH}/cp2k" +ln -s "./cp2k_shell.${VERSION}" "/workspace/cp2k/exe/${ARCH}/cp2k_shell" + +"$@" + +#EOF diff --git a/tools/docker/scripts/test_aiida.sh b/tools/docker/scripts/test_aiida.sh index 4dbd27e42b..d67ff94ce8 100755 --- a/tools/docker/scripts/test_aiida.sh +++ b/tools/docker/scripts/test_aiida.sh @@ -8,7 +8,7 @@ source /opt/cp2k-toolchain/install/setup echo -e "\n========== Compiling CP2K ==========" cd /workspace/cp2k echo -n "Compiling cp2k... " -if make -j VERSION=pdbg &> make.out; then +if make -j VERSION=sdbg &> make.out; then echo "done." else echo -e "failed.\n\n" @@ -18,13 +18,36 @@ else exit 0 fi +echo -e "\n========== Installing Dependencies ==========" +apt-get update -qq +export DEBIAN_FRONTEND=noninteractive +export DEBCONF_NONINTERACTIVE_SEEN=true +apt-get install -qq --no-install-recommends \ + python3-setuptools \ + python3-wheel \ + python3-pip \ + python3-dev \ + postgresql \ + rabbitmq-server \ + sudo \ + ssh +rm -rf /var/lib/apt/lists/* + # Some buggy Python packages open utf8 files in text mode. # As a workaround we set locale.getpreferredencoding() to utf8. export LANG="en_US.UTF-8" LANGUAGE="en_US:en" LC_ALL="en_US.UTF-8" +# create ubuntu user with sudo powers +adduser --disabled-password --gecos "" ubuntu +echo "ubuntu ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + +# link mpi executables into path +MPI_INSTALL_DIR=$(dirname "$(command -v mpirun)") +for i in "${MPI_INSTALL_DIR}"/*; do ln -sf "$i" /usr/bin/; done + echo -e "\n========== Installing AiiDA-CP2K plugin ==========" +git clone --quiet https://github.com/aiidateam/aiida-cp2k.git /opt/aiida-cp2k/ cd /opt/aiida-cp2k/ -git pull pip3 install './[test]' echo -e "\n========== Configuring AiiDA ==========" @@ -43,13 +66,11 @@ service postgresql start cat > /usr/bin/cp2k << EndOfMessage #!/bin/bash -e source /opt/cp2k-toolchain/install/setup -/workspace/cp2k/exe/local/cp2k.pdbg "\$@" +/workspace/cp2k/exe/local/cp2k.sdbg "\$@" EndOfMessage chmod +x /usr/bin/cp2k echo -e "\n========== Running AiiDA-CP2K Tests ==========" -cd /opt/aiida-cp2k/ - set +e # disable error trapping for remainder of script ( set -e # abort on error @@ -59,15 +80,13 @@ set +e # disable error trapping for remainder of script EXIT_CODE=$? -echo "" - AIIDA_COMMIT=$(git rev-parse --short HEAD) if ((EXIT_CODE)); then - echo "Summary: Something is wrong with aiida-cp2k commit ${AIIDA_COMMIT}." - echo "Status: FAILED" + echo -e "\nSummary: Something is wrong with aiida-cp2k commit ${AIIDA_COMMIT}." + echo -e "Status: FAILED\n" else - echo "Summary: aiida-cp2k commit ${AIIDA_COMMIT} works fine." - echo "Status: OK" + echo -e "\nSummary: aiida-cp2k commit ${AIIDA_COMMIT} works fine." + echo -e "Status: OK\n" fi #EOF diff --git a/tools/docker/scripts/test_ase.sh b/tools/docker/scripts/test_ase.sh index d3e43a2dcf..185e93f1cc 100755 --- a/tools/docker/scripts/test_ase.sh +++ b/tools/docker/scripts/test_ase.sh @@ -7,7 +7,7 @@ source /opt/cp2k-toolchain/install/setup cd /workspace/cp2k echo -n "Compiling cp2k... " -if make -j VERSION=pdbg &> make.out; then +if make -j VERSION=sdbg &> make.out; then echo "done." else echo -e "failed.\n\n" @@ -17,12 +17,11 @@ else exit 0 fi -echo -e "\n========== Installing CP2K ==========" cat > /usr/bin/cp2k_shell << EndOfMessage #!/bin/bash -e source /opt/cp2k-toolchain/install/setup export OMP_NUM_THREADS=1 -mpiexec -np 2 /workspace/cp2k/exe/local/cp2k_shell.pdbg "\$@" +/workspace/cp2k/exe/local/cp2k_shell.sdbg "\$@" EndOfMessage chmod +x /usr/bin/cp2k_shell @@ -32,28 +31,39 @@ cat > /usr/bin/cp2k << EndOfMessage #!/bin/bash -e source /opt/cp2k-toolchain/install/setup export OMP_NUM_THREADS=1 -mpiexec -np 2 /workspace/cp2k/exe/local/cp2k.pdbg "\$@" +/workspace/cp2k/exe/local/cp2k.sdbg "\$@" EndOfMessage chmod +x /usr/bin/cp2k mkdir -p ~/.config/ase echo -e "[executables]\ncp2k = /usr/bin/cp2k_shell\n" > ~/.config/ase/ase.conf +echo -e "\n========== Installing Dependencies ==========" +apt-get update -qq +apt-get install -qq --no-install-recommends \ + python3 \ + python3-dev \ + python3-pip \ + python3-wheel \ + python3-setuptools \ + build-essential +rm -rf /var/lib/apt/lists/* + echo -e "\n========== Installing ASE ==========" +git clone --quiet --depth=1 --single-branch -b master https://gitlab.com/ase/ase.git /opt/ase cd /opt/ase/ -git pull pip3 install ".[test]" echo -e "\n========== Running ASE Tests ==========" -cd /opt/ase/ ASE_REVISION=$(git rev-parse --short HEAD) +echo - if ase test -j 0 -c cp2k calculator/cp2k; then - echo "Summary: ASE commit ${ASE_REVISION} works fine." - echo "Status: OK" + echo -e "\nSummary: ASE commit ${ASE_REVISION} works fine." + echo -e "Status: OK\n" else - echo "Summary: Something is wrong with ASE commit ${ASE_REVISION}." - echo "Status: FAILED" + echo -e "\nSummary: Something is wrong with ASE commit ${ASE_REVISION}." + echo -e "Status: FAILED\n" fi #EOF diff --git a/tools/docker/scripts/test_conventions.sh b/tools/docker/scripts/test_conventions.sh deleted file mode 100755 index 8aea9fed8a..0000000000 --- a/tools/docker/scripts/test_conventions.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -e - -# author: Ole Schuett - -# shellcheck disable=SC1091 -source /opt/cp2k-toolchain/install/setup - -echo -e "\n========== Running Conventions Test ==========" -cd /workspace/cp2k/tools/conventions -./test_conventions.sh #TODO port to Python3 - -#EOF diff --git a/tools/docker/scripts/test_coverage.sh b/tools/docker/scripts/test_coverage.sh index 183d66865f..2a70acfabe 100755 --- a/tools/docker/scripts/test_coverage.sh +++ b/tools/docker/scripts/test_coverage.sh @@ -13,6 +13,7 @@ VERSION=$1 # shellcheck disable=SC1091 source /opt/cp2k-toolchain/install/setup +echo -e "\n========== Compiling CP2K ==========" cd /workspace/cp2k || exit 1 CP2K_REVISION=$(./tools/build_utils/get_revision_number ./src) rm -rf "obj/${ARCH}/${VERSION}"/*.gcda # remove old gcov statistics @@ -29,7 +30,28 @@ else exit 0 fi +echo -e "\n========== Installing Dependencies ==========" +lcov_version="1.15" +lcov_sha256="c1cda2fa33bec9aa2c2c73c87226cfe97de0831887176b45ee523c5e30f8053a" + +# LCOV dependencies +apt-get update -qq +apt-get install -qq --no-install-recommends \ + libperlio-gzip-perl \ + libjson-perl +rm -rf /var/lib/apt/lists/* + +cd /tmp || exit 1 +wget -q "https://www.cp2k.org/static/downloads/lcov-${lcov_version}.tar.gz" +echo "${lcov_sha256} lcov-${lcov_version}.tar.gz" | sha256sum --check +tar -xzf "lcov-${lcov_version}.tar.gz" +cd "lcov-${lcov_version}" || exit 1 +make install > make.log 2>&1 +cd .. || exit 1 +rm -rf "lcov-${lcov_version}.tar.gz" "lcov-${lcov_version}" + echo -e "\n========== Running Regtests ==========" +cd /workspace/cp2k || exit 1 make ARCH="${ARCH}" VERSION="${VERSION}" TESTOPTS="${TESTOPTS}" test # gcov gets stuck on some files... diff --git a/tools/docker/scripts/test_gromacs.sh b/tools/docker/scripts/test_gromacs.sh index 614c781a69..ef0a3d8f70 100755 --- a/tools/docker/scripts/test_gromacs.sh +++ b/tools/docker/scripts/test_gromacs.sh @@ -7,7 +7,7 @@ source /opt/cp2k-toolchain/install/setup cd /workspace/cp2k echo -n "Compiling libcp2k... " -if make -j VERSION=pdbg libcp2k &> make.out; then +if make -j VERSION=sdbg libcp2k &> make.out; then echo "done." else echo -e "failed.\n\n" @@ -18,8 +18,10 @@ else fi echo -e "\n========== Building Gromacs ==========" +echo -n "Cloning Gromacs repository... " +git clone --quiet --depth=1 --single-branch -b master https://gitlab.com/gromacs/gromacs.git /opt/gromacs +echo "done." cd /opt/gromacs/ -git pull GROMACS_REVISION=$(git rev-parse --short HEAD) mkdir build cd build @@ -31,7 +33,7 @@ if cmake .. \ -DGMX_INSTALL_NBLIB_API=OFF \ -DGMXAPI=OFF \ -DGMX_CP2K=ON \ - -DCP2K_DIR="/workspace/cp2k/lib/local/pdbg/" \ + -DCP2K_DIR="/workspace/cp2k/lib/local/sdbg/" \ &> cmake.out; then echo "done." else diff --git a/tools/docker/scripts/test_i-pi.sh b/tools/docker/scripts/test_i-pi.sh index b533e82315..a1388ba773 100755 --- a/tools/docker/scripts/test_i-pi.sh +++ b/tools/docker/scripts/test_i-pi.sh @@ -8,7 +8,7 @@ source /opt/cp2k-toolchain/install/setup echo -e "\n========== Compiling CP2K ==========" cd /workspace/cp2k echo -n "Compiling cp2k... " -if make -j VERSION=pdbg &> make.out; then +if make -j VERSION=sdbg &> make.out; then echo "done." else echo -e "failed.\n\n" @@ -18,9 +18,18 @@ else exit 0 fi +echo -e "\n========== Installing Dependencies ==========" +apt-get update -qq +apt-get install -qq --no-install-recommends \ + python3 \ + python3-pip \ + python3-wheel \ + python3-setuptools +rm -rf /var/lib/apt/lists/* + echo -e "\n========== Installing i-Pi ==========" +git clone --quiet --depth=1 --single-branch -b master https://github.com/i-pi/i-pi.git /opt/i-pi cd /opt/i-pi -git pull --quiet pip3 install --quiet . echo -e "\n========== Running i-Pi Tests ==========" @@ -38,7 +47,7 @@ ulimit -t ${TIMEOUT_SEC} # Limit cpu time. echo 42 > cp2k_exit_code sleep 10 # give i-pi some time to startup export OMP_NUM_THREADS=2 - mpiexec -np 2 /workspace/cp2k/exe/local/cp2k.pdbg ../in.cp2k + /workspace/cp2k/exe/local/cp2k.sdbg ../in.cp2k echo $? > cp2k_exit_code ) & @@ -57,11 +66,11 @@ echo "i-Pi exit code: ${IPI_EXIT_CODE}" IPI_REVISION=$(git rev-parse --short HEAD) if ((IPI_EXIT_CODE)) || ((CP2K_EXIT_CODE)); then - echo "Summary: Something is wrong with i-Pi commit ${IPI_REVISION}." - echo "Status: FAILED" + echo -e "\nnSummary: Something is wrong with i-Pi commit ${IPI_REVISION}." + echo -e "Status: FAILED\n" else - echo "Summary: i-Pi commit ${IPI_REVISION} works fine." - echo "Status: OK" + echo -e "\nSummary: i-Pi commit ${IPI_REVISION} works fine." + echo -e "Status: OK\n" fi #EOF diff --git a/tools/docker/scripts/test_manual.sh b/tools/docker/scripts/test_manual.sh index e26f07d702..81f8644f3b 100755 --- a/tools/docker/scripts/test_manual.sh +++ b/tools/docker/scripts/test_manual.sh @@ -7,7 +7,6 @@ source /opt/cp2k-toolchain/install/setup echo -e "\n========== Compiling CP2K ==========" cd /workspace/cp2k -touch src/cp2k_info.F # ensure latest REVISION is picked up. echo -n "Compiling cp2k... " if make -j VERSION=psmp &> make.out; then echo "done." @@ -19,6 +18,13 @@ else exit 0 fi +echo -e "\n========== Installing Dependencies ==========" +apt-get update -qq +apt-get install -qq --no-install-recommends \ + default-jre-headless \ + libsaxonhe-java +rm -rf /var/lib/apt/lists/* + echo -e "\n========== Generating Manual ==========" mkdir -p /workspace/artifacts/manual @@ -41,13 +47,12 @@ set +e # disable error trapping for remainder of script ) EXIT_CODE=$? -echo "" if ((EXIT_CODE)); then - echo "Summary: Something is wrong." - echo "Status: FAILED" + echo -e "\nSummary: Something is wrong." + echo -e "Status: FAILED\n" else - echo "Summary: Manual generation works fine." - echo "Status: OK" + echo -e "\nSummary: Manual generation works fine." + echo -e "Status: OK\n" fi #EOF diff --git a/tools/docker/scripts/test_performance.sh b/tools/docker/scripts/test_performance.sh index 6a4737a463..ea4b7a0254 100755 --- a/tools/docker/scripts/test_performance.sh +++ b/tools/docker/scripts/test_performance.sh @@ -81,7 +81,7 @@ if [[ "${ARCH}" == "local" ]]; then run_benchmark 32 1 "${INPUT_BASENAME}" "${OUTPUT_OMP}" cd .. echo "" - /workspace/plot_performance.py \ + /workspace/cp2k/plot_performance.py \ "${LABEL} with 32 OpenMP Threads" "${LABEL}_timings_32omp" "${OUTPUT_OMP}" \ "${LABEL} with 32 MPI Ranks" "${LABEL}_timings_32mpi" "${OUTPUT_MPI}" echo "" @@ -100,7 +100,7 @@ elif [[ "${ARCH}" == "local_cuda" ]]; then run_benchmark 3 2 "${INPUT_BASENAME}" "${OUTPUT}" cd .. echo "" - /workspace/plot_performance.py \ + /workspace/cp2k/plot_performance.py \ "${LABEL} with 6 CPU Cores and 1 GPU" "${LABEL}_timings_6cpu_1gpu" "${OUTPUT}" echo "" done diff --git a/tools/docker/scripts/test_python.sh b/tools/docker/scripts/test_python.sh index 83648fb628..db080b0cd1 100755 --- a/tools/docker/scripts/test_python.sh +++ b/tools/docker/scripts/test_python.sh @@ -22,6 +22,9 @@ cd /workspace/cp2k echo "Using $(python3 --version) and $(mypy --version)." echo "" +# prepare inputs for minimax_to_fortran_source.py +unzip -q -d ./tools/minimax_tools/1_xData 1_xData.zip + run_test ./tools/prettify/prettify_test.py run_test ./tools/minimax_tools/minimax_to_fortran_source.py --check run_test ./tools/docker/generate_dockerfiles.py --check @@ -34,14 +37,16 @@ run_test mypy --strict ./tools/precommit/check_file_properties.py run_test mypy --strict ./tools/precommit/format_makefile.py run_test mypy --strict ./tools/docker/generate_dockerfiles.py -# Test generate_dashboard.py. Running it twice to also execute its caching. -mkdir -p /workspace/artifacts/dashboard -for _ in {1..2}; do - run_test ./tools/dashboard/generate_dashboard.py \ - ./tools/dashboard/dashboard.conf \ - /workspace/artifacts/dashboard/status.pickle \ - /workspace/artifacts/dashboard/ -done +# TODO: Find a way to test generate_dashboard.py without git repository. +# +# # Test generate_dashboard.py. Running it twice to also execute its caching. +# mkdir -p /workspace/artifacts/dashboard +# for _ in {1..2}; do +# run_test ./tools/dashboard/generate_dashboard.py \ +# ./tools/dashboard/dashboard.conf \ +# /workspace/artifacts/dashboard/status.pickle \ +# /workspace/artifacts/dashboard/ +# done echo "" echo "Summary: Python tests passed" diff --git a/tools/toolchain/scripts/generate_arch_files.sh b/tools/toolchain/scripts/generate_arch_files.sh index 6deaad2abe..2685b4cef8 100755 --- a/tools/toolchain/scripts/generate_arch_files.sh +++ b/tools/toolchain/scripts/generate_arch_files.sh @@ -293,6 +293,7 @@ rm -f ${INSTALLDIR}/arch/local* gen_arch_file "local.ssmp" gen_arch_file "local_static.ssmp" STATIC gen_arch_file "local.sdbg" DEBUG +gen_arch_file "local_coverage.sdbg" COVERAGE arch_vers="ssmp sdbg" if [ "$MPI_MODE" != no ]; then