Skip to content

Commit

Permalink
Docker: Copy logs into artifacts after failure
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Dec 12, 2023
1 parent 530e040 commit 47e8414
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 6 deletions.
2 changes: 2 additions & 0 deletions tools/docker/scripts/test_aiida.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ if make -j VERSION=sdbg &> make.out; then
else
echo -e "failed.\n\n"
tail -n 100 make.out
mkdir -p /workspace/artifacts/
cp make.out /workspace/artifacts/
echo -e "\nSummary: Compilation failed."
echo -e "Status: FAILED\n"
exit 0
Expand Down
2 changes: 2 additions & 0 deletions tools/docker/scripts/test_ase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ if make -j VERSION=sdbg &> make.out; then
else
echo -e "failed.\n\n"
tail -n 100 make.out
mkdir -p /workspace/artifacts/
cp make.out /workspace/artifacts/
echo -e "\nSummary: Compilation failed."
echo -e "Status: FAILED\n"
exit 0
Expand Down
2 changes: 2 additions & 0 deletions tools/docker/scripts/test_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ if make -j ARCH="${ARCH}" VERSION="${VERSION}" &> make.out; then
else
echo -e "failed.\n\n"
tail -n 100 make.out
mkdir -p /workspace/artifacts/
cp make.out /workspace/artifacts/
echo -e "\nSummary: Compilation failed."
echo -e "Status: FAILED\n"
fi
Expand Down
2 changes: 2 additions & 0 deletions tools/docker/scripts/test_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ if make -j ARCH="${ARCH}" VERSION="${VERSION}" &> make.out; then
else
echo -e "failed.\n\n"
tail -n 100 make.out
mkdir -p /workspace/artifacts/
cp make.out /workspace/artifacts/
echo -e "\nSummary: Compilation failed."
echo -e "Status: FAILED\n"
exit 0
Expand Down
2 changes: 2 additions & 0 deletions tools/docker/scripts/test_doxygen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ cd /opt/cp2k
if ! make doxygen &> make.out; then
echo -e "failed.\n\n"
tail -n 100 make.out
mkdir -p /workspace/artifacts/
cp make.out /workspace/artifacts/
echo -e "\nSummary: Doxygen generation failed."
echo -e "Status: FAILED\n"
exit 0
Expand Down
18 changes: 12 additions & 6 deletions tools/docker/scripts/test_gromacs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ source /opt/cp2k-toolchain/install/setup

cd /opt/cp2k
echo -n "Compiling libcp2k... "
if make -j VERSION=sdbg libcp2k &> make.out; then
if make -j VERSION=sdbg libcp2k &> cp2k_make.out; then
echo "done."
else
echo -e "failed.\n\n"
tail -n 100 make.out
tail -n 100 cp2k_make.out
mkdir -p /workspace/artifacts/
cp cp2k_make.out /workspace/artifacts/
echo -e "\nSummary: Compiling libcp2k failed."
echo -e "Status: FAILED\n"
exit 0
Expand All @@ -34,23 +36,27 @@ if cmake .. \
-DGMXAPI=OFF \
-DGMX_CP2K=ON \
-DCP2K_DIR="/opt/cp2k/lib/local/sdbg/" \
&> cmake.out; then
&> gromacs_cmake.out; then
echo "done."
else
echo -e "failed.\n\n"
tail -n 100 cmake.out
tail -n 100 gromacs_cmake.out
mkdir -p /workspace/artifacts/
cp gromacs_cmake.out /workspace/artifacts/
echo -e "\nSummary: Configuring Gromacs failed."
echo -e "Status: FAILED\n"
exit 0
fi

echo -n "Compiling Gromacs... "
if make -j 32 all qmmm_applied_forces-test &> make.out; then
if make -j 32 all qmmm_applied_forces-test &> gromacs_make.out; then
echo -e "done.\n\n"
./bin/gmx --version
else
echo -e "failed.\n\n"
tail -n 100 make.out
tail -n 100 gromacs_make.out
mkdir -p /workspace/artifacts/
cp gromacs_make.out /workspace/artifacts/
echo -e "\nSummary: Compiling Gromacs failed."
echo -e "Status: FAILED\n"
exit 0
Expand Down
2 changes: 2 additions & 0 deletions tools/docker/scripts/test_i-pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ if make -j VERSION=sdbg &> make.out; then
else
echo -e "failed.\n\n"
tail -n 100 make.out
mkdir -p /workspace/artifacts/
cp make.out /workspace/artifacts/
echo -e "\nSummary: Compilation failed."
echo -e "Status: FAILED\n"
exit 0
Expand Down
2 changes: 2 additions & 0 deletions tools/docker/scripts/test_manual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ if make -j VERSION=psmp &> make.out; then
else
echo -e "failed.\n\n"
tail -n 100 make.out
mkdir -p /workspace/artifacts/
cp make.out /workspace/artifacts/
echo -e "\nSummary: Compilation failed."
echo -e "Status: FAILED\n"
exit 0
Expand Down
2 changes: 2 additions & 0 deletions tools/docker/scripts/test_misc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ function run_test {
else
echo -e "failed.\n\n"
tail -n 100 test.out
mkdir -p /workspace/artifacts/
cp test.out /workspace/artifacts/
echo -e "\nSummary: Test \"${TEST_COMMAND[*]}\" failed."
echo -e "Status: FAILED\n"
exit 0
Expand Down
1 change: 1 addition & 0 deletions tools/docker/scripts/test_performance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ if make -j ARCH="${ARCH}" VERSION="psmp" &> make.out; then
else
echo -e "failed.\n\n"
tail -n 100 make.out
cp make.out /workspace/artifacts/
echo -e "\nSummary: Compilation failed."
echo -e "Status: FAILED\n"
exit 0
Expand Down
2 changes: 2 additions & 0 deletions tools/docker/scripts/test_regtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ if make -j ARCH="${ARCH}" VERSION="${VERSION}" &> make.out; then
else
echo -e "failed.\n\n"
tail -n 100 make.out
mkdir -p /workspace/artifacts/
cp make.out /workspace/artifacts/
echo -e "\nSummary: Compilation failed."
echo -e "Status: FAILED\n"
exit 0
Expand Down
2 changes: 2 additions & 0 deletions tools/docker/scripts/test_regtest_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ if ninja --verbose &> ninja.log; then
else
echo -e "failed.\n\n"
tail -n 100 ninja.log
mkdir -p /workspace/artifacts/
cp ninja.out /workspace/artifacts/
echo -e "\nSummary: Compilation failed."
echo -e "Status: FAILED\n"
exit 0
Expand Down

0 comments on commit 47e8414

Please sign in to comment.