Skip to main content

NoETL Configuration

NoETL uses a centralized configuration system based on Pydantic. This document describes how to configure NoETL using environment variables and the .env file.

Configuration Settings​

All NoETL settings are defined in the Settings class in noetl/config.py. The settings are loaded from environment variables and can be overridden by command line arguments.

Application Settings​

SettingEnvironment VariableDefaultDescription
app_nameNOETL_APP_NAME"NoETL"Application name
app_versionNOETL_APP_VERSION"1.0.0"Application version
debugNOETL_DEBUGFalseEnable debug mode
hostNOETL_HOST"0.0.0.0"Server host
portNOETL_PORT8080Server port
enable_uiNOETL_ENABLE_UITrueEnable UI components
run_modeNOETL_RUN_MODE"server"Run mode (server, worker, or cli)

Worker Settings​

SettingEnvironment VariableDefaultDescription
playbook_pathNOETL_PLAYBOOK_PATHNonePath to the playbook file
playbook_versionNOETL_PLAYBOOK_VERSIONNoneVersion of the playbook to execute
mock_modeNOETL_MOCK_MODEFalseRun in mock mode

Database Settings​

SettingEnvironment VariableDefaultDescription
postgres_userPOSTGRES_USER or NOETL_POSTGRES_USER"noetl"PostgreSQL username
postgres_passwordPOSTGRES_PASSWORD or NOETL_POSTGRES_PASSWORD"noetl"PostgreSQL password
postgres_hostPOSTGRES_HOST or NOETL_POSTGRES_HOST"localhost"PostgreSQL host
postgres_portPOSTGRES_PORT or NOETL_POSTGRES_PORT5432PostgreSQL port
postgres_dbPOSTGRES_DB or NOETL_POSTGRES_DB"noetl"PostgreSQL database name
postgres_schemaPOSTGRES_SCHEMA or NOETL_POSTGRES_SCHEMA"noetl"PostgreSQL schema

Admin Database Settings​

SettingEnvironment VariableDefaultDescription
admin_postgres_userPOSTGRES_USER"postgres"Admin PostgreSQL username
admin_postgres_passwordPOSTGRES_PASSWORD"postgres"Admin PostgreSQL password

Other Settings​

SettingEnvironment VariableDefaultDescription
data_dirNOETL_DATA_DIR"./data"Data directory

Using Environment Variables​

You can configure NoETL by setting environment variables before running the application:

# Server settings
export NOETL_HOST="0.0.0.0"
export NOETL_PORT="8080"
export NOETL_DEBUG="true"
export NOETL_ENABLE_UI="true"

# Database settings
export POSTGRES_USER="noetl"
export POSTGRES_PASSWORD="noetl"
export POSTGRES_HOST="localhost"
export POSTGRES_PORT="5432"
export POSTGRES_DB="noetl"

# Run the application
noetl server

Using .env File​

You can also create a .env file in the project root directory with the same environment variables:

# Server settings
NOETL_HOST=0.0.0.0
NOETL_PORT=8080
NOETL_DEBUG=true
NOETL_ENABLE_UI=true

# Database settings
POSTGRES_USER=noetl
POSTGRES_PASSWORD=noetl
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=noetl

Podman and Kubernetes Configuration​

When running NoETL in Podman or Kubernetes, you can set environment variables in the configuration files:

Podman Compose​

services:
noetl:
image: noetl:latest
environment:
NOETL_HOST: "0.0.0.0"
NOETL_PORT: "8080"
NOETL_DEBUG: "true"
POSTGRES_USER: "noetl"
POSTGRES_PASSWORD: "noetl"
POSTGRES_HOST: "database"
POSTGRES_PORT: "5432"
POSTGRES_DB: "noetl"

Kubernetes​

containers:
- name: noetl
image: noetl:latest
env:
- name: NOETL_HOST
value: "0.0.0.0"
- name: NOETL_PORT
value: "8080"
- name: NOETL_DEBUG
value: "true"
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: postgres-credentials
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-credentials
key: password

Accessing Settings in Code​

You can access the settings in your code by importing the settings instance:

from noetl.config import settings

# Access settings
host = settings.host
port = settings.port
debug = settings.debug

# Get database URL
db_url = settings.get_database_url()

# Get connection string
conn_string = settings.get_pgdb_connection_string()

Command Line Arguments​

When using the command line interface, command line arguments will override environment variables:

noetl server --host 127.0.0.1 --port 9090 --debug

In this example, the host, port, and debug settings will be set to the values provided in the command line arguments, regardless of the environment variables.