Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/common_v3
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set overlay_path [ string map {/conda/ /envs/} $basedir ].sqsh

set launcher $myscripts/launcher.sh

module load singularity
module load apptainer

prepend-path CONTAINER_OVERLAY_PATH $overlay_path
prepend-path SINGULARITYENV_PREPEND_PATH $basedir/condabin
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fi
export TEST_OUT_FILE=test_results.xml
export PYTHONNOUSERSITE=true
export CONTAINER_PATH="${SCRIPT_DIR}"/../container/base.sif
export SINGULARITY_BINARY_PATH="/opt/singularity/bin/singularity"
export SINGULARITY_BINARY_PATH="/opt/nci/apptainer/bin/singularity"

declare -a bind_dirs=( "/etc" "/half-root" "/local" "/ram" "/run" "/system" "/usr" "/var/lib/sss" "/var/lib/rpm" "/var/run/munge" "/sys/fs/cgroup" "/iointensive" )

Expand Down
10 changes: 5 additions & 5 deletions scripts/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ done
$debug "PROG_ARGS =" "${PROG_ARGS[@]}"

if ! [[ "${SINGULARITY_BINARY_PATH}" ]]; then
module load singularity
module load apptainer
export SINGULARITY_BINARY_PATH=$( type -p singularity )
fi

Expand Down Expand Up @@ -114,10 +114,10 @@ $debug "CONTAINER_OVERLAY_PATH after override check = " ${CONTAINER_OVERLAY_PATH

export CONDA_BASE="${CONDA_BASE_ENV_PATH}/envs/${myenv}"

if ! [[ -x "${SINGULARITY_BINARY_PATH}" ]]; then
### Short circuit detection
if [[ $(awk '/NoNewPrivs/ {print $2}' /proc/self/status) -ne 0 ]]; then
### Short circuit detection - check process status (0 if running out outside a container)
### In some cases (e.g. mpi processes launched from orterun), launcher will be invoked from
### within the container. The tell-tale sign for this is if /opt/singularity is missing.
### within the container.
### The only way this can happen is if we've tried to run something that has come
### from the bin directory in scripts/env.d/bin/ - the only place these can come from is the
### bin directory of the active conda env, so just reset the path to that but keep the
Expand All @@ -144,7 +144,7 @@ declare -a singularity_default_path=( '/usr/local/sbin' '/usr/local/bin' '/usr/s

while IFS= read -r -d: i; do
in_array "${singularity_default_path[@]}" "${i}" && continue
[[ "${i}" == "/opt/singularity/bin" ]] && continue
[[ "${i}" == "/opt/nci/apptainer/bin" ]] && continue
[[ "${i}" == "${wrapper_bin}" ]] && continue
SINGULARITYENV_PREPEND_PATH="${SINGULARITYENV_PREPEND_PATH}:${i}"
done<<<"${PATH%:}:"
Expand Down
2 changes: 1 addition & 1 deletion scripts/launcher_conf.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Subject to change
export SINGULARITY_BINARY_PATH="/opt/singularity/bin/singularity"
export SINGULARITY_BINARY_PATH="/opt/nci/apptainer/bin/singularity"
export CONTAINER_PATH="__CONDA_BASE__/__APPS_SUBDIR__/__CONDA_INSTALL_BASENAME__/etc/base.sif"

export CONDA_BASE_ENV_PATH="__CONDA_BASE__/__APPS_SUBDIR__/__CONDA_INSTALL_BASENAME__"
Expand Down
2 changes: 1 addition & 1 deletion scripts/overrides/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ function findreal {
}

### Subject to change
export SINGULARITY_BINARY_PATH=/opt/singularity/bin/singularity
export SINGULARITY_BINARY_PATH=/opt/nci/apptainer/bin/singularity
Loading