From a0eb0b69be2b58428b95c736d5655fcd10a65f46 Mon Sep 17 00:00:00 2001 From: Alistair Adcroft Date: Wed, 13 Jan 2021 12:50:03 -0500 Subject: [PATCH] Always stream job logs in gitlab pipeline - When a batch job fails we used to see the job logs but we suspect this behavior changed a long time ago. This commit intercepts an error from the sbatch command and causes the pipeline to fail only after streaming the log. --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 40b2705995..1f9768a6a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -117,8 +117,9 @@ run: - time tar zxf $CACHE_DIR/build-pgi-repro-$CI_PIPELINE_ID.tgz # time tar zxf $CACHE_DIR/build-gnu-debug-$CI_PIPELINE_ID.tgz - (echo '#!/bin/tcsh';echo 'make -f MRS/Makefile.tests all') > job.sh - - sbatch --clusters=c3,c4 --nodes=29 --time=0:34:00 --account=gfdl_o --qos=debug --job-name=mom6_regressions --output=log.$CI_PIPELINE_ID --wait job.sh + - sbatch --clusters=c3,c4 --nodes=29 --time=0:34:00 --account=gfdl_o --qos=debug --job-name=mom6_regressions --output=log.$CI_PIPELINE_ID --wait job.sh || MJOB_RETURN_STATE=Fail - cat log.$CI_PIPELINE_ID + - test -z "$MJOB_RETURN_STATE" - test -f restart_results_gnu.tar.gz - time tar zvcf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz *.tar.gz