Skip to content

Commit

Permalink
Docker: User build context for all images
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Feb 24, 2022
1 parent 75fc08f commit f276815
Show file tree
Hide file tree
Showing 64 changed files with 929 additions and 1,143 deletions.
33 changes: 22 additions & 11 deletions tools/docker/Dockerfile.test_aiida
Original file line number Diff line number Diff line change
Expand Up @@ -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

COPY ./tools/docker/scripts/install_basics.sh .
RUN ./install_basics.sh

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

# Run test for aiida.
COPY ./tools/docker/scripts/test_aiida.sh .
RUN ./test_aiida.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
33 changes: 22 additions & 11 deletions tools/docker/Dockerfile.test_ase
Original file line number Diff line number Diff line change
Expand Up @@ -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

COPY ./tools/docker/scripts/install_basics.sh .
RUN ./install_basics.sh

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

# Run test for ase.
COPY ./tools/docker/scripts/test_ase.sh .
RUN ./test_ase.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
37 changes: 26 additions & 11 deletions tools/docker/Dockerfile.test_conventions
Original file line number Diff line number Diff line change
Expand Up @@ -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

COPY ./tools/docker/scripts/install_basics.sh .
RUN ./install_basics.sh

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

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

# 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
36 changes: 22 additions & 14 deletions tools/docker/Dockerfile.test_coverage-pdbg
Original file line number Diff line number Diff line change
Expand Up @@ -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

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 pdbg

COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_coverage.sh ./
CMD ["./ci_entrypoint.sh", "./test_coverage.sh", "pdbg"]
# 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

# Run coverage test for pdbg.
COPY ./tools/docker/scripts/test_coverage.sh .
RUN ./test_coverage.sh "pdbg" 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
36 changes: 22 additions & 14 deletions tools/docker/Dockerfile.test_coverage-sdbg
Original file line number Diff line number Diff line change
Expand Up @@ -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

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 sdbg

COPY ./tools/docker/scripts/ci_entrypoint.sh ./tools/docker/scripts/test_coverage.sh ./
CMD ["./ci_entrypoint.sh", "./test_coverage.sh", "sdbg"]
# 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

# Run coverage test for sdbg.
COPY ./tools/docker/scripts/test_coverage.sh .
RUN ./test_coverage.sh "sdbg" 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
32 changes: 16 additions & 16 deletions tools/docker/Dockerfile.test_cuda_A100
Original file line number Diff line number Diff line change
Expand Up @@ -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

# Run regression tests.
ARG TESTOPTS
COPY ./tools/docker/scripts/test_regtest.sh ./
RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local_cuda' 'psmp' 2>&1 | tee report.txt
RUN /bin/bash -c " \
TESTOPTS="${TESTOPTS}" \
./test_regtest.sh 'local_cuda' 'psmp' |& tee report.log && \
rm -rf regtesting"

# Output the report if the image was pulled from the build cache.
CMD cat $(find ./report.txt -mmin +3)
# 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
32 changes: 16 additions & 16 deletions tools/docker/Dockerfile.test_cuda_P100
Original file line number Diff line number Diff line change
Expand Up @@ -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

# Run regression tests.
ARG TESTOPTS
COPY ./tools/docker/scripts/test_regtest.sh ./
RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local_cuda' 'psmp' 2>&1 | tee report.txt
RUN /bin/bash -c " \
TESTOPTS="${TESTOPTS}" \
./test_regtest.sh 'local_cuda' 'psmp' |& tee report.log && \
rm -rf regtesting"

# Output the report if the image was pulled from the build cache.
CMD cat $(find ./report.txt -mmin +3)
# 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
32 changes: 16 additions & 16 deletions tools/docker/Dockerfile.test_cuda_V100
Original file line number Diff line number Diff line change
Expand Up @@ -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

# Run regression tests.
ARG TESTOPTS
COPY ./tools/docker/scripts/test_regtest.sh ./
RUN TESTOPTS="${TESTOPTS}" ./test_regtest.sh 'local_cuda' 'psmp' 2>&1 | tee report.txt
RUN /bin/bash -c " \
TESTOPTS="${TESTOPTS}" \
./test_regtest.sh 'local_cuda' 'psmp' |& tee report.log && \
rm -rf regtesting"

# Output the report if the image was pulled from the build cache.
CMD cat $(find ./report.txt -mmin +3)
# 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
25 changes: 17 additions & 8 deletions tools/docker/Dockerfile.test_doxygen
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f276815

Please sign in to comment.