aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/genenetwork220
1 files changed, 18 insertions, 2 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2
index cbaba76f..65330ec8 100755
--- a/bin/genenetwork2
+++ b/bin/genenetwork2
@@ -1,8 +1,11 @@
#! /bin/bash
#
+# This is the startup script for GN2. It sets the environment variables to pick
+# up a Guix profile and allows for overriding parameters.
+#
# Typical usage
#
-# env GN2_PROFILE=~/opt/genenetwork2-phewas ./bin/genenetwork2
+# env GN2_PROFILE=~/opt/genenetwork2-phewas ./bin/genenetwork2 ~/my_settings.py
#
# Where GN2_PROFILE points to the GNU Guix profile used for deployment.
#
@@ -41,6 +44,7 @@
# env GN2_PROFILE=~/opt/gn-latest-guix ./bin/genenetwork2 ./etc/default_settings.py -gunicorn "--bind 0.0.0.0:5003 --workers=1 wsgi"
SCRIPT=$(realpath "$0")
+echo SCRIPT=$SCRIPT
GN2_BASE_DIR=$(dirname $(dirname "$SCRIPT"))
GN2_ID=$(cat /etc/hostname):$(basename $GN2_BASE_DIR)
@@ -96,6 +100,8 @@ if [ -z $GN2_PROFILE ] ; then
if [ -d $GN2_PROFILE ]; then
echo "Best guess is $GN2_PROFILE"
fi
+ echo "ERROR: always set GN2_PROFILE"
+ exit 1
fi
if [ -z $GN2_PROFILE ]; then
read -p "PRESS [ENTER] TO CONTINUE..."
@@ -143,7 +149,7 @@ set|grep guix
set|grep $GN2_PROFILE
set|grep TMPDIR
-# Now handle command parameter -c
+# Now handle command parameter -c which runs python
if [ "$1" = '-c' ] ; then
cd $GN2_BASE_DIR/wqflask
cmd=${2#wqflask/}
@@ -152,6 +158,16 @@ if [ "$1" = '-c' ] ; then
python $cmd
exit $?
fi
+# Now handle command parameter -cli which runs in bash
+if [ "$1" = "-cli" ] ; then
+ echo "HERE"
+ cd $GN2_BASE_DIR/wqflask
+ cmd=$2
+ echo PYTHONPATH=$PYTHONPATH
+ echo RUNNING COMMAND $cmd
+ $cmd
+ exit $?
+fi
if [ "$1" = '-gunicorn' ] ; then
cd $GN2_BASE_DIR/wqflask
cmd=$2