Skip to content

Commit

Permalink
Merge pull request #12 from csiro-easi/gunicorn-workers
Browse files Browse the repository at this point in the history
Change to async worker class and increase timeout
  • Loading branch information
mpaget authored Feb 2, 2023
2 parents 051921b + 18f5048 commit 0ad804d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG py_env_path=/env

FROM csiroeasi/geobase-builder:develop.latest as env_builder
FROM csiroeasi/geobase-builder:master.latest as env_builder

ARG py_env_path

Expand All @@ -15,7 +15,7 @@ RUN ${py_env_path}/bin/python -m pip install --no-cache-dir -r /conf/requiremen

ENV PATH=${py_env_path}/bin:$PATH

FROM csiroeasi/geobase-runner:develop.latest
FROM csiroeasi/geobase-runner:master.latest

RUN mkdir -p /code/logs
RUN mkdir -p /code/outputs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ This part is flow-on from Workflow testing
### DescribeProcess
- Returns a description of a configured process in XML format (accepted input formats, data types etc.)
- Returned XML provides framework for input data to execute described process.
- Locally accessed via http://localhost:8000/?service=WPS&version=1.0.0&request=DescribeProcess&identifier=<PROCESS NAME>
- Locally accessed via http://localhost:8000/?service=WPS&version=1.0.0&request=DescribeProcess&identifier=PROCESS-IDENTIFIER

### Execute
- Runs a specified process.
Expand Down
4 changes: 4 additions & 0 deletions gunicorn.conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from prometheus_flask_exporter.multiprocess import \
GunicornInternalPrometheusMetrics

# Settings, https://docs.gunicorn.org/en/stable/settings.html
# Check what the server sees: gunicorn --print-config datacube_wps:app
timeout = 600 # 10 mins
worker_class = 'gevent'

def child_exit(server, worker):
GunicornInternalPrometheusMetrics.mark_process_dead_on_child_exit(worker.pid)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--extra-index-url="https://packages.dea.ga.gov.au"
flask
pywps
gunicorn
gunicorn[gevent]
datacube
altair
altair_saver
Expand Down

0 comments on commit 0ad804d

Please sign in to comment.