Setup#
This document describes the configuration options for the Urban Model Platform (UMP). The configuration is managed using environment variables, which can be set in the .env
file. Below is a detailed explanation of the available configuration options.
Environment Variables#
App Settings#
Variable |
Description |
Default Value |
---|---|---|
|
Logging level for the application. |
|
|
Path to the providers configuration file. |
|
|
Base URL of the API server. Used in job details responses. |
|
|
Interval (in seconds) for checking remote job statuses. |
|
|
Name of the PostgreSQL database. |
|
|
Hostname of the PostgreSQL database. |
|
|
Port of the PostgreSQL database. |
|
|
Username for the PostgreSQL database. |
|
|
Password for the PostgreSQL database. |
|
|
URL of the GeoServer instance. |
|
|
Hostname of the GeoServer database. |
|
|
Port of the GeoServer database. |
|
|
Name of the GeoServer workspace. |
|
|
Username for GeoServer. |
|
|
Password for GeoServer. |
|
|
Timeout (in seconds) for GeoServer connections. |
|
|
Interval (in minutes) for cleaning up old jobs. |
|
|
URL of the Keycloak server. |
|
|
Keycloak realm name. |
|
|
Keycloak client ID. |
|
|
Keycloak admin username. |
|
|
Keycloak admin password. |
|
|
subpath prefix, e.g.: “/api” |
|
Example Modelserver Settings#
Variable |
Description |
Default Value |
---|---|---|
|
Hostname for the example modelserver. |
|
|
Internal port for the example modelserver. |
|
|
External port for the example modelserver. |
|
Docker Dev Environment Settings#
Variable |
Description |
Default Value |
---|---|---|
|
Name of the Docker network for the development environment. |
|
|
External port for the UMP web application. |
|
|
External port for the PostgreSQL database used by the API. |
|
|
External port for the GeoServer instance. |
|
|
External port for the Keycloak instance. |
|
Docker Build Settings#
Variable |
Description |
Default Value |
---|---|---|
|
Container registry URL. |
|
|
Namespace for the container registry. |
|
|
Name of the Docker image. |
|
|
Tag for the Docker image. |
|
Testing and running the Application#
Docker containers are used to ease the setup of required services: PostgreSQL database(s), GeoServer and Keycloak.
There are two ways to test the application:
1. Using Docker Compose#
You can build and run the application in a containerized environment using the provided Docker Compose files:
make initiate-dev
Then, adjust the newly created .env file to your needs. After that run:
make build-image
make start-dev # or make start-dev-example
docker compose -f docker-compose-dev.yaml up api -d
2. Running the app locally#
Alternatively, you can run the application locally:
make initiate-dev
make start-dev # or make start-dev-example
gunicorn --workers=1 --bind=0.0.0.0:5000 ump.main:app
Both methods will set up the necessary dependencies (PostgreSQL, GeoServer, Keycloak) for the application to function correctly.
Either use the provided Makefile:
make initiate-dev
Then, adjust the newly created .env file to your needs.
Or do it manually:
Create a virtual python environment:
conda env create -f environment.yaml
Copy providers.yaml:
cp providers.yaml.example providers.yaml
Copy .env.example
cp .env.example .env
Start the required apps with
make start-dev
Or start them with an example process
make start-dev-example
Enjoy!