aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md41
1 files changed, 37 insertions, 4 deletions
diff --git a/README.md b/README.md
index c1acba1..c3a9848 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ Simply load up the environment (for development purposes):
guix environment --load=guix.scm
```
-Also, make sure you have the *guix-bioinformatics* channel set up.
+Also, make sure you have the [guix-bioinformatics](https://git.genenetwork.org/guix-bioinformatics/guix-bioinformatics) channel set up.
```bash
env GUIX_PACKAGE_PATH=~/guix-bioinformatics/ ~/.config/guix/current/bin/guix environment --load=guix.scm
@@ -22,9 +22,21 @@ python3
Better run a proper container
```
-env GUIX_PACKAGE_PATH=~/guix-bioinformatics/ ~/.config/guix/current/bin/guix environment -C --network --load=guix.scm
+env GUIX_PACKAGE_PATH=~/guix-bioinformatics/ ~/.config/guix/current/bin/guix environment -C --network --load=guix.scm
```
+If you get a Guix error, such as `ice-9/boot-9.scm:1669:16: In procedure raise-exception:
+error: python-sqlalchemy-stubs: unbound variable` it typically means an update to guix latest is required (i.e., guix pull):
+
+```
+guix pull
+source ~/.config/guix/current/etc/profile
+```
+
+and try again.
+
+See also instructions in [.guix.scm](.guix.scm).
+
#### Running Tests
(assuming you are in a guix container; otherwise use venv!)
@@ -49,12 +61,33 @@ mypy .
#### Running the flask app
-To spin up the server:
+To spin up the server on its own (for development):
```bash
env FLASK_DEBUG=1 FLASK_APP="main.py" flask run --port=8080
```
+And test with
+
+```
+curl localhost:8080/api/version
+"1.0"
+```
+
+To run with gunicorn
+
+```
+gunicorn --bind 0.0.0.0:8080 wsgi:app
+```
+
+consider the following options for development `--bind 0.0.0.0:$SERVER_PORT --workers=1 --timeout 180 --reload wsgi`.
+
+And for the scalable production version run
+
+```
+gunicorn --bind 0.0.0.0:8080 --workers 8 --keep-alive 6000 --max-requests 10 --max-requests-jitter 5 --timeout 1200 wsgi:app
+```
+
##### Using python-pip
IMPORTANT NOTE: we do not recommend using pip tools, use Guix instead
@@ -71,7 +104,7 @@ virtualenv --python python3 venv
```bash
# The --ignore-installed flag forces packages to
-# get installed in the venv even if they existed
+# get installed in the venv even if they existed
# in the global env
pip install -r requirements.txt --ignore-installed
```