Skip to content

Commit bc119ee

Browse files
author
Caspar van Leeuwen
committed
Do bind-mount of TMPDIR in eessi_container instead, and check that the TMP_IN_CONTAINER doesn't already contain that prefix
1 parent 174354a commit bc119ee

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

bot/build.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ echo "bot/build.sh: STORAGE='${STORAGE}'"
103103
# make sure ${STORAGE} exists
104104
mkdir -p ${STORAGE}
105105

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-
110106
# make sure the base tmp storage is unique
111107
JOB_STORAGE=$(mktemp --directory --tmpdir=${STORAGE} bot_job_tmp_XXX)
112108
echo "bot/build.sh: created unique base tmp storage directory at ${JOB_STORAGE}"
@@ -295,9 +291,6 @@ else
295291
TARBALL_STEP_ARGS+=("--resume" "${REMOVAL_TMPDIR}")
296292
fi
297293

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-
301294
timestamp=$(date +%s)
302295
# to set EESSI_VERSION we need to source init/eessi_defaults now
303296
source $software_layer_dir/init/eessi_defaults

eessi_container.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,15 @@ BIND_PATHS="${EESSI_CVMFS_VAR_LIB}:/var/lib/cvmfs,${EESSI_CVMFS_VAR_RUN}:/var/ru
529529

530530
# provide a '/tmp' inside the container
531531
BIND_PATHS="${BIND_PATHS},${EESSI_TMPDIR}:${TMP_IN_CONTAINER}"
532+
533+
# if TMPDIR is not empty and if TMP_IN_CONTAINER is not a prefix of TMPDIR, we need to add a bind mount for TMPDIR
534+
if [[ ! -z ${TMPDIR} && ${TMP_IN_CONTAINER} != ${TMPDIR}* ]]; then
535+
msg="TMPDIR is not empty (${TMPDIR}) and TMP_IN_CONTAINER (${TMP_IN_CONTAINER}) is not a prefix of TMPDIR:"
536+
msg="${msg} adding bind mount for TMPDIR"
537+
echo "${msg}"
538+
BIND_PATHS="${BIND_PATHS},${TMPDIR}"
539+
fi
540+
532541
if [[ ! -z ${EXTRA_BIND_PATHS} ]]; then
533542
BIND_PATHS="${BIND_PATHS},${EXTRA_BIND_PATHS}"
534543
fi

0 commit comments

Comments
 (0)