From de06aab38e8e82d695a4134c71f3bcec34fd2c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 5 Dec 2024 13:00:19 +0100 Subject: [PATCH] reorder code for resuming from a dir/tarball, always create job storage dir --- bot/test.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bot/test.sh b/bot/test.sh index 0c107636bb..43e94bf158 100755 --- a/bot/test.sh +++ b/bot/test.sh @@ -101,8 +101,14 @@ fi # try to determine tmp directory from build job RESUME_DIR=$(grep 'Using .* as tmp directory' slurm-${SLURM_JOBID}.out | head -1 | awk '{print $2}') - if [[ -z ${RESUME_DIR} ]]; then + RESUME_TGZ=${PWD}/previous_tmp/build_step/$(ls previous_tmp/build_step) + if [[ -z ${RESUME_TGZ} ]]; then + echo "bot/test.sh: no information about tmp directory and tarball of build step; --> giving up" + exit 2 + fi +fi + echo -n "setting \$STORAGE by replacing any var in '${LOCAL_TMP}' -> " # replace any env variable in ${LOCAL_TMP} with its # current value (e.g., a value that is local to the job) @@ -116,13 +122,6 @@ if [[ -z ${RESUME_DIR} ]]; then JOB_STORAGE=$(mktemp --directory --tmpdir=${STORAGE} bot_job_tmp_XXX) echo "bot/test.sh: created unique base tmp storage directory at ${JOB_STORAGE}" - RESUME_TGZ=${PWD}/previous_tmp/build_step/$(ls previous_tmp/build_step) - if [[ -z ${RESUME_TGZ} ]]; then - echo "bot/test.sh: no information about tmp directory and tarball of build step; --> giving up" - exit 2 - fi -fi - # obtain list of modules to be loaded LOAD_MODULES=$(cfg_get_value "site_config" "load_modules") echo "bot/test.sh: LOAD_MODULES='${LOAD_MODULES}'"