Skip to content

Engine Configuration

engine-config.yaml is the sole configuration surface for an engine — no code changes needed to add a new variant or adjust parameter handling. For the crate structure and how to build a custom engine binary, see Engine Internals.

Starting an Engine

bash
ENGINE_CONFIG_PATH=/etc/metis/engine-config.yaml \
  metis-engine-nextflow

Required environment variables:

bash
DATABASE_URL=postgres://user:pass@host:5432/metis
REDIS_URL=redis://:pass@host:6379
NATS_URL=nats://user:pass@host:4222
KEYCLOAK_SERVER=http://keycloak:8080
KEYCLOAK_REALM=metis
KEYCLOAK_AUDIENCE=metis-engine
SERVICE_CLIENT_ID=metis-engine
SERVICE_CLIENT_SECRET=<secret>

Environment Variable Substitution

Config values support ${VAR:default} placeholders that resolve from environment variables at startup. If the variable is unset and a default is provided, the default is used. If no default is provided and the variable is unset, the placeholder is left as-is.

yaml
runs:
  workdir:
    workdir: "${METIS_WORKDIR_BASE:/nextflow/runs}/{user_id}/{run_id}"

This allows baking engine behavior into the Docker image while letting infra control paths and storage via Helm env vars.

Workdir Configuration

The workdir field is a template string that resolves per-run. Supported template variables: {user_id}, {run_id}, {date}, {time}, {timestamp}.

yaml
runs:
  workdir:
    workdir: "/var/wes/runs/{user_id}/{run_id}"
    subdirs:
      logs: "logs"
      outputs: "outputs"
      work: "work"
      tmp: "tmp"

Per-Run Config Template

Engines can generate a config file per run. The content field supports both ${ENV:default} (resolved at startup) and {template_var} (resolved per-run).

yaml
runs:
  config:
    filepath: "nextflow.config"
    content: |
      workDir = "${METIS_RUN_WORK_DIR:{workdir}/work"
      params {
        outdir = "${METIS_RUN_OUTPUT_DIR:s3://bucket/{user_id}/{run_id}/outputs"
      }

Parameter Fields Reference

FieldTypeRequiredDescription
names[string]yesAccepted aliases. First is canonical
cliFlagstringyesFlag written to the CLI command
typestringyesstring, int, bool, list
defaultanynoValue when client omits the param
strictDefaultboolnoAlways use default, ignore client
requiredboolnoReject run if missing, no default
listSeparatorstringnoSeparator for list type
booleanStylestringnoflag or value (-flag true)
sensitiveboolnoRedact value from logs
envVarstringnoSet as env var instead of CLI flag
validate[Spec]noList of validation rules

Validation Types

TypeFieldsDescription
enumallowed, messageValue must be in list
regexpattern, messageValue must match regex
rangemin, maxNumeric value in range
file_existsFile must exist on host
file_extensionallowedMust end with extension

Denied Parameters

Denied params are evaluated against raw keys before alias resolution.

FieldValuesDescription
patternstringPattern to match against
typeexact, regexMatch mode
reasonstringError message to client

workflowParams Methods

MethodBehaviour
inlineParams appended as CLI flags
fileParams written to file, path in template

Registering a New Engine

The engine registers its heartbeat in Valkey and appears in GET /service-info. Submit runs using a workflow_engine that matches engine.name. For custom parsing or hooks, implement the Engine trait and build a custom binary. See Engine Internals.

Proprietary software. All rights reserved.