Skip to content

Commit

Permalink
reorder code for resuming from a dir/tarball, always create job stora…
Browse files Browse the repository at this point in the history
…ge dir
  • Loading branch information
bedroge committed Dec 5, 2024
1 parent ebad04b commit de06aab
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions bot/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}'"
Expand Down

0 comments on commit de06aab

Please sign in to comment.