From 204a308be0f741726b9a620d88fbc22b22124c81 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 29 Dec 2023 18:55:37 +0000 Subject: Namespace all modules under gn2. We move all modules under a gn2 directory. This is important for "correct" packaging and deployment as a Guix service. --- bin/genenetwork2 | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'bin') diff --git a/bin/genenetwork2 b/bin/genenetwork2 index a03ad6ef..09b3415e 100755 --- a/bin/genenetwork2 +++ b/bin/genenetwork2 @@ -159,8 +159,6 @@ set|grep TMPDIR # Now handle command parameter -c which runs python if [ "$1" = '-c' ] ; then - cd "${GN2_BASE_DIR}/wqflask" - cmd=${2#wqflask/} echo PYTHONPATH="${PYTHONPATH}" shift ; shift echo "RUNNING COMMAND ${cmd} ${*}" @@ -170,7 +168,6 @@ fi # Now handle command parameter -cli which runs in bash if [ "$1" = "-cli" ] ; then - cd "${GN2_BASE_DIR}/wqflask" cmd=$2 echo PYTHONPATH="${PYTHONPATH}" shift ; shift @@ -179,7 +176,6 @@ if [ "$1" = "-cli" ] ; then exit $? fi if [ "$1" = '-gunicorn' ] ; then - cd "${GN2_BASE_DIR}/wqflask" cmd=$2 echo PYTHONPATH="${PYTHONPATH}" echo "RUNNING gunicorn ${cmd}" @@ -187,20 +183,18 @@ if [ "$1" = '-gunicorn' ] ; then exit $? fi if [ "$1" = '-gunicorn-dev' ] ; then - cd "${GN2_BASE_DIR}/wqflask" echo PYTHONPATH="${PYTHONPATH}" if [ -z "${SERVER_PORT}" ]; then echo "ERROR: Provide a SERVER_PORT" ; exit 1 ; fi - cmd="--bind 0.0.0.0:$SERVER_PORT --workers=1 --timeout 180 --reload run_gunicorn:app" + cmd="--bind 0.0.0.0:$SERVER_PORT --workers=1 --timeout 180 --reload gn2.run_gunicorn:app" echo "RUNNING gunicorn ${cmd}" gunicorn $cmd exit $? fi if [ "$1" = '-gunicorn-prod' ] ; then - cd "${GN2_BASE_DIR}/wqflask" echo PYTHONPATH="${PYTHONPATH}" if [ -z "${SERVER_PORT}" ]; then echo "ERROR: Provide a SERVER_PORT" ; exit 1 ; fi PID=$TMPDIR/gunicorn.$USER.pid - cmd="--bind 0.0.0.0:$SERVER_PORT --pid $PID --workers 20 --keep-alive 6000 --max-requests 100 --max-requests-jitter 30 --timeout 1200 wsgi" + cmd="--bind 0.0.0.0:$SERVER_PORT --pid $PID --workers 20 --keep-alive 6000 --max-requests 100 --max-requests-jitter 30 --timeout 1200 gn2.wsgi" echo "RUNNING gunicorn ${cmd}" gunicorn $cmd exit $? @@ -219,16 +213,14 @@ fi if [ "$1" = "--with-pdb" ] ; then - cd "${GN2_BASE_DIR}/wqflask" cmd=$2 echo PYTHONPATH="${PYTHONPATH}" shift ; shift - echo "RUNNING COMMAND python3 -m runserver.py" + echo "RUNNING COMMAND python3 -m gn2.runserver.py" python3 -m pdb runserver.py exit $? fi # Start the flask server running GN2 -cd "${GN2_BASE_DIR}/wqflask" echo "Starting with $settings" -python runserver.py +python gn2.runserver.py -- cgit v1.2.3 From 7fc329038720b85686f883177f6e7073e815bae8 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 29 Dec 2023 19:26:20 +0000 Subject: Remove only up to -c in bin/genenetwork2. For example, in bin/genenetwork2 etc/default_settings.py -c -m pytest, remove only up to -c. --- bin/genenetwork2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/genenetwork2 b/bin/genenetwork2 index 09b3415e..2ac83c7f 100755 --- a/bin/genenetwork2 +++ b/bin/genenetwork2 @@ -160,9 +160,9 @@ set|grep TMPDIR # Now handle command parameter -c which runs python if [ "$1" = '-c' ] ; then echo PYTHONPATH="${PYTHONPATH}" - shift ; shift - echo "RUNNING COMMAND ${cmd} ${*}" - python $cmd $* + shift + echo "RUNNING COMMAND python ${*}" + python $* exit $? fi -- cgit v1.2.3