Skip to content

Commit

Permalink
move block of code that sets $STORAGE and $JOB_STORAGE out of if stat…
Browse files Browse the repository at this point in the history
…ement
  • Loading branch information
bedroge committed Dec 6, 2024
1 parent 5927dae commit e4c8b04
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions bot/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,26 @@ fi
RESUME_DIR=$(grep 'Using .* as tmp directory' slurm-${SLURM_JOBID}.out | head -1 | awk '{print $2}')

if [[ -z ${RESUME_DIR} ]]; then
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)
STORAGE=$(envsubst <<< ${LOCAL_TMP})
echo "'${STORAGE}'"

# make sure ${STORAGE} exists
mkdir -p ${STORAGE}

# make sure the base tmp storage is unique
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

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)
STORAGE=$(envsubst <<< ${LOCAL_TMP})
echo "'${STORAGE}'"

# make sure ${STORAGE} exists
mkdir -p ${STORAGE}

# make sure the base tmp storage is unique
JOB_STORAGE=$(mktemp --directory --tmpdir=${STORAGE} bot_job_tmp_XXX)
echo "bot/test.sh: created unique base tmp storage directory at ${JOB_STORAGE}"

# 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 e4c8b04

Please sign in to comment.