Skip to content

Commit a69b4e6

Browse files
committed
Use sandbox mode which is more robust in singularity cleanup phase
1 parent 655d651 commit a69b4e6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

eessi_container.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,9 +1039,13 @@ for arg in "${PASS_THROUGH[@]}"; do
10391039
ADDITIONAL_CONTAINER_OPTIONS+=(${arg})
10401040
done
10411041

1042-
echo "Launching container with command (next line):"
1043-
echo "singularity ${RUN_QUIET} ${MODE} ${ADDITIONAL_CONTAINER_OPTIONS[@]} ${EESSI_FUSE_MOUNTS[@]} ${CONTAINER} $@"
1044-
singularity ${RUN_QUIET} ${MODE} "${ADDITIONAL_CONTAINER_OPTIONS[@]}" "${EESSI_FUSE_MOUNTS[@]}" ${CONTAINER} "$@"
1042+
# using a sandbox image mode is more robust at the cleanup phase at the end
1043+
CONTAINER_SANDBOX=CONTAINER.removesuffix(".sif") + ".sandbox"
1044+
echo "Building a sandbox image with command (next line):"
1045+
echo "singularity build --sandbox ${CONTAINER_SANDBOX} ${CONTAINER}"
1046+
echo "Launching sandbox container with command (next line):"
1047+
echo "singularity ${RUN_QUIET} ${MODE} ${ADDITIONAL_CONTAINER_OPTIONS[@]} ${EESSI_FUSE_MOUNTS[@]} ${CONTAINER_SANDBOX} $@"
1048+
singularity ${RUN_QUIET} ${MODE} "${ADDITIONAL_CONTAINER_OPTIONS[@]}" "${EESSI_FUSE_MOUNTS[@]}" ${CONTAINER_SANDBOX} "$@"
10451049
exit_code=$?
10461050

10471051
# 6. save tmp if requested (arg -s|--save)

0 commit comments

Comments
 (0)