Skip to Content
OpenETL
Internals

Control plane and runners

Explain the API, metadata store, orchestration workflows and runner responsibilities.

Edit on GitHub

This page describes the main components for contributors. Self-host covers installation.

The parts

internal/daemon runs the roles of the openetld program. server serves the API and console. orchestrator executes workflows and assigns jobs. runner executes attempts. dev combines all three roles in one process.

The API

internal/api serves the API defined in proto/openetl/api/v1 over Connect, gRPC, gRPC-Web and REST. Vanguard transcodes the REST routes from google.api.http rules. These rules also generate internal/api/openapi.yaml.

The CLI and console use this API. internal/webui serves the built console from the same origin.

Runners call DataPlaneService, defined in proto/openetl/dataplane/v1. A runner token limits each runner to its data plane's work. internal/auth manages API keys, runner tokens and roles.

The metadata store

internal/store is the metadata database, on Postgres: its goose migrations, and the queries from which sqlc generates internal/store/db. Every query outside the orgs table is scoped by org_id, which TestQueriesAreOrgScoped checks.

The database has a format, store.Format, which goes up only with a change that older binaries cannot work with. Before it migrates, Migrate refuses a database whose format is higher than its own, and then records its own format and release in the install table. The DBOS backend's openetl schema has a format of its own, and its changes are an ordered list of steps.

internal/secrets encrypts secret values before storage. Each organization has data keys. Its active key encrypts new values with AES-256-GCM, and each value starts with a version byte and the ID of the key that encrypted it. The installation's local or KMS key wraps those data keys.

Secrets can also reference AWS Secrets Manager, GCP Secret Manager or Azure Key Vault. Runners resolve these references with their cloud identity through internal/secretstore.

Orchestration

Workflows manage schedules, continuous-pipeline supervisors, syncs and operations such as source discovery. They use the interface in internal/orchestration. The default DBOS backend stores workflow state in Postgres. Temporal is the other supported backend.

Steps perform I/O; workflow code does not. After a failure, workflow replay returns the recorded results of previous calls. Workflow code therefore cannot use its own clocks, randomness or goroutines. Changes that alter an existing workflow's execution path require Context.Version.

internal/orchestration/dispatch sends work to data planes through the API. It uses Postgres dispatch records, leases and long polling to deliver results to waiting workflows. sizing selects the resources for the next attempt. scaling adjusts continuous jobs when their lanes need more or fewer resources.

Runners

A runner (internal/runner/worker) registers with the API, polls for work, executes it and reports results. Each attempt goes to a runner in the pipeline's data plane and pool with sufficient capacity. A pod launcher can instead create a Kubernetes pod for one attempt. That pod runs openetld runner and obtains the attempt from the API. Install on Kubernetes explains sizes, pools and placement.

An attempt (internal/runner) hosts connectors, drives dataflow and coordinates checkpoints. Built-in connectors run inside the runner. External connectors run as separate processes and serve the connector protocol on Unix sockets. internal/connectorhost supplies host services, including HTTP retries and secrets.

What a component does not know

The control plane, a runner, the coordinator and workers of an attempt, and the engine are separate processes. A component can receive a message that a newer release wrote. The internal protocols, openetl.dataplane.v1, openetl.attempt.v1 and openetl.engine.v1, follow these rules:

  • A field the receiver does not know is ignored. So is a member of a work's JSON input. openetl-engine plan is the exception: it refuses a request with a member it does not know.
  • An enum number the receiver does not know fails the work, the attempt or the job with CONFIG_INVALID. The error names the field and says that a newer version wrote it. The receiver does not use a default in its place. An error's code is the exception: an error with a code the receiver does not know is not retried.
  • A oneof that must be set and holds no case the receiver knows fails the job in the same way. In the attempt protocol, it is out of the protocol and fails the attempt.
  • A requirement the receiver does not know fails in the same way, and the error names it. requires in Work, Assignment, StartJobRequest and the request of openetl-engine plan names behaviors the receiver must implement. A sender names one when an older receiver would ignore a new field and give a different result. A runner reports such a failure of work as not retried. No names are in use.

Each component sends its release in its first exchange with another: a runner in ReportRunnerRequest, the control plane in ReportRunnerResponse and PollWorkResponse, a worker in Join, the runner in StartJobRequest, the engine in StartJobResponse, and each engine of an attempt in MeshHello. The receiver logs it. No component refuses another because of its release.

internal/platform/known checks what Go components receive, at the point where they receive it: the sync spec, a work's requirements, the attempt protocol's messages and the engine's events. A spec that a component reads from the metadata store goes through internal/store/stored, which fails the read on an enum value whose name it does not know. TestReceivedEnumsAreChecked fails when a message that a runner receives carries an enum and nothing checks it. In the engine, known.rs reads each enum field's raw number. clippy.toml disallows prost's accessors, which give the default for a number they do not know, on every message the engine receives, and a test fails when one is not listed.

Around the data path

  • Incidents (internal/heal) are opened and resolved, and their playbooks run, in the same transaction as the report that shows them.
  • Platform events (internal/events) enter an outbox in the transaction that changes the reported resource. internal/webhooks delivers them with Standard Webhooks signatures.
  • Outbound connections go through internal/netguard, which checks every address after DNS resolution, against server-side request forgery.
  • Transforms run on the user's clusters. internal/spark runs Spark applications. internal/flink runs a continuous pipeline's Flink job. libs/ contains the cluster-side libraries.

On this page