|
|
#!/bin/bash |
|
|
|
|
|
show_help() { |
|
|
echo "usage: docker run --rm -e v1=a -e v2=b -v /host/path/to/file:/simdata ghcr.io/virtualcell/vcell-opt:latest [OPTIONS] optProblem.json results.json report.txt" |
|
|
echo " or singularity run --bind /host/path/to/file:/simdata ghcr_io_virtualcell_vcell_opt_latest.img [OPTIONS] optProblem.json results.json report.txt" |
|
|
echo " [OPTIONS]" |
|
|
echo " -h | --help show this message" |
|
|
echo " -e | --env var=value add environment variable (needed for Singularity only)" |
|
|
echo " this option can be repeated to define multiple variables" |
|
|
exit 1 |
|
|
} |
|
|
|
|
|
if [ "$#" -lt 1 ]; then |
|
|
show_help |
|
|
fi |
|
|
|
|
|
|
|
|
while :; do |
|
|
case $1 in |
|
|
-h|--help) |
|
|
show_help |
|
|
exit |
|
|
;; |
|
|
-e|--env) |
|
|
shift |
|
|
export $1 |
|
|
;; |
|
|
-?*) |
|
|
printf 'ERROR: Unknown option: %s\n' "$1" >&2 |
|
|
echo "" |
|
|
show_help |
|
|
;; |
|
|
*) |
|
|
break |
|
|
esac |
|
|
shift |
|
|
done |
|
|
|
|
|
echo "$@" |
|
|
|
|
|
if [ "$#" -lt 1 ]; then |
|
|
show_help |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
arguments=$* |
|
|
echo "script args = $arguments" |
|
|
|
|
|
|
|
|
|
|
|
cd /usr/local/app/vcell/installDir/python/vcell_opt || exit 1 |
|
|
poetry run python -m vcell_opt.optService $arguments |
|
|
exit $? |