Commit 69330b64 authored by Andrea Sciaba's avatar Andrea Sciaba
Browse files

Adapted isolation test to latest singularity search algo; removed /usr/bin as...

Adapted isolation test to latest singularity search algo; removed /usr/bin as default path for singularity
parent 88f2ac48
#!/bin/sh
# default image
export OSG_SINGULARITY_IMAGE_DEFAULT="/cvmfs/singularity.opensciencegrid.org/cmssw/cms:rhel6-m202001"
# for now, we will only advertise singularity on nodes which can access cvmfs
if [ ! -e "$OSG_SINGULARITY_IMAGE_DEFAULT" ]; then
echo "ERROR: cannot find default singularity image under CVMFS"
echo "summary: SINGULARITY_CVMFS_IMAGE_NOT_FOUND"
exit $SAME_ERROR
fi
source ${SAME_SENSOR_HOME}/tests/singularity_lib.sh
# some known singularity locations
for LOCATION in \
/util/opt/singularity/2.2.1/gcc/4.4/bin \
......@@ -12,26 +24,17 @@ for LOCATION in \
fi
done
export PATH
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`
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`
fi
fi
# default image for this glidein
export OSG_SINGULARITY_IMAGE_DEFAULT="/cvmfs/singularity.opensciencegrid.org/bbockelm/cms:rhel6"
SINGULARITY_BIN=${SINGULARITY_BIN:-""}
singularity_locate_bin "$SINGULARITY_BIN" $OSG_SINGULARITY_IMAGE_DEFAULT
# for now, we will only advertise singularity on nodes which can access cvmfs
if [ ! -e "$OSG_SINGULARITY_IMAGE_DEFAULT" ]; then
HAS_SINGULARITY="False"
if [ "$HAS_SINGULARITY" == "False" ] ; then
echo 'ERROR: Singularity not found!'
echo 'summary: SINGULARITY_NOT_FOUND'
exit $SAME_ERROR
else
echo "OSG_SINGULARITY_VERSION = ${GWMS_SINGULARITY_VERSION}"
echo "OSG_SINGULARITY_PATH = ${GWMS_SINGULARITY_PATH}"
fi
# Let's do a simple singularity test by echoing something inside, and then
......@@ -40,8 +43,8 @@ fi
# ERROR : Could not identify basedir for home directory path: /
if [ "x$HAS_SINGULARITY" = "xTrue" ]; then
SINGULARITY_HOME=`mktemp -d`
echo "$OSG_SINGULARITY_PATH exec --home $SINGULARITY_HOME:/srv --bind /cvmfs --pwd /srv --contain --ipc --pid $OSG_SINGULARITY_IMAGE_DEFAULT echo Hello World | grep Hello World"
if ! ($OSG_SINGULARITY_PATH exec --home $SINGULARITY_HOME:/srv \
echo "$GWMS_SINGULARITY_PATH exec --home $SINGULARITY_HOME:/srv --bind /cvmfs --pwd /srv --contain --ipc --pid $OSG_SINGULARITY_IMAGE_DEFAULT echo \"Hello World\" | grep \"Hello World\""
if ! ($GWMS_SINGULARITY_PATH exec --home $SINGULARITY_HOME:/srv \
--bind /cvmfs \
--pwd /srv \
--contain --ipc --pid \
......
......@@ -34,7 +34,7 @@ done
export PATH
SINGULARITY_BIN=${SINGULARITY_BIN:-"/usr/bin"}
singularity_locate_bin $SINGULARITY_BIN $OSG_SINGULARITY_IMAGE_DEFAULT
singularity_locate_bin "$SINGULARITY_BIN" $OSG_SINGULARITY_IMAGE_DEFAULT
# Grid environment is taken from OSG, check it's available:
if [ ! -e /cvmfs/oasis.opensciencegrid.org/osg-software/osg-wn-client ]; then
......@@ -64,7 +64,7 @@ if [ -f "$X509_USER_PROXY" ] ; then
elif [ -f /tmp/x509up_u`id -u` ] ; then
cp -f /tmp/x509up_u`id -u` ${SAME_SENSOR_HOME}/proxy.pem
else
echo "ERRROR: proxy not found!"
echo "ERROR: proxy not found!"
echo "summary: PROXY_NOT_FOUND"
exit $SAME_ERROR
fi
......
......@@ -411,7 +411,7 @@ if [[ -e "$glidein_config" ]]; then # was: [ -n "$glidein_config" ] && [ "$gl
fi
else
# glidein_config not available
warn "glidein_config not defined ($glidein_config) in singularity_lib.sh. Some functions like advertise and error_gen will be limited." || true
#warn "glidein_config not defined ($glidein_config) in singularity_lib.sh. Some functions like advertise and error_gen will be limited." || true
[[ -z "$error_gen" ]] && error_gen=warn
glidein_config=NONE
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment