-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVRE_RUNNER
executable file
·50 lines (41 loc) · 937 Bytes
/
VRE_RUNNER
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
#!/bin/bash
###
### Main Executor
###
### Script that validates software dependencies and call VRE_RUNNER.py
###
DEPENDENCIES=(
"cwltool"\
"singularity"\
)
PROGNAME="VRE_RUNNER.py"
# Validate dependencies
REALPATH="$(realpath "$0")"
BASEDIR="$(dirname "$REALPATH")"
case "$BASEDIR" in
/*)
true
;;
*)
BASEDIR="${PWD}/$BASEDIR"
;;
esac
for prog in "${DEPENDENCIES[@]}" ; do
type -a "$prog" >/dev/null
if [ $? -ne 0 ]; then
echo "UNCONFIGURED: No $prog executable found" 1>&2
exit 1
fi
done
# Run VRE_RUNNER
source "$BASEDIR"/venv/bin/activate
# Create a nodejs running from within the environment
if [ ! -x "$BASEDIR"/venv/bin/nodejs ] ; then
cp -p "$BASEDIR"/nodejs_singularity_wrapper.bash "$BASEDIR"/venv/bin/nodejs
chmod +x "$BASEDIR"/venv/bin/nodejs
fi
if [ ! -x "$BASEDIR"/venv/bin/node ] ; then
ln -s nodejs "$BASEDIR"/venv/bin/node
fi
exec python -u "${BASEDIR}"/"${PROGNAME}" "$@"
exit 1