diff --git a/tools/docker/.gitignore b/tools/docker/.gitignore new file mode 100644 index 0000000000..3fdce256ad --- /dev/null +++ b/tools/docker/.gitignore @@ -0,0 +1 @@ +!/scripts/ diff --git a/tools/docker/Dockerfile.test_aiida b/tools/docker/Dockerfile.test_aiida new file mode 100644 index 0000000000..594f361b13 --- /dev/null +++ b/tools/docker/Dockerfile.test_aiida @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_aiida.sh . +RUN ./install_aiida.sh + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_aiida.sh ./ +CMD ["./ci_entrypoint.sh", "./test_aiida.sh"] + +#EOF diff --git a/tools/docker/Dockerfile.test_ase b/tools/docker/Dockerfile.test_ase new file mode 100644 index 0000000000..470aa7ee1f --- /dev/null +++ b/tools/docker/Dockerfile.test_ase @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_ase.sh . +RUN ./install_ase.sh + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_ase.sh ./ +CMD ["./ci_entrypoint.sh", "./test_ase.sh"] + +#EOF diff --git a/tools/docker/Dockerfile.test_conventions b/tools/docker/Dockerfile.test_conventions new file mode 100644 index 0000000000..f1353abc95 --- /dev/null +++ b/tools/docker/Dockerfile.test_conventions @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_conventions.sh . +RUN ./install_conventions.sh + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_conventions.sh ./ +CMD ["./ci_entrypoint.sh", "./test_conventions.sh"] + +#EOF diff --git a/tools/docker/Dockerfile.test_coverage-pdbg b/tools/docker/Dockerfile.test_coverage-pdbg new file mode 100644 index 0000000000..8c5e923447 --- /dev/null +++ b/tools/docker/Dockerfile.test_coverage-pdbg @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local_coverage pdbg + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_coverage.sh ./ +CMD ["./ci_entrypoint.sh", "./test_coverage.sh", "pdbg"] + +#EOF diff --git a/tools/docker/Dockerfile.test_coverage-sdbg b/tools/docker/Dockerfile.test_coverage-sdbg new file mode 100644 index 0000000000..9cc369ad18 --- /dev/null +++ b/tools/docker/Dockerfile.test_coverage-sdbg @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local_coverage sdbg + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_coverage.sh ./ +CMD ["./ci_entrypoint.sh", "./test_coverage.sh", "sdbg"] + +#EOF diff --git a/tools/docker/Dockerfile.test_farming b/tools/docker/Dockerfile.test_farming new file mode 100644 index 0000000000..cf9e369d93 --- /dev/null +++ b/tools/docker/Dockerfile.test_farming @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local popt + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_farming.sh ./ +CMD ["./ci_entrypoint.sh", "./test_farming.sh"] + +#EOF diff --git a/tools/docker/Dockerfile.test_formatting b/tools/docker/Dockerfile.test_formatting new file mode 100644 index 0000000000..beed2ea4c5 --- /dev/null +++ b/tools/docker/Dockerfile.test_formatting @@ -0,0 +1,16 @@ +FROM ubuntu:18.04 + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_formatting.sh . +RUN ./install_formatting.sh + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_formatting.sh ./ +CMD ["./ci_entrypoint.sh", "./test_formatting.sh"] + +#EOF diff --git a/tools/docker/Dockerfile.test_i-pi b/tools/docker/Dockerfile.test_i-pi new file mode 100644 index 0000000000..eb07f55a76 --- /dev/null +++ b/tools/docker/Dockerfile.test_i-pi @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_i-pi.sh . +RUN ./install_i-pi.sh + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_i-pi.sh ./ +CMD ["./ci_entrypoint.sh", "./test_i-pi.sh"] + +#EOF diff --git a/tools/docker/Dockerfile.test_manual b/tools/docker/Dockerfile.test_manual new file mode 100644 index 0000000000..eb737d6294 --- /dev/null +++ b/tools/docker/Dockerfile.test_manual @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_manual.sh . +RUN ./install_manual.sh + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_manual.sh ./ +CMD ["./ci_entrypoint.sh", "./test_manual.sh"] + +#EOF diff --git a/tools/docker/Dockerfile.test_minimal b/tools/docker/Dockerfile.test_minimal new file mode 100644 index 0000000000..2144e75bc0 --- /dev/null +++ b/tools/docker/Dockerfile.test_minimal @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh minimal sdbg + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_regtest.sh ./ +CMD ["./ci_entrypoint.sh", "./test_regtest.sh", "minimal", "sdbg"] + +#EOF diff --git a/tools/docker/Dockerfile.test_pdbg b/tools/docker/Dockerfile.test_pdbg new file mode 100644 index 0000000000..8b4aff3891 --- /dev/null +++ b/tools/docker/Dockerfile.test_pdbg @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local pdbg + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_regtest.sh ./ +CMD ["./ci_entrypoint.sh", "./test_regtest.sh", "local", "pdbg"] + +#EOF diff --git a/tools/docker/Dockerfile.test_popt b/tools/docker/Dockerfile.test_popt new file mode 100644 index 0000000000..db8e7e8c2d --- /dev/null +++ b/tools/docker/Dockerfile.test_popt @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local popt + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_regtest.sh ./ +CMD ["./ci_entrypoint.sh", "./test_regtest.sh", "local", "popt"] + +#EOF diff --git a/tools/docker/Dockerfile.test_psmp b/tools/docker/Dockerfile.test_psmp new file mode 100644 index 0000000000..3c3756a6a2 --- /dev/null +++ b/tools/docker/Dockerfile.test_psmp @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local psmp + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_regtest.sh ./ +CMD ["./ci_entrypoint.sh", "./test_regtest.sh", "local", "psmp"] + +#EOF diff --git a/tools/docker/Dockerfile.test_python b/tools/docker/Dockerfile.test_python new file mode 100644 index 0000000000..366bb2e2eb --- /dev/null +++ b/tools/docker/Dockerfile.test_python @@ -0,0 +1,16 @@ +FROM ubuntu:18.04 + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_python.sh . +RUN ./install_python.sh + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_python.sh ./ +CMD ["./ci_entrypoint.sh", "./test_python.sh"] + +#EOF \ No newline at end of file diff --git a/tools/docker/Dockerfile.test_sdbg b/tools/docker/Dockerfile.test_sdbg new file mode 100644 index 0000000000..ddb635d4f3 --- /dev/null +++ b/tools/docker/Dockerfile.test_sdbg @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local sdbg + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_regtest.sh ./ +CMD ["./ci_entrypoint.sh", "./test_regtest.sh", "local", "sdbg"] + +#EOF diff --git a/tools/docker/Dockerfile.test_sopt b/tools/docker/Dockerfile.test_sopt new file mode 100644 index 0000000000..9ed217c824 --- /dev/null +++ b/tools/docker/Dockerfile.test_sopt @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local sopt + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_regtest.sh ./ +CMD ["./ci_entrypoint.sh", "./test_regtest.sh", "local", "sopt"] + +#EOF diff --git a/tools/docker/Dockerfile.test_ssmp b/tools/docker/Dockerfile.test_ssmp new file mode 100644 index 0000000000..b5b1a073d7 --- /dev/null +++ b/tools/docker/Dockerfile.test_ssmp @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local ssmp + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_regtest.sh ./ +CMD ["./ci_entrypoint.sh", "./test_regtest.sh", "local", "ssmp"] + +#EOF diff --git a/tools/docker/Dockerfile.test_ubuntu b/tools/docker/Dockerfile.test_ubuntu new file mode 100644 index 0000000000..f07b39faa6 --- /dev/null +++ b/tools/docker/Dockerfile.test_ubuntu @@ -0,0 +1,19 @@ +FROM ubuntu:18.04 + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_ubuntu_toolchain.sh . +RUN ./install_ubuntu_toolchain.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local ssmp + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_regtest.sh ./ +CMD ["./ci_entrypoint.sh", "./test_regtest.sh", "local", "ssmp"] + +#EOF diff --git a/tools/docker/Dockerfile.test_valgrind-pdbg b/tools/docker/Dockerfile.test_valgrind-pdbg new file mode 100644 index 0000000000..d2d21e06a4 --- /dev/null +++ b/tools/docker/Dockerfile.test_valgrind-pdbg @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local_valgrind pdbg + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_regtest.sh ./ +CMD ["./ci_entrypoint.sh", "./test_regtest.sh", "local_valgrind", "pdbg"] + +#EOF diff --git a/tools/docker/Dockerfile.test_valgrind-sdbg b/tools/docker/Dockerfile.test_valgrind-sdbg new file mode 100644 index 0000000000..c89a5ecedb --- /dev/null +++ b/tools/docker/Dockerfile.test_valgrind-sdbg @@ -0,0 +1,16 @@ +FROM cp2k/toolchain:latest + +# author: Ole Schuett + +WORKDIR /workspace + +COPY ./scripts/install_basics.sh . +RUN ./install_basics.sh + +COPY ./scripts/install_regtest.sh . +RUN ./install_regtest.sh local_valgrind sdbg + +COPY ./scripts/ci_entrypoint.sh ./scripts/test_regtest.sh ./ +CMD ["./ci_entrypoint.sh", "./test_regtest.sh", "local_valgrind", "sdbg"] + +#EOF diff --git a/tools/docker/build_test.sh b/tools/docker/build_test.sh index 511be7c50c..9a91411dfb 100755 --- a/tools/docker/build_test.sh +++ b/tools/docker/build_test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e # author: Ole Schuett @@ -13,12 +13,7 @@ TESTNAME=$1 shift echo "Building ${TESTNAME} ..." -BUILDARGS="" -if [ -f ./test_${TESTNAME}/buildargs.sh ]; then - source ./test_${TESTNAME}/buildargs.sh -fi - set -x -docker build -t img_cp2k_test_${TESTNAME} ${BUILDARGS} "$@" ./test_${TESTNAME}/ +docker build -t "img_cp2k_test_${TESTNAME}" "$@" -f "Dockerfile.test_${TESTNAME}" . #EOF diff --git a/tools/docker/exe_psmp/Dockerfile.psmp b/tools/docker/exe_psmp/Dockerfile.psmp deleted file mode 100644 index a5179aa601..0000000000 --- a/tools/docker/exe_psmp/Dockerfile.psmp +++ /dev/null @@ -1,28 +0,0 @@ -FROM cp2k/toolchain:latest - -# author: Ole Schuett -# Has to be build from cp2k root directory: -# docker build -f ./infra/docker/Dockerfile.psmp . - -WORKDIR /opt/cp2k/ -RUN ln -s /opt/cp2k-toolchain/install/arch/ . -COPY makefiles ./makefiles -COPY tools ./tools -COPY tests ./tests -COPY data ./data -COPY src ./src - -ARG REVISION -RUN echo ${REVISION} > ./REVISION - -WORKDIR /opt/cp2k/makefiles -RUN ln -sf bash /bin/sh -RUN source /opt/cp2k-toolchain/install/setup && \ - make -j VERSION="psmp" cp2k && \ - make -j VERSION="psmp" cp2k_shell && \ - make VERSION="psmp" clean - -ENV PATH="/opt/cp2k/exe/local:${PATH}" -WORKDIR / - -#EOF diff --git a/tools/docker/regtest/Dockerfile b/tools/docker/regtest/Dockerfile deleted file mode 100644 index b102e82084..0000000000 --- a/tools/docker/regtest/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM cp2k/toolchain:latest - -# author: Ole Schuett - -# download and compile cp2k snapshot -WORKDIR /opt/ -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/arch -RUN ln -vs /opt/cp2k-toolchain/install/arch/local* . - -ARG ARCH -ARG VERSION -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-* - -# install Debian packages -RUN apt-get update && apt-get install -y --no-install-recommends \ - rsync \ - && rm -rf /var/lib/apt/lists/* - -ARG TESTNAME -ENV TESTNAME=${TESTNAME} -ENV ARCH=${ARCH} -ENV VERSION=${VERSION} -WORKDIR /opt/cp2k_test_${TESTNAME} -COPY ./cmd.sh . -CMD ["./cmd.sh"] - -#EOF diff --git a/tools/docker/regtest/buildargs.sh b/tools/docker/regtest/buildargs.sh deleted file mode 100644 index 00b1b74055..0000000000 --- a/tools/docker/regtest/buildargs.sh +++ /dev/null @@ -1,27 +0,0 @@ - -# author: Ole Schuett - -BUILDARGS="$BUILDARGS --build-arg TESTNAME=${TESTNAME}" - -if [[ "${TESTNAME}" =~ ^(sopt|ssmp|sdbg|popt|psmp|pdbg)$ ]]; then - BUILDARGS="$BUILDARGS --build-arg ARCH=local --build-arg VERSION=${TESTNAME}" - -elif [[ "${TESTNAME}" == "farming" ]]; then - BUILDARGS="$BUILDARGS --build-arg ARCH=local --build-arg VERSION=popt" - -elif [[ "${TESTNAME}" == "minimal" ]]; then - BUILDARGS="$BUILDARGS --build-arg ARCH=minimal --build-arg VERSION=sdbg" - -elif [[ "${TESTNAME}" =~ ^coverage-(sdbg|pdbg)$ ]]; then - BUILDARGS="$BUILDARGS --build-arg ARCH=local_coverage --build-arg VERSION=${TESTNAME:9}" - -elif [[ "${TESTNAME}" =~ ^valgrind-(sdbg|sopt|pdbg|popt)$ ]]; then - BUILDARGS="$BUILDARGS --build-arg ARCH=local_valgrind --build-arg VERSION=${TESTNAME:9}" - -else - echo "Unkown test name: ${TESTNAME}" - exit 1 - -fi - -#EOF diff --git a/tools/docker/regtest/cmd.sh b/tools/docker/regtest/cmd.sh deleted file mode 100755 index fa32096953..0000000000 --- a/tools/docker/regtest/cmd.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash - -# author: Ole Schuett -set -e - -echo -e "\n========== Copying Changed Files ==========" -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --exclude=/obj/ \ - --exclude=/lib/ \ - --exclude=/exe/ \ - --exclude=/regtesting/ \ - --exclude=/tools/toolchain/ \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /opt/cp2k-local/ /opt/cp2k-master/ - -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --exclude=/build/ \ - --exclude=/install/ \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /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 -rm -rf obj/${ARCH}/${VERSION}/*.gcda # remove old gcov statistics - -if [[ "$TESTNAME" != "farming" ]]; then - make ARCH=${ARCH} VERSION=${VERSION} test TESTOPTS="${TESTOPTS}" -else - make ARCH=${ARCH} VERSION=${VERSION} test TESTOPTS="-farming -skipunittest -skipdir TMC/regtest_ana_on_the_fly -skipdir TMC/regtest_ana_post_proc -skipdir TMC/regtest ${TESTOPTS}" -fi - -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/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/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/obj/${ARCH}/${VERSION} --capture --output-file coverage.info > lcov.log - lcov --summary coverage.info - - # generate html report - genhtml --title "CP2K Regtests (${CP2K_REVISION})" coverage.info > genhtml.log - - # plot - LINE_COV=$(lcov --summary coverage.info | grep lines | awk '{print substr($2, 1, length($2)-1)}') - FUNC_COV=$(lcov --summary coverage.info | grep funct | awk '{print substr($2, 1, length($2)-1)}') - echo 'Plot: name="cov", title="Test Coverage", ylabel="Coverage %"' - echo "PlotPoint: name='lines', plot='cov', label='Lines', y=$LINE_COV, yerr=0" - echo "PlotPoint: name='funcs', plot='cov', label='Functions', y=$FUNC_COV, yerr=0" -fi -#EOF diff --git a/tools/docker/run_test.sh b/tools/docker/run_test.sh index 49989d0d90..3d994dcf1e 100755 --- a/tools/docker/run_test.sh +++ b/tools/docker/run_test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e # author: Ole Schuett @@ -13,21 +13,12 @@ TESTNAME=$1 shift echo "Running ${TESTNAME} ..." -echo -n "StartDate: " -date --utc --rfc-3339=seconds - -if git rev-parse; then - git --no-pager log -1 --pretty="%nCommitSHA: %H%nCommitTime: %ci%nCommitAuthor: %an%nCommitSubject: %s%n" - CP2K_REVISION="git:$(git log --pretty=format:'%h' -n 1)" -fi - 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} -set +x -echo -n "EndDate: " -date --utc --rfc-3339=seconds +# SYS_PTRACE needed by LeakSanitizer. +docker run -i --init --rm --cap-add=SYS_PTRACE \ + --volume "${CP2K_LOCAL}:/mnt/cp2k/:ro" \ + "$@" "img_cp2k_test_${TESTNAME}" #EOF diff --git a/tools/docker/scripts/ci_entrypoint.sh b/tools/docker/scripts/ci_entrypoint.sh new file mode 100755 index 0000000000..61763cef85 --- /dev/null +++ b/tools/docker/scripts/ci_entrypoint.sh @@ -0,0 +1,105 @@ +#!/bin/bash -e + +# author: Ole Schuett + +REPORT=/workspace/report.txt +echo -n "StartDate: " > $REPORT +date --utc --rfc-3339=seconds >> $REPORT + +# Rsync with common args. +function rsync_changes { + rsync --update \ + --delete \ + --executability \ + --ignore-times \ + --verbose \ + --recursive \ + --checksum \ + "$@" +} + +# Upload to cloud storage. +function upload_file { + URL=$1 + FILE=$2 + CONTENT_TYPE=$3 + wget -O- --method=PUT --header="content-type: ${CONTENT_TYPE}" --header="cache-control: no-cache" --body-file="${FILE}" "${URL}" +} + +# Get cp2k sources. +if [ -n "${GIT_REF}" ]; then + echo -e "\n========== Fetching Git Commit ==========" + cd /workspace/cp2k + git fetch origin "${GIT_BRANCH}" + git checkout "${GIT_REF}" + git submodule update --init --recursive + git --no-pager log -1 --pretty='%nCommitSHA: %H%nCommitTime: %ci%nCommitAuthor: %an%nCommitSubject: %s%n' | tee -a $REPORT + +elif [ -d /mnt/cp2k ]; then + echo -e "\n========== Copying Changed Files ==========" + rsync_changes --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 + + +# Update toolchain. +if [ -d /opt/cp2k-toolchain ]; then + echo -e "\n========== Updating Toolchain ==========" + cd /opt/cp2k-toolchain + rsync_changes --exclude="/build/" \ + --exclude="/install/" \ + /workspace/cp2k/tools/toolchain/ /opt/cp2k-toolchain/ + + # shellcheck disable=SC1091 + source /opt/cp2k-toolchain/install/setup + # shellcheck disable=SC2086 + ./install_cp2k_toolchain.sh ${CP2K_TOOLCHAIN_OPTIONS} +fi + +echo -e "\n========== Running Test ==========" +cd /workspace +"$@" 2>&1 | tee -a $REPORT & # Launch in the background. + +# Upload preliminary report every 30s while test is running. +while jobs %1 &> /dev/null ; do + sleep 1 + count=$(( (count + 1) % 30 )) + if (( count == 1 )) && [ -n "${REPORT_UPLOAD_URL}" ]; then + upload_file "${REPORT_UPLOAD_URL}" "${REPORT}" "text/plain;charset=utf-8" + fi +done + +# Test has finished. +echo -n "EndDate: " >> $REPORT +date --utc --rfc-3339=seconds >> $REPORT + +# Upload final report. +if [ -n "${REPORT_UPLOAD_URL}" ]; then + echo "Uploading report..." + upload_file "${REPORT_UPLOAD_URL}" "${REPORT}" "text/plain;charset=utf-8" +fi + +# Upload artifacts. +if [ -n "${ARTIFACTS_UPLOAD_URL}" ] && [ -d /workspace/artifacts ]; then + echo "Uploading artifacts..." + ARTIFACTS_TGZ="/tmp/test_${TESTNAME}_artifacts.tgz" + tar -czf "${ARTIFACTS_TGZ}" -C /workspace/artifacts . + upload_file "${ARTIFACTS_UPLOAD_URL}" "${ARTIFACTS_TGZ}" "application/gzip" +fi + +echo "Done :-)" + +#EOF diff --git a/tools/docker/scripts/install_aiida.sh b/tools/docker/scripts/install_aiida.sh new file mode 100755 index 0000000000..58e5aeea9a --- /dev/null +++ b/tools/docker/scripts/install_aiida.sh @@ -0,0 +1,39 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# install Ubuntu packages +apt-get update +export DEBIAN_FRONTEND=noninteractive +export DEBCONF_NONINTERACTIVE_SEEN=true +apt-get install -y --no-install-recommends \ + build-essential \ + python-setuptools \ + python-wheel \ + python-pip \ + python-dev \ + postgresql \ + sudo \ + ssh +rm -rf /var/lib/apt/lists/* + +# install python packages +pip install flake8 aiida ase + +# 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 + +# setup arch files +cd /workspace/cp2k/arch +ln -vs /opt/cp2k-toolchain/install/arch/local* . + +# pre-build cp2k +cd /workspace/cp2k +make -j VERSION=pdbg +rm -rf lib exe + +#EOF diff --git a/tools/docker/scripts/install_ase.sh b/tools/docker/scripts/install_ase.sh new file mode 100755 index 0000000000..0036fbf785 --- /dev/null +++ b/tools/docker/scripts/install_ase.sh @@ -0,0 +1,34 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# install python packages +apt-get update +apt-get install -y --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 numpy scipy matplotlib flask + +# clone ase reprository +git clone --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 +make -j VERSION=pdbg +rm -rf lib exe + +#EOF diff --git a/tools/docker/scripts/install_basics.sh b/tools/docker/scripts/install_basics.sh new file mode 100755 index 0000000000..889b73598f --- /dev/null +++ b/tools/docker/scripts/install_basics.sh @@ -0,0 +1,22 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# install Ubuntu packages +apt-get update +apt-get install -y --no-install-recommends \ + ca-certificates \ + python \ + git \ + nano \ + wget \ + unzip \ + less \ + make \ + rsync +rm -rf /var/lib/apt/lists/* + +# clone cp2k repository +git clone --depth=1 --single-branch -b master https://github.com/cp2k/cp2k.git /workspace/cp2k + +#EOF diff --git a/tools/docker/scripts/install_conventions.sh b/tools/docker/scripts/install_conventions.sh new file mode 100755 index 0000000000..a621ca6868 --- /dev/null +++ b/tools/docker/scripts/install_conventions.sh @@ -0,0 +1,17 @@ +#!/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 +./test_conventions.sh +rm -rf ../lib/ ../exe/ + +#EOF diff --git a/tools/docker/scripts/install_formatting.sh b/tools/docker/scripts/install_formatting.sh new file mode 100755 index 0000000000..47d5a4c5b9 --- /dev/null +++ b/tools/docker/scripts/install_formatting.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# install Ubuntu packages +apt-get update +apt-get install -y --no-install-recommends libfindbin-libs-perl +rm -rf /var/lib/apt/lists/* + +# pre-run prettify +cd /workspace/cp2k +make -j pretty + +#EOF diff --git a/tools/docker/scripts/install_i-pi.sh b/tools/docker/scripts/install_i-pi.sh new file mode 100755 index 0000000000..1accc09e2a --- /dev/null +++ b/tools/docker/scripts/install_i-pi.sh @@ -0,0 +1,32 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# install Ubuntu packages +apt-get update +apt-get install -y --no-install-recommends \ + python \ + python-pip \ + python-wheel \ + python-setuptools +rm -rf /var/lib/apt/lists/* + +# install python packages +pip install numpy + +# clone i-pi repository +git clone --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 +make -j VERSION=pdbg +rm -rf lib exe + +#EOF diff --git a/tools/docker/scripts/install_manual.sh b/tools/docker/scripts/install_manual.sh new file mode 100755 index 0000000000..0d1ca0e37a --- /dev/null +++ b/tools/docker/scripts/install_manual.sh @@ -0,0 +1,24 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# install Ubuntu packages +apt-get update +apt-get install -y --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 +make -j VERSION=sopt +rm -rf lib exe + +#EOF diff --git a/tools/docker/scripts/install_python.sh b/tools/docker/scripts/install_python.sh new file mode 100755 index 0000000000..7968857d7a --- /dev/null +++ b/tools/docker/scripts/install_python.sh @@ -0,0 +1,36 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# install Ubuntu packages +apt-get update +apt-get install -y --no-install-recommends \ + python \ + python3 \ + python-pip \ + python3-pip \ + python-wheel \ + python3-wheel \ + python-setuptools \ + python3-setuptools \ + python-dev \ + python3-dev \ + build-essential +rm -rf /var/lib/apt/lists/* + +# install python packages +pip install numpy matplotlib requests +pip3 install numpy matplotlib requests + +# install python2.6 +cd /tmp +wget -q https://www.python.org/ftp/python/2.6.9/Python-2.6.9.tgz +tar -xzf Python-2.6.9.tgz +pushd Python-2.6.9 +./configure +make -j +make install +popd +rm -rf Python-2.6.9* + +#EOF diff --git a/tools/docker/scripts/install_regtest.sh b/tools/docker/scripts/install_regtest.sh new file mode 100755 index 0000000000..0b80e16c21 --- /dev/null +++ b/tools/docker/scripts/install_regtest.sh @@ -0,0 +1,30 @@ +#!/bin/bash -e + +# 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 +ln -vs /opt/cp2k-toolchain/install/arch/local* . + +# shellcheck disable=SC1091 +source /opt/cp2k-toolchain/install/setup + +# pre-build cp2k +cd /workspace/cp2k +make -j ARCH="${ARCH}" VERSION="${VERSION}" + +# run regtests which lack fixed reference value +# Disable LeakSanitizer during docker build as it requires ptrace capabilities. +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-* + +#EOF diff --git a/tools/docker/scripts/install_ubuntu_toolchain.sh b/tools/docker/scripts/install_ubuntu_toolchain.sh new file mode 100755 index 0000000000..41e9a040f6 --- /dev/null +++ b/tools/docker/scripts/install_ubuntu_toolchain.sh @@ -0,0 +1,32 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# install Ubuntu packages +apt-get update +apt-get install -y --no-install-recommends \ + build-essential \ + gfortran \ + fftw3-dev \ + libopenblas-dev \ + liblapack-dev \ + libint-dev +rm -rf /var/lib/apt/lists/* + +# build toolchain relying mostly on ubuntu packages +cp -r /workspace/cp2k/tools/toolchain /opt/cp2k-toolchain/ +cd /opt/cp2k-toolchain/ +./install_cp2k_toolchain.sh \ + --mpi-mode=no \ + --with-gcc=system \ + --with-binutils=system \ + --with-make=system \ + --with-fftw=system \ + --with-openblas=system \ + --with-reflapack=system \ + --with-libint=system \ + --with-libxc=install \ + --with-libxsmm=install +rm -rf ./build + +#EOF diff --git a/tools/docker/scripts/test_aiida.sh b/tools/docker/scripts/test_aiida.sh new file mode 100755 index 0000000000..6bf79c70eb --- /dev/null +++ b/tools/docker/scripts/test_aiida.sh @@ -0,0 +1,53 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# shellcheck disable=SC1091 +source /opt/cp2k-toolchain/install/setup + +echo -e "\n========== Compiling CP2K ==========" +cd /workspace/cp2k +make -j VERSION=pdbg cp2k + +echo -e "\n========== Installing CP2K ==========" +cat > /usr/bin/cp2k << EndOfMessage +#!/bin/bash -e +source /opt/cp2k-toolchain/install/setup +/workspace/cp2k/exe/local/cp2k.pdbg "\$@" +EndOfMessage +chmod +x /usr/bin/cp2k + +echo -e "\n========== Installing AiiDA-CP2K plugin ==========" +cd /opt/ +git clone https://github.com/cp2k/aiida-cp2k.git +pip install ./aiida-cp2k/ + +echo -e "\n========== Configuring AiiDA ==========" +for i in $(dirname "$(which mpirun)")/* ; do ln -sf "$i" /usr/bin/; done +SUDO="sudo -u ubuntu -H" +cd /opt/aiida-cp2k/test/ +$SUDO ./configure_aiida.sh + +echo -e "\n========== Running AiiDA-CP2K Tests ==========" +cd /opt/aiida-cp2k/test/ + +set +e # disable error trapping for remainder of script +( +set -e # abort on error +$SUDO ./run_tests.sh +) + +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" +else + echo "Summary: aiida-cp2k commit ${AIIDA_COMMIT} works fine." + echo "Status: OK" +fi + +#EOF diff --git a/tools/docker/scripts/test_ase.sh b/tools/docker/scripts/test_ase.sh new file mode 100755 index 0000000000..ab52d346b3 --- /dev/null +++ b/tools/docker/scripts/test_ase.sh @@ -0,0 +1,44 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# shellcheck disable=SC1091 +source /opt/cp2k-toolchain/install/setup + +echo -e "\n========== Compiling CP2K ==========" +cd /workspace/cp2k +make -j VERSION=pdbg cp2k_shell + +echo -e "\n========== Installing ASE ==========" +cd /opt/ase/ +git pull +pip3 install . + +echo -e "\n========== Running ASE Tests ==========" +cd /opt/ase/ +export ASE_CP2K_COMMAND="mpiexec -np 2 /workspace/cp2k/exe/local/cp2k_shell.pdbg" + +set +e # disable error trapping for remainder of script +( +set -e # abort if error is encountered +for i in ./ase/test/cp2k/cp2k_*.py +do + echo "Running $i ..." + python3 "$i" +done +) + +EXIT_CODE=$? + +echo "" + +ASE_REVISION=$(git rev-parse --short HEAD) +if (( EXIT_CODE )); then + echo "Summary: Something is wrong with ASE commit ${ASE_REVISION}." + echo "Status: FAILED" +else + echo "Summary: ASE commit ${ASE_REVISION} works fine." + echo "Status: OK" +fi + +#EOF diff --git a/tools/docker/scripts/test_conventions.sh b/tools/docker/scripts/test_conventions.sh new file mode 100755 index 0000000000..2db9b87fdd --- /dev/null +++ b/tools/docker/scripts/test_conventions.sh @@ -0,0 +1,12 @@ +#!/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 new file mode 100755 index 0000000000..1a505503e9 --- /dev/null +++ b/tools/docker/scripts/test_coverage.sh @@ -0,0 +1,49 @@ +#!/bin/bash -e + +# author: Ole Schuett + +if (( $# != 1 )) ; then + echo "Usage: test_coverage.sh " + exit 1 +fi + +ARCH=local_coverage +VERSION=$1 + +# shellcheck disable=SC1091 +source /opt/cp2k-toolchain/install/setup + +echo -e "\n========== Running Regtests ==========" +cd /workspace/cp2k +rm -rf "obj/${ARCH}/${VERSION}"/*.gcda # remove old gcov statistics + +make ARCH="${ARCH}" VERSION="${VERSION}" TESTOPTS="${TESTOPTS}" test + +# 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 "/workspace/cp2k/obj/${ARCH}/${VERSION}"/almo_scf_types.gcda +rm -v "/workspace/cp2k/obj/${ARCH}/${VERSION}"/dbcsr_tensor_types.gcda +rm -v "/workspace/cp2k/obj/${ARCH}/${VERSION}"/mp2_types.gcda +#cd /tmp +#for i in /workspace/cp2k/obj/${ARCH}/${VERSION}/*.gcda; do +# timeout 30 gcov $i >/dev/null 2>&1 || rm -v $i +#done + +# collect coverage stats +mkdir -p /workspace/artifacts/coverage +cd /workspace/artifacts/coverage +lcov --directory "/workspace/cp2k/obj/${ARCH}/${VERSION}" --capture --output-file coverage.info > lcov.log +lcov --summary coverage.info + +# generate html report +genhtml --title "CP2K Regtests (${CP2K_REVISION})" coverage.info > genhtml.log + +# plot +LINE_COV=$(lcov --summary coverage.info | grep lines | awk '{print substr($2, 1, length($2)-1)}') +FUNC_COV=$(lcov --summary coverage.info | grep funct | awk '{print substr($2, 1, length($2)-1)}') +echo 'Plot: name="cov", title="Test Coverage", ylabel="Coverage %"' +echo "PlotPoint: name='lines', plot='cov', label='Lines', y=$LINE_COV, yerr=0" +echo "PlotPoint: name='funcs', plot='cov', label='Functions', y=$FUNC_COV, yerr=0" + +#EOF diff --git a/tools/docker/scripts/test_farming.sh b/tools/docker/scripts/test_farming.sh new file mode 100755 index 0000000000..a5048bec15 --- /dev/null +++ b/tools/docker/scripts/test_farming.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# shellcheck disable=SC1091 +source /opt/cp2k-toolchain/install/setup + +echo -e "\n========== Running Regtests ==========" +cd /workspace/cp2k +make VERSION=popt test TESTOPTS="-farming -skipunittest -skipdir TMC/regtest_ana_on_the_fly -skipdir TMC/regtest_ana_post_proc -skipdir TMC/regtest ${TESTOPTS}" + +#EOF diff --git a/tools/docker/scripts/test_formatting.sh b/tools/docker/scripts/test_formatting.sh new file mode 100755 index 0000000000..43f96d5e59 --- /dev/null +++ b/tools/docker/scripts/test_formatting.sh @@ -0,0 +1,9 @@ +#!/bin/bash -e + +# author: Ole Schuett + +echo -e "\n========== Running Formatting Test ==========" +cd /workspace/cp2k +./tools/formatting/test_formatting.sh + +#EOF diff --git a/tools/docker/scripts/test_i-pi.sh b/tools/docker/scripts/test_i-pi.sh new file mode 100755 index 0000000000..d1de70477e --- /dev/null +++ b/tools/docker/scripts/test_i-pi.sh @@ -0,0 +1,53 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# shellcheck disable=SC1091 +source /opt/cp2k-toolchain/install/setup + +echo -e "\n========== Compiling CP2K ==========" +cd /workspace/cp2k +make -j VERSION=pdbg cp2k + +echo -e "\n========== Installing i-Pi ==========" +cd /opt/i-pi +git pull +pip install . + +echo -e "\n========== Running i-Pi Tests ==========" + +cd /opt/i-pi/examples/cp2k/nvt-cl +set +e # disable error trapping for remainder of script + +# launch cp2k +( + mkdir -p run_1 + cd run_1 + echo 42 > cp2k_exit_code + sleep 2 # give i-pi some time to startup + mpiexec -np 2 /workspace/cp2k/exe/local/cp2k.pdbg ../in.cp2k + echo $? > cp2k_exit_code +) & + +# launch i-pi +sed -i "s/total_steps>1000/total_steps>10/" input.xml +/usr/local/bin/i-pi input.xml +IPI_EXIT_CODE=$? + +wait # for cp2k to shutdown +CP2K_EXIT_CODE=$(cat ./run_1/cp2k_exit_code) + +echo "" +echo "CP2K exit code: ${CP2K_EXIT_CODE}" +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" +else + echo "Summary: i-Pi commit ${IPI_REVISION} works fine." + echo "Status: OK" +fi + +#EOF diff --git a/tools/docker/scripts/test_manual.sh b/tools/docker/scripts/test_manual.sh new file mode 100755 index 0000000000..dca3d8f60d --- /dev/null +++ b/tools/docker/scripts/test_manual.sh @@ -0,0 +1,43 @@ +#!/bin/bash -e + +# author: Ole Schuett + +# shellcheck disable=SC1091 +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. +make -j VERSION="sopt" cp2k + +echo -e "\n========== Generating Manual ==========" + +mkdir -p /workspace/artifacts/manual +cd /workspace/artifacts/manual + +/workspace/cp2k/exe/local/cp2k.sopt --version +/workspace/cp2k/exe/local/cp2k.sopt --xml + +TOOLS=/workspace/cp2k/tools +cp ${TOOLS}/manual/favicon.png . +cp ${TOOLS}/manual/toggle_folding.js . + +set +e # disable error trapping for remainder of script +( +set -e # abort if error is encountered +SAXON="java -jar /usr/share/java/Saxon-HE.jar" +$SAXON -o:index.html ./cp2k_input.xml ${TOOLS}/manual/cp2k_input.xsl add_edit_links=yes +$SAXON -o:cp2k.vim ./cp2k_input.xml ${TOOLS}/input_editing/vim/vim.xsl +) +EXIT_CODE=$? + +echo "" +if (( EXIT_CODE )); then + echo "Summary: Something is wrong." + echo "Status: FAILED" +else + echo "Summary: Manual generation works fine." + echo "Status: OK" +fi + +#EOF diff --git a/tools/docker/test_python/cmd.sh b/tools/docker/scripts/test_python.sh similarity index 50% rename from tools/docker/test_python/cmd.sh rename to tools/docker/scripts/test_python.sh index ac7ac3d187..07fa4e3e86 100755 --- a/tools/docker/test_python/cmd.sh +++ b/tools/docker/scripts/test_python.sh @@ -1,62 +1,54 @@ -#!/bin/bash +#!/bin/bash -e # author: Ole Schuett -set -e - -run_selftests() { +function run_selftests { PYTHON=$1 - shift - BASEDIR=`pwd` - VERSION=`$PYTHON -V 2>&1 | tr -d '\n'` + SCRIPTS=$2 + BASEDIR=$(pwd) + VERSION=$(${PYTHON} -V 2>&1 | tr -d '\n') echo "" echo "========== Running ${VERSION} Tests ==========" #find ./src/ ./tools/ -name "*.pyc" -exec rm {} \; - for i in $@ ; do + for i in $SCRIPTS ; do set +e #disable error trapping - if [[ `head -n1 $i` =~ "python3" && "$PYTHON" != "python3" ]]; then + if [[ $(head -n1 "$i") =~ "python3" && "$PYTHON" != "python3" ]]; then echo "Skipping $i - it's Python3 only." continue fi - echo "Selftesting" $i - cd $(dirname $i) - $PYTHON -B ./$(basename $i) --selftest - if [ $? -ne 0 ]; then + echo "Selftesting $i" + cd "$(dirname "$i")" + SCRIPT=$(basename "$i") + if ! $PYTHON -B "./${SCRIPT}" --selftest ; then echo "Selftest of $i failed" ERRORS=$((ERRORS+1)) fi set -e #re-enable error trapping - cd $BASEDIR + cd "$BASEDIR" done } - #=============================================================================== -echo -e "\n========== Copying Changed Files ==========" -mkdir /opt/cp2k-local-rw/ -cp -r /opt/cp2k-local/tools /opt/cp2k-local-rw/tools -cp -r /opt/cp2k-local/src /opt/cp2k-local-rw/src -cd /opt/cp2k-local-rw/ - - ERRORS=0 +cd /workspace/cp2k + # find executable python scripts -ALL_SCRIPTS=`find ./src/ ./tools/ -name "*.py" -executable` -ESSENTIAL_SCRIPTS=`find ./tools/build_utils -name "*.py" -executable` +ALL_SCRIPTS=$(find ./src/ ./tools/ -name "*.py" -executable) +ESSENTIAL_SCRIPTS=$(find ./tools/build_utils -name "*.py" -executable) ESSENTIAL_SCRIPTS="$ESSENTIAL_SCRIPTS ./src/dbcsr/libsmm_acc/libcusmm/generate.py" # python 2.6 -run_selftests python2.6 $ESSENTIAL_SCRIPTS +run_selftests python2.6 "${ESSENTIAL_SCRIPTS}" # python 2.7 -run_selftests python2.7 $ALL_SCRIPTS +run_selftests python2.7 "${ALL_SCRIPTS}" # python 3.x -run_selftests python3 $ALL_SCRIPTS +run_selftests python3 "${ALL_SCRIPTS}" # print report -NUM_SCRIPTS=`echo $ALL_SCRIPTS | wc -w` +NUM_SCRIPTS=$(echo "${ALL_SCRIPTS}" | wc -w) echo "" echo "Summary: Checked ${NUM_SCRIPTS} Python scripts, found ${ERRORS} errors." if [ $ERRORS == 0 ]; then diff --git a/tools/docker/scripts/test_regtest.sh b/tools/docker/scripts/test_regtest.sh new file mode 100755 index 0000000000..b9d339064e --- /dev/null +++ b/tools/docker/scripts/test_regtest.sh @@ -0,0 +1,20 @@ +#!/bin/bash -e + +# author: Ole Schuett + +if (( $# != 2 )) ; then + echo "Usage: test_regtest.sh " + exit 1 +fi + +ARCH=$1 +VERSION=$2 + +# shellcheck disable=SC1091 +source /opt/cp2k-toolchain/install/setup + +echo -e "\n========== Running Regtests ==========" +cd /workspace/cp2k +make ARCH="${ARCH}" VERSION="${VERSION}" TESTOPTS="${TESTOPTS}" test + +#EOF diff --git a/tools/docker/test_aiida/Dockerfile b/tools/docker/test_aiida/Dockerfile deleted file mode 100644 index f7f129fbb2..0000000000 --- a/tools/docker/test_aiida/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -FROM cp2k/toolchain:latest - -# author: Ole Schuett - -# download and compile cp2k snapshot -WORKDIR /opt/ -RUN wget -q -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \ - unzip -q cp2k-master.zip && \ - rm cp2k-master.zip - -RUN ls -l cp2k-master/ - -WORKDIR /opt/cp2k-master/arch -RUN ln -vs /opt/cp2k-toolchain/install/arch/local* . - -WORKDIR /opt/cp2k-master -RUN source /opt/cp2k-toolchain/install/setup && \ - make -j VERSION=pdbg && \ - rm -rf lib exe - -# install Debian packages -RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && \ - apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - python-setuptools \ - python-wheel \ - python-pip \ - python-dev \ - postgresql \ - less \ - nano \ - sudo \ - ssh \ - git \ - rsync \ - && rm -rf /var/lib/apt/lists/* - -# install python packages -RUN pip install flake8 aiida ase - -# create ubuntu user with sudo powers -RUN adduser --disabled-password --gecos "" ubuntu && \ - echo "ubuntu ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers - -WORKDIR /opt/cp2k_test_aiida -COPY cmd.sh . -CMD ["./cmd.sh"] - -#EOF diff --git a/tools/docker/test_aiida/cmd.sh b/tools/docker/test_aiida/cmd.sh deleted file mode 100755 index 642303eb38..0000000000 --- a/tools/docker/test_aiida/cmd.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# author: Ole Schuett - -set -e - -echo -e "\n========== Copying Changed Files ==========" -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --exclude=/obj/ \ - --exclude=/lib/ \ - --exclude=/exe/ \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /opt/cp2k-local/ /opt/cp2k-master/ - -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /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 -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/exe/local/cp2k.pdbg "\$@" -EndOfMessage -chmod +x /usr/bin/cp2k - -echo -e "\n========== Installing AiiDA-CP2K plugin ==========" -cd /opt/ -git clone https://github.com/cp2k/aiida-cp2k.git -pip install ./aiida-cp2k/ - -echo -e "\n========== Configuring AiiDA ==========" -for i in $(dirname $(which mpirun))/* ; do ln -sf $i /usr/bin/; done -SUDO="sudo -u ubuntu -H" -cd /opt/aiida-cp2k/test/ -$SUDO ./configure_aiida.sh - -echo -e "\n========== Running AiiDA-CP2K Tests ==========" -cd /opt/aiida-cp2k/test/ - -set +e # disable error trapping for remainder of script -( -set -e # abort on error -$SUDO ./run_tests.sh -) - -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" -else - echo "Summary: aiida-cp2k commit ${AIIDA_COMMIT} works fine." - echo "Status: OK" -fi - -#EOF diff --git a/tools/docker/test_ase/Dockerfile b/tools/docker/test_ase/Dockerfile deleted file mode 100644 index b1ea295ae5..0000000000 --- a/tools/docker/test_ase/Dockerfile +++ /dev/null @@ -1,42 +0,0 @@ -FROM cp2k/toolchain:latest - -# author: Ole Schuett - -# download and compile cp2k snapshot -WORKDIR /opt/ -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/arch -RUN ln -vs /opt/cp2k-toolchain/install/arch/local* . - -WORKDIR /opt/cp2k-master -RUN source /opt/cp2k-toolchain/install/setup && \ - make -j VERSION=pdbg && \ - rm -rf lib exe - -# install Debian packages -RUN apt-get update && apt-get install -y --no-install-recommends \ - python3 \ - python3-dev \ - python3-pip \ - python3-wheel \ - python3-setuptools \ - build-essential \ - rsync \ - git \ - && rm -rf /var/lib/apt/lists/* - -# install python packages -RUN pip3 install numpy scipy matplotlib flask - -# clone ase reprository -WORKDIR /opt/ -RUN git clone https://gitlab.com/ase/ase.git - -WORKDIR /opt/cp2k_test_ase -COPY cmd.sh . -CMD ["./cmd.sh"] - -#EOF diff --git a/tools/docker/test_ase/cmd.sh b/tools/docker/test_ase/cmd.sh deleted file mode 100755 index dc6a921a86..0000000000 --- a/tools/docker/test_ase/cmd.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -# author: Ole Schuett - -set -e - -echo -e "\n========== Copying Changed Files ==========" -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --exclude=/obj/ \ - --exclude=/lib/ \ - --exclude=/exe/ \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /opt/cp2k-local/ /opt/cp2k-master/ - -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /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 -make -j VERSION=pdbg cp2k_shell - -echo -e "\n========== Installing ASE ==========" -cd /opt/ase/ -git pull -pip3 install . - -echo -e "\n========== Running ASE Tests ==========" -cd /opt/ase/ -export ASE_CP2K_COMMAND="mpiexec -np 2 /opt/cp2k-master/exe/local/cp2k_shell.pdbg" - -set +e # disable error trapping for remainder of script -( -set -e # abort if error is encountered -for i in ./ase/test/cp2k/cp2k_*.py -do - echo "Running $i ..." - python3 $i -done -) - -EXIT_CODE=$? - -echo "" - -ASE_REVISION=`git rev-parse --short HEAD` -if (( $EXIT_CODE )); then - echo "Summary: Something is wrong with ASE commit ${ASE_REVISION}." - echo "Status: FAILED" -else - echo "Summary: ASE commit ${ASE_REVISION} works fine." - echo "Status: OK" -fi - -#EOF diff --git a/tools/docker/test_conventions/Dockerfile b/tools/docker/test_conventions/Dockerfile deleted file mode 100644 index 4a2a209849..0000000000 --- a/tools/docker/test_conventions/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM cp2k/toolchain:latest - -# author: Ole Schuett - -# download and compile cp2k snapshot -WORKDIR /opt/ -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/arch -RUN ln -vs /opt/cp2k-toolchain/install/arch/local* . - -WORKDIR /opt/cp2k-master/tools/conventions/ -RUN source /opt/cp2k-toolchain/install/setup && \ - ./test_conventions.sh && \ - rm -rf ../lib/ ../exe/ - -# install Debian packages -RUN apt-get update && apt-get install -y --no-install-recommends \ - rsync \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /opt/cp2k_test_conventions -COPY cmd.sh . -CMD ["./cmd.sh"] - -#EOF diff --git a/tools/docker/test_conventions/cmd.sh b/tools/docker/test_conventions/cmd.sh deleted file mode 100755 index 5e37218538..0000000000 --- a/tools/docker/test_conventions/cmd.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# author: Ole Schuett - -set -e - -echo -e "\n========== Copying Changed Files ==========" -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --exclude=/obj/ \ - --exclude=/lib/ \ - --exclude=/exe/ \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /opt/cp2k-local/ /opt/cp2k-master/ - -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /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/tools/conventions/ -#TODO port to Python3 -./test_conventions.sh - -#EOF diff --git a/tools/docker/test_coverage-pdbg b/tools/docker/test_coverage-pdbg deleted file mode 120000 index 4fc135f0e9..0000000000 --- a/tools/docker/test_coverage-pdbg +++ /dev/null @@ -1 +0,0 @@ -regtest \ No newline at end of file diff --git a/tools/docker/test_coverage-sdbg b/tools/docker/test_coverage-sdbg deleted file mode 120000 index 4fc135f0e9..0000000000 --- a/tools/docker/test_coverage-sdbg +++ /dev/null @@ -1 +0,0 @@ -regtest \ No newline at end of file diff --git a/tools/docker/test_farming b/tools/docker/test_farming deleted file mode 120000 index 991a8f09f4..0000000000 --- a/tools/docker/test_farming +++ /dev/null @@ -1 +0,0 @@ -regtest/ \ No newline at end of file diff --git a/tools/docker/test_formatting/Dockerfile b/tools/docker/test_formatting/Dockerfile deleted file mode 100644 index 330b16e575..0000000000 --- a/tools/docker/test_formatting/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM ubuntu:rolling - -# author: Ole Schuett - -RUN apt-get update && apt-get install -y --no-install-recommends \ - python \ - ca-certificates \ - wget \ - unzip \ - less \ - make \ - rsync \ - libfindbin-libs-perl \ -&& rm -rf /var/lib/apt/lists/* - -WORKDIR /opt/ -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 -RUN ./tools/formatting/test_formatting.sh - -WORKDIR /opt/cp2k_test_formatting -COPY cmd.sh . -CMD ["./cmd.sh"] - -#EOF diff --git a/tools/docker/test_formatting/cmd.sh b/tools/docker/test_formatting/cmd.sh deleted file mode 100755 index 64edb1071b..0000000000 --- a/tools/docker/test_formatting/cmd.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# author: Ole Schuett - -set -e - -echo -e "\n========== Copying Changed Files ==========" -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --exclude=/obj/ \ - --exclude=/lib/ \ - --exclude=/exe/ \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /opt/cp2k-local/ /opt/cp2k-master/ - -echo -e "\n========== Running Formatting Test ==========" -cd /opt/cp2k-master -./tools/formatting/test_formatting.sh - -#EOF diff --git a/tools/docker/test_i-pi/Dockerfile b/tools/docker/test_i-pi/Dockerfile deleted file mode 100644 index 8d78239265..0000000000 --- a/tools/docker/test_i-pi/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -FROM cp2k/toolchain:latest - -# author: Ole Schuett - -# download and compile cp2k snapshot -WORKDIR /opt/ -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/arch -RUN ln -vs /opt/cp2k-toolchain/install/arch/local* . - -WORKDIR /opt/cp2k-master -RUN source /opt/cp2k-toolchain/install/setup && \ - make -j VERSION=pdbg && \ - rm -rf lib exe - -# install Debian packages -RUN apt-get update && apt-get install -y --no-install-recommends \ - python \ - python-pip \ - python-wheel \ - python-setuptools \ - rsync \ - git \ - && rm -rf /var/lib/apt/lists/* - -# install python packages -RUN pip install numpy - -# clone i-pi repository (200MB!) -WORKDIR /opt/ -RUN git clone https://github.com/i-pi/i-pi.git - -WORKDIR /opt/cp2k_test_i-pi -COPY cmd.sh . -CMD ["./cmd.sh"] - -#EOF - diff --git a/tools/docker/test_i-pi/cmd.sh b/tools/docker/test_i-pi/cmd.sh deleted file mode 100755 index bc80503416..0000000000 --- a/tools/docker/test_i-pi/cmd.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash - -# author: Ole Schuett - -set -e - -echo -e "\n========== Copying Changed Files ==========" -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --exclude=/obj/ \ - --exclude=/lib/ \ - --exclude=/exe/ \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /opt/cp2k-local/ /opt/cp2k-master/ - -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /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 -make -j VERSION=pdbg cp2k - -echo -e "\n========== Installing i-Pi ==========" -cd /opt/i-pi -git pull -pip install . - -echo -e "\n========== Running i-Pi Tests ==========" - -cd /opt/i-pi/examples/cp2k/nvt-cl -set +e # disable error trapping for remainder of script - -# launch cp2k -( - mkdir -p run_1 - cd run_1 - echo 42 > cp2k_exit_code - sleep 2 # give i-pi some time to startup - mpiexec -np 2 /opt/cp2k-master/exe/local/cp2k.pdbg ../in.cp2k - echo $? > cp2k_exit_code -) & - -# launch i-pi -sed -i "s/total_steps>1000/total_steps>10/" input.xml -/usr/local/bin/i-pi input.xml -IPI_EXIT_CODE=$? - -wait # for cp2k to shutdown -CP2K_EXIT_CODE=`cat ./run_1/cp2k_exit_code` - -echo "" -echo "CP2K exit code: " $CP2K_EXIT_CODE -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" -else - echo "Summary: i-Pi commit ${IPI_REVISION} works fine." - echo "Status: OK" -fi - -#EOF - diff --git a/tools/docker/test_manual/Dockerfile b/tools/docker/test_manual/Dockerfile deleted file mode 100644 index 0aeafea5d8..0000000000 --- a/tools/docker/test_manual/Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -FROM cp2k/toolchain:latest - -# author: Ole Schuett - -# download and compile cp2k snapshot -WORKDIR /opt/ -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/arch -RUN ln -vs /opt/cp2k-toolchain/install/arch/local* . - -WORKDIR /opt/cp2k-master -RUN source /opt/cp2k-toolchain/install/setup && \ - make -j VERSION="sopt" cp2k && \ - rm -rf lib exe - -# install Debian packages -RUN apt-get update && apt-get install -y --no-install-recommends \ - default-jre-headless \ - libsaxonhe-java \ - rsync \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /opt/cp2k_test_manual -COPY cmd.sh . -CMD ["./cmd.sh"] - -#EOF diff --git a/tools/docker/test_manual/cmd.sh b/tools/docker/test_manual/cmd.sh deleted file mode 100755 index 13b57d4ba1..0000000000 --- a/tools/docker/test_manual/cmd.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -# author: Ole Schuett - -set -e - -echo -e "\n========== Copying Changed Files ==========" -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --exclude=/obj/ \ - --exclude=/lib/ \ - --exclude=/exe/ \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /opt/cp2k-local/ /opt/cp2k-master/ - -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /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 -source ./install/setup - -echo -e "\n========== Compiling CP2K ==========" -cd /opt/cp2k-master -echo ${CP2K_REVISION} > REVISION -touch src/cp2k_info.F # ensure latest REVISION is picked up. -make -j VERSION="sopt" cp2k - -echo -e "\n========== Generating Manual ==========" - -mkdir -p /opt/cp2k_test_artifacts/manual -cd /opt/cp2k_test_artifacts/manual - -/opt/cp2k-master/exe/local/cp2k.sopt --version -/opt/cp2k-master/exe/local/cp2k.sopt --xml - -TOOLS=/opt/cp2k-master/tools -cp ${TOOLS}/manual/favicon.png . -cp ${TOOLS}/manual/toggle_folding.js . - -set +e # disable error trapping for remainder of script -( -set -e # abort if error is encountered -SAXON="java -jar /usr/share/java/Saxon-HE.jar" -$SAXON -o:index.html ./cp2k_input.xml ${TOOLS}/manual/cp2k_input.xsl add_edit_links=yes -$SAXON -o:cp2k.vim ./cp2k_input.xml ${TOOLS}/input_editing/vim/vim.xsl -) -EXIT_CODE=$? - -echo "" -if (( $EXIT_CODE )); then - echo "Summary: Something is wrong." - echo "Status: FAILED" -else - echo "Summary: Manual generation works fine." - echo "Status: OK" -fi - -#EOF diff --git a/tools/docker/test_minimal b/tools/docker/test_minimal deleted file mode 120000 index 991a8f09f4..0000000000 --- a/tools/docker/test_minimal +++ /dev/null @@ -1 +0,0 @@ -regtest/ \ No newline at end of file diff --git a/tools/docker/test_pdbg b/tools/docker/test_pdbg deleted file mode 120000 index 991a8f09f4..0000000000 --- a/tools/docker/test_pdbg +++ /dev/null @@ -1 +0,0 @@ -regtest/ \ No newline at end of file diff --git a/tools/docker/test_popt b/tools/docker/test_popt deleted file mode 120000 index 991a8f09f4..0000000000 --- a/tools/docker/test_popt +++ /dev/null @@ -1 +0,0 @@ -regtest/ \ No newline at end of file diff --git a/tools/docker/test_psmp b/tools/docker/test_psmp deleted file mode 120000 index 991a8f09f4..0000000000 --- a/tools/docker/test_psmp +++ /dev/null @@ -1 +0,0 @@ -regtest/ \ No newline at end of file diff --git a/tools/docker/test_python/Dockerfile b/tools/docker/test_python/Dockerfile deleted file mode 100644 index 0de017c3d2..0000000000 --- a/tools/docker/test_python/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -FROM ubuntu:rolling - -# author: Ole Schuett - -# TODO: maybe use conda instead? - -RUN apt-get update && apt-get install -y --no-install-recommends \ - python \ - python3 \ - python-pip \ - python3-pip \ - python-wheel \ - python3-wheel \ - python-setuptools \ - python3-setuptools \ - python-dev \ - python3-dev \ - build-essential \ - ca-certificates \ - wget \ -&& rm -rf /var/lib/apt/lists/* - -RUN pip install numpy matplotlib requests -RUN pip3 install numpy matplotlib requests - -# install python2.6 -WORKDIR /opt/ -RUN wget -q https://www.python.org/ftp/python/2.6.9/Python-2.6.9.tgz && \ - tar -xzf Python-2.6.9.tgz && \ - cd Python-2.6.9 && \ - ./configure && \ - make -j && \ - make install && \ - cd .. && \ - rm -rf Python-2.6.9* - -WORKDIR /opt/cp2k_test_python -COPY cmd.sh . -CMD ["./cmd.sh"] - -#EOF diff --git a/tools/docker/test_scaling/Dockerfile b/tools/docker/test_scaling/Dockerfile deleted file mode 100644 index dabed64f99..0000000000 --- a/tools/docker/test_scaling/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM cp2k/toolchain:latest - -# author: Ole Schuett - -# download and compile cp2k snapshot -WORKDIR /opt/ -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/arch -RUN ln -vs /opt/cp2k-toolchain/install/arch/local* . - -WORKDIR /opt/cp2k-master -RUN source /opt/cp2k-toolchain/install/setup && \ - make -j VERSION="popt psmp ssmp" cp2k && \ - rm -rf lib exe - -# install Debian packages -RUN apt-get update && apt-get install -y --no-install-recommends \ - python3-numpy \ - rsync \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /opt/cp2k_test_scaling -COPY cmd.sh . -CMD ["./cmd.sh"] - -#EOF diff --git a/tools/docker/test_scaling/cmd.sh b/tools/docker/test_scaling/cmd.sh deleted file mode 100755 index 9428dc8d08..0000000000 --- a/tools/docker/test_scaling/cmd.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -# author: Ole Schuett - -set -e - -echo -e "\n========== Copying Changed Files ==========" -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --exclude=/obj/ \ - --exclude=/lib/ \ - --exclude=/exe/ \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /opt/cp2k-local/ /opt/cp2k-master/ - -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /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 -make -j VERSION="popt psmp ssmp" cp2k - -echo -e "\n========== Running Scaling Test ==========" -cd tests/QS/benchmark -python3 ../../../tools/regtesting/test_scaling.py 30.0 ../../../exe/local/ H2O-32.inp -550.50556087853511 - -#EOF diff --git a/tools/docker/test_sdbg b/tools/docker/test_sdbg deleted file mode 120000 index 991a8f09f4..0000000000 --- a/tools/docker/test_sdbg +++ /dev/null @@ -1 +0,0 @@ -regtest/ \ No newline at end of file diff --git a/tools/docker/test_sopt b/tools/docker/test_sopt deleted file mode 120000 index 991a8f09f4..0000000000 --- a/tools/docker/test_sopt +++ /dev/null @@ -1 +0,0 @@ -regtest/ \ No newline at end of file diff --git a/tools/docker/test_ssmp b/tools/docker/test_ssmp deleted file mode 120000 index 991a8f09f4..0000000000 --- a/tools/docker/test_ssmp +++ /dev/null @@ -1 +0,0 @@ -regtest/ \ No newline at end of file diff --git a/tools/docker/test_ubuntu/Dockerfile b/tools/docker/test_ubuntu/Dockerfile deleted file mode 100644 index 9f38cf615b..0000000000 --- a/tools/docker/test_ubuntu/Dockerfile +++ /dev/null @@ -1,60 +0,0 @@ -FROM ubuntu:rolling - -# author: Ole Schuett - -# install Ubuntu packages -RUN apt-get update && apt-get install -y \ - build-essential \ - ca-certificates \ - gfortran \ - python \ - git \ - wget \ - less \ - unzip \ - fftw3-dev \ - libopenblas-dev \ - liblapack-dev \ - libint-dev \ - rsync \ - --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* - -RUN ln -sf bash /bin/sh - -# download and compile cp2k snapshot -WORKDIR /opt/ -RUN wget -q -O cp2k-master.zip https://github.com/cp2k/cp2k/archive/master.zip && \ - unzip -q cp2k-master.zip && \ - rm cp2k-master.zip - -# build toolchain relying mostly on ubuntu packages -WORKDIR /opt/cp2k-master/tools/toolchain -RUN ./install_cp2k_toolchain.sh \ - --mpi-mode=no \ - --with-gcc=system \ - --with-binutils=system \ - --with-make=system \ - --with-fftw=system \ - --with-openblas=system \ - --with-reflapack=system \ - --with-libint=system \ - --with-libxc=install \ - --with-libxsmm=install \ - && rm -rf ./build - -WORKDIR /opt/cp2k-master/arch -RUN ln -vs ../tools/toolchain/install/arch/local* . - -# run regtests which lack fixed reference value -WORKDIR /opt/cp2k-master -RUN source ./tools/toolchain/install/setup && \ - make -j VERSION=ssmp && \ - make test VERSION=ssmp 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/local/ssmp/TEST-* - -WORKDIR /opt/cp2k_test_ubuntu -COPY ./cmd.sh . -CMD ["./cmd.sh"] - -#EOF diff --git a/tools/docker/test_ubuntu/cmd.sh b/tools/docker/test_ubuntu/cmd.sh deleted file mode 100755 index 655a9b61f0..0000000000 --- a/tools/docker/test_ubuntu/cmd.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# author: Ole Schuett -set -e - -echo -e "\n========== Copying Changed Files ==========" -rsync --exclude="*~" \ - --exclude=".*/" \ - --exclude="*.pyc" \ - --exclude=/obj/ \ - --exclude=/lib/ \ - --exclude=/exe/ \ - --executability \ - --ignore-times \ - --update \ - --verbose \ - --recursive \ - --checksum \ - /opt/cp2k-local/ /opt/cp2k-master/ - -echo -e "\n========== Updating Toolchain ==========" -cd /opt/cp2k-master/tools/toolchain -./install_cp2k_toolchain.sh \ - --mpi-mode=no \ - --with-gcc=system \ - --with-binutils=system \ - --with-make=system \ - --with-fftw=system \ - --with-openblas=system \ - --with-reflapack=system \ - --with-libint=system \ - --with-libxc=install \ - --with-libxsmm=install - -echo -e "\n========== Running Regtests ==========" -source /opt/cp2k-master/tools/toolchain/install/setup -cd /opt/cp2k-master -make VERSION=ssmp test TESTOPTS="${TESTOPTS}" - -#EOF diff --git a/tools/docker/test_valgrind-pdbg b/tools/docker/test_valgrind-pdbg deleted file mode 120000 index 991a8f09f4..0000000000 --- a/tools/docker/test_valgrind-pdbg +++ /dev/null @@ -1 +0,0 @@ -regtest/ \ No newline at end of file diff --git a/tools/docker/test_valgrind-sdbg b/tools/docker/test_valgrind-sdbg deleted file mode 120000 index 991a8f09f4..0000000000 --- a/tools/docker/test_valgrind-sdbg +++ /dev/null @@ -1 +0,0 @@ -regtest/ \ No newline at end of file