Skip to content

runtime_config_template Reference

The runtime_config_template is a JSON column in the processor_template_versions database table. The orchestrator reads it to configure how processor pods are deployed on Kubernetes and which environment variables are injected into the pod — no dory.yaml config file needed.

Important: The keys under env_vars are plain environment variables injected into the pod. They are not all read by the SDK ConfigLoader. Only a small subset (5 vars) maps to DoryConfig fields; others are read directly by specific subsystems (RabbitMQ publisher, fencing, S3 state) via os.environ; and some are consumed only by the orchestrator or are reserved/unused. Each var is annotated below — see env_vars.


Full Template

{
  "resources": {
    "cpu_request": "500m",
    "memory_request": "512Mi",
    "cpu_limit": "2000m",
    "memory_limit": "2Gi",
    "gpu_required": false,
    "gpu_limit": ""
  },

  "container": {
    "port": 8080,
    "command": [],
    "args": [],
    "image_pull_policy": "Always"
  },

  "health_probes": {
    "initial_delay_sec": 60,
    "period_sec": 10,
    "timeout_sec": 3,
    "failure_threshold": 3
  },

  "env_vars": {
    "DORY_LOG_LEVEL": "INFO",
    "DORY_LOG_FORMAT": "json",
    "DORY_PRESET": "production",

    "DORY_HEALTH_PORT": "8080",
    "DORY_HEALTH_PATH": "/healthz",
    "DORY_READY_PATH": "/ready",
    "DORY_METRICS_PATH": "/metrics",
    "DORY_HEALTH_CHECK_INTERVAL_SEC": "10",

    "DORY_STARTUP_TIMEOUT_SEC": "120",
    "DORY_SHUTDOWN_TIMEOUT_SEC": "10",

    "DORY_STATE_BACKEND": "configmap",
    "DORY_STATE_PVC_MOUNT": "/data",
    "DORY_STATE_S3_BUCKET": "",
    "DORY_STATE_S3_PREFIX": "dory-state",
    "DORY_STATE_CAPTURE_TIMEOUT_SEC": "25",
    "DORY_STATE_RESTORE_TIMEOUT_SEC": "25",
    "DORY_STATE_MAX_SIZE_BYTES": "8388608",
    "DORY_STATE_SIZE_WARN_THRESHOLD": "0.75",

    "DORY_MAX_RESTART_ATTEMPTS": "3",
    "DORY_RESTART_BACKOFF_SEC": "10",
    "DORY_GOLDEN_IMAGE_THRESHOLD": "3",

    "DORY_METRICS_ENABLED": "true",
    "DORY_METRICS_PREFIX": "dory",

    "DORY_RABBITMQ_ENABLED": "false",
    "DORY_RABBITMQ_URL": "amqp://guest:guest@localhost:5672/",
    "DORY_RABBITMQ_EXCHANGE": "dory.output",
    "DORY_RABBITMQ_EXCHANGE_TYPE": "topic",
    "DORY_RABBITMQ_EXCHANGE_DURABLE": "true",
    "DORY_RABBITMQ_CONNECTION_TIMEOUT": "10.0",
    "DORY_RABBITMQ_HEARTBEAT": "60",
    "DORY_RABBITMQ_BUFFER_ENABLED": "true",
    "DORY_RABBITMQ_BUFFER_MAX_SIZE": "10000",
    "DORY_RABBITMQ_BUFFER_MAX_BYTES": "104857600",

    "DORY_REDIS_URL": "",

    "DORY_OUTPUT_FORMAT": "json",

    "DORY_ENVELOPE_ENABLED": "false",
    "DORY_ENVELOPE_INCLUDE_CHECKSUM": "true",
    "DORY_ENVELOPE_SCHEMA_VERSION": "2.0",
    "DORY_ENVELOPE_ORGANIZATION_ID": ""
  }
}

DB-Ready (single line)

Copy-paste directly into the runtime_config_template JSONB column:

{"resources":{"cpu_request":"500m","memory_request":"512Mi","cpu_limit":"2000m","memory_limit":"2Gi","gpu_required":false,"gpu_limit":""},"container":{"port":8080,"command":[],"args":[],"image_pull_policy":"Always"},"health_probes":{"initial_delay_sec":60,"period_sec":10,"timeout_sec":3,"failure_threshold":3},"env_vars":{"DORY_LOG_LEVEL":"INFO","DORY_LOG_FORMAT":"json","DORY_PRESET":"production","DORY_HEALTH_PORT":"8080","DORY_HEALTH_PATH":"/healthz","DORY_READY_PATH":"/ready","DORY_METRICS_PATH":"/metrics","DORY_HEALTH_CHECK_INTERVAL_SEC":"10","DORY_STARTUP_TIMEOUT_SEC":"120","DORY_SHUTDOWN_TIMEOUT_SEC":"10","DORY_STATE_BACKEND":"configmap","DORY_STATE_PVC_MOUNT":"/data","DORY_STATE_S3_BUCKET":"","DORY_STATE_S3_PREFIX":"dory-state","DORY_STATE_CAPTURE_TIMEOUT_SEC":"25","DORY_STATE_RESTORE_TIMEOUT_SEC":"25","DORY_STATE_MAX_SIZE_BYTES":"8388608","DORY_STATE_SIZE_WARN_THRESHOLD":"0.75","DORY_MAX_RESTART_ATTEMPTS":"3","DORY_RESTART_BACKOFF_SEC":"10","DORY_GOLDEN_IMAGE_THRESHOLD":"3","DORY_METRICS_ENABLED":"true","DORY_METRICS_PREFIX":"dory","DORY_RABBITMQ_ENABLED":"false","DORY_RABBITMQ_URL":"amqp://guest:guest@localhost:5672/","DORY_RABBITMQ_EXCHANGE":"dory.output","DORY_RABBITMQ_EXCHANGE_TYPE":"topic","DORY_RABBITMQ_EXCHANGE_DURABLE":"true","DORY_RABBITMQ_CONNECTION_TIMEOUT":"10.0","DORY_RABBITMQ_HEARTBEAT":"60","DORY_RABBITMQ_BUFFER_ENABLED":"true","DORY_RABBITMQ_BUFFER_MAX_SIZE":"10000","DORY_RABBITMQ_BUFFER_MAX_BYTES":"104857600","DORY_REDIS_URL":"","DORY_OUTPUT_FORMAT":"json","DORY_ENVELOPE_ENABLED":"false","DORY_ENVELOPE_INCLUDE_CHECKSUM":"true","DORY_ENVELOPE_SCHEMA_VERSION":"2.0","DORY_ENVELOPE_ORGANIZATION_ID":""}}

Edge Node Template

Tuned for edge deployments: smaller resource footprint, local PVC state, Redis fencing enabled, bandwidth-conscious image pulling.

The orchestrator auto-injects ORCHESTRATOR_URL and WORKLOAD_TYPE=edge for edge pods — do not set those in the template.

{
  "resources": {
    "cpu_request": "250m",
    "memory_request": "256Mi",
    "cpu_limit": "1000m",
    "memory_limit": "1Gi",
    "gpu_required": false,
    "gpu_limit": ""
  },

  "container": {
    "port": 8080,
    "command": [],
    "args": [],
    "image_pull_policy": "IfNotPresent"
  },

  "health_probes": {
    "initial_delay_sec": 30,
    "period_sec": 10,
    "timeout_sec": 3,
    "failure_threshold": 3
  },

  "env_vars": {
    "DORY_LOG_LEVEL": "INFO",
    "DORY_LOG_FORMAT": "json",
    "DORY_PRESET": "production",

    "DORY_HEALTH_PORT": "8080",
    "DORY_HEALTH_PATH": "/healthz",
    "DORY_READY_PATH": "/ready",
    "DORY_METRICS_PATH": "/metrics",
    "DORY_HEALTH_CHECK_INTERVAL_SEC": "10",

    "DORY_STARTUP_TIMEOUT_SEC": "60",
    "DORY_SHUTDOWN_TIMEOUT_SEC": "15",

    "DORY_STATE_BACKEND": "pvc",
    "DORY_STATE_PVC_MOUNT": "/data",
    "DORY_STATE_S3_BUCKET": "",
    "DORY_STATE_S3_PREFIX": "dory-state",
    "DORY_STATE_CAPTURE_TIMEOUT_SEC": "25",
    "DORY_STATE_RESTORE_TIMEOUT_SEC": "25",
    "DORY_STATE_MAX_SIZE_BYTES": "8388608",
    "DORY_STATE_SIZE_WARN_THRESHOLD": "0.75",

    "DORY_MAX_RESTART_ATTEMPTS": "3",
    "DORY_RESTART_BACKOFF_SEC": "10",
    "DORY_GOLDEN_IMAGE_THRESHOLD": "3",

    "DORY_METRICS_ENABLED": "true",
    "DORY_METRICS_PREFIX": "dory",

    "DORY_RABBITMQ_ENABLED": "false",
    "DORY_RABBITMQ_URL": "amqp://guest:guest@localhost:5672/",
    "DORY_RABBITMQ_EXCHANGE": "dory.output",
    "DORY_RABBITMQ_EXCHANGE_TYPE": "topic",
    "DORY_RABBITMQ_EXCHANGE_DURABLE": "true",
    "DORY_RABBITMQ_CONNECTION_TIMEOUT": "10.0",
    "DORY_RABBITMQ_HEARTBEAT": "60",
    "DORY_RABBITMQ_BUFFER_ENABLED": "true",
    "DORY_RABBITMQ_BUFFER_MAX_SIZE": "10000",
    "DORY_RABBITMQ_BUFFER_MAX_BYTES": "104857600",

    "DORY_REDIS_URL": "redis://redis.svc:6379",

    "DORY_OUTPUT_FORMAT": "json",

    "DORY_ENVELOPE_ENABLED": "false",
    "DORY_ENVELOPE_INCLUDE_CHECKSUM": "true",
    "DORY_ENVELOPE_SCHEMA_VERSION": "2.0",
    "DORY_ENVELOPE_ORGANIZATION_ID": ""
  }
}

Differences from Managed Template

Setting Managed Edge Reason
cpu_request 500m 250m Edge nodes have less capacity
memory_request 512Mi 256Mi Edge nodes have less capacity
cpu_limit 2000m 1000m Tighter limits on edge hardware
memory_limit 2Gi 1Gi Tighter limits on edge hardware
image_pull_policy Always IfNotPresent Edge has limited bandwidth; avoid re-pulling
initial_delay_sec 60 30 Edge apps are typically lighter, start faster
DORY_STARTUP_TIMEOUT_SEC 120 60 Faster startup expected
DORY_SHUTDOWN_TIMEOUT_SEC 10 15 More time for state flush over slower network
DORY_STATE_BACKEND configmap pvc Local PVC avoids API server dependency
DORY_REDIS_URL "" redis://redis.svc:6379 Required for distributed leader fencing

DB-Ready Edge (single line)

{"resources":{"cpu_request":"250m","memory_request":"256Mi","cpu_limit":"1000m","memory_limit":"1Gi","gpu_required":false,"gpu_limit":""},"container":{"port":8080,"command":[],"args":[],"image_pull_policy":"IfNotPresent"},"health_probes":{"initial_delay_sec":30,"period_sec":10,"timeout_sec":3,"failure_threshold":3},"env_vars":{"DORY_LOG_LEVEL":"INFO","DORY_LOG_FORMAT":"json","DORY_PRESET":"production","DORY_HEALTH_PORT":"8080","DORY_HEALTH_PATH":"/healthz","DORY_READY_PATH":"/ready","DORY_METRICS_PATH":"/metrics","DORY_HEALTH_CHECK_INTERVAL_SEC":"10","DORY_STARTUP_TIMEOUT_SEC":"60","DORY_SHUTDOWN_TIMEOUT_SEC":"15","DORY_STATE_BACKEND":"pvc","DORY_STATE_PVC_MOUNT":"/data","DORY_STATE_S3_BUCKET":"","DORY_STATE_S3_PREFIX":"dory-state","DORY_STATE_CAPTURE_TIMEOUT_SEC":"25","DORY_STATE_RESTORE_TIMEOUT_SEC":"25","DORY_STATE_MAX_SIZE_BYTES":"8388608","DORY_STATE_SIZE_WARN_THRESHOLD":"0.75","DORY_MAX_RESTART_ATTEMPTS":"3","DORY_RESTART_BACKOFF_SEC":"10","DORY_GOLDEN_IMAGE_THRESHOLD":"3","DORY_METRICS_ENABLED":"true","DORY_METRICS_PREFIX":"dory","DORY_RABBITMQ_ENABLED":"false","DORY_RABBITMQ_URL":"amqp://guest:guest@localhost:5672/","DORY_RABBITMQ_EXCHANGE":"dory.output","DORY_RABBITMQ_EXCHANGE_TYPE":"topic","DORY_RABBITMQ_EXCHANGE_DURABLE":"true","DORY_RABBITMQ_CONNECTION_TIMEOUT":"10.0","DORY_RABBITMQ_HEARTBEAT":"60","DORY_RABBITMQ_BUFFER_ENABLED":"true","DORY_RABBITMQ_BUFFER_MAX_SIZE":"10000","DORY_RABBITMQ_BUFFER_MAX_BYTES":"104857600","DORY_REDIS_URL":"redis://redis.svc:6379","DORY_OUTPUT_FORMAT":"json","DORY_ENVELOPE_ENABLED":"false","DORY_ENVELOPE_INCLUDE_CHECKSUM":"true","DORY_ENVELOPE_SCHEMA_VERSION":"2.0","DORY_ENVELOPE_ORGANIZATION_ID":""}}

Section Reference

resources — K8s Pod Resources

Consumed by orchestrator to set pod resources.requests and resources.limits.

Field Type Example Description
cpu_request string "500m" K8s CPU request
memory_request string "512Mi" K8s memory request
cpu_limit string "2000m" K8s CPU limit
memory_limit string "2Gi" K8s memory limit
gpu_required bool false If true, adds nvidia.com/gpu resource and sets node selector to gpu family
gpu_limit string "" GPU limit (e.g. "1"). Only used when gpu_required is true

container — K8s Container Spec

Consumed by orchestrator to configure the main container.

Field Type Default Description
port int 8080 Container port for health probes. Also used as readiness/liveness probe port
command string[] [] Override container entrypoint (K8s command). Empty uses image default
args string[] [] Override container args. Empty uses image default
image_pull_policy string "IfNotPresent" "Always", "IfNotPresent", or "Never"

health_probes — K8s Probe Timing

Controls readiness and liveness probe timing. Probe paths are hardcoded by the orchestrator (pods.go): readiness = /ready, liveness = /health.

Field Type Readiness Default Liveness Default Description
initial_delay_sec int 5 10 Seconds before first probe
period_sec int 2 10 Seconds between probes
timeout_sec int 1 2 Seconds before probe timeout
failure_threshold int 3 3 Consecutive failures before unhealthy

env_vars — Injected Environment Variables

Every key under env_vars is injected verbatim into the pod as an environment variable. They are not all read by the SDK ConfigLoader. What actually consumes each var falls into four categories, shown in the Read By column:

  • ConfigLoader — one of the only 5 vars that config/loader.py:_load_from_env() maps onto a DoryConfig field (schema.py). DoryConfig has exactly these 5 fields and ignores all other env vars (extra="ignore"). These are: DORY_STARTUP_TIMEOUT_SEC, DORY_SHUTDOWN_TIMEOUT_SEC, DORY_HEALTH_PORT, DORY_STATE_BACKEND, DORY_LOG_LEVEL.
  • subsystem — read directly via os.environ by a specific SDK subsystem (RabbitMQ publisher, fencing, S3 state backend), bypassing ConfigLoader/DoryConfig entirely.
  • orchestrator — consumed by the Go orchestrator when building the pod spec (e.g. DORY_HEALTH_PORT as a container-port fallback, DORY_SHUTDOWN_TIMEOUT_SEC for the grace period), not by the SDK config layer.
  • unused — not read anywhere in the current SDK or orchestrator code. Present in the template as a placeholder / for forward-compatibility; setting it has no effect today.

There is no dory.yaml in the orchestrated path: when the SDK detects Kubernetes it ignores YAML files and presets and takes config only from injected env vars + production defaults (loader.py:_load_orchestrated()).

Logging

Env Var Read By Default Values
DORY_LOG_LEVEL ConfigLoaderlog_level "INFO" DEBUG, INFO, WARNING, ERROR, CRITICAL
DORY_LOG_FORMAT unused (no DoryConfig field; orchestrator only maps the legacy dory.log_format → this var) "json" "json", "text"
DORY_PRESET ConfigLoader (selects preset on the local path only; ignored in the orchestrated K8s path) auto-detect "development", "production", "high-availability"

Health Server

Env Var Read By Default Description
DORY_HEALTH_PORT ConfigLoaderhealth_port; also orchestrator (container-port fallback, see GetContainerPort) 8080 Health/metrics server port
DORY_HEALTH_PATH unused (no DoryConfig field; probe paths are hardcoded — see health_probes) "/healthz"
DORY_READY_PATH unused (no DoryConfig field; probe paths are hardcoded) "/ready"
DORY_METRICS_PATH unused (no DoryConfig field) "/metrics"
DORY_HEALTH_CHECK_INTERVAL_SEC unused (no DoryConfig field) 10

Lifecycle Timeouts

Env Var Read By Default Description
DORY_STARTUP_TIMEOUT_SEC ConfigLoaderstartup_timeout_sec 30 Max startup time (seconds)
DORY_SHUTDOWN_TIMEOUT_SEC ConfigLoadershutdown_timeout_sec; also orchestrator (GetTerminationGracePeriod, see Pod Security Context) 30 Max shutdown time (seconds)

State Management

Env Var Read By Default Description
DORY_STATE_BACKEND ConfigLoaderstate_backend "configmap" "configmap", "pvc", "s3", "memory"
DORY_STATE_PVC_MOUNT unused (no DoryConfig field) "/data" Intended PVC mount path
DORY_STATE_S3_BUCKET subsystem (S3 state backend, read via os.environ when state_backend="s3") "" S3 bucket for state objects
DORY_STATE_S3_PREFIX subsystem (S3 state backend) "dory-state" S3 key prefix for state objects

State Transfer

Env Var Read By Default Description
DORY_STATE_CAPTURE_TIMEOUT_SEC unused (no DoryConfig field) 25
DORY_STATE_RESTORE_TIMEOUT_SEC unused (no DoryConfig field) 25
DORY_STATE_MAX_SIZE_BYTES unused (no DoryConfig field) 8388608
DORY_STATE_SIZE_WARN_THRESHOLD unused (no DoryConfig field) 0.75

Recovery

Env Var Read By Default Description
DORY_MAX_RESTART_ATTEMPTS unused (no DoryConfig field) 3
DORY_RESTART_BACKOFF_SEC unused (no DoryConfig field) 10
DORY_GOLDEN_IMAGE_THRESHOLD unused (no DoryConfig field) 3

Metrics

Env Var Read By Default Description
DORY_METRICS_ENABLED unused (no DoryConfig field) "true"
DORY_METRICS_PREFIX unused (no DoryConfig field) "dory"

RabbitMQ Publisher

Read directly by the RabbitMQ publisher subsystem via os.environ (not through ConfigLoader/DoryConfig). Defaults below match PublisherConfig in output/rabbitmq.py. RabbitMQ settings are intentionally absent from DoryConfig because they may contain credentials that should not flow through YAML config.

Env Var Read By Default Description
DORY_RABBITMQ_ENABLED subsystem "false" Enable RabbitMQ publisher
DORY_RABBITMQ_URL subsystem "amqp://guest:guest@localhost:5672/" AMQP connection URL
DORY_RABBITMQ_EXCHANGE subsystem "dory.output" Default exchange name
DORY_RABBITMQ_EXCHANGE_TYPE subsystem "topic" Exchange type (topic, direct, fanout, headers)
DORY_RABBITMQ_EXCHANGE_DURABLE subsystem "true" Whether the exchange is durable
DORY_RABBITMQ_CONNECTION_TIMEOUT subsystem "10.0" Connection timeout (seconds)
DORY_RABBITMQ_HEARTBEAT subsystem "60" AMQP heartbeat interval (seconds)
DORY_RABBITMQ_BUFFER_ENABLED subsystem "true" Enable in-memory message buffering on failure
DORY_RABBITMQ_BUFFER_MAX_SIZE subsystem "10000" Maximum number of buffered messages
DORY_RABBITMQ_BUFFER_MAX_BYTES subsystem "104857600" Maximum total buffered message size (bytes)

Edge / Fencing

Env Var Read By Default Description
DORY_REDIS_URL subsystem (fencing) — read directly via os.environ in FencingConfig.__post_init__ (edge/fencing.py) "redis://localhost:6379" Redis URL for distributed leader fencing. If not set, SDK falls back to memory-based fencing (suitable for dev/single-node). Required for multi-node edge deployments

Output & Envelope

Env Var Read By Default Description
DORY_OUTPUT_FORMAT unused (no DoryConfig field) "json"
DORY_ENVELOPE_ENABLED unused (no DoryConfig field; envelope wrapping is always on in the publisher) "false"
DORY_ENVELOPE_INCLUDE_CHECKSUM unused (no DoryConfig field) "true"
DORY_ENVELOPE_SCHEMA_VERSION unused (no DoryConfig field) "2.0"
DORY_ENVELOPE_ORGANIZATION_ID unused (no DoryConfig field) ""

Auto-Injected by Orchestrator (NOT in template)

These environment variables are injected automatically by the orchestrator from pod/processor metadata. Do not set them in env_vars.

Env Var Source Description
POD_NAME fieldRef: metadata.name Kubernetes pod name
POD_NAMESPACE fieldRef: metadata.namespace Kubernetes namespace
POD_IP fieldRef: status.podIP Pod IP address
NODE_NAME fieldRef: spec.nodeName Node the pod runs on
WORKLOAD_TYPE processor config "edge" or "managed"
DATABASE_URL orchestrator config Database connection string
PROCESSOR_ID processor.ID Processor UUID
ORCHESTRATOR_URL orchestrator config Orchestrator URL (edge pods only)
DORY_SENSOR_ID sensors.id Sensor UUID (only when processor has a sensor assigned)
DORY_SENSOR_TYPE sensors.sensor_type Sensor type: "camera", "lidar", "radar", etc.
DORY_SENSOR_CONNECTION_CONFIG sensors.connection_config Full sensor connection JSON (e.g., {"url":"rtsp://...","fps":30})
DORY_SENSOR_METADATA sensors.metadata Full sensor metadata JSON (e.g., {"location":"entrance","label":"Camera-A"})
DORY_GEO_REFERENCE_POINTS sensors.metadata.reference_points reference_points array extracted from sensor metadata (only when present); used by the SDK for per-detection geolocation
DORY_GEOHASH ST_AsText(sensors.location_point) Geohash (precision 9) computed by the orchestrator from the sensor's location_point (only when set); used for geohash-based routing keys

Pod Security Context (Hardcoded)

Not configurable via template:

  • runAsNonRoot: true
  • runAsUser: 1000
  • fsGroup: 1000
  • serviceAccountName: "dory-processor"
  • terminationGracePeriodSeconds: derived in two steps.
  • models.go:GetTerminationGracePeriod() reads the shutdown timeout — env_vars["DORY_SHUTDOWN_TIMEOUT_SEC"], falling back to legacy dory.timeouts.shutdown_sec, else 30.
  • pods.go:buildPodSpec() then sets the pod field: when that value is > 0, the pod gets shutdown_timeout + 15s (buffer for the preStop hook + kubelet overhead); when no value is resolved, the bare default constant 45 is used.

So the example managed template (DORY_SHUTDOWN_TIMEOUT_SEC=10) yields 10 + 15 = 25s; the edge template (15) yields 30s; a template that omits the var yields 45s.


Source Files

  • Orchestrator struct: orchestrator/orchestrator/pkg/config/models.goRuntimeConfigJSON
  • Orchestrator pod builder: orchestrator/orchestrator/pkg/k8s/pods.gobuildPodSpec()
  • SDK config schema: dory-sdk/src/dory/config/schema.pyDoryConfig
  • SDK defaults: dory-sdk/src/dory/config/defaults.pyDEFAULT_CONFIG
  • SDK env loader: dory-sdk/src/dory/config/loader.pyConfigLoader._load_from_env()