Skip to content

Commit

Permalink
Adopt docker tests to new repo layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Oct 2, 2018
1 parent a7945e2 commit b26af28
Show file tree
Hide file tree
Showing 21 changed files with 113 additions and 112 deletions.
6 changes: 3 additions & 3 deletions tools/docker/regtest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ RUN wget -q -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip &
unzip -q cp2k-master.zip && \
rm cp2k-master.zip

WORKDIR /opt/cp2k-master/cp2k/arch
WORKDIR /opt/cp2k-master/arch
RUN ln -vs /opt/cp2k-toolchain/install/arch/local* .

ARG ARCH
ARG VERSION
WORKDIR /opt/cp2k-master/cp2k/makefiles
WORKDIR /opt/cp2k-master
# run regtests which lack fixed reference value
# Disable LeakSanitizer during docker build as it requires ptrace capabilities.
RUN source /opt/cp2k-toolchain/install/setup && \
make -j ARCH=${ARCH} VERSION=${VERSION} && \
export LSAN_OPTIONS="detect_leaks=0" && \
make test ARCH=${ARCH} VERSION=${VERSION} TESTOPTS="-restrictdir QS/regtest-almo-md -restrictdir QS/regtest-almo-1 -restrictdir SE/regtest-3-4 -restrictdir QS/regtest-ot-1-vib -restrictdir Fist/regtest-5-vib -restrictdir QS/regtest-optbas -restrictdir TMC/regtest_ana_post_proc" && \
rm -rf ../lib/ ../exe/ ../regtesting/${ARCH}/${VERSION}/TEST-*
rm -rf lib exe regtesting/${ARCH}/${VERSION}/TEST-*

# install Debian packages
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand Down
26 changes: 13 additions & 13 deletions tools/docker/regtest/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ echo -e "\n========== Copying Changed Files =========="
rsync --exclude="*~" \
--exclude=".*/" \
--exclude="*.pyc" \
--exclude=/cp2k/obj/ \
--exclude=/cp2k/lib/ \
--exclude=/cp2k/exe/ \
--exclude=/cp2k/regtesting/ \
--exclude=/cp2k/tools/toolchain/ \
--exclude=/obj/ \
--exclude=/lib/ \
--exclude=/exe/ \
--exclude=/regtesting/ \
--exclude=/tools/toolchain/ \
--ignore-times \
--update \
--verbose \
Expand All @@ -29,16 +29,16 @@ rsync --exclude="*~" \
--verbose \
--recursive \
--checksum \
/opt/cp2k-local/cp2k/tools/toolchain/ /opt/cp2k-toolchain/
/opt/cp2k-local/tools/toolchain/ /opt/cp2k-toolchain/

echo -e "\n========== Updating Toolchain =========="
cd /opt/cp2k-toolchain/
./install_cp2k_toolchain.sh --install-all --with-make=no

echo -e "\n========== Running Regtests =========="
source /opt/cp2k-toolchain/install/setup
cd /opt/cp2k-master/cp2k/makefiles
rm -rf ../obj/${ARCH}/${VERSION}/*.gcda # remove old gcov statistics
cd /opt/cp2k-master
rm -rf obj/${ARCH}/${VERSION}/*.gcda # remove old gcov statistics

if [[ "$TESTNAME" != "farming" ]]; then
make ARCH=${ARCH} VERSION=${VERSION} test TESTOPTS="${TESTOPTS}"
Expand All @@ -50,18 +50,18 @@ if [[ "$TESTNAME" == coverage-* ]]; then
# gcov gets stuck on some files...
# Maybe related: https://bugs.launchpad.net/gcc-arm-embedded/+bug/1694644
# As a workaround we'll simply remove the offending files for now.
rm -v /opt/cp2k-master/cp2k/obj/${ARCH}/${VERSION}/almo_scf_types.gcda
rm -v /opt/cp2k-master/cp2k/obj/${ARCH}/${VERSION}/dbcsr_tensor_types.gcda
rm -v /opt/cp2k-master/cp2k/obj/${ARCH}/${VERSION}/mp2_types.gcda
rm -v /opt/cp2k-master/obj/${ARCH}/${VERSION}/almo_scf_types.gcda
rm -v /opt/cp2k-master/obj/${ARCH}/${VERSION}/dbcsr_tensor_types.gcda
rm -v /opt/cp2k-master/obj/${ARCH}/${VERSION}/mp2_types.gcda
#cd /tmp
#for i in /opt/cp2k-master/cp2k/obj/${ARCH}/${VERSION}/*.gcda; do
#for i in /opt/cp2k-master/obj/${ARCH}/${VERSION}/*.gcda; do
# timeout 30 gcov $i >/dev/null 2>&1 || rm -v $i
#done

# collect coverage stats
mkdir -p /opt/cp2k_test_artifacts/coverage
cd /opt/cp2k_test_artifacts/coverage
lcov --directory /opt/cp2k-master/cp2k/obj/${ARCH}/${VERSION} --capture --output-file coverage.info > lcov.log
lcov --directory /opt/cp2k-master/obj/${ARCH}/${VERSION} --capture --output-file coverage.info > lcov.log
lcov --summary coverage.info

# generate html report
Expand Down
2 changes: 1 addition & 1 deletion tools/docker/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if git rev-parse; then
CP2K_REVISION="git:$(git log --pretty=format:'%h' -n 1)"
fi

CP2K_LOCAL=$(realpath ../../../)
CP2K_LOCAL=$(realpath ../../)
set -x
# SYS_PTRACE needed by LeakSanitizer.
docker run -i --init --rm --cap-add=SYS_PTRACE --env "CP2K_REVISION=$CP2K_REVISION" --volume ${CP2K_LOCAL}:/opt/cp2k-local/:ro "$@" img_cp2k_test_${TESTNAME}
Expand Down
12 changes: 7 additions & 5 deletions tools/docker/test_aiida/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ FROM cp2k/toolchain:latest

# download and compile cp2k snapshot
WORKDIR /opt/
RUN wget -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \
unzip cp2k-master.zip && \
RUN wget -q -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \
unzip -q cp2k-master.zip && \
rm cp2k-master.zip

WORKDIR /opt/cp2k-master/cp2k/arch
RUN ls -l cp2k-master/

WORKDIR /opt/cp2k-master/arch
RUN ln -vs /opt/cp2k-toolchain/install/arch/local* .

WORKDIR /opt/cp2k-master/cp2k/makefiles
WORKDIR /opt/cp2k-master
RUN source /opt/cp2k-toolchain/install/setup && \
make -j VERSION=pdbg && \
rm -rf ../lib/ ../exe/
rm -rf lib exe

# install Debian packages
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && \
Expand Down
12 changes: 6 additions & 6 deletions tools/docker/test_aiida/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ echo -e "\n========== Copying Changed Files =========="
rsync --exclude="*~" \
--exclude=".*/" \
--exclude="*.pyc" \
--exclude=/cp2k/obj/ \
--exclude=/cp2k/lib/ \
--exclude=/cp2k/exe/ \
--exclude=/obj/ \
--exclude=/lib/ \
--exclude=/exe/ \
--ignore-times \
--update \
--verbose \
Expand All @@ -26,22 +26,22 @@ rsync --exclude="*~" \
--verbose \
--recursive \
--checksum \
/opt/cp2k-local/cp2k/tools/toolchain/ /opt/cp2k-toolchain/
/opt/cp2k-local/tools/toolchain/ /opt/cp2k-toolchain/

echo -e "\n========== Updating Toolchain =========="
cd /opt/cp2k-toolchain/
./install_cp2k_toolchain.sh --install-all --with-make=no

echo -e "\n========== Compiling CP2K =========="
source /opt/cp2k-toolchain/install/setup
cd /opt/cp2k-master/cp2k/makefiles
cd /opt/cp2k-master
make -j VERSION=pdbg cp2k

echo -e "\n========== Installing CP2K =========="
cat > /usr/bin/cp2k << EndOfMessage
#!/bin/bash -e
source /opt/cp2k-toolchain/install/setup
/opt/cp2k-master/cp2k/exe/local/cp2k.pdbg "\$@"
/opt/cp2k-master/exe/local/cp2k.pdbg "\$@"
EndOfMessage
chmod +x /usr/bin/cp2k

Expand Down
10 changes: 5 additions & 5 deletions tools/docker/test_ase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ FROM cp2k/toolchain:latest

# download and compile cp2k snapshot
WORKDIR /opt/
RUN wget -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \
unzip cp2k-master.zip && \
RUN wget -q -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \
unzip -q cp2k-master.zip && \
rm cp2k-master.zip

WORKDIR /opt/cp2k-master/cp2k/arch
WORKDIR /opt/cp2k-master/arch
RUN ln -vs /opt/cp2k-toolchain/install/arch/local* .

WORKDIR /opt/cp2k-master/cp2k/makefiles
WORKDIR /opt/cp2k-master
RUN source /opt/cp2k-toolchain/install/setup && \
make -j VERSION=pdbg && \
rm -rf ../lib/ ../exe/
rm -rf lib exe

# install Debian packages
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand Down
13 changes: 6 additions & 7 deletions tools/docker/test_ase/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ echo -e "\n========== Copying Changed Files =========="
rsync --exclude="*~" \
--exclude=".*/" \
--exclude="*.pyc" \
--exclude=/cp2k/obj/ \
--exclude=/cp2k/lib/ \
--exclude=/cp2k/exe/ \
--exclude=/obj/ \
--exclude=/lib/ \
--exclude=/exe/ \
--ignore-times \
--update \
--verbose \
Expand All @@ -26,17 +26,16 @@ rsync --exclude="*~" \
--verbose \
--recursive \
--checksum \
/opt/cp2k-local/cp2k/tools/toolchain/ /opt/cp2k-toolchain/
/opt/cp2k-local/tools/toolchain/ /opt/cp2k-toolchain/

echo -e "\n========== Updating Toolchain =========="
cd /opt/cp2k-toolchain/
./install_cp2k_toolchain.sh --install-all --with-make=no

echo -e "\n========== Compiling CP2K =========="
source /opt/cp2k-toolchain/install/setup
cd /opt/cp2k-master/cp2k/makefiles
cd /opt/cp2k-master
make -j VERSION=pdbg cp2k_shell
ln -s /opt/cp2k-master/cp2k/exe/local/cp2k.pdbg /usr/bin/cp2k

echo -e "\n========== Installing ASE =========="
cd /opt/ase/
Expand All @@ -45,7 +44,7 @@ pip3 install .

echo -e "\n========== Running ASE Tests =========="
cd /opt/ase/
export ASE_CP2K_COMMAND="mpiexec -np 2 /opt/cp2k-master/cp2k/exe/local/cp2k_shell.pdbg"
export ASE_CP2K_COMMAND="mpiexec -np 2 /opt/cp2k-master/exe/local/cp2k_shell.pdbg"

set +e # disable error trapping for remainder of script
(
Expand Down
8 changes: 4 additions & 4 deletions tools/docker/test_conventions/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ FROM cp2k/toolchain:latest

# download and compile cp2k snapshot
WORKDIR /opt/
RUN wget -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \
unzip cp2k-master.zip && \
RUN wget -q -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \
unzip -q cp2k-master.zip && \
rm cp2k-master.zip

WORKDIR /opt/cp2k-master/cp2k/arch
WORKDIR /opt/cp2k-master/arch
RUN ln -vs /opt/cp2k-toolchain/install/arch/local* .

WORKDIR /opt/cp2k-master/cp2k/tools/conventions/
WORKDIR /opt/cp2k-master/tools/conventions/
RUN source /opt/cp2k-toolchain/install/setup && \
./test_conventions.sh && \
rm -rf ../lib/ ../exe/
Expand Down
10 changes: 5 additions & 5 deletions tools/docker/test_conventions/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ echo -e "\n========== Copying Changed Files =========="
rsync --exclude="*~" \
--exclude=".*/" \
--exclude="*.pyc" \
--exclude=/cp2k/obj/ \
--exclude=/cp2k/lib/ \
--exclude=/cp2k/exe/ \
--exclude=/obj/ \
--exclude=/lib/ \
--exclude=/exe/ \
--ignore-times \
--update \
--verbose \
Expand All @@ -26,15 +26,15 @@ rsync --exclude="*~" \
--verbose \
--recursive \
--checksum \
/opt/cp2k-local/cp2k/tools/toolchain/ /opt/cp2k-toolchain/
/opt/cp2k-local/tools/toolchain/ /opt/cp2k-toolchain/

echo -e "\n========== Updating Toolchain =========="
cd /opt/cp2k-toolchain/
./install_cp2k_toolchain.sh --install-all --with-make=no

echo -e "\n========== Running Conventions Test =========="
source /opt/cp2k-toolchain/install/setup
cd /opt/cp2k-master/cp2k/tools/conventions/
cd /opt/cp2k-master/tools/conventions/
#TODO port to Python3
./test_conventions.sh

Expand Down
8 changes: 4 additions & 4 deletions tools/docker/test_formatting/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /opt/
RUN wget -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \
unzip cp2k-master.zip && \
RUN wget -q -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \
unzip -q cp2k-master.zip && \
rm cp2k-master.zip

WORKDIR /opt/cp2k-master/cp2k
WORKDIR /opt/cp2k-master
RUN ./tools/formatting/test_formatting.sh

WORKDIR /opt/cp2k_test_formatting
COPY cmd.sh .
CMD ["./cmd.sh"]

#EOF
#EOF
8 changes: 4 additions & 4 deletions tools/docker/test_formatting/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ echo -e "\n========== Copying Changed Files =========="
rsync --exclude="*~" \
--exclude=".*/" \
--exclude="*.pyc" \
--exclude=/cp2k/obj/ \
--exclude=/cp2k/lib/ \
--exclude=/cp2k/exe/ \
--exclude=/obj/ \
--exclude=/lib/ \
--exclude=/exe/ \
--ignore-times \
--update \
--verbose \
Expand All @@ -19,7 +19,7 @@ rsync --exclude="*~" \
/opt/cp2k-local/ /opt/cp2k-master/

echo -e "\n========== Running Formatting Test =========="
cd /opt/cp2k-master/cp2k
cd /opt/cp2k-master
./tools/formatting/test_formatting.sh

#EOF
10 changes: 5 additions & 5 deletions tools/docker/test_i-pi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ FROM cp2k/toolchain:latest

# download and compile cp2k snapshot
WORKDIR /opt/
RUN wget -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \
unzip cp2k-master.zip && \
RUN wget -q -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \
unzip -q cp2k-master.zip && \
rm cp2k-master.zip

WORKDIR /opt/cp2k-master/cp2k/arch
WORKDIR /opt/cp2k-master/arch
RUN ln -vs /opt/cp2k-toolchain/install/arch/local* .

WORKDIR /opt/cp2k-master/cp2k/makefiles
WORKDIR /opt/cp2k-master
RUN source /opt/cp2k-toolchain/install/setup && \
make -j VERSION=pdbg && \
rm -rf ../lib/ ../exe/
rm -rf lib exe

# install Debian packages
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand Down
12 changes: 6 additions & 6 deletions tools/docker/test_i-pi/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ echo -e "\n========== Copying Changed Files =========="
rsync --exclude="*~" \
--exclude=".*/" \
--exclude="*.pyc" \
--exclude=/cp2k/obj/ \
--exclude=/cp2k/lib/ \
--exclude=/cp2k/exe/ \
--exclude=/obj/ \
--exclude=/lib/ \
--exclude=/exe/ \
--ignore-times \
--update \
--verbose \
Expand All @@ -26,15 +26,15 @@ rsync --exclude="*~" \
--verbose \
--recursive \
--checksum \
/opt/cp2k-local/cp2k/tools/toolchain/ /opt/cp2k-toolchain/
/opt/cp2k-local/tools/toolchain/ /opt/cp2k-toolchain/

echo -e "\n========== Updating Toolchain =========="
cd /opt/cp2k-toolchain/
./install_cp2k_toolchain.sh --install-all --with-make=no

echo -e "\n========== Compiling CP2K =========="
source /opt/cp2k-toolchain/install/setup
cd /opt/cp2k-master/cp2k/makefiles
cd /opt/cp2k-master
make -j VERSION=pdbg cp2k

echo -e "\n========== Installing i-Pi =========="
Expand All @@ -53,7 +53,7 @@ set +e # disable error trapping for remainder of script
cd run_1
echo 42 > cp2k_exit_code
sleep 2 # give i-pi some time to startup
mpiexec -np 2 /opt/cp2k-master/cp2k/exe/local/cp2k.pdbg ../in.cp2k
mpiexec -np 2 /opt/cp2k-master/exe/local/cp2k.pdbg ../in.cp2k
echo $? > cp2k_exit_code
) &

Expand Down
6 changes: 3 additions & 3 deletions tools/docker/test_manual/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ RUN wget -q -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip &
unzip -q cp2k-master.zip && \
rm cp2k-master.zip

WORKDIR /opt/cp2k-master/cp2k/arch
WORKDIR /opt/cp2k-master/arch
RUN ln -vs /opt/cp2k-toolchain/install/arch/local* .

WORKDIR /opt/cp2k-master/cp2k/makefiles
WORKDIR /opt/cp2k-master
RUN source /opt/cp2k-toolchain/install/setup && \
make -j VERSION="sopt" cp2k && \
rm -rf ../lib/ ../exe/
rm -rf lib exe

# install Debian packages
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand Down

0 comments on commit b26af28

Please sign in to comment.