Singularity wrapper failing when SINGULARITY_BIN does not contain the correct path
The current GWMS script works only if SINGULARITY_BIN contains a correct path for singularity.
If not, it finds the path but fails to advertise it correctly, failing the execution.
For reference, the current segment in a OSG script (osgvo-node-advertise) looking for the Singularity path
info "Checking for singularity..." # set up the env to make sure Singularity uses the glidein dir for exported /tmp, /var/tmp if [ "x$GLIDEIN_Tmp_Dir" != "x" -a -e "$GLIDEIN_Tmp_Dir" ]; then export SINGULARITY_WORKDIR=$GLIDEIN_Tmp_Dir/adv-singularity-work.$$ fi HAS_SINGULARITY="False" export OSG_SINGULARITY_VERSION=`singularity --version 2>/dev/null` if [ "x$OSG_SINGULARITY_VERSION" != "x" ]; then HAS_SINGULARITY="True" export OSG_SINGULARITY_PATH=`which singularity 2>/dev/null` else # some sites requires us to do a module load first - not sure if we always want to do that export OSG_SINGULARITY_VERSION=`module load singularity >/dev/null 2>&1; singularity --version 2>/dev/null` if [ "x$OSG_SINGULARITY_VERSION" != "x" ]; then HAS_SINGULARITY="True" export OSG_SINGULARITY_PATH=`module load singularity >/dev/null 2>&1; which singularity` else info "Unable to find singularity in PATH=$PATH" fi fi if [ "x$HAS_SINGULARITY" = "xTrue" ]; then # one last check - make sure we could determine the path to singularity if [ "x$OSG_SINGULARITY_PATH" = "x" ]; then my_warn "Looks like we found Singularity, but were unable to determine the full path to the executable" HAS_SINGULARITY="False" else info "Singularity binary appears present in $OSG_SINGULARITY_PATH and claims to be version $OSG_SINGULARITY_VERSION" fi fi