Skip to content

Configuration

The Dory SDK is configured through a small typed schema (DoryConfig), a set of presets, and environment variables. How those sources combine depends on whether the processor is running orchestrated inside Kubernetes or locally. Secrets (RabbitMQ, AWS, Redis) are never part of the schema — they are read from environment variables only.

DoryConfig schema

DoryConfig is a Pydantic model with exactly five fields (extra keys are ignored):

Field Type / range Default Purpose
startup_timeout_sec int, 1–300 30 Max time for startup (including state restore).
shutdown_timeout_sec int, 1–300 30 Max time for graceful shutdown (including state flush).
health_port int, 0–65535 8080 Health/metrics server port; 0 = auto-select.
state_backend configmap / pvc / s3 / local configmap Where state is persisted.
log_level DEBUG / INFO / WARNING / ERROR / CRITICAL INFO Log verbosity.

Note

RabbitMQ settings are not in DoryConfig. They are secrets and are read from DORY_RABBITMQ_* environment variables only. See Output & Events.

Presets

A preset is a named starting point. Select one with DORY_PRESET or a preset key in the config file.

Preset Overrides
development log_level=DEBUG, health_port=0, state_backend=local
production state_backend=configmap, startup_timeout_sec=120
high-availability state_backend=pvc, shutdown_timeout_sec=60

Loading precedence

ConfigLoader.load() branches on the runtime environment.

Orchestrated (in Kubernetes)

The orchestrator is the single source of truth, so YAML files and presets are ignored:

  1. Start from the production preset.
  2. App name = PROCESSOR_ID (or the working directory), version = DORY_APP_VERSION.
  3. Overlay environment variables.

Local

A full precedence chain applies, highest wins:

env vars  >  config file  >  preset  >  auto-detected app info  >  defaults

Kubernetes is detected when any of these hold:

  • KUBERNETES_SERVICE_HOST is set, or
  • DORY_POD_NAME is set, or
  • /var/run/secrets/kubernetes.io exists.

Warning

Only five environment keys map onto the schema: DORY_STARTUP_TIMEOUT_SEC, DORY_SHUTDOWN_TIMEOUT_SEC, DORY_HEALTH_PORT, DORY_STATE_BACKEND, DORY_LOG_LEVEL. Every other DORY_* variable configures a subsystem directly, not DoryConfig.

Config file discovery

A YAML config file is located in this order (first hit wins); it is only consulted in the local path above:

  1. Explicit path argument to ConfigLoader.
  2. Env DORY_CONFIG_FILE.
  3. /etc/dory/config.yaml
  4. /app/config/dory.yaml
  5. ./dory.yaml
preset: production
log_level: INFO
health_port: 8080
state_backend: configmap

Environment variable reference

Config + identity

Variable Default Effect
DORY_CONFIG_FILE Path to YAML config file.
DORY_PRESET Select preset.
DORY_APP_VERSION 0.0.0 (OTel uses 1.0.0) App version / OTel service.version.
DORY_POD_NAME / POD_NAME unknown Pod name; also triggers K8s detection.
DORY_POD_NAMESPACE / POD_NAMESPACE default Namespace.
DORY_PROCESSOR_ID / PROCESSOR_ID derived from pod name Processor identity / routing-key prefix.
DORY_IS_MIGRATING false is_migrating flag.
DORY_MIGRATED_FROM Previous pod name.
APP_NAME dory-processor app_name in the ApplicationState wrapper.

Schema-mapped settings

Variable Default Effect
DORY_STARTUP_TIMEOUT_SEC 30 Startup timeout.
DORY_SHUTDOWN_TIMEOUT_SEC 30 Shutdown timeout.
DORY_HEALTH_PORT 8080 Health server port (0 = auto).
DORY_STATE_BACKEND configmap State backend.
DORY_LOG_LEVEL INFO Log level.

Health & edge

Variable Default Effect
DORY_STATE_TOKEN Bearer token for /state endpoints (warns if unset).
DORY_REDIS_URL redis://localhost:6379 Redis fencing backend.
DORY_ORCHESTRATOR_URL http://dory-orchestrator:8080 Heartbeat target.

See Edge & Failover and Observability.

Output / RabbitMQ (secrets)

Variable Default Effect
DORY_RABBITMQ_OAUTH2_TOKEN_URL If set, enables the RabbitMQ publisher.
DORY_RABBITMQ_OAUTH2_CLIENT_ID / _CLIENT_SECRET "" OAuth2 client credentials.
DORY_RABBITMQ_EXCHANGE dory.output Publisher exchange.
DORY_RABBITMQ_HOST "" RabbitMQ host.
DORY_RABBITMQ_VHOST / Virtual host.
DORY_RABBITMQ_TLS_ENABLED true Use amqps (port 5671).

Routing / geo

Variable Default Effect
DORY_GEOHASH "" Precomputed geohash for routing keys.
DORY_LATITUDE / DORY_LONGITUDE "" Geohash computed from these if DORY_GEOHASH unset.

S3 state backend

Variable Default Effect
DORY_S3_BUCKET — (required for S3) S3 state bucket.
DORY_S3_PREFIX dory-state S3 key prefix.
DORY_S3_REGION / AWS_REGION S3 region.
DORY_S3_ENDPOINT_URL Custom S3 endpoint.
DORY_S3_ROLE_ARN Assume-role ARN.
DORY_S3_ENABLE_OFFLINE_BUFFER true Offline buffer.
DORY_S3_BUFFER_PATH /data/dory-state-buffer.db Buffer path.
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN AWS credentials.

See State Management for backend details.

Pod metadata & restart detection (downward API / init container)

Variable Default Effect
RESTART_COUNT Restart detection.
PREVIOUS_EXIT_CODE Restart detection.
RESTART_REASON Restart detection.
NODE_NAME Pod's node name.
POD_IP Pod IP.
POD_UID Pod UID.
POD_LABELS Pod labels.