Skip to content

Commit ca714ee

Browse files
committed
let mode 'run' call 'apptainer exec', as that's what apptainer uses when running a command/script
1 parent c6a57dc commit ca714ee

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

eessi_container.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,15 @@ fi
368368
# HOST_STORAGE_ERROR_EXITCODE
369369

370370
# (arg -m|--mode) check if MODE is known
371-
if [[ "${MODE}" != "shell" && "${MODE}" != "run" ]]; then
371+
if [[ "${MODE}" != "shell" && "${MODE}" != "exec" && "${MODE}" != "run" ]]; then
372372
fatal_error "unknown execution mode '${MODE}'" "${MODE_UNKNOWN_EXITCODE}"
373373
fi
374374

375+
# the run mode should actually call "apptainer exec", so simply override run to exec
376+
if [[ "${MODE}" == "run" ]]; then
377+
MODE="exec"
378+
fi
379+
375380
# Also validate the NVIDIA GPU mode (if present)
376381
if [[ ${SETUP_NVIDIA} -eq 1 ]]; then
377382
if [[ "${NVIDIA_MODE}" != "run" && "${NVIDIA_MODE}" != "install" && "${NVIDIA_MODE}" != "all" ]]; then
@@ -434,8 +439,8 @@ done
434439
# TODO (arg -y|--https-proxy) check if https proxy is accessible
435440
# HTTPS_PROXY_ERROR_EXITCODE
436441

437-
# check if a script is provided if mode is 'run'
438-
if [[ "${MODE}" == "run" ]]; then
442+
# check if a script is provided if mode is 'exec'
443+
if [[ "${MODE}" == "exec" ]]; then
439444
if [[ $# -eq 0 ]]; then
440445
fatal_error "no command specified to run?!" "${RUN_SCRIPT_MISSING_EXITCODE}"
441446
fi

0 commit comments

Comments
 (0)