@@ -90,15 +90,23 @@ if [[ ! -z ${SINGULARITY_CACHEDIR} ]]; then
90
90
export SINGULARITY_CACHEDIR
91
91
fi
92
92
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} '"
98
102
99
103
# make sure ${STORAGE} exists
100
104
mkdir -p ${STORAGE}
101
105
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
+
102
110
# make sure the base tmp storage is unique
103
111
JOB_STORAGE=$( mktemp --directory --tmpdir=${STORAGE} bot_job_tmp_XXX)
104
112
echo " bot/build.sh: created unique base tmp storage directory at ${JOB_STORAGE} "
288
296
TARBALL_STEP_ARGS+=(" --resume" " ${REMOVAL_TMPDIR} " )
289
297
fi
290
298
299
+ # Make sure we define storage, so that the TMPDIR is set to this in eessi_container.sh
300
+ TARBALL_STEP_ARGS+=(" --storage" " ${STORAGE} " )
301
+
291
302
timestamp=$( date +%s)
292
303
# to set EESSI_VERSION we need to source init/eessi_defaults now
293
304
source $software_layer_dir /init/eessi_defaults
0 commit comments