-
Notifications
You must be signed in to change notification settings - Fork 1
/
osg-nocontainer.sh
executable file
·82 lines (75 loc) · 3.18 KB
/
osg-nocontainer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
#
# osg-nocontainer.sh - gluex job wrapper script for osg jobs
#
# This script contains GENERIC (non-job-specific) steps for getting
# set up outside the gluex container on an osg worker node and launching
# the job script. It should not normally be modified by the user.
#
# Note: Because one is running outside the container, eg. on a host
# without singularity installed, there are certain restrictions on
# what the job can do. For example, to run an executable that was
# built to run inside the container, it must be started with a
# special command prefix defined in $OSG_CONTAINER_HELPER.
#
# Usage: osg-nocontainer.sh <job script> [job script arguments]
#
# Author: Richard.T.Jones at uconn.edu
# Version: June 8, 2017
dockerimage="docker://markito3/gluex_docker_devel:latest"
#container="/cvmfs/singularity.opensciencegrid.org/markito3/gluex_docker_devel:latest"
container="/cvmfs/singularity.opensciencegrid.org/rjones30/gluex:latest"
oasismount="/cvmfs"
if [[ -n "$OSG_GLUEX_CONTAINER" ]]; then
container=$OSG_GLUEX_CONTAINER/singularity.opensciencegrid.org/rjones30/gluex:latest
#container=$OSG_GLUEX_CONTAINER/singularity.opensciencegrid.org/markito3/gluex_docker_devel:latest
fi
if [[ -n "$OSG_GLUEX_SOFTWARE" ]]; then
oasismount=$OSG_GLUEX_SOFTWARE
fi
oasisprefix="oasis.opensciencegrid.org/gluex"
oasisroot="$oasismount/$oasisprefix"
userproxy=x509up_u$UID
bs=/group/halld/Software/build_scripts
dist=/group/halld/www/halldweb/html/halld_versions
version=4.21.0
context="variation=mc"
# define the container context for running on osg workers
if [[ -d $container/group || -h $container/group ]]; then
echo "Job running on" `hostname`
echo "=== Contents of $oasisroot/gluex/update.details: ==="
cat $oasisroot/update.details
echo "=========================================================================="
if [[ -f osg-nocontainer_$version.env ]]; then
source /dev/stdin <<<$(cat osg-nocontainer_$version.env \
| sed "s|/group/halld|$oasisroot/group/halld|g" \
| awk '{print "export",$0}')
else
echo "Error in osg-nocontainer.sh - "
echo " prebuilt container environment script osg-nocontainer_$version.env not found"
echo " You must build this script before using osg-nocontainer.sh with this version."
exit 3
fi
export RCDB_CONNECTION=sqlite:///$oasisroot/$dist/rcdb.sqlite
export CCDB_CONNECTION=sqlite:///$oasisroot/$dist/ccdb.sqlite
export JANA_GEOMETRY_URL=ccdb://GEOMETRY/main_HDDS.xml
export JANA_CALIB_URL=sqlite:///$oasisroot/$dist/ccdb.sqlite
export JANA_CALIB_CONTEXT=$context
export OSG_CONTAINER_HELPER=`pwd`/osg-container-helper.sh
if [[ -d $oasisroot/xrootd ]]; then
export XROOTD_HOME=$oasisroot/xrootd/4.9.1/x86_64
export PATH=$XROOTD_HOME/bin:$PATH
export LD_LIBRARY_PATH=$XROOTD_HOME/lib64:$LD_LIBRARY_PATH
export LD_PRELOAD=$XROOTD_HOME/lib64/libXrdPosixPreload.so
else
unset LD_PRELOAD
fi
$*
retcode=$?
echo "Job finished with exit code" $retcode
exit $retcode
else
echo "Job container not found on" `hostname`
echo "Hint: Look at http://zeus.phys.uconn.edu/halld/containers"
exit 9
fi