From 7fadd2414b20dd3fb158ea6135ff76c82145cc03 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Wed, 6 Dec 2023 10:59:43 -0500 Subject: [PATCH 1/3] chore: gunicorn logging + gevent worker + increased timeout --- container.requirements.txt | 1 + run.bash | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/container.requirements.txt b/container.requirements.txt index a986da5a..121ada7f 100644 --- a/container.requirements.txt +++ b/container.requirements.txt @@ -1,3 +1,4 @@ gunicorn==21.2.0 +gevent==23.9.1 pysam>=0.22.0,<0.23.0 fasta-checksum-utils>=0.3.1,<0.4 diff --git a/run.bash b/run.bash index b62692db..00373c25 100644 --- a/run.bash +++ b/run.bash @@ -6,12 +6,14 @@ # Start Celery worker with log level dependent on BENTO_DEBUG echo "[bento_wes] [entrypoint] Starting celery worker" celery_log_level="INFO" +gunicorn_log_level="info" if [[ "${BENTO_DEBUG}" == "true" || "${BENTO_DEBUG}" == "True" || "${BENTO_DEBUG}" == "1" ]]; then celery_log_level="DEBUG" + gunicorn_log_level="debug" fi celery --app bento_wes.app worker --loglevel="${celery_log_level}" & @@ -20,6 +22,9 @@ echo "[bento_wes] [entrypoint] Starting gunicorn" # using 1 worker, multiple threads # see https://stackoverflow.com/questions/38425620/gunicorn-workers-and-threads gunicorn bento_wes.app:application \ + --log-level "${gunicorn_log_level}" \ + --timeout 660 \ --workers 1 \ + --worker-class 'gevent' \ --threads "$(( 2 * $(nproc --all) + 1))" \ - --bind "0.0.0.0:${INTERNAL_PORT}" + --bind "0.0.0.0:${INTERNAL_PORT}" \ From e55ea19350a4278c3e0a5c4ef79b9f6585578072 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Wed, 6 Dec 2023 11:04:43 -0500 Subject: [PATCH 2/3] chore: require at least werkzeug 2.2.3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9b93af98..5a89bef2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ requests = "^2.28.1" Flask = "~2.2.5" pydantic = "^2.0.2" flask-cors = "^4.0.0" -werkzeug = "~2.2.2" # debugpy is broken with werkzeug 2.3.x so pin this manually +werkzeug = "~2.2.3" # debugpy is broken with werkzeug 2.3.x so pin this manually [tool.poetry.group.dev.dependencies] coverage = "^7.2.2" From 9074499c1c8130448ead3bf8b6a88de967e410ff Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Wed, 6 Dec 2023 11:08:55 -0500 Subject: [PATCH 3/3] typo --- run.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.bash b/run.bash index 00373c25..745e1ee3 100644 --- a/run.bash +++ b/run.bash @@ -27,4 +27,4 @@ gunicorn bento_wes.app:application \ --workers 1 \ --worker-class 'gevent' \ --threads "$(( 2 * $(nproc --all) + 1))" \ - --bind "0.0.0.0:${INTERNAL_PORT}" \ + --bind "0.0.0.0:${INTERNAL_PORT}"