Skip to content

Commit b7b0068

Browse files
committed
Update readme docs to current situation
related to #117
1 parent 19d2da5 commit b7b0068

File tree

2 files changed

+51
-32
lines changed

2 files changed

+51
-32
lines changed

README.md

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,43 @@
22

33
Driver to run an openEO back-end that combines the collections and compute power of a set of openEO back-ends.
44

5-
## Install
5+
6+
## Installation
67

78
Basic install from source, preferably in some kind of virtual environment:
89

910
pip install .
1011

11-
When planning to do development, it is recommended to install it in development mode with the `dev` "extra":
12+
When planning to do development, it is recommended to install it in development mode (option `-e`) with the `dev` "extra":
1213

1314
pip install -e .[dev]
1415

15-
## Usage
16+
17+
## Configuration
18+
19+
The openEO-Aggregator specific configuration,
20+
is grouped by an `AggregatorBackendConfig` container object
21+
(subclass of `OpenEoBackendConfig` as defined in the `openeo-python-driver` framework project).
22+
The most important config value is `aggregator_backends`, which
23+
defines the backends to "aggregate".
24+
See [`src/openeo_aggregator/config/config.py`](src/openeo_aggregator/config/config.py)
25+
for more details and other available configuration options.
26+
27+
Use the env var `OPENEO_BACKEND_CONFIG` to point to the desired config path.
28+
For example, using the example [dummy config](src/openeo_aggregator/config/examples/aggregator.dummy.py)
29+
from the repo:
30+
31+
export OPENEO_BACKEND_CONFIG=src/openeo_aggregator/config/examples/aggregator.dummy.py
32+
33+
When no valid openEO-Aggregator is set that way, you typically get this error:
34+
35+
ConfigException: Expected AggregatorBackendConfig but got OpenEoBackendConfig
36+
37+
38+
## Running the webapp
39+
40+
Note, as mentioned above: make sure you point to a valid configuration file
41+
before trying to run the web app.
1642

1743
### Flask dev mode
1844

@@ -23,7 +49,7 @@ for example (also see `./scripts/run-flask-dev.sh`):
2349
export FLASK_ENV=development
2450
flask run
2551

26-
The webapp should be available at http://localhost:5000/openeo/1.0
52+
The webapp should be available at http://localhost:5000/openeo/1.2
2753

2854
### With gunicorn
2955

@@ -32,24 +58,31 @@ for example (also see `./scripts/run-gunicorn.sh`):
3258

3359
gunicorn --workers=4 --bind 0.0.0.0:8080 'openeo_aggregator.app:create_app()'
3460

35-
The webapp should be available at http://localhost:8080/openeo/1.0
61+
The webapp should be available at http://localhost:8080/openeo/1.2
3662

3763

3864
## Docker image
3965

40-
There is a `Dockerfile` to build a Docker image, for example:
66+
The [docker](docker) folder has a `Dockerfile` to build a Docker image, e.g.:
4167

42-
docker build -t openeo-aggregator .
68+
docker build -t openeo-aggregator -f docker/Dockerfile .
4369

44-
The image runs the app in gunicorn by default, serving on `0.0.0.0:8080`.
45-
For example, to run it locally:
70+
This image is built and hosted by VITO at `vito-docker.artifactory.vgt.vito.be/openeo-aggregator`
4671

47-
docker run --rm -p 8080:8080 openeo-aggregator
72+
The image runs the app in gunicorn by default (serving on `127.0.0.1:8000`).
73+
Example usage, with some extra gunicorn settings and the built-in dummy config:
4874

49-
The webapp should be available at http://localhost:8080/openeo/1.0
75+
docker run \
76+
--rm \
77+
-p 8080:8080 \
78+
-e GUNICORN_CMD_ARGS='--bind=0.0.0.0:8080 --workers=2' \
79+
-e OPENEO_BACKEND_CONFIG=/home/openeo/venv/lib/python3.11/site-packages/openeo_aggregator/config/examples/aggregator.dummy.py \
80+
vito-docker.artifactory.vgt.vito.be/openeo-aggregator:latest
5081

82+
The webapp should be available at http://localhost:8080/openeo/1.2
5183

52-
## Configuration
84+
85+
## Further configuration
5386

5487
The flask/gunicorn related configuration can be set through
5588
standard flask/gunicorn configuration means
@@ -60,26 +93,14 @@ like command line options or env variables, as shown above.
6093
For gunicorn there is an example config at `src/openeo_aggregator/config/examples/gunicorn-config.py`,
6194
for example to be used like this:
6295

63-
gunicorn --config=src/openeo_aggregator/config/examples/gunicorn-config.py openeo_aggregator.app:create_app()
64-
65-
### Application/Flask config
66-
67-
The openEO-Aggregator specific configuration,
68-
is grouped by an `AggregatorBackendConfig` container object
69-
(subclass of `OpenEoBackendConfig` as defined in the `openeo-python-driver` framework project).
70-
The most important config value is `aggregator_backends`, which
71-
defines the backends to "aggregate".
72-
See `src/openeo_aggregator/config/config.py` for more details and other available configuration options.
73-
74-
Use the env var `OPENEO_BACKEND_CONFIG` to point to the desired config path.
75-
For example, using the example dummy config from the repo:
76-
77-
export OPENEO_BACKEND_CONFIG=src/openeo_aggregator/config/examples/aggregator.dummy.py
78-
96+
gunicorn --config=src/openeo_aggregator/config/examples/gunicorn-config.py 'openeo_aggregator.app:create_app()'
7997

8098
### Logging
8199

82-
Logging is set up (by default) through `config/logging-json.conf`.
100+
By default, logging is done in JSON format.
101+
You can switch to a simple text-based logging with this env var:
102+
103+
OPENEO_AGGREGATOR_SIMPLE_LOGGING=1
83104

84105
## Running tests
85106

src/openeo_aggregator/config/examples/aggregator.dummy.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@
1111
capabilities_title="openEO Aggregator Dummy",
1212
capabilities_description="openEO Aggregator Dummy instance.",
1313
aggregator_backends={
14-
"dummy": "https://openeo.example/openeo/1.1/",
14+
"dummy": "https://openeo.example/",
1515
},
1616
oidc_providers=[
1717
OidcProvider(
1818
id="egi",
1919
title="EGI Check-in",
2020
issuer="https://aai.egi.eu/auth/realms/egi/",
21-
scopes=["openid"],
2221
),
2322
],
24-
zookeeper_prefix="/openeo/aggregator/dummy/",
2523
)

0 commit comments

Comments
 (0)