Skip to content

Commit

Permalink
Issue #117 move example configs inside package tree
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Aug 30, 2024
1 parent 93cb177 commit 13871c1
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 11 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ RUN pip install --upgrade pip && \
pip install .


# TODO #117/#143 eliminate conf/gunicorn.prod.py reference
CMD ["gunicorn", "--config=conf/gunicorn.prod.py", "openeo_aggregator.app:create_app()"]
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ like command line options or env variables, as shown above.

### Gunicorn config

For gunicorn there are also configuration files in the `conf` folder.
The production docker based run for examples uses
For gunicorn there is an example config at `src/openeo_aggregator/config/examples/gunicorn-config.py`,
for example to be used like this:

gunicorn --config=conf/gunicorn.prod.py openeo_aggregator.app:create_app()
gunicorn --config=src/openeo_aggregator/config/examples/gunicorn-config.py openeo_aggregator.app:create_app()

### Application/Flask config

Expand All @@ -78,11 +78,9 @@ variant of this application config:
- `conf/aggregator.prod.py`

Use the env var `OPENEO_BACKEND_CONFIG` to point to the desired config path.
By default, `conf/aggregator.dummy.py` is loaded.
For example, using the example dummy config from the repo:

For example, when using the Docker image, add something like this

-e OPENEO_BACKEND_CONFIG=/home/openeo/aggregator/conf/aggregator.dev.py
export OPENEO_BACKEND_CONFIG=src/openeo_aggregator/config/examples/aggregator.dummy.py

Also note that these concrete config files will be refactored out of the `openeo-aggregator` repo
at some point in the future ([#117](https://github.com/Open-EO/openeo-aggregator/issues/117))
Expand Down
1 change: 1 addition & 0 deletions conf/gunicorn.dev.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# See https://docs.gunicorn.org/en/stable/settings.html
# TODO #117 eliminate this file from this repository

bind = ["0.0.0.0:8080"]

Expand Down
1 change: 1 addition & 0 deletions conf/gunicorn.prod.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# See https://docs.gunicorn.org/en/stable/settings.html
# TODO #117 eliminate this file from this repository

bind = ["0.0.0.0:8080"]

Expand Down
2 changes: 1 addition & 1 deletion scripts/run-gunicorn.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

gunicorn --config=conf/gunicorn.dev.py 'openeo_aggregator.app:create_app()'
gunicorn --config=src/openeo_aggregator/config/examples/gunicorn-config.py 'openeo_aggregator.app:create_app()'
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
url="https://github.com/Open-EO/openeo-aggregator",
packages=find_packages(where="src", include=["openeo_aggregator", "openeo_aggregator.*"]),
package_dir={"": "src"},
package_data={"openeo_aggregator": ["config/examples/*.py"]},
include_package_data=True,
data_files=[
(
"openeo-aggregator-data",
[
"CHANGELOG.md",
"conf/gunicorn.dev.py",
"conf/gunicorn.prod.py",
"conf/aggregator.dummy.py",
"conf/gunicorn.dev.py", # TODO #117 eliminate gunicorn.dev.py reference
"conf/gunicorn.prod.py", # TODO #117 eliminate gunicorn.prod.py reference
],
),
],
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions src/openeo_aggregator/config/examples/gunicorn-config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://docs.gunicorn.org/en/stable/settings.html

bind = ["0.0.0.0:8080"]

workers = 1
threads = 1

# Worker timeout
timeout = 60

0 comments on commit 13871c1

Please sign in to comment.