From 174354a026d0ea693d7da4b658cfb4274ada3dbb Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 12 Feb 2025 03:00:22 +0100 Subject: [PATCH 1/3] Make sure that the TMPDIR is used as STORAGE if it is set --- bot/build.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/bot/build.sh b/bot/build.sh index 29444a32c2..91d9721515 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -90,15 +90,23 @@ if [[ ! -z ${SINGULARITY_CACHEDIR} ]]; then export SINGULARITY_CACHEDIR 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}'" +if [[ -z "${TMPDIR}" ]]; 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}) +else + STORAGE=${TMPDIR} +fi +echo "bot/build.sh: STORAGE='${STORAGE}'" # make sure ${STORAGE} exists mkdir -p ${STORAGE} +# Make sure ${STORAGE} gets bind-mounted +# This will make sure that any subsequent jobs that create dirs or files under STORAGE have access to it in the container +export SINGULARITY_BIND="${SINGULARITY_BIND},${STORAGE}" + # make sure the base tmp storage is unique JOB_STORAGE=$(mktemp --directory --tmpdir=${STORAGE} bot_job_tmp_XXX) echo "bot/build.sh: created unique base tmp storage directory at ${JOB_STORAGE}" @@ -287,6 +295,9 @@ else TARBALL_STEP_ARGS+=("--resume" "${REMOVAL_TMPDIR}") fi +# Make sure we define storage, so that the TMPDIR is set to this in eessi_container.sh +TARBALL_STEP_ARGS+=("--storage" "${STORAGE}") + timestamp=$(date +%s) # to set EESSI_VERSION we need to source init/eessi_defaults now source $software_layer_dir/init/eessi_defaults From d3d0524986531dc06500ccbf7247d4811459d017 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 12 Feb 2025 17:30:14 +0100 Subject: [PATCH 2/3] Make sure we have something to build --- .../nvidia/zen4_h100/eessi-2023.06-eb-4.9.4-2023a-CUDA.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 easystacks/software.eessi.io/2023.06/accel/nvidia/zen4_h100/eessi-2023.06-eb-4.9.4-2023a-CUDA.yml diff --git a/easystacks/software.eessi.io/2023.06/accel/nvidia/zen4_h100/eessi-2023.06-eb-4.9.4-2023a-CUDA.yml b/easystacks/software.eessi.io/2023.06/accel/nvidia/zen4_h100/eessi-2023.06-eb-4.9.4-2023a-CUDA.yml new file mode 100644 index 0000000000..fbb9203fd2 --- /dev/null +++ b/easystacks/software.eessi.io/2023.06/accel/nvidia/zen4_h100/eessi-2023.06-eb-4.9.4-2023a-CUDA.yml @@ -0,0 +1,5 @@ +easyconfigs: + - CUDA-12.1.1.eb: + options: + accept-eula-for: CUDA + - pmt-1.2.0-GCCcore-12.3.0-CUDA-12.1.1.eb From bc119ee421f2f1e67fca8ada23683094a8ae0aaf Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 12 Feb 2025 18:36:59 +0100 Subject: [PATCH 3/3] Do bind-mount of TMPDIR in eessi_container instead, and check that the TMP_IN_CONTAINER doesn't already contain that prefix --- bot/build.sh | 7 ------- eessi_container.sh | 9 +++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bot/build.sh b/bot/build.sh index 91d9721515..f63ff38b79 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -103,10 +103,6 @@ echo "bot/build.sh: STORAGE='${STORAGE}'" # make sure ${STORAGE} exists mkdir -p ${STORAGE} -# Make sure ${STORAGE} gets bind-mounted -# This will make sure that any subsequent jobs that create dirs or files under STORAGE have access to it in the container -export SINGULARITY_BIND="${SINGULARITY_BIND},${STORAGE}" - # make sure the base tmp storage is unique JOB_STORAGE=$(mktemp --directory --tmpdir=${STORAGE} bot_job_tmp_XXX) echo "bot/build.sh: created unique base tmp storage directory at ${JOB_STORAGE}" @@ -295,9 +291,6 @@ else TARBALL_STEP_ARGS+=("--resume" "${REMOVAL_TMPDIR}") fi -# Make sure we define storage, so that the TMPDIR is set to this in eessi_container.sh -TARBALL_STEP_ARGS+=("--storage" "${STORAGE}") - timestamp=$(date +%s) # to set EESSI_VERSION we need to source init/eessi_defaults now source $software_layer_dir/init/eessi_defaults diff --git a/eessi_container.sh b/eessi_container.sh index fc97f9877c..1cbc6c1c8d 100755 --- a/eessi_container.sh +++ b/eessi_container.sh @@ -529,6 +529,15 @@ BIND_PATHS="${EESSI_CVMFS_VAR_LIB}:/var/lib/cvmfs,${EESSI_CVMFS_VAR_RUN}:/var/ru # provide a '/tmp' inside the container BIND_PATHS="${BIND_PATHS},${EESSI_TMPDIR}:${TMP_IN_CONTAINER}" + +# 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 +if [[ ! -z ${TMPDIR} && ${TMP_IN_CONTAINER} != ${TMPDIR}* ]]; then + msg="TMPDIR is not empty (${TMPDIR}) and TMP_IN_CONTAINER (${TMP_IN_CONTAINER}) is not a prefix of TMPDIR:" + msg="${msg} adding bind mount for TMPDIR" + echo "${msg}" + BIND_PATHS="${BIND_PATHS},${TMPDIR}" +fi + if [[ ! -z ${EXTRA_BIND_PATHS} ]]; then BIND_PATHS="${BIND_PATHS},${EXTRA_BIND_PATHS}" fi