Skip to content

Commit fe3541e

Browse files
Add sandbox mode option to eessi_container.sh
1 parent 2a0f763 commit fe3541e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

eessi_container.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ display_help() {
118118
echo " [default: not set]; uses env var \$http_proxy if set"
119119
echo " -y | --https-proxy URL - provides URL for the env variable https_proxy"
120120
echo " [default: not set]; uses env var \$https_proxy if set"
121+
echo " --sandbox - use sandbox mode (i.e. convert .sif image to sandbox and then run"
122+
echo " it instead"
123+
echo " [default: not set]"
121124
echo
122125
echo " If value for --mode is 'exec' or 'run', the SCRIPT/COMMAND provided is executed. If"
123126
echo " arguments to the script/command start with '-' or '--', use the flag terminator"
@@ -293,6 +296,10 @@ while [[ $# -gt 0 ]]; do
293296
export https_proxy=${HTTPS_PROXY}
294297
shift 2
295298
;;
299+
--sandbox)
300+
SANDBOX=1
301+
shift 1
302+
;;
296303
--)
297304
shift
298305
POSITIONAL_ARGS+=("$@") # save positional args
@@ -1040,7 +1047,7 @@ for arg in "${PASS_THROUGH[@]}"; do
10401047
done
10411048

10421049
# EESSI_SINGULARITY_SANDBOX is an environment variable (typically set in site_config.sh, if needed)
1043-
if [[ -n "$EESSI_SINGULARITY_SANDBOX" ]]; then
1050+
if [[ -n "$EESSI_SINGULARITY_SANDBOX" || $SANDBOX -eq 1 ]]; then
10441051
# using a sandbox image mode is more robust at the cleanup phase at the end
10451052
CONTAINER_SANDBOX="${CONTAINER%.sif}.sandbox"
10461053
echo "Building a sandbox image with command (next line):"

0 commit comments

Comments
 (0)