@@ -90,15 +90,23 @@ if [[ ! -z ${SINGULARITY_CACHEDIR} ]]; then
9090 export SINGULARITY_CACHEDIR
9191fi
9292
93- echo -n " setting \$ STORAGE by replacing any var in '${LOCAL_TMP} ' -> "
94- # replace any env variable in ${LOCAL_TMP} with its
95- # current value (e.g., a value that is local to the job)
96- STORAGE=$( envsubst <<< ${LOCAL_TMP} )
97- echo " '${STORAGE} '"
93+ if [[ -z " ${TMPDIR} " ]]; then
94+ echo -n " setting \$ STORAGE by replacing any var in '${LOCAL_TMP} ' -> "
95+ # replace any env variable in ${LOCAL_TMP} with its
96+ # current value (e.g., a value that is local to the job)
97+ STORAGE=$( envsubst <<< ${LOCAL_TMP} )
98+ else
99+ STORAGE=${TMPDIR}
100+ fi
101+ echo " bot/build.sh: STORAGE='${STORAGE} '"
98102
99103# make sure ${STORAGE} exists
100104mkdir -p ${STORAGE}
101105
106+ # Make sure ${STORAGE} gets bind-mounted
107+ # This will make sure that any subsequent jobs that create dirs or files under STORAGE have access to it in the container
108+ export SINGULARITY_BIND=" ${SINGULARITY_BIND} ,${STORAGE} "
109+
102110# make sure the base tmp storage is unique
103111JOB_STORAGE=$( mktemp --directory --tmpdir=${STORAGE} bot_job_tmp_XXX)
104112echo " bot/build.sh: created unique base tmp storage directory at ${JOB_STORAGE} "
287295 TARBALL_STEP_ARGS+=(" --resume" " ${REMOVAL_TMPDIR} " )
288296fi
289297
298+ # Make sure we define storage, so that the TMPDIR is set to this in eessi_container.sh
299+ TARBALL_STEP_ARGS+=(" --storage" " ${STORAGE} " )
300+
290301timestamp=$( date +%s)
291302# to set EESSI_VERSION we need to source init/eessi_defaults now
292303source $software_layer_dir /init/eessi_defaults
0 commit comments