Commit 33920d47 authored by Andrea Sciaba's avatar Andrea Sciaba
Browse files

Added test for Singularity

parent d7fe842f
#!/bin/sh
# some known singularity locations
for LOCATION in \
/util/opt/singularity/2.2.1/gcc/4.4/bin \
/util/opt/singularity/2.2/gcc/4.4/bin \
/uufs/chpc.utah.edu/sys/installdir/singularity/std/bin ; do
if [ -e "$LOCATION" ]; then
echo " ... prepending $LOCATION to PATH"
export PATH="$LOCATION:$PATH"
break
fi
done
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"
# for now, we will only advertise singularity on nodes which can access cvmfs
if [ ! -e "$OSG_SINGULARITY_IMAGE_DEFAULT" ]; then
HAS_SINGULARITY="False"
fi
# Let's do a simple singularity test by echoing something inside, and then
# grepping for it outside. This takes care of some errors which happen "late"
# in the execing, like:
# ERROR : Could not identify basedir for home directory path: /
if [ "x$HAS_SINGULARITY" = "xTrue" ]; then
echo "$OSG_SINGULARITY_PATH exec --home $PWD:/srv --bind /cvmfs --bind $PWD:/srv --pwd /srv --scratch /var/tmp --scratch /tmp --containall $OSG_SINGULARITY_IMAGE_DEFAULT echo Hello World | grep Hello World"
if ! ($OSG_SINGULARITY_PATH exec --home $PWD:/srv \
--bind /cvmfs \
--bind $PWD:/srv \
--pwd /srv \
--scratch /var/tmp \
--scratch /tmp \
--containall \
"$OSG_SINGULARITY_IMAGE_DEFAULT" \
echo "Hello World" \
| grep "Hello World") 1>&2 \
; then
# singularity simple exec failed - we are done
echo "ERROR: Singularity simple exec failed. Disabling support"
echo "summary: SINGULARITY_FAILED"
exit $SAME_ERROR
fi
echo "summary: OK"
exit $SAME_OK
fi
echo "ERROR: Could not find singularity on system"
echo "summary: NO_SINGULARITY"
exit $SAME_ERROR
......@@ -189,6 +189,16 @@
},
"metricset" : "org.cms.WN"
},
"org.cms.WN-singularity" : {
"docurl" : "https://twiki.cern.ch/twiki/bin/view/LCG/SAMProbesMetrics#WN",
"parent" : "org.sam.CONDOR-JobState",
"flags" : {
"OBSESS" : 1,
"VO" : 1,
"PASSIVE" : 1
},
"metricset" : "org.cms.WN"
},
"org.cms.SRM-AllCMS" : {
"parameter" : {
"-m" : "org.cms.SRM-AllCMS"
......
......@@ -34,6 +34,7 @@ CE_METRICS = (
'org.cms.WN-remotestageout-/cms/Role=lcgadmin',
'org.cms.WN-squid-/cms/Role=lcgadmin',
'org.cms.WN-swinst-/cms/Role=lcgadmin',
'org.cms.WN-singularity-/cms/Role=lcgadmin',
'org.cms.WN-xrootd-access-/cms/Role=lcgadmin',
'org.cms.WN-xrootd-fallback-/cms/Role=lcgadmin')
......
......@@ -99,3 +99,8 @@ define service {
service_description org.cms.WN-remotestageout-<VOMS>
check_command samtest-run-sensor!CE-cms-remotestageout
}
define service {
use sam-generic-wn-active
service_description org.cms.WN-singularity-<VOMS>
check_command samtest-run-sensor!CE-cms-singularity
}
......@@ -4,7 +4,7 @@
Summary: WLCG Compliant Probes from %{site}
Name: nagios-plugins-wlcg-org.cms
Version: 1.1.39
Version: 1.1.40
Release: 1%{?dist}
License: GPL
......@@ -49,6 +49,8 @@ install --directory %{buildroot}/etc/cron.d
/etc/cron.d/cms_glexec
%changelog
* Tue Mar 21 2017 Andrea Sciaba <Andrea.Sciaba@cern.ch> 1.1.40-1.
- added test for Singularity
* Tue Feb 28 2017 Andrea Sciaba <Andrea.Sciaba@cern.ch> 1.1.39-1.
- included the latest version of the GFAL2 plugin for WMCore
* Tue Feb 14 2017 Andrea Sciaba <Andrea.Sciaba@cern.ch> 1.1.38-1.
......
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