-
Notifications
You must be signed in to change notification settings - Fork 20
/
docker_run.sh
executable file
·96 lines (87 loc) · 2.41 KB
/
docker_run.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
echo -n "docker: Command recieved::<"
echo -n $@
echo ">"
rawCommand="$(echo -n "$1" | sed -E 's/(^(\s*))|((\s*)$)//g')" # Strip ends of its whitespace
command="biosimulations" # default
echo -n "<"
echo -n $rawCommand
echo ">"
case "$rawCommand" in
"convert")
echo 'convert mode requested'
command="convert"
shift
;;
"export-omex")
echo 'export-omex mode requested'
command="export-omex"
shift
;;
"export-omex-batch")
echo 'export-omex-batch mode requested'
command="export-omex-batch"
shift
;;
"import-omex")
echo 'import-omex mode requested'
command="import-omex"
shift
;;
"import-omex-batch")
echo 'import-omex-batch mode requested'
command="import-omex-batch"
shift
;;
"model")
echo 'model mode requested'
command="model"
shift
;;
"execute")
echo 'execute mode requested'
command="execute"
shift
;;
"validate")
echo 'validate mode requested'
command="validate"
shift
;;
"version")
echo 'version mode requested'
command="version"
shift
;;
"biosimulations")
echo 'biosimulations mode requested'
command="biosimulations"
shift
;;
"help")
command="help"
shift
;;
*) # Default case: No more options, so break out of the loop.
echo "Default case selected"
;;
esac
# Input validate arugments
arguments="$(echo -n "$@" | sed -E 's/(\s)+/ /g' | sed -E 's/(^(\s*))|((\s*)$)//g')" # convert any whitespace to spaces and strip ends
echo "VCell shall execute <$command" "$arguments>"
java \
-classpath '/usr/local/app/vcell/lib/*' \
-XX:MaxRAMPercentage=80 \
-Dlog4j.configurationFile=/usr/local/app/vcell/installDir/biosimulations_log4j2.xml \
-Dvcell.softwareVersion=$ENV_SIMULATOR_VERSION \
-Dvcell.installDir=/usr/local/app/vcell/installDir \
-Dvcell.server.id="7.3.0.16" \
-Dvcell.cli="true" \
-Dvcell.python.executable=/usr/bin/python3 \
-Dvcell.mongodb.database="localhost" \
-Dvcell.mongodb.host.internal="localhost" \
-Dvcell.mongodb.port.internal=27017 \
-Dvcell.server.dbDriverName=oracle.jdbc.driver.OracleDriver \
-Dvcell.server.dbConnectURL=jdbc:oracle:thin:@vcell-oracle.cam.uchc.edu:1521/ORCLPDB1 \
-Dcli.workingDir=/usr/local/app/vcell/installDir/python/vcell_cli_utils/ $(if [ $MAX_JAVA_MEM_MB -gt 0 ]; then echo "-Xmx${MAX_JAVA_MEM_MB}m"; fi) \
org.vcell.cli.CLIStandalone $command $arguments