Configuration - Dc-Maestro
This page describes how to configure the images of the Dc-Maestro module, the pipeline orchestrator of the Datachain solution.
The images are configured through Docker *.env files or environment variables.
|
Unlike the Console and Marketplace images, the Dc-Maestro images currently do not support variables suffixed with |
Overview
Dc-Maestro is delivered as several images. A single image can carry several services, which are distinguished by their startup command.
The images run without root privileges and are compatible with OpenShift: see Running without privileges.
| Service | Image | Ports | Role |
|---|---|---|---|
backend |
maestro/maestro-backend |
8080 |
Maestro REST API |
synchronizer |
maestro/maestro-backend |
None |
Synchronization of pipelines with Airflow |
websockets |
maestro/maestro-backend |
None |
Real-time broadcast of execution events |
db-migration |
maestro/maestro-migrate |
None |
Maestro database migration (single run) |
front-ui |
maestro/maestro-ui |
8080 |
Web interface |
airflow-webserver, airflow-scheduler, airflow-worker, airflow-migration |
maestro/maestro-airflow |
8080 (airflow-webserver only) |
Airflow execution engine (Celery executor) |
maestro-upflower |
maestro/maestro-upflower |
8000 |
Maestro / Airflow link: deposits the DAGs generated by Maestro |
socket-proxy |
maestro/docker-proxy |
2375 |
Filtered access to the Docker API, for launching tasks |
Two additional images are not services: they are the images in which pipeline tasks (maestro/maestro-python3.12-airflow-dc) and DCCode notebooks (maestro/maestro-notebook) run.
Dc-Maestro also uses:
-
one PostgreSQL database for Maestro (
dc_maestro) and one for Airflow (airflow); -
a Valkey (Redis-compatible) server: cache and event queues for Maestro, Celery broker for Airflow.
In an installation integrated into the Datachain suite, these databases are hosted by the dc/pg image (dc_maestro and airflow values of DATABASE_MODE) and the Datachain Valkey: see Data management. Airflow then uses Valkey database number 1, database 0 being reserved for Datachain notifications.
Backend module - Image maestro/maestro-backend
This image carries the Maestro API, as well as the two background processes (Airflow synchronization and WebSocket events). In deployment, three separate services use the same image with a different command.
Image description
Description |
Carries the Dc-Maestro REST API: management of Datachain instances, pipelines, schedules and permissions. Generates the Airflow DAGs, synchronizes their state and broadcasts execution events. |
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Size |
~580MB |
||||||||||
Technical components |
Python 3.12 / FastAPI / Uvicorn / SQLAlchemy (Alembic migrations) |
||||||||||
User |
|
||||||||||
Commands |
|
||||||||||
Volumes |
|
||||||||||
Logs |
Application logs are written to the container’s standard output and to a rotating file (
|
||||||||||
URLs |
|
Environment variables
Variables are read from the container’s environment variables; failing that, from the file designated by ENV_FILE (by default .env in the application directory). An environment value always takes precedence over the one in the file. Booleans accept 0/1 or true/false.
Variables without a default value are required.
Maestro database
| Variable | Default | Description |
|---|---|---|
PG_HOST |
(none) |
PostgreSQL server host |
PG_PORT |
5432 |
PostgreSQL server port |
PG_DB |
(none) |
Database name ( |
PG_USER |
(none) |
PostgreSQL user |
PG_PWD |
(none) |
PostgreSQL user password |
DB_URL |
(built) |
Full SQLAlchemy URL ( |
EXTRA_ENGINE_PARAMS |
(none) |
SQLAlchemy connection pool parameters, in JSON format. Example: |
CONNECT_ARGS |
(none) |
Driver connection arguments, in JSON format |
ECHO_SQL |
0 |
|
Valkey
| Variable | Default | Description |
|---|---|---|
VALKEY_HOST |
(none) |
Valkey server host. The legacy names |
VALKEY_PORT |
6379 |
Valkey server port |
VALKEY_PWD |
(none) |
Valkey password, if protected |
VALKEY_LOCK_TIMEOUT_S |
60 |
Lifetime (in seconds) of the locks set by the different Maestro instances |
Keycloak
| Variable | Default | Description |
|---|---|---|
DC_KEYCLOAK_HOST |
(none) |
Keycloak server URL |
DC_KEYCLOAK_REALM |
(none) |
Keycloak realm ( |
DC_KEYCLOAK_CLIENT_ID |
(none) |
Keycloak client of the Maestro interface ( |
DC_KEYCLOAK_CLIENT_SECRET |
(none) |
Secret of this client. Required for startup; leave empty if the client is public. |
DC_KEYCLOAK_CLIENT_BACKEND |
(none) |
Keycloak client representing the API ( |
DC_KEYCLOAK_CLIENT_AIRFLOW_ID |
(none) |
Keycloak client used by Airflow ( |
DC_KEYCLOAK_CLIENT_AIRFLOW_SECRET |
(none) |
Secret of the Airflow client |
DC_KEYCLOAK_ADMIN |
(none) |
Keycloak administrator account used by Maestro |
DC_KEYCLOAK_ADMIN_PWD |
(none) |
Password of this account |
DC_KEYCLOAK_ADMIN_REALM |
master |
Realm in which the administrator account is defined |
DC_MAESTRO_ADMIN_PWD |
(none) |
Password of the |
DC_KEYCLOAK_GROUPS_LABEL |
user-groups |
Name of the Keycloak attribute that carries the user’s groups |
Instance identification
| Variable | Default | Description |
|---|---|---|
PLATEFORM_ID |
default |
Platform identifier |
MODULE_INSTANCE_ID |
dcm-1 |
Module instance identifier, useful when several backends coexist |
Airflow integration
| Variable | Default | Description |
|---|---|---|
AIRFLOW_API_URL |
(none) |
Airflow REST API URL. Example: |
AIRFLOW_UPFLOWER_URL |
(none) |
Upflower URL. Example: |
AIRFLOW_USER |
(none) |
Airflow user used by Maestro ( |
AIRFLOW_PASSWORD |
(none) |
Password of this user |
AIRFLOW_DB_URI |
(none) |
Direct access to the Airflow database, in the format |
AIRFLOW_ONLY_API |
1 |
|
AIRFLOW_SYNC_DELAY_MIN |
5 |
Frequency of the synchronization with Airflow, in minutes |
STATUS_STREAM_DELAY_SEC |
10 |
Frequency of the execution event broadcast, in seconds |
MIGRATE_ON_UPDATE |
1 |
|
Task execution
These variables define how pipeline tasks are launched by Airflow.
| Variable | Default | Description |
|---|---|---|
DC_AFJOB_IMAGE |
(none) |
Image in which Datachain tasks run ( |
DEPLOY_MODE |
SWARM |
Deployment mode: |
DC_AF_OPERATOR |
DockerOperator |
Airflow operator used by default |
DOCKER_URI |
tcp://socket-proxy:2375 |
Address of the Docker API used by tasks (in practice the |
DOCKER_NETWORK |
(none) |
Docker network to which each task container is attached |
DOCKER_NETWORKS |
(none) |
For DCCode tasks: list of networks separated by |
DOCKER_SWARM_PLACEMENT |
(none) |
Swarm placement constraints for task containers |
DOCKER_FORCE_PULL |
false |
|
ADOBIS_REGISTRY_CONN_ID |
(none) |
Identifier of the Airflow connection used to authenticate against the image registry when pulling the image of a Docker task. The connection is declared on the Airflow side ( |
K8S_NAMESPACE |
datachain |
Kubernetes: namespace in which to launch tasks |
K8S_REGISTRY_SECRETS |
datachain-ovh-registry-credential |
Kubernetes: secret used to pull images |
K8S_AFFINITY |
(none) |
Kubernetes: affinity rules of the task pods |
K8S_SECURITY_CONTEXT |
|
Kubernetes: security context of the DCCode pods |
K8S_DCCODE_IMAGE |
(none) |
Kubernetes: image of the DCCode tasks |
DCCode
| Variable | Default | Description |
|---|---|---|
DCCODE_LINKER_URL |
(none) |
(Private) URL of the |
DCCODE_PUBLIC_URL |
localhost |
Public URL of DCCode |
DCCODE_RUN_IMAGE |
(reference image) |
Image in which DCCode notebooks run ( |
Email sending (SMTP)
| Variable | Default | Description |
|---|---|---|
SMTP_SERVER |
(none) |
SMTP server |
SMTP_PORT |
(none) |
SMTP server port (25, 465 or 587) |
SMTP_SENDER |
Sender address |
|
DC_MAESTRO_ADMIN_EMAIL |
(none) |
Email address of the instance administrator: it is added to the recipients of pipeline notification emails. Must be a valid address, otherwise startup fails. |
SMTP_USER |
(none) |
SMTP account. Without |
SMTP_PASSWORD |
(none) |
SMTP account password |
SMTP_STARTTLS |
true |
STARTTLS after connection (ports 25 and 587) |
SMTP_SSL |
false |
Implicit SSL from the connection (port 465). Takes precedence over |
SMTP_TIMEOUT |
30 |
Timeout, in seconds, of the connection and of each SMTP exchange |
TEMPLATE_PATH |
app/core/templates/ |
Directory of email templates |
Maestro addresses
| Variable | Default | Description |
|---|---|---|
MAESTRO_PUBLIC_URL |
(none) |
Address where users open Maestro (the web interface): used for the links in emails. If absent, the legacy |
MAESTRO_PRIVATE_API_URL |
(none) |
Address of the Maestro API, as seen by task containers ( |
DC_MAESTRO_API_PREFIX |
(empty) |
URL prefix (for example |
USE_INSTANCE_PRIVATE_URL |
(not set) |
If the variable is set (whatever its value, including |
History purge
The purge of the execution history is disabled by default: nothing is deleted unless HISTORY_PURGE_ENABLED is true.
| Variable | Default | Description |
|---|---|---|
HISTORY_PURGE_ENABLED |
false |
Enables the purge |
HISTORY_PURGE_DRY_RUN |
false |
|
HISTORY_KEEP_RUNS |
500 |
Maximum number of runs kept per pipeline (the most recent ones) |
HISTORY_RETENTION_DAYS |
548 |
Maximum age of a run, in days (548 days = 18 months) |
HISTORY_RULE |
cap |
|
HISTORY_PURGE_DELETED_PIPELINES |
true |
Also purges the history of pipelines that no longer exist |
HISTORY_SYNC_KEEP_DAYS |
30 |
Retention period, in days, of synchronization rows (the last successful synchronization is always kept) |
HISTORY_PURGE_HOUR |
3 |
The purge runs once a day, starting at this hour (0-23, server time) |
HISTORY_PURGE_BATCH |
500 |
Number of runs deleted per transaction |
HISTORY_PURGE_MAX_SECONDS |
600 |
Maximum duration of a purge, in seconds (the rest is processed the next day) |
The HISTORY_KEEP_RUNS, HISTORY_RETENTION_DAYS and HISTORY_RULE values have the same defaults as the airflow_db_cleanup Airflow maintenance DAG: it is recommended to keep them identical on both sides.
Logs and execution
| Variable | Default | Description |
|---|---|---|
LOG_FILENAME |
/opt/adobis/logs/maestro.log |
Log file path. The provided deployments use |
LOG_MAXBYTES |
10000000 |
Maximum size of a log file before rotation, in bytes (10 MB by default) |
LOG_BACKUPCOUNT |
3 |
Number of archived log files kept |
DEBUG |
0 |
Enables debug logs |
HOST |
0.0.0.0 (image) |
API listening address |
PORT |
8080 (image) |
API listening port |
UVICORN_WORKERS |
8 (image) |
Number of Uvicorn processes of the API. Only the backend service uses it. |
TTL_CACHE_MIN |
5 |
Lifetime, in minutes, of the internal cache |
ENV_FILE |
.env |
Variables file read in addition to the environment |
DEV |
0 |
Development mode (automatic code reload, single process). Do not use in production. |
Configuration file
The image embeds a default .env file, which the container’s environment variables override. Example of a backend.env file for a Docker Swarm deployment (values between angle brackets must be replaced):
# Maestro database
PG_HOST=<postgresql host>
PG_PORT=5432
PG_DB=dc_maestro
PG_USER=<user>
PG_PWD=<password>
# Valkey
VALKEY_HOST=<valkey host>
# Keycloak
DC_KEYCLOAK_HOST=<public keycloak url>
DC_KEYCLOAK_REALM=dc-realm
DC_KEYCLOAK_CLIENT_ID=maestro
DC_KEYCLOAK_CLIENT_SECRET=<maestro client secret>
DC_KEYCLOAK_ADMIN=<keycloak administrator>
DC_KEYCLOAK_ADMIN_PWD=<password>
DC_KEYCLOAK_ADMIN_REALM=master
DC_KEYCLOAK_CLIENT_AIRFLOW_ID=maestro_airflow
DC_KEYCLOAK_CLIENT_AIRFLOW_SECRET=<maestro_airflow client secret>
DC_KEYCLOAK_CLIENT_BACKEND=maestro_backend
DC_MAESTRO_ADMIN_PWD=<maestro-sys password>
# Airflow
AIRFLOW_UPFLOWER_URL=http://maestro-upflower:8000/
AIRFLOW_API_URL=http://airflow-api:8080/api/v1/
AIRFLOW_USER=maestro
AIRFLOW_PASSWORD=<password of the maestro airflow user>
AIRFLOW_ONLY_API=1
DOCKER_URI=tcp://socket-proxy:2375
DC_AFJOB_IMAGE=<registry>/maestro/maestro-python3.12-airflow-dc:<version>
DEPLOY_MODE=SWARM
# Maestro addresses
MAESTRO_PUBLIC_URL=https://<maestro domain name>
MAESTRO_PRIVATE_API_URL=http://maestro-backend
# SMTP
SMTP_SERVER=<smtp server>
SMTP_PORT=587
SMTP_SENDER=<sender>
SMTP_USER=<smtp account>
SMTP_PASSWORD=<password>
# Logs
LOG_FILENAME=/log/maestro_logs.log
LOG_MAXBYTES=104800
LOG_BACKUPCOUNT=3
EXTRA_ENGINE_PARAMS={"pool_size":20,"max_overflow":5}
STATUS_STREAM_DELAY_SEC=10
AIRFLOW_SYNC_DELAY_MIN=5
Each of the following variables is read by only one service. To adjust them, define them at the level of that service in the deployment file (docker-compose) rather than in backend.env, which is shared by all services:
| Variable | Service | Default | Role |
|---|---|---|---|
UVICORN_WORKERS |
backend |
8 (image) |
Number of Uvicorn processes of the API |
MIGRATE_ON_UPDATE |
synchronizer |
1 |
Migration of existing DAGs at each startup |
AIRFLOW_SYNC_DELAY_MIN |
synchronizer |
5 |
Frequency of the synchronization with Airflow, in minutes |
STATUS_STREAM_DELAY_SEC |
websockets |
10 |
Frequency of the execution event broadcast, in seconds |
As an example, the provided Docker Swarm deployments reduce the synchronization frequency to 2 minutes and the event frequency to 5 seconds, and may limit the API to 3 processes.
Migration module - Image maestro/maestro-migrate
This image applies the Maestro database migrations (Alembic). It is run once at each installation or update, before the backend starts, and then stops.
Image description
Description |
Migrates the Maestro database schema to the image version ( |
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
Size |
~540MB |
|||||||||
Technical components |
Python 3.12 / Alembic / PostgreSQL client ( |
|||||||||
User |
|
|||||||||
Volumes |
|
|||||||||
URLs |
None: the container runs and then stops. The service must not be restarted automatically (restart policy |
Environment variables
| Variable | Default | Description |
|---|---|---|
PG_HOST |
(none) |
PostgreSQL server host |
PG_PORT |
5432 |
PostgreSQL server port |
PG_DB |
(none) |
Database name ( |
PG_USER |
(none) |
PostgreSQL user. Must be able to modify the schema. |
PG_PWD |
(none) |
PostgreSQL user password |
DUMP_DB |
(disabled) |
The value |
RESET_DB |
(disabled) |
The value |
The service must access the same database as the backend. The PG_* variables are the same as those of the backend.
Interface module - Image maestro/maestro-ui
This image serves the Maestro web interface (Angular application). Its configuration is injected into the application files when the container starts: it does not require rebuilding the image.
Image description
Description |
Dc-Maestro web interface: design, scheduling and monitoring of pipelines. |
||||||
|---|---|---|---|---|---|---|---|
Size |
~85MB |
||||||
Technical components |
Angular application served by Nginx (alpine) |
||||||
User |
|
||||||
URLs |
|
Environment variables
| Variable | Default | Description |
|---|---|---|
MAESTRO_API_URL |
(none) |
Public URL of the Maestro API, as seen from the browser. Example: |
MAESTRO_WS_URL |
(none) |
Public URL of the Maestro WebSockets. Example: |
MAESTRO_KEYCLOAK_AUTH_URL |
(none) |
Keycloak authentication URL, as seen from the browser (ends with |
MAESTRO_KEYCLOAK_REALM |
(none) |
Keycloak realm ( |
MAESTRO_KEYCLOAK_CLIENT_ID |
(none) |
Keycloak client of the interface ( |
DOCUMENTATION_BASE_URL |
|
Documentation URL, used by the interface help links |
SUPPORT_BASE_URL |
|
Support URL, used by the interface help links |
IS_EXPOSV2_ACTIVE |
(none) |
|
IS_DCCODE_ACTIVE |
(none) |
|
AIRFLOW_TIME_ZONE |
(none) |
Airflow time zone, used to display schedules |
Configuration file
MAESTRO_API_URL=https://<maestro domain name>/api
MAESTRO_WS_URL=wss://<maestro domain name>/api
MAESTRO_KEYCLOAK_AUTH_URL=https://<public keycloak url>/auth
MAESTRO_KEYCLOAK_REALM=dc-realm
MAESTRO_KEYCLOAK_CLIENT_ID=maestro
DOCUMENTATION_BASE_URL=https://docs.adobisdc.fr/fr/datachain-maestro/current/
SUPPORT_BASE_URL=<support url>
IS_EXPOSV2_ACTIVE=true
IS_DCCODE_ACTIVE=false
AIRFLOW_TIME_ZONE=Europe/Paris
Airflow module - Image maestro/maestro-airflow
Apache Airflow 2.11 image (Python 3.12) enriched with Maestro extensions (plugins, email templates, Datachain client). The same image carries four services, which are distinguished by their command.
Image description
Description |
Runs the pipelines generated by Maestro as Airflow DAGs, with the Celery executor. |
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Size |
~2.8GB |
||||||||||
Technical components |
Apache Airflow 2.11 / Python 3.12 / Celery |
||||||||||
User |
|
||||||||||
Commands |
|
||||||||||
Volumes |
|
||||||||||
URLs |
|
Environment variables
Airflow is configured through the standard AIRFLOW__<SECTION>__<KEY> variables, described in the Apache Airflow documentation. The variables below are those set in the provided deployments, and shared by the four services through an airflow_common.env file.
| Variable | Deployment value | Description |
|---|---|---|
AIRFLOW__CORE__EXECUTOR |
CeleryExecutor |
Task executor |
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN |
|
Airflow metadata database |
AIRFLOW__CELERY__RESULT_BACKEND |
|
Celery task results (same database) |
AIRFLOW__CELERY__BROKER_URL |
|
Celery broker (Valkey). Use a database different from those already used elsewhere. |
AIRFLOW__CORE__FERNET_KEY |
(to be defined) |
Encryption key for Airflow connections and variables |
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION |
true |
DAGs are created paused |
AIRFLOW__CORE__LOAD_EXAMPLES |
false |
Do not load example DAGs |
AIRFLOW__CORE__MIN_SERIALIZED_DAG_UPDATE_INTERVAL |
5 |
Minimum update interval of serialized DAGs, in seconds |
AIRFLOW__CORE__MAX_ACTIVE_RUNS_PER_DAG |
1 |
Maximum number of simultaneous runs of a single DAG |
AIRFLOW__CORE__MAX_ACTIVE_TASKS_PER_DAG |
5 |
Maximum number of simultaneous tasks of a single DAG |
AIRFLOW__CORE__PARALLELISM |
15 |
Maximum number of simultaneous tasks across the whole of Airflow |
AIRFLOW__API__AUTH_BACKENDS |
|
API authentication methods. Basic authentication is required by Maestro. |
AIRFLOW__WEBSERVER__BASE_URL |
Web server base address |
|
AIRFLOW__WEBSERVER__PAGE_SIZE |
20 |
Number of items per page |
AIRFLOW__WEBSERVER__WEB_SERVER_WORKER_TIMEOUT |
300 |
Web server worker timeout, in seconds |
AIRFLOW__LOGGING__LOGGING_LEVEL |
INFO |
Log level |
AIRFLOW__LOGGING__EXTRA_LOGGER_NAMES |
maestro |
Additional loggers taken into account |
AIRFLOW__SMTP__SMTP_HOST |
(smtp server) |
SMTP server for Airflow emails |
AIRFLOW__SMTP__SMTP_PORT |
587 |
SMTP port |
AIRFLOW__SMTP__SMTP_STARTTLS |
True |
STARTTLS |
AIRFLOW__SMTP__SMTP_USER |
(smtp account) |
SMTP account |
AIRFLOW__SMTP__SMTP_PASSWORD |
(password) |
SMTP password |
AIRFLOW__SMTP__SMTP_MAIL_FROM |
(sender) |
Sender address |
ADOBIS_REGISTRY_CONN_ID, AIRFLOW_CONN_ADOBIS_REGISTRY |
(empty if DCCode inactive) |
Airflow connection to the image registry, used to pull the image of Docker tasks and, with DCCode, that of notebooks ( |
The following variables are set in the image and can be overridden: AIRFLOW__EMAIL__EMAIL_BACKEND (custom_utils.email_handler.send_email_with_id), AIRFLOW__EMAIL__HTML_CONTENT_TEMPLATE (/opt/airflow/mail_template.j2.html) and AIRFLOW__EMAIL__SUBJECT_TEMPLATE (/opt/airflow/mail_subject.j2.html).
Variables specific to the migration service (airflow-migration):
| Variable | Value | Description |
|---|---|---|
_AIRFLOW_DB_MIGRATE |
true |
Migrates the Airflow database at startup |
_AIRFLOW_WWW_USER_CREATE |
true |
Creates the Maestro Airflow user |
_AIRFLOW_WWW_USER_USERNAME |
maestro |
User name. Must match the backend’s |
_AIRFLOW_WWW_USER_PASSWORD |
(password) |
User password. Must match the backend’s |
Configuration file
AIRFLOW__CORE__EXECUTOR=CeleryExecutor
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://<user>:<password>@<postgresql host>/airflow
AIRFLOW__CELERY__RESULT_BACKEND=db+postgresql://<user>:<password>@<postgresql host>/airflow
AIRFLOW__CELERY__BROKER_URL=redis://<valkey host>:6379/1
AIRFLOW__CORE__FERNET_KEY=<fernet key>
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION=true
AIRFLOW__CORE__LOAD_EXAMPLES=false
AIRFLOW__CORE__MAX_ACTIVE_RUNS_PER_DAG=1
AIRFLOW__CORE__MAX_ACTIVE_TASKS_PER_DAG=5
AIRFLOW__CORE__PARALLELISM=15
AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.basic_auth,airflow.api.auth.backend.session
AIRFLOW__WEBSERVER__BASE_URL=http://airflow-api
AIRFLOW__LOGGING__EXTRA_LOGGER_NAMES=maestro
AIRFLOW__LOGGING__LOGGING_LEVEL=INFO
AIRFLOW__SMTP__SMTP_HOST=<smtp server>
AIRFLOW__SMTP__SMTP_PORT=587
AIRFLOW__SMTP__SMTP_STARTTLS=True
AIRFLOW__SMTP__SMTP_USER=<smtp account>
AIRFLOW__SMTP__SMTP_PASSWORD=<password>
AIRFLOW__SMTP__SMTP_MAIL_FROM=<sender>
Upflower module - Image maestro/maestro-upflower
The Upflower is the link service between Maestro and Airflow: it receives the generated DAGs from Maestro and deposits them in the Airflow DAG directory. It verifies the Keycloak token of the calls it receives.
Image description
Description |
API for depositing the Airflow DAGs generated by Maestro. Also delivers, at startup, the maintenance DAGs provided with the image ( |
||||||
|---|---|---|---|---|---|---|---|
Size |
~200MB |
||||||
Technical components |
Python 3.12 / FastAPI / Uvicorn (3 processes) |
||||||
User |
|
||||||
Volumes |
|
||||||
URLs |
|
Environment variables
| Variable | Default | Description |
|---|---|---|
DC_KEYCLOAK_HOST |
localhost |
Keycloak server URL |
DC_KEYCLOAK_REALM |
dc-realm |
Keycloak realm |
DC_KEYCLOAK_CLIENT_ID |
maestro |
Keycloak client |
DC_KEYCLOAK_CLIENT_SECRET |
(none) |
Keycloak client secret |
DC_KEYCLOAK_AUDIENCE |
maestro_backend |
Audience expected in received tokens |
AIRFLOW_DAG_PATH |
/opt/airflow/dags |
DAG directory in the container |
AIRFLOW_MAESTRO_FOLDER |
maestro |
Subdirectory of the DAGs generated by Maestro |
AIRFLOW_OPS_FOLDER |
ops |
Subdirectory of the maintenance DAGs delivered with the image |
UPFLOWER_SEED_OPS_DAGS |
1 |
|
UPFLOWER_OPS_DAGS_DIR |
/app/ops_dags |
Directory, in the image, of the delivered maintenance DAGs |
AIRFLOW_UID |
1000 |
Owner of the deposited DAG files. Since the Upflower does not run as |
AIRFLOW_GID |
0 |
Group of the deposited DAG files: must be a group of the Upflower ( |
LOGLEVEL |
INFO |
Log level |
The parameters of the maintenance DAGs (history retention, for example) are also set through Upflower environment variables: the Upflower writes them into the delivered DAG file, which avoids configuring the Airflow services. See Airflow maintenance DAGs (ops).
Airflow maintenance DAGs (ops)
The maestro/maestro-upflower image delivers two maintenance DAGs, which clean up Airflow’s technical data (Airflow 2.x). They are not Maestro DAGs: they are deposited in the ops subdirectory of the DAG directory (variable AIRFLOW_OPS_FOLDER), not in maestro.
| DAG | Role |
|---|---|
|
Cleans up the Airflow database: run history, technical tables (jobs, sessions, Celery results, import errors) and audit log. It can also purge the metadata of DAGs that were deleted without being cleaned up. |
|
Deletes old Airflow log files: execution logs of each DAG, scheduler logs, empty folders, and log folders of deleted DAGs. |
How it works
-
Delivery: at startup, the Upflower copies the files delivered with the image (directory
/app/ops_dags, variableUPFLOWER_OPS_DAGS_DIR) into theopsdirectory. A file is rewritten only if its content changes: an image or configuration update is therefore applied when the Upflower restarts. Manual changes made to a delivered file are overwritten. -
Configuration: all the parameters of each DAG are set through environment variables of the Upflower (
OPS_DB_CLEANUP_<PARAMETER>andOPS_LOGS_CLEANUP_<PARAMETER>, in upper case). The Upflower writes the values into the DAG file at delivery time: the Airflow services have nothing to configure. The type of the value is that of the parameter (boolean:true/false,1/0,yes/no,on/off; integer; text). An invalid value is ignored (warning in the Upflower logs) and the default value is kept. -
Deactivation:
UPFLOWER_SEED_OPS_DAGS=0prevents the delivery of the DAGs. The files must then be provided by other means, and their parameters changed directly in theSETTINGSblock of the file. -
Cautious by default: each DAG is created paused and only performs a simulation (dry-run): it reports in its logs what it would delete, without deleting anything.
A DAG is started (unpaused) only when it is created. If the DAG already exists in a paused state, reactivate it once in the Airflow interface (or with airflow dags unpause), even after setting ENABLED to true.
|
Setting up a maintenance DAG
-
Set
OPS_DB_CLEANUP_ENABLED=true(orOPS_LOGS_CLEANUP_ENABLED=true) in the Upflower environment, adjust the other parameters if needed, then restart the Upflower. -
Let the DAG run in simulation mode and check in its logs what would be deleted.
-
Back up the Airflow database (
pg_dump) before the first actual deletion. -
Enable deletions:
OPS_DB_CLEANUP_APPLY=true(orOPS_LOGS_CLEANUP_APPLY=true) in the Upflower environment, or, without restarting, run the DAG manually with theapplyparameter set totrue, or create the Airflow variabledb_cleanup_apply(respectivelylogs_cleanup_apply) set totrue.
On a large database, reduce the retention gradually (for example OPS_DB_CLEANUP_KEEP_RUNS to 5000, then 1000, then 500).
Scope
The SCOPE parameter of both DAGs defines the DAGs concerned:
-
maestro(default): only the DAGs whose file path containsSCOPE_MARKER(by default/maestro/maestro_, i.e. the DAGs generated by Maestro). Other DAGs (handwritten ones, the maintenance DAGs themselves) are never touched; -
all: all the DAGs of the Airflow instance, whether they come from Maestro or not.
airflow_db_cleanup DAG
The DAG never deletes DAGs: the dag and serialized_dag tables are not modified (except with PURGE_ORPHANS, see below). Only the history is cleaned up:
-
technical tables (
job,celery_taskmeta,celery_tasksetmeta,session,import_error): rows older thanTECH_DAYSdays, whatever the scope (these tables are global); -
runs (
dag_run, with their task instances and xcom): according toRUNS_MODE; -
audit log (
log): rows older thanLOG_DAYSdays. A running or queued run is never deleted.
Variable (prefix OPS_DB_CLEANUP_) |
Default | Description |
|---|---|---|
ENABLED |
false |
|
APPLY |
false |
|
SCHEDULE |
|
Schedule (cron expression: without quotes in a Docker environment file), by default every Sunday at 03:00. |
SCOPE |
maestro |
Scope: |
SCOPE_MARKER |
/maestro/maestro_ |
|
TECH_DAYS |
14 |
Technical tables: maximum age, in days |
RUNS_MODE |
keep_runs |
Run cleanup: |
KEEP_RUNS |
500 |
|
RUNS_DAYS |
548 |
|
RUNS_RULE |
cap |
|
LOG_DAYS |
90 |
Audit log ( |
PURGE_ORPHANS |
false |
|
ORPHAN_MIN_AGE_DAYS |
7 |
|
ORPHAN_MAX |
200 |
|
The KEEP_RUNS, RUNS_DAYS and RUNS_RULE values are the same as those of the Maestro history purge (HISTORY_KEEP_RUNS, HISTORY_RETENTION_DAYS and HISTORY_RULE of the backend): keep the same values on both sides.
|
A DAG is purged (PURGE_ORPHANS) only if it has been inactive for more than ORPHAN_MIN_AGE_DAYS days, is within the chosen scope, and has no running execution started less than 3 days ago. Runs are deleted first, in batches, then the DAG itself, as the Airflow REST API does (DELETE /dags/{dag_id}). The audit log rows are kept.
The tasks use the database connection of the Airflow worker: this DAG works with Airflow 2.x only. No archive table is kept.
airflow_logs_cleanup DAG
The DAG deletes, in the Airflow log directory (base_log_folder):
-
the execution log folders (
dag_id=<id>/run_id=<run>) of each DAG in scope, according toRUNS_LOGS_KEEP,RUNS_LOGS_DAYSandRUNS_LOGS_RULE. Age and rank are those of the files (last write); the database is not used. A folder modified during the lastRUNS_LOGS_GRACE_DAYSdays is never deleted; -
optionally, the log folders of DAGs that no longer exist (
DELETED_DAGS_LOGS); -
the files of the
scheduler/folder older thanSCHEDULER_LOGS_DAYSdays; -
empty folders, older than one day;
-
as a safety net, whatever the scope, any log file older than
MAX_AGE_DAYSdays.
Variable (prefix OPS_LOGS_CLEANUP_) |
Default | Description |
|---|---|---|
ENABLED |
false |
|
APPLY |
false |
|
SCHEDULE |
|
Schedule (cron expression), by default every day at 02:00. |
SCOPE |
maestro |
Scope: |
SCOPE_MARKER |
/maestro/maestro_ |
|
RUNS_LOGS_KEEP |
100 |
Maximum number of runs whose logs are kept per DAG (the most recent ones) |
RUNS_LOGS_DAYS |
548 |
Maximum age of the execution logs, in days (18 months) |
RUNS_LOGS_RULE |
cap |
|
RUNS_LOGS_GRACE_DAYS |
1 |
A run folder modified during the last N days is never deleted |
RUNS_LOGS_MAX |
5000 |
Maximum number of run folders deleted per DAG run |
DELETED_DAGS_LOGS |
false |
|
DELETED_DAGS_MIN_AGE_DAYS |
7 |
|
DELETED_DAGS_MAX |
500 |
|
MAX_AGE_DAYS |
730 |
Safety net: any log file older than N days is deleted, for all DAGs, known to the database or not (730 days, i.e. 2 years; |
SCHEDULER_LOGS_DAYS |
7 |
Files of the |
Log retention is independent of the run history retention (database). With the maestro scope, the deletion of the logs of a DAG deleted from the database can no longer be linked to Maestro: these logs are deleted by MAX_AGE_DAYS, or by DELETED_DAGS_LOGS with the all scope. To avoid any deletion by mistake, the DAG refuses to run if the database knows none of the DAGs present in the log directory (wrong or empty database). The log directory seen by the worker is that of its host: it is shared by the Airflow services of the same host.
If a handwritten log cleanup DAG already exists in the DAG directory, remove it so that the two do not run at the same time.
Configuration example
Variables to add to the Upflower environment file, to enable both DAGs with actual deletions:
# Airflow database cleanup
OPS_DB_CLEANUP_ENABLED=true
OPS_DB_CLEANUP_APPLY=true
OPS_DB_CLEANUP_KEEP_RUNS=500
OPS_DB_CLEANUP_RUNS_DAYS=548
# Log file cleanup
OPS_LOGS_CLEANUP_ENABLED=true
OPS_LOGS_CLEANUP_APPLY=true
OPS_LOGS_CLEANUP_SCHEDULE=0 2 * * *
Docker Proxy module - Image maestro/docker-proxy
This image (HAProxy 2.6) exposes the node’s Docker API with limited permissions. It allows the Airflow worker to launch task containers without direct access to the Docker socket.
Image description
Description |
Filters calls to the Docker API: only the call families allowed by the variables below are forwarded to the Docker socket. |
||||||
|---|---|---|---|---|---|---|---|
Size |
~25MB |
||||||
Technical components |
HAProxy 2.6 (alpine) |
||||||
User |
|
||||||
Volumes |
|
||||||
URLs |
|
|
This service makes it possible to create containers on the cluster. It must be attached only to the internal Datachain network, never published, and placed on a manager node. |
Environment variables
Each variable allows (1) or forbids (0) a family of Docker API calls. By default, the image only allows read access: EVENTS, PING and VERSION. The provided deployment enables the families required to launch containers.
| Variable | Image default | Provided deployment | Description |
|---|---|---|---|
POST |
0 |
1 |
Allows calls that modify state (without it, the API is read-only) |
CONTAINERS |
0 |
1 |
Container management |
IMAGES |
0 |
1 |
Image management |
NETWORKS |
0 |
1 |
Network management |
SERVICES, TASKS, SWARM, NODES, CONFIGS |
0 |
1 |
Management of Swarm services and cluster state |
VOLUMES |
0 |
1 |
Volume management |
EXEC, BUILD, COMMIT, DISTRIBUTION, PLUGINS, SESSION, SYSTEM, INFO, AUTH |
0 |
1 |
Other families of Docker API calls |
SECRETS, GRPC |
0 |
0 |
Unchanged: calls forbidden |
ALLOW_RESTARTS |
0 |
0 |
Allows stopping, restarting and destroying containers, even when |
PING, VERSION |
1 |
1 |
Required for the Docker client version negotiation |
EVENTS |
1 |
1 |
Docker event stream |
SOCKET_PATH |
/var/run/docker.sock |
unix@/var/run/docker.sock |
Socket path. The |
LOG_LEVEL |
info |
info |
HAProxy log level |
Since the group owning the Docker socket varies from machine to machine, the provided deployments run this service as root (user: "0:0") rather than assuming a fixed group.
Pipeline execution images
Image maestro/maestro-python3.12-airflow-dc
Image in which the Datachain tasks of a pipeline run (triggering an exposure, an export, etc.). It is designated by the backend’s DC_AFJOB_IMAGE variable.
Description |
Runs the Maestro task scripts with the Datachain Python client. |
|---|---|
Size |
~215MB |
Technical components |
Python 3.12 / |
User |
|
Configuration |
No configuration to provide: Maestro passes the required variables to each task container ( |
Image maestro/maestro-notebook
Image in which the notebooks of the DCCode integration run. It is designated by the backend’s DCCODE_RUN_IMAGE variable (and K8S_DCCODE_IMAGE for Kubernetes).
Description |
Prepares the notebook’s Python environment ( |
|---|---|
Size |
~160MB |
Technical components |
Python 3.12 / uv / Papermill |
User |
|
Configuration |
No configuration to provide: the working directory ( |
Dernière mise à jour le 2 novembre 2026 à 15:16