-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVRE_RUNNER
executable file
·46 lines (35 loc) · 993 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
#!/bin/bash
###
### Main Executor
###
### Script that validates software dependencies and call VRE_RUNNER.py
###
DEPENDENCIES=("python","Rscript") # TODO add your software dependencies (e.g. DEPENDENCIES=("Rscript","docker")
PROGNAME="VRE_RUNNER.py"
# Validate dependencies
REALPATH="$(realpath "$0")"
BASEDIR="$(dirname "$REALPATH")"
case "$BASEDIR" in
/*)
true
;;
*)
BASEDIR="${PWD}/$BASEDIR"
;;
esac
for prog in $(echo $DEPENDENCIES | sed "s/,/ /g"); do
type -a "$prog" >/dev/null
if [ $? -ne 0 ]; then
echo "UNCONFIGURED: No $prog executable found" 1>&2
exit 1
fi
done
# check R dependencies
Rscript -e 'if (R.Version()$major < 4) stop("Need at least R 4.0")' || exit 1
"$BASEDIR/check_r_package.R" "dataquieR" "1.0.5" || exit 1
"$BASEDIR/check_r_package.R" "openxlsx" "4.2.3" || exit 1
"$BASEDIR/check_r_package.R" "parallelly" "1.25.0" || exit 1
# Run VRE_RUNNER
source "$BASEDIR"/venv/bin/activate
exec python -u "${BASEDIR}"/"${PROGNAME}" "$@"
exit 1