aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/genenetwork214
-rwxr-xr-xbin/test-website2
-rw-r--r--doc/GUIX-Reproducible-from-source.org4
-rw-r--r--doc/development.org2
-rw-r--r--doc/testing.org4
-rw-r--r--gn2/default_settings.py (renamed from etc/default_settings.py)2
-rw-r--r--gn2/run_gunicorn.py2
-rw-r--r--gn2/utility/tools.py2
-rw-r--r--gn2/wqflask/__init__.py4
-rw-r--r--scripts/performance/README.org2
-rwxr-xr-xscripts/run_debug.sh2
-rwxr-xr-xtest/requests/test-website.py2
12 files changed, 20 insertions, 22 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2
index 2ac83c7f..3e2f31d3 100755
--- a/bin/genenetwork2
+++ b/bin/genenetwork2
@@ -25,15 +25,15 @@
# webserver) run from the base-dir with settings file and add that
# script with a -c switch, e.g.
#
-# env GN2_PROFILE=/usr/local/guix-profiles/gn-latest-20190905 TMPDIR=/export/local/home/zas1024/gn2-zach/tmp WEBSERVER_MODE=DEBUG LOG_LEVEL=DEBUG SERVER_PORT=5002 GENENETWORK_FILES=/export/local/home/zas1024/gn2-zach/genotype_files SQL_URI=mysql://webqtlout:webqtlout@lily.uthsc.edu/db_webqtl ./bin/genenetwork2 ./etc/default_settings.py -c ./maintenance/gen_select_dataset.py
+# env GN2_PROFILE=/usr/local/guix-profiles/gn-latest-20190905 TMPDIR=/export/local/home/zas1024/gn2-zach/tmp WEBSERVER_MODE=DEBUG LOG_LEVEL=DEBUG SERVER_PORT=5002 GENENETWORK_FILES=/export/local/home/zas1024/gn2-zach/genotype_files SQL_URI=mysql://webqtlout:webqtlout@lily.uthsc.edu/db_webqtl ./bin/genenetwork2 ./gn2/default_settings.py -c ./maintenance/gen_select_dataset.py
#
# To run any script in the environment
#
-# env GN2_PROFILE=~/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -cli echo "HELLO WORLD"
+# env GN2_PROFILE=~/opt/gn-latest ./bin/genenetwork2 ./gn2/default_settings.py -cli echo "HELLO WORLD"
#
# To get a python REPL(!)
#
-# env GN2_PROFILE=~/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -cli python
+# env GN2_PROFILE=~/opt/gn-latest ./bin/genenetwork2 ./gn2/default_settings.py -cli python
#
# For development you may want to run
#
@@ -42,15 +42,15 @@
# For staging and production we use gunicorn. Run with something like
# (note you have to provide the server port). Provide a settings file!
#
-# env GN2_PROFILE=~/opt/gn-latest-guix SERVER_PORT=5003 ./bin/genenetwork2 ./etc/default_settings.py -gunicorn-prod
+# env GN2_PROFILE=~/opt/gn-latest-guix SERVER_PORT=5003 ./bin/genenetwork2 ./gn2/default_settings.py -gunicorn-prod
#
# For development use
#
-# env GN2_PROFILE=~/opt/gn-latest-guix SERVER_PORT=5003 ./bin/genenetwork2 ./etc/default_settings.py -gunicorn-dev
+# env GN2_PROFILE=~/opt/gn-latest-guix SERVER_PORT=5003 ./bin/genenetwork2 ./gn2/default_settings.py -gunicorn-dev
#
# For extra flexibility you can also provide gunicorn parameters yourself with something like
#
-# env GN2_PROFILE=~/opt/gn-latest-guix ./bin/genenetwork2 ./etc/default_settings.py -gunicorn "--bind 0.0.0.0:5003 --workers=1 wsgi"
+# env GN2_PROFILE=~/opt/gn-latest-guix ./bin/genenetwork2 ./gn2/default_settings.py -gunicorn "--bind 0.0.0.0:5003 --workers=1 wsgi"
SCRIPT=$(realpath "$0")
echo SCRIPT="${SCRIPT}"
@@ -77,7 +77,7 @@ fi
settings=$1
if [ -z "${settings}" ]; then
- settings=$GN2_BASE_DIR/etc/default_settings.py
+ settings=$GN2_BASE_DIR/gn2/default_settings.py
else
shift
fi
diff --git a/bin/test-website b/bin/test-website
index 7fbcfd2f..43264472 100755
--- a/bin/test-website
+++ b/bin/test-website
@@ -2,6 +2,6 @@
if [ -z $GN2_PROFILE ]; then
echo "Run request tests with something like"
- echo env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -c ../test/requests/test-website.py -a http://localhost:5003
+ echo env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./gn2/default_settings.py -c ../test/requests/test-website.py -a http://localhost:5003
exit 1
fi
diff --git a/doc/GUIX-Reproducible-from-source.org b/doc/GUIX-Reproducible-from-source.org
index fffa9571..50abec3a 100644
--- a/doc/GUIX-Reproducible-from-source.org
+++ b/doc/GUIX-Reproducible-from-source.org
@@ -252,7 +252,7 @@ Inside the repository:
: ./bin/genenetwork2
Will fire up your local repo http://localhost:5003/ using the
-settings in ./etc/default_settings.py. These settings may
+settings in ./gn2/default_settings.py. These settings may
not reflect your system. To override settings create your own from a copy of
default_settings.py and pass it into GN2 with
@@ -265,7 +265,7 @@ software.
If something is not working, take a hint from the settings file
that comes in the Guix installation. It sits in something like
-: cat ~/.guix-profile/lib/python3.8/site-packages/genenetwork2-2.0-py2.7.egg/etc/default_settings.py
+: cat ~/.guix-profile/lib/python3.8/site-packages/genenetwork2-2.0-py2.7.egg/gn2/default_settings.py
** Set up nginx port forwarding
diff --git a/doc/development.org b/doc/development.org
index cd3beea3..4f3693ee 100644
--- a/doc/development.org
+++ b/doc/development.org
@@ -86,7 +86,7 @@ In fact you can kick off a Python shell with something like
env SERVER_PORT=5013 WEBSERVER_MODE=DEBUG LOG_LEVEL=DEBUG \
SQL_URI=mysql://gn2:webqtl@localhost/db_webqtl_s \
GN2_PROFILE=~/opt/genenetwork2 \
- ./bin/genenetwork2 ./etc/default_settings.py -c
+ ./bin/genenetwork2 ./gn2/default_settings.py -c
Python 2.7.17 (default, Jan 1 1970, 00:00:01)
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
diff --git a/doc/testing.org b/doc/testing.org
index d5ab117d..5c1e954e 100644
--- a/doc/testing.org
+++ b/doc/testing.org
@@ -35,14 +35,14 @@ Run the tests from the root of the genenetwork2 source tree as. Ensure
that Redis and Mariadb are running.
To run Mechanical Rob:
-: time env GN2_PROFILE=~/opt/genenetwork2 TMPDIR=~/tmp SERVER_PORT=5004 GENENETWORK_FILES=/gnu/data/gn2_data/ ./bin/genenetwork2 ./etc/default_settings.py -c ~/projects/genenetwork2/test/requests/test-website.py -a http://localhost:5004
+: time env GN2_PROFILE=~/opt/genenetwork2 TMPDIR=~/tmp SERVER_PORT=5004 GENENETWORK_FILES=/gnu/data/gn2_data/ ./bin/genenetwork2 ./gn2/default_settings.py -c ~/projects/genenetwork2/test/requests/test-website.py -a http://localhost:5004
Use these aliases for the following examples.
#+begin_src sh
alias runpython="env GN2_PROFILE=~/opt/gn-latest TMPDIR=/tmp SERVER_PORT=5004 GENENETWORK_FILES=/gnu/data/gn2_data/ ./bin/genenetwork2
-alias runcmd="time env GN2_PROFILE=~/opt/gn-latest TMPDIR=//tmp SERVER_PORT=5004 GENENETWORK_FILES=/gnu/data/gn2_data/ ./bin/genenetwork2 ./etc/default_settings.py -cli"
+alias runcmd="time env GN2_PROFILE=~/opt/gn-latest TMPDIR=//tmp SERVER_PORT=5004 GENENETWORK_FILES=/gnu/data/gn2_data/ ./bin/genenetwork2 ./gn2/default_settings.py -cli"
#+end_src
You could use them in your =.bashrc= or =.zshrc= file.
diff --git a/etc/default_settings.py b/gn2/default_settings.py
index c49a3c25..e781f196 100644
--- a/etc/default_settings.py
+++ b/gn2/default_settings.py
@@ -19,7 +19,7 @@
#
# For GNU Guix deployment also check the paths in
#
-# ~/.guix-profile/lib/python3.8/site-packages/genenetwork2-2.0-py2.7.egg/etc/default_settings.py
+# ~/.guix-profile/lib/python3.8/site-packages/genenetwork2-2.0-py2.7.egg/gn2/default_settings.py
import os
import sys
diff --git a/gn2/run_gunicorn.py b/gn2/run_gunicorn.py
index 6de470fe..370d2425 100644
--- a/gn2/run_gunicorn.py
+++ b/gn2/run_gunicorn.py
@@ -2,7 +2,7 @@
#
# Run standalone with
#
-# ./bin/genenetwork2 ./etc/default_settings.py -c run_gunicorn.py
+# ./bin/genenetwork2 ./gn2/default_settings.py -c run_gunicorn.py
# from flask import Flask
# application = Flask(__name__)
diff --git a/gn2/utility/tools.py b/gn2/utility/tools.py
index 159643d3..29d94a43 100644
--- a/gn2/utility/tools.py
+++ b/gn2/utility/tools.py
@@ -40,7 +40,7 @@ def get_setting(command_id, guess=None):
Note that we do not use the system path. This is on purpose
because it will mess up controlled (reproducible) deployment. The
proper way is to either use the GNU Guix defaults as listed in
- etc/default_settings.py or override them yourself by creating a
+ gn2/default_settings.py or override them yourself by creating a
different settings.py file (or setting the environment).
"""
diff --git a/gn2/wqflask/__init__.py b/gn2/wqflask/__init__.py
index 9b714868..bca95275 100644
--- a/gn2/wqflask/__init__.py
+++ b/gn2/wqflask/__init__.py
@@ -48,9 +48,7 @@ app = Flask(__name__)
# See http://flask.pocoo.org/docs/config/#configuring-from-files
# Note no longer use the badly named WQFLASK_OVERRIDES (nyi)
-default_settings_file = Path(Path(__file__).parent.parent.parent,
- "etc/default_settings.py")
-app.config.from_pyfile(default_settings_file)
+app.config.from_object('gn2.default_settings')
app.config.from_envvar('GN2_SETTINGS')
app.jinja_env.globals.update(
diff --git a/scripts/performance/README.org b/scripts/performance/README.org
index f7fb392f..0ca5db18 100644
--- a/scripts/performance/README.org
+++ b/scripts/performance/README.org
@@ -17,7 +17,7 @@ env GN2_PROFILE=$HOME/opt/genenetwork2 \
GN3_LOCAL_URL=http://localhost:8083 \
GN_LOCAL_URL=http://localhost:8083 \
$HOME/projects/oqo-genenetwork2/bin/genenetwork2 \
- $HOME/projects/oqo-genenetwork2/etc/default_settings.py\
+ $HOME/projects/oqo-genenetwork2/gn2/default_settings.py\
-cli $*
#+end_src
diff --git a/scripts/run_debug.sh b/scripts/run_debug.sh
index be7ecdb8..bcb63c5b 100755
--- a/scripts/run_debug.sh
+++ b/scripts/run_debug.sh
@@ -16,5 +16,5 @@ echo Running source from $cwd
mkdir -p ~/tmp
-env TMPDIR=~/tmp WEBSERVER_MODE=DEBUG LOG_LEVEL=DEBUG GENENETWORK_FILES=/export/data/genenetwork/genotype_files/ SQL_URI=mysql://webqtlout:webqtlout@localhost/db_webqtl ./bin/genenetwork2 etc/default_settings.py -gunicorn-dev
+env TMPDIR=~/tmp WEBSERVER_MODE=DEBUG LOG_LEVEL=DEBUG GENENETWORK_FILES=/export/data/genenetwork/genotype_files/ SQL_URI=mysql://webqtlout:webqtlout@localhost/db_webqtl ./bin/genenetwork2 gn2/default_settings.py -gunicorn-dev
diff --git a/test/requests/test-website.py b/test/requests/test-website.py
index 91bcb12d..5090d465 100755
--- a/test/requests/test-website.py
+++ b/test/requests/test-website.py
@@ -1,6 +1,6 @@
# Run with something like
#
-# env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./etc/default_settings.py -c ../test/requests/test-website.py http://localhost:5003
+# env GN2_PROFILE=/home/wrk/opt/gn-latest ./bin/genenetwork2 ./gn2/default_settings.py -c ../test/requests/test-website.py http://localhost:5003
#
# Mostly to pick up the Guix GN2_PROFILE and python modules