2
2
3
3
Driver to run an openEO back-end that combines the collections and compute power of a set of openEO back-ends.
4
4
5
- ## Install
5
+
6
+ ## Installation
6
7
7
8
Basic install from source, preferably in some kind of virtual environment:
8
9
9
10
pip install .
10
11
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":
12
13
13
14
pip install -e .[dev]
14
15
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.
16
42
17
43
### Flask dev mode
18
44
@@ -23,7 +49,7 @@ for example (also see `./scripts/run-flask-dev.sh`):
23
49
export FLASK_ENV=development
24
50
flask run
25
51
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
27
53
28
54
### With gunicorn
29
55
@@ -32,24 +58,31 @@ for example (also see `./scripts/run-gunicorn.sh`):
32
58
33
59
gunicorn --workers=4 --bind 0.0.0.0:8080 'openeo_aggregator.app:create_app()'
34
60
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
36
62
37
63
38
64
## Docker image
39
65
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. :
41
67
42
- docker build -t openeo-aggregator .
68
+ docker build -t openeo-aggregator -f docker/Dockerfile .
43
69
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 `
46
71
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:
48
74
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
50
81
82
+ The webapp should be available at http://localhost:8080/openeo/1.2
51
83
52
- ## Configuration
84
+
85
+ ## Further configuration
53
86
54
87
The flask/gunicorn related configuration can be set through
55
88
standard flask/gunicorn configuration means
@@ -60,26 +93,14 @@ like command line options or env variables, as shown above.
60
93
For gunicorn there is an example config at ` src/openeo_aggregator/config/examples/gunicorn-config.py ` ,
61
94
for example to be used like this:
62
95
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()'
79
97
80
98
### Logging
81
99
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
83
104
84
105
## Running tests
85
106
0 commit comments