diff options
author | Pjotr Prins | 2018-09-05 09:49:09 +0000 |
---|---|---|
committer | Pjotr Prins | 2018-09-05 09:49:09 +0000 |
commit | 33e2e09d00881de9b07274bc52b58587e5135cab (patch) | |
tree | 86492a323eece8a67cc85156a72505199b444886 | |
parent | b3c2253a99ff9495a0132f466df825340ddf367c (diff) | |
download | genenetwork2-33e2e09d00881de9b07274bc52b58587e5135cab.tar.gz |
ELASTICSEARCH settings and fix runserver.py to run without gunicorn
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | etc/default_settings.py | 10 | ||||
-rw-r--r-- | wqflask/runserver.py | 4 | ||||
-rw-r--r-- | wqflask/utility/tools.py | 1 |
4 files changed, 23 insertions, 4 deletions
@@ -25,9 +25,15 @@ Once installed GN2 can be run online through a browser interface genenetwork2 ``` -(default is http://localhost:5003/). For full examples (you'll need to -set a number of environment variables), including running scripts and -a Python REPL, see the startup script +(default is http://localhost:5003/). A quick example is + +```sh +env GN2_PROFILE=~/opt/gn-latest SERVER_PORT=5300 GENENETWORK_FILES=~/data/gn2_data/ ./bin/genenetwork2 ./etc/default_settings.py -gunicorn-dev +``` + +For full examples (you may need to set a number of environment +variables), including running scripts and a Python REPL, also see the +startup script [./bin/genenetwork2](https://github.com/genenetwork/genenetwork2/blob/testing/bin/genenetwork2). ## Testing diff --git a/etc/default_settings.py b/etc/default_settings.py index 3e54ad1f..85eab2c6 100644 --- a/etc/default_settings.py +++ b/etc/default_settings.py @@ -25,9 +25,17 @@ import os import sys GN_VERSION = open("../etc/VERSION","r").read() +GN_SERVER_URL = "http://localhost:8880/" # REST API server + +# ---- MySQL + SQL_URI = "mysql://gn2:mysql_password@localhost/db_webqtl_s" SQL_ALCHEMY_POOL_RECYCLE = 3600 -GN_SERVER_URL = "http://localhost:8880/" # REST API server + +# ---- Elastic search + +ELASTICSEARCH_HOST = "localhost" +ELASTICSEARCH_PORT = 9200 # ---- Flask configuration (see website) TRAP_BAD_REQUEST_ERRORS = True diff --git a/wqflask/runserver.py b/wqflask/runserver.py index 5f41d04d..c0ac980a 100644 --- a/wqflask/runserver.py +++ b/wqflask/runserver.py @@ -9,6 +9,7 @@ from wqflask import app + import logging import utility.logger logger = utility.logger.getLogger(__name__ ) @@ -27,6 +28,9 @@ app_config() werkzeug_logger = logging.getLogger('werkzeug') +from utility.tools import WEBSERVER_MODE, SERVER_PORT +port = int(SERVER_PORT) + if WEBSERVER_MODE == 'DEBUG': app.run(host='0.0.0.0', port=port, diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index ea216a35..f12b0d76 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -233,6 +233,7 @@ def show_settings(): # Cached values GN_VERSION = get_setting('GN_VERSION') HOME = get_setting('HOME') +SERVER_PORT = get_setting('SERVER_PORT') WEBSERVER_MODE = get_setting('WEBSERVER_MODE') GN_SERVER_URL = get_setting('GN_SERVER_URL') SQL_URI = get_setting('SQL_URI') |