# OpenLakeForge > OpenLakeForge is an open-source lakehouse platform defined as code: infrastructure, data contracts, SQL models, pipelines, dashboards and CI live in one Git repository, deployed by the `olf` CLI on local Kubernetes (kind) today, with AWS and Azure in preview. The stack is Apache Iceberg, Apache Polaris, Trino, dlt, Floe, dbt, Dagster, Superset and OpenMetadata. The complete documentation of release `v0.6.0-alpha.3`. --- # OpenLakeForge documentation > OpenLakeForge is an open-source lakehouse you run entirely in your own infrastructure, small enough for one data team to operate. These pages show how to… Source: https://openlakeforge.dev/docs/ OpenLakeForge is an open-source lakehouse you run entirely in your own infrastructure, small enough for one data team to operate. These pages show how to install it, build data products on it, and deploy it to AWS or Azure. New to OpenLakeForge? Read the [Introduction](https://openlakeforge.dev/docs/get-started/introduction/), run the [Quickstart](https://openlakeforge.dev/docs/get-started/quickstart/), then follow the [Tutorial](https://openlakeforge.dev/docs/tutorial/01-tour-the-platform/) from lesson 1. | I want to | Go to | | --- | --- | | Know what OpenLakeForge is and whether it fits | [Introduction](https://openlakeforge.dev/docs/get-started/introduction/) | | Run it on my machine | [Quickstart](https://openlakeforge.dev/docs/get-started/quickstart/) | | Learn the vocabulary | [Concepts](https://openlakeforge.dev/docs/get-started/concepts/) | | Build my first data product | [Tutorial](https://openlakeforge.dev/docs/tutorial/01-tour-the-platform/) | | Add sources, domains and products | [Build and manage data products](https://openlakeforge.dev/docs/guides/data-products/) | | Load an API or a database incrementally | [Load an external source incrementally](https://openlakeforge.dev/docs/guides/incremental-sources/) | | Configure a local install | [Install and configure a local deployment](https://openlakeforge.dev/docs/guides/local-installation/) | | Deploy to a cloud | [AWS](https://openlakeforge.dev/docs/guides/cloud/deploy-to-aws/) or [Azure](https://openlakeforge.dev/docs/guides/cloud/deploy-to-azure/) | | Control who can sign in | [Connect GitHub](https://openlakeforge.dev/docs/guides/identity/connect-github/) | | Promote from DEV to PROD in CI | [CI/CD and environment promotion](https://openlakeforge.dev/docs/guides/promote-dev-to-prod/) | | Fix a failing deployment | [Troubleshooting](https://openlakeforge.dev/docs/guides/troubleshooting/) | | Look up a command or field | [CLI](https://openlakeforge.dev/docs/reference/cli/), [Deployment Profile](https://openlakeforge.dev/docs/reference/deployment-profile/), [Descriptors](https://openlakeforge.dev/docs/reference/descriptors/), [Runtime API](https://openlakeforge.dev/docs/reference/runtime-api/) | | Understand how it works | [Architecture](https://openlakeforge.dev/docs/architecture/overview/) | To change OpenLakeForge itself, start with the contributor guide, [AGENTS.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/AGENTS.md). Maintainer material such as the [architecture decision records](https://openlakeforge.dev/docs/adr/) stays in the repository. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/README.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/README.md). --- # Introduction > OpenLakeForge is an open-source lakehouse you run entirely in your own infrastructure, small enough for one data team to operate. This page says what it… Source: https://openlakeforge.dev/docs/get-started/introduction/ OpenLakeForge is an open-source lakehouse you run entirely in your own infrastructure, small enough for one data team to operate. This page says what it assembles, who it is for, and what you take on when you run it. ## What it is OpenLakeForge packages ingestion, validation, table storage, a catalog, a query engine, transformations and orchestration into one platform on Kubernetes. Terraform and Helm come with it, and the `olf` CLI drives them, so you do not install or wire any of those tools yourself. | Layer | What happens | Technology | | --- | --- | --- | | Bronze | Source files land as CSV in object storage | dlt | | Silver | Technical contracts validate them into Iceberg tables | Floe | | Gold | Business marts are modelled in SQL and run in the query engine | dbt-trino on Trino | Dagster orchestrates every run. Around that path sit the shared services: | Capability | Local | AWS | | --- | --- | --- | | Table format | Apache Iceberg | Apache Iceberg | | Catalog | Apache Polaris | AWS Glue | | Object storage | SeaweedFS | Amazon S3 | | Service state | PostgreSQL | Amazon RDS | | Governance and lineage | OpenMetadata _(optional)_ | OpenMetadata _(optional)_ | | Dashboards | Superset _(optional)_ | Superset _(optional)_ | Infrastructure sits behind provider-neutral contracts, so the same project runs on a laptop, AWS or Azure. See [Architecture](https://openlakeforge.dev/docs/architecture/overview/#providers). ## Who it is for Data teams that have to own their data platform and want a complete one without building it first: - **Teams whose data must stay in their own infrastructure.** Data sovereignty, data residency or sector rules (public sector, health, finance) rule out a SaaS warehouse; every component runs in your cluster, storage and cloud account. - **Data teams that already run Kubernetes** and want an open, predictable-cost alternative to a proprietary warehouse. - **Consultancies and integrators** that deliver the same platform to several clients: one pinned, tested release they can reproduce per client. In each case the team running it is small: the platform comes assembled, so it does not need a dedicated platform engineer to start. Everything is code in one repository: the Deployment Profile (`openlakeforge.yaml`) says where the platform runs, and `lakehouse_code/` holds your sources, contracts, dbt models, Dagster jobs and dashboards. ## Is it a good fit? | Good fit | Not yet | | --- | --- | | Data that must stay on your own Kubernetes, storage and cloud account | Streaming workloads: v1 is batch-first | | A data team on Kubernetes that wants an open alternative to a proprietary warehouse | Production-critical use: the project is alpha | | An integrator deploying the same platform for several clients | Teams that want a fully managed SaaS | | A small team that wants a batch lakehouse without building the platform first | A small team with no Kubernetes and no residency constraint: a managed warehouse is simpler | ## What you operate OpenLakeForge is software you run, not a service. Once you deploy it, these are yours: | Responsibility | What OpenLakeForge gives you | | --- | --- | | The cluster and its capacity | `olf infra deploy` creates a local kind cluster, an EKS cluster or an AKS cluster | | Access and sign-in | Plain HTTP on `*.olf.localhost` locally; GitHub sign-in when you add `spec.identity` ([Connect GitHub](https://openlakeforge.dev/docs/guides/identity/connect-github/)) | | Who may use which service | Canonical roles mapped to GitHub teams; membership changes happen in GitHub | | Upgrades | Pinned component versions per release ([Compatibility matrix](https://openlakeforge.dev/docs/reference/compatibility-matrix/)) | | Diagnosis | `olf infra status`, `olf infra diagnostics collect`, `olf infra e2e run` | | Backup and restore | `olf infra backup` and `olf infra restore` on the local provider ([Back up and restore](https://openlakeforge.dev/docs/guides/backup-and-restore/)) | Monitoring and backups of the cloud providers are on the roadmap, not in the alpha: see the [milestones](https://github.com/OpenLakeForge/openlakeforge/milestones). ## Next - [Quickstart](https://openlakeforge.dev/docs/get-started/quickstart/): a local platform with three example data products, in one deploy. - [Concepts](https://openlakeforge.dev/docs/get-started/concepts/): the vocabulary the rest of the docs use. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/get-started/introduction.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/get-started/introduction.md). --- # Quickstart > Deploy OpenLakeForge on your machine, run an example data product from Bronze to Gold, and check the result. You need Docker and about the time of one first… Source: https://openlakeforge.dev/docs/get-started/quickstart/ Deploy OpenLakeForge on your machine, run an example data product from Bronze to Gold, and check the result. You need Docker and about the time of one first deploy, which takes several minutes while images download. The local platform runs in a [kind](https://kind.sigs.k8s.io/) cluster on your Docker engine. It does not touch your own `~/.kube/config`. ## Before you start | You need | Check | | --- | --- | | A running Docker engine | `docker ps` succeeds | | [uv](https://docs.astral.sh/uv/) | `uv --version` | | Ports 80 and 443 free on `127.0.0.1` | Nothing else serves `http://localhost` | | 4 CPUs and 16 GB of memory available to Docker | `docker info` shows `CPUs` and `Total Memory` | | Free disk for Docker's images and volumes | 100 GB covers the Full preset with two stages ([details](https://openlakeforge.dev/docs/guides/local-installation/#hardware)) | | On WSL2 only: one time source | `systemctl is-active systemd-timesyncd` is not `active` ([why and how](https://openlakeforge.dev/docs/guides/local-installation/#on-wsl2)) | Terraform, Helm, kubectl and kind are not prerequisites: `olf` provisions pinned copies under `~/.openlakeforge`. ## 1. Install `olf` and create a project ```bash uv tool install "openlakeforge==0.6.0a3" --python 3.12 mkdir my-lakehouse && cd my-lakehouse olf init ``` `olf init` writes two things you own: ```text my-lakehouse/ ├── openlakeforge.yaml # Deployment Profile: provider, stages, preset, access └── lakehouse_code/ # sources, contracts, dbt projects, Dagster jobs ``` The profile is a single DEV stage, the Slim preset, plain HTTP and no sign-in. `lakehouse_code/` holds three example data products: `sales/order_revenue`, `sales/customer_health` and `supply_chain/inventory_reliability`. ## 2. Deploy ```bash olf infra deploy ``` `olf infra deploy` creates the kind cluster, deploys the platform services, builds the project-code image from `lakehouse_code/`, and registers the data products with Dagster. ## 3. Open the portal ```bash olf infra status ``` Its `URLs` section lists every service. Open the portal: ```text http://olf.localhost ``` It links to each service the profile enables. Browsers resolve every `*.localhost` name to your machine, so no hosts-file entry is needed. There is no sign-in: authentication stays off until you add `spec.identity`. :::note A profile without `spec.identity` publishes nothing beyond your machine: locally, only on `*.localhost`. With the Full preset and sign-in off, Superset opens as Admin and OpenMetadata keeps its `admin@open-metadata.org` login, with the password in Secret `openmetadata-admin`, as `olf infra status` notes. To serve HTTPS, see [Serve HTTPS](https://openlakeforge.dev/docs/guides/local-installation/#serve-https); to sign in with GitHub, see [Connect GitHub](https://openlakeforge.dev/docs/guides/identity/connect-github/). ::: ## 4. Run a data product Open Dagster from the portal, or directly: ```text http://dagster-dev.olf.localhost ``` Open **Jobs**, select `order_revenue_pipeline` and launch it. The run loads the CRM CSV files into Bronze with dlt, validates them into Silver Iceberg tables with Floe, and builds four Gold marts with dbt-trino, such as `mart_order_revenue_by_day`. The asset graph shows each step as it materializes. ## 5. Check it worked ```bash olf infra e2e run --env local --suite full ``` The suite launches every example product's job and checks that each Silver and Gold table exists, then queries every Gold mart through Trino and expects rows. It ends without an error when the platform works end to end. To see the Gold rows yourself, query them through Trino: ```bash olf infra query "SELECT * FROM order_revenue_gold.mart_order_revenue_by_day LIMIT 10" ``` ## Tear down ```bash olf infra destroy ``` ## Next - [Tutorial: Discover OpenLakeForge](https://openlakeforge.dev/docs/tutorial/01-tour-the-platform/): tour the platform, then add a source, a contract and a Gold model of your own. - [Concepts](https://openlakeforge.dev/docs/get-started/concepts/): presets, stages, project revisions and roles. - [Install and configure a local deployment](https://openlakeforge.dev/docs/guides/local-installation/): pip installs, presets, HTTPS and teardown. - Deploy for real: [AWS](https://openlakeforge.dev/docs/guides/cloud/deploy-to-aws/) or [Azure](https://openlakeforge.dev/docs/guides/cloud/deploy-to-azure/). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/get-started/quickstart.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/get-started/quickstart.md). --- # Concepts > The words the rest of the documentation uses, one paragraph each, with a link to the page that goes deeper. Source: https://openlakeforge.dev/docs/get-started/concepts/ The words the rest of the documentation uses, one paragraph each, with a link to the page that goes deeper. ## Medallion layers Data moves through three layers, each owned by one tool. **Bronze** holds source files as CSV in object storage, loaded by dlt. **Silver** holds the same entities as Iceberg tables, validated by Floe contracts. **Gold** holds business marts that dbt-trino builds in SQL. Dagster orchestrates the path. See [Architecture](https://openlakeforge.dev/docs/architecture/overview/#bronze-silver-and-gold). ## Sources, domains and data products A **source** is one system you ingest from, declared in `lakehouse_code/bronze//source.yaml`. A **domain** groups the Silver tables a business area owns. A **data product** belongs to a domain, reads Silver tables and publishes Gold tables; each product gets one Dagster job, `_pipeline`. `olf source new`, `olf domain new` and `olf product new` scaffold them. See [Ingest a source](https://openlakeforge.dev/docs/tutorial/02-ingest-a-source/). ## Descriptors `lakehouse_code/governance.yml` declares domains and products, and each `source.yaml` declares a source's resources. Descriptors name logical things only, never Polaris, Glue, S3 or SeaweedFS: OpenLakeForge derives catalog namespaces and storage paths from them. See the [descriptor reference](https://openlakeforge.dev/docs/reference/descriptors/). ## Deployment Profile `openlakeforge.yaml` says where the platform runs: the provider (`local`, `aws`, `azure`), the preset, the enabled stages, access (`spec.access`) and sign-in (`spec.identity`). `olf profile validate` checks it. See [Deployment Profile reference](https://openlakeforge.dev/docs/reference/deployment-profile/). ## Presets **Slim**, the default, deploys ingestion, validation, Iceberg, the catalog, Trino, dbt and Dagster. **Full** adds OpenMetadata for governance and lineage, and Superset for dashboards. Set `spec.preset: full` and deploy again; the data path does not change. ## Stages A profile enables `dev`, an optional `uat`, and `prod`. All stages share one cluster and the platform services in `olf-system`. Each stage has its own `olf-` namespace with its own Dagster (and Superset with Full), its own buckets and its own `lakehouse_` catalog. No data is copied between stages. See [Architecture](https://openlakeforge.dev/docs/architecture/overview/#deployment-model). ## Project revisions `olf infra project build` freezes the project into an immutable **project revision**: descriptors, contracts, dbt, Dagster code and the project-code image digest. A revision is activated in DEV, validated, then activated unchanged in PROD; PROD never rebuilds. See [CI/CD and environment promotion](https://openlakeforge.dev/docs/guides/promote-dev-to-prod/). ## Deploy phases `olf infra deploy` runs three phases in order. **Foundation** creates the cluster and registry; **platform** deploys the shared services; **artifacts** deploys everything derived from `lakehouse_code/`. A code change only reruns artifacts. See [Architecture](https://openlakeforge.dev/docs/architecture/overview/#deployment-model). ## Provider contracts Platform components talk to infrastructure through provider-neutral contracts, so local, AWS and Azure expose the same capabilities with different implementations, such as Polaris or Glue as the catalog. See [Architecture](https://openlakeforge.dev/docs/architecture/overview/#providers). ## Roles With sign-in on, each person holds one of four canonical roles: `platform-admin`, `data-engineer`, `analyst` or `viewer`. The profile maps each role to GitHub teams, and the role decides which services a person can open and what they can do inside them; an `analyst` reaches Superset but not Dagster. See [Roles and permissions](https://openlakeforge.dev/docs/reference/roles-and-permissions/). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/get-started/concepts.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/get-started/concepts.md). --- # Tour the platform > This lesson opens the portal and Dagster on a running local deployment, launches one of the demo data products, and shows what each step produced. It is the… Source: https://openlakeforge.dev/docs/tutorial/01-tour-the-platform/ This lesson opens the portal and Dagster on a running local deployment, launches one of the demo data products, and shows what each step produced. It is the first of the tutorial lessons that build one project, one capability at a time. **You will** open the portal, read the Dagster asset graph and run a data product from Bronze to Gold, in about 15 minutes. **Start from** the project you deployed in the [Quickstart](https://openlakeforge.dev/docs/get-started/quickstart/) (steps 1 and 2), on the default **Slim** preset with its three demo data products. Lesson 6 switches the same deployment to Full in place, without losing anything you built. Run every `olf` command in this tutorial from that project directory. ## 1. Open the portal ```text http://olf.localhost ``` The portal links to every service the profile enables. `olf infra status --provider local` lists the same addresses in its `URLs` section. Browsers resolve every `*.localhost` name to your machine, so no hosts-file entry is needed, and there is no sign-in yet. ## 2. Open Dagster Select Dagster in the portal, or go to it directly: ```text http://dagster-dev.olf.localhost ``` Dagster orchestrates every pipeline in OpenLakeForge. From its UI you can inspect the asset graph, launch a job, inspect each materialization and read the execution logs. ## 3. Read the asset graph Open **Assets** and its lineage graph. Each data product is a chain of three layers, and the asset key tells you which: | Layer | Built by | Asset key | Example | | --- | --- | --- | --- | | Bronze | dlt | `/` | `crm/accounts` | | Silver | Floe | `/` | `sales/accounts` | | Gold | dbt | `/` | `customer_health/mart_customer_health_score` | The demo project has two sources (`crm`, `erp`), two domains (`sales`, `supply_chain`) and three products (`order_revenue`, `customer_health`, `inventory_reliability`). Follow the arrows from `crm/accounts` to a Gold mart to see one product end to end. ## 4. Launch a product job Every product gets one job named `_pipeline`. Open **Jobs**, select `customer_health_pipeline`, open its **Launchpad** and select **Launch Run**. The run loads the CSV files into Bronze, validates them into Silver Iceberg tables, and builds the Gold marts with dbt. The graph updates as each asset materializes. ## 5. Inspect the materializations When the run succeeds, select the Bronze asset `crm/accounts` and open its latest materialization. dlt records the number of `rows` loaded, the `bronze_uri` it wrote to in object storage and the `source_file` it read. The run page lists the logs of every step. ## Check it worked ```bash olf infra e2e run --env local --suite full ``` The suite launches every demo product's job, checks that each Silver and Gold table exists, and queries every Gold mart through Trino for rows. It ends with: ```text Local OpenLakeForge full e2e validation passed. ``` ## What you learned - The portal links every service; Dagster is where you run and inspect pipelines. - A data product is a Bronze, Silver and Gold chain with one `_pipeline` job. - `olf infra e2e run` checks every deployed data product end to end; you will rerun it after each change to a product. ## Next [Ingest a source](https://openlakeforge.dev/docs/tutorial/02-ingest-a-source/): add a source of your own. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/tutorial/01-tour-the-platform.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/tutorial/01-tour-the-platform.md). --- # Ingest a source > This lesson adds a new source to the project with olf source new, gives it data, and explains the dlt loader that lands that data in Bronze. The source is a… Source: https://openlakeforge.dev/docs/tutorial/02-ingest-a-source/ This lesson adds a new source to the project with `olf source new`, gives it data, and explains the dlt loader that lands that data in Bronze. The source is a marketing platform that exports campaign performance as CSV. **You will** scaffold a Bronze source and give it real data, in about 10 minutes. **Start from** the project of [lesson 1](https://openlakeforge.dev/docs/tutorial/01-tour-the-platform/): deployed, with the three demo data products. Run every command from the project directory. :::note The lesson uses a CSV file because it is the fastest example, and a fixed CSV gives the same result on every run, which is why the demo products use them as test seeds. CSV is not a limit of the platform: dlt can extract from APIs and databases, and Floe reads CSV, TSV, JSON, Parquet, ORC, Avro, XLSX, XML and fixed-width files into Iceberg. Sources of those kinds are being added in [#110](https://github.com/OpenLakeForge/openlakeforge/issues/110). ::: ## How the project is organized Your code lives under `lakehouse_code/`, and each medallion layer has its own owner (see [ADR 0004](https://openlakeforge.dev/docs/adr/0004-medallion-layout-and-catalog-namespaces/)): | Layer | Aligned to | Directory | | --- | --- | --- | | Bronze | A source | `lakehouse_code/bronze//` | | Silver | A domain | `lakehouse_code/silver//` | | Gold | A data product | `lakehouse_code/gold/models//` | Across the next lessons you add the source `marketing_platform`, the domain `marketing` and the product `campaign_performance`. OpenLakeForge derives every platform name from those three: the Silver namespace `marketing_silver`, the Gold namespace `campaign_performance_gold` and the Dagster job `campaign_performance_pipeline`. You never create these by hand and you never edit Terraform to register a product. ## 1. Scaffold the source ```bash olf source new marketing_platform --resource campaigns ``` ```text Created source 'marketing_platform' with 1 resource(s): campaigns. ``` The command validates its result before it writes anything, and writes nothing if validation fails. It creates: ```text lakehouse_code/bronze/marketing_platform/ ├── source.yaml ├── README.md ├── examples/ │ └── campaigns.csv └── dlt/ ├── __init__.py └── marketing_platform.py ``` ## 2. Read the source descriptor `source.yaml` is the logical description of the source: ```yaml apiVersion: openlakeforge.io/v1beta1 kind: Source name: marketing_platform displayName: "Marketing Platform" description: "Marketing Platform source system." status: planned resources: - name: campaigns description: "Raw CSV campaigns." ``` It lists the resources the source exposes and never names Polaris, Glue, S3 or any other provider: OpenLakeForge derives the physical names from it. Its `name` must match its directory. ## 3. Add the data The scaffold wrote a placeholder file with a single column. Replace it with campaign data: ```bash cat > lakehouse_code/bronze/marketing_platform/examples/campaigns.csv <<'CSV' campaign_id,campaign_date,channel,spend,conversions cmp_001,2026-08-01,search,120.50,18 cmp_002,2026-08-01,social,80.00,9 cmp_003,2026-08-02,search,150.00,24 cmp_004,2026-08-02,email,30.00,12 cmp_005,2026-08-03,social,95.50,11 CSV ``` Do this before the next lesson: the validation contract for Silver is inferred from this file when you create the domain. ## 4. Read the loader `dlt/marketing_platform.py` is the Bronze loader. It reads each resource's CSV from `examples/` through dlt, writes it to the Bronze bucket under the `marketing_platform` prefix, and returns the row count, the `bronze_uri` and the `source_file` to Dagster, which shows them on the asset. Its core is one call: ```python return load_entities_to_bronze( entities=entities, raw_dir=raw_dir or _RAW_DIR, bronze_prefix=_BRONZE_PREFIX, ) ``` Loading is keyed by source, so every product that needs `marketing_platform.campaigns` calls this one loader. Nothing loads yet: Dagster runs the loader as the first step of a product job, which you create in lesson 4. ## Check it worked ```bash olf check contracts ``` It validates `lakehouse_code/governance.yml` and every `source.yaml` against the project schemas. It prints one `[PASS]` line per check, including: ```text [PASS] descriptor_schema_conformance: 4 descriptor(s) validated ``` ## What you learned - `olf source new` scaffolds a source-owned Bronze package: a descriptor, a dlt loader and example data. - Descriptors stay provider-neutral; OpenLakeForge derives physical names. - Bronze fills when a product job runs. ## Next [Validate into Silver](https://openlakeforge.dev/docs/tutorial/03-validate-into-silver/): declare what a valid row looks like. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/tutorial/02-ingest-a-source.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/tutorial/02-ingest-a-source.md). --- # Validate into Silver > This lesson creates the marketing domain with olf domain new, which writes the Floe contract that turns the Bronze CSV into a validated Silver Iceberg… Source: https://openlakeforge.dev/docs/tutorial/03-validate-into-silver/ This lesson creates the `marketing` domain with `olf domain new`, which writes the Floe contract that turns the Bronze CSV into a validated Silver Iceberg table. It explains what the contract checks and where rows that fail it go. **You will** create a domain and read its validation contract, in about 10 minutes. **Start from** the project of [lesson 2](https://openlakeforge.dev/docs/tutorial/02-ingest-a-source/): the `marketing_platform` source exists and `campaigns.csv` holds the five campaign rows. ## 1. Create the domain ```bash olf domain new marketing --input marketing_platform/campaigns ``` ```text Created domain 'marketing' with 1 Silver table(s): campaigns. Domain 'marketing' has no products yet; run `olf product new marketing/` to add one. ``` A domain groups the Silver tables a business area owns. `--input /` names a Bronze resource to validate into one of them. The command adds the domain to `lakehouse_code/governance.yml` and creates a Floe entity for the Silver table `campaigns`, read from `marketing_platform/campaigns`: ```text lakehouse_code/silver/marketing/ ├── __init__.py ├── README.md ├── domain.yml └── contracts/ └── campaigns.yml ``` It also declares `marketing_platform` in `lakehouse_code/silver/sources.yml`, the named Bronze sources every domain's entities read from. ## 2. Read the contract The Floe contract of a domain is split in two. `domain.yml` holds what every entity of the domain shares: ```yaml name: "marketing" entities: "contracts/*.yml" defaults: incremental_mode: "none" sink: write_mode: "overwrite" accepted: format: "iceberg" path: "marketing/{{entity.name}}" storage: "lakehouse_silver" iceberg: { catalog: "iceberg_catalog", namespace: "marketing_silver" } rejected: { format: "csv", path: "floe/rejected/marketing/{{entity.name}}", storage: "lakehouse_silver" } policy: { severity: "reject" } schema: normalize_columns: { enabled: true, strategy: "snake_case" } ``` Each file in `contracts/` is one entity. `campaigns.yml` names its Bronze input and the columns inferred from the CSV you wrote in lesson 2: ```yaml name: "campaigns" source: { ref: "marketing_platform", resource: "campaigns" } schema: primary_key: ["campaign_id"] columns: - { name: "campaign_id", type: "string", nullable: false } - { name: "campaign_date", type: "date", nullable: false } - { name: "channel", type: "string", nullable: false } - { name: "spend", type: "number", nullable: false } - { name: "conversions", type: "integer", nullable: false } ``` Four parts matter: - **Source and cast mode.** `ref: "marketing_platform"` points at the source in `sources.yml`, which reads the CSV dlt wrote to Bronze and casts each value to its column type strictly. - **Accepted sink.** Rows that satisfy the contract are written to the Iceberg table `marketing_silver.campaigns`. The namespace is named after the *domain*, not a product: every `marketing` product shares it. - **Rejected sink.** With `severity: "reject"`, a row that breaks the contract goes to the CSV quarantine path `floe/rejected/marketing/campaigns` in the Silver bucket instead of into Silver. The run still succeeds: Floe reports it as a run with rejected rows, which is not a technical failure. - **Columns.** Every column is `nullable: false`, because the scaffold cannot know which are optional. Loosen a column by hand when a value may be empty. :::note Nothing here names a bucket or a catalog endpoint. Dagster runs Floe, one Kubernetes Job per domain, with a profile it renders for the stage it is deployed to, so the same contract validates into DEV and PROD. ::: ## Check it worked ```bash olf check contracts ``` It checks that each domain writes its own `_silver` namespace through the logical catalog. Among its lines: ```text [PASS] floe_contract_structure: 19 Floe domain and entity file(s) validated ``` ## What you learned - `olf domain new` declares the Silver namespace and writes its Floe contract in one step -- domain defaults plus one file per entity -- inferring column types from the example CSV. The next deploy creates the namespace in the catalog. - Rows that satisfy the contract reach `marketing_silver.campaigns`; rows that do not are quarantined, not dropped and not mixed into Silver. - Silver is owned by the domain; products consume it. ## Next [Model Gold with dbt](https://openlakeforge.dev/docs/tutorial/04-model-gold-with-dbt/): build a business mart on top of Silver. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/tutorial/03-validate-into-silver.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/tutorial/03-validate-into-silver.md). --- # Model Gold with dbt > This lesson creates the campaign_performance data product with olf product new, writes its dbt model and tests, and deploys it. Gold is the layer that holds… Source: https://openlakeforge.dev/docs/tutorial/04-model-gold-with-dbt/ This lesson creates the `campaign_performance` data product with `olf product new`, writes its dbt model and tests, and deploys it. Gold is the layer that holds business marts, built in SQL by dbt-trino from the Silver tables. **You will** build one Gold mart from the Silver `campaigns` table and deploy it, in about 15 minutes. **Start from** the project of [lesson 3](https://openlakeforge.dev/docs/tutorial/03-validate-into-silver/): the `marketing` domain and its Floe contract exist. ## 1. Create the product ```bash olf product new marketing/campaign_performance \ --silver-input campaigns \ --gold-table mart_campaign_performance ``` ```text Created product marketing/campaign_performance with 1 Gold table(s): mart_campaign_performance. ``` `--silver-input` names a Silver table of the domain that the product reads, and `--gold-table` a mart it produces. The command adds the product to `lakehouse_code/governance.yml` and creates: ```text lakehouse_code/ ├── gold/ │ ├── dbt_project.yml │ ├── packages.yml │ ├── macros/generate_schema_name.sql │ └── models/ │ ├── _sources/ │ │ └── marketing.yml │ └── campaign_performance/ │ ├── mart_campaign_performance.sql │ └── schema.yml └── pipelines/dagster/campaign_performance.py ``` ## 2. Know the generated dbt project Gold is one dbt project for every product, and `campaign_performance/` is this product's folder in it. The first product creates the shared files; the next ones add their folder and a line to `dbt_project.yml`. You do not edit most of it: - `dbt_project.yml` materializes every model as an Iceberg table that is replaced on each run, in the catalog of the stage being deployed. Do not hard-code Trino hosts or catalog settings in it: OpenLakeForge supplies one dbt profile whose connection comes from each stage's environment. It also puts each product's folder in a dbt group of the same name, whose models other products cannot `ref()` unless they are marked public. - `macros/generate_schema_name.sql` hands each model's schema to the shared package, which names it after the product's folder. - `packages.yml` pulls in the shared OpenLakeForge dbt package. It ships with OpenLakeForge, not with your project, so the file names it through `OPENLAKEFORGE_DBT_PACKAGES_DIR`, which `olf` and the project-code image set. - `models/_sources/marketing.yml` declares the `marketing` domain's Silver tables as one dbt source, in the `marketing_silver` schema. Every product of the domain reads them from there. dbt reads the table Floe owns and does not build a second staging layer. Ownership follows the layer: Bronze belongs to dlt, Silver to Floe, Gold to dbt. The Gold namespace is owned by the product and named after its folder, with no domain prefix: `campaign_performance_gold`. ## 3. Write the model The scaffold generated a placeholder that selects everything from Silver. Replace it with an aggregation by channel: ```bash cat > lakehouse_code/gold/models/campaign_performance/mart_campaign_performance.sql <<'SQL' with campaigns as ( select campaign_id, cast(campaign_date as date) as campaign_date, channel, cast(spend as double) as spend, cast(conversions as bigint) as conversions from {{ source('marketing', 'campaigns') }} ) select channel, cast(count(*) as bigint) as campaign_count, cast(sum(spend) as double) as total_spend, cast(sum(conversions) as bigint) as total_conversions from campaigns group by channel SQL ``` ## 4. Document and test the model Describe the mart and its columns, and add dbt tests. dbt runs them in the same `dbt build` that creates the table, so a failing test fails the run. Keep the `groups` entry the scaffold wrote: it declares the product's dbt group. ```bash cat > lakehouse_code/gold/models/campaign_performance/schema.yml <<'YAML' version: 2 groups: - name: campaign_performance owner: name: campaign_performance models: - name: mart_campaign_performance description: Campaign spend and conversions aggregated by channel. columns: - name: channel description: Marketing channel of the campaigns. data_tests: - unique - not_null - name: total_spend description: Sum of campaign spend for the channel. YAML ``` ## 5. Deploy the product The platform is already running, so deploy only the artifacts phase, which covers everything derived from `lakehouse_code/`: ```bash olf infra deploy --provider local --phase artifacts ``` It reconciles the catalog namespaces, builds the project-code image, loads it into the cluster and restarts the Dagster code location. The namespaces `marketing_silver` and `campaign_performance_gold` are created for you; no Terraform change is needed. ## Check it worked ```bash olf infra e2e run --env local --suite full ``` The suite discovers products from the project, so `campaign_performance` is included without any registration. It launches every product's job, verifies the Silver and Gold tables exist and requires rows in every Gold mart, including `mart_campaign_performance`. It ends with: ```text Local OpenLakeForge full e2e validation passed. ``` Then look at the rows themselves. `olf infra query` runs SQL against the DEV stage's catalog, so a table is named `.
`: ```bash olf infra query "SELECT * FROM campaign_performance_gold.mart_campaign_performance ORDER BY channel" ``` It prints one row per marketing channel, with its `campaign_count`, `total_spend` and `total_conversions`. Add `--format csv` or `--format json` for other output. `olf infra query` runs as the stage's workload user, through your cluster access. If your deployment signs people in with GitHub (`spec.identity.issuer: github`), you can run the same query as yourself: ```bash olf login olf query "SELECT * FROM campaign_performance_gold.mart_campaign_performance ORDER BY channel" ``` Your role then decides what you read: an `analyst` reads this Gold mart but is refused the Silver tables beneath it ([Roles and permissions](https://openlakeforge.dev/docs/reference/roles-and-permissions/#what-each-role-reads-and-writes)). ## What you learned - `olf product new` creates a product-owned dbt project and a Dagster module and registers the product in `governance.yml`. - `olf infra query` reads any Silver or Gold table of a stage from your machine; `olf query` runs SQL as yourself, limited to what your role reads. - Gold is plain SQL over declared Silver sources; tests run as part of the build. - `olf infra deploy --phase artifacts` ships code changes without touching the platform. ## Next [Orchestrate and schedule](https://openlakeforge.dev/docs/tutorial/05-orchestrate-and-schedule/): run the product's job from Dagster and see how scheduling works. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/tutorial/04-model-gold-with-dbt.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/tutorial/04-model-gold-with-dbt.md). --- # Orchestrate and schedule > This lesson runs the campaign_performance_pipeline job from Dagster, reruns it, and explains where the recurring schedule of a product comes from. Source: https://openlakeforge.dev/docs/tutorial/05-orchestrate-and-schedule/ This lesson runs the `campaign_performance_pipeline` job from Dagster, reruns it, and explains where the recurring schedule of a product comes from. **You will** launch and rerun your product's job and read its schedule, in about 10 minutes. **Start from** the project of [lesson 4](https://openlakeforge.dev/docs/tutorial/04-model-gold-with-dbt/): the `campaign_performance` product is deployed. ## 1. Read the product definition Dagster code for a product lives in `lakehouse_code/pipelines/dagster/campaign_performance.py`, which `olf product new` generated: ```python from __future__ import annotations from openlakeforge_runtime.product_dagster import ProductDefinitionSpec, build_product_definitions defs = build_product_definitions(ProductDefinitionSpec(domain="marketing", product="campaign_performance")) ``` `build_product_definitions` connects the three layers of the product: the Bronze loader of `marketing_platform`, the Floe Silver table `campaigns` and the dbt Gold mart. It reads them from the project: the dbt models are the Gold assets, the dbt sources are the Silver inputs, and the Floe entity of each source names its Bronze resource ([Runtime API](https://openlakeforge.dev/docs/reference/runtime-api/)). It also defines the job `campaign_performance_pipeline`. `lakehouse_code/definitions.py` finds every module in `lakehouse_code/pipelines/dagster/` by itself, so you register nothing. ## 2. Launch the job Open Dagster: ```text http://dagster-dev.olf.localhost ``` Open **Jobs**, select `campaign_performance_pipeline`, open its **Launchpad** and select **Launch Run**. The graph runs in order: ```text marketing_platform/campaigns dlt writes campaigns.csv to Bronze marketing/campaigns Floe validates it into marketing_silver.campaigns campaign_performance/mart_campaign_performance dbt builds and tests the Gold mart ``` Select the Bronze asset to see its `rows`, `bronze_uri` and `source_file`, as in lesson 1. ## 3. Rerun Open the finished run and use **Re-execute** to run the same job again. A rerun is safe: Floe writes Silver with `write_mode: "overwrite"` and dbt replaces the Gold table, so the tables reflect the current input rather than accumulating duplicates. ## 4. Know where the schedule comes from A product's job has no recurring trigger of its own in DEV. The shared `build_product_definitions` adds a daily schedule named `campaign_performance_daily` (`0 3 * * *`, UTC), but only in the PROD stage. It is created stopped, and enabling it is a deliberate act in the Dagster UI. DEV and UAT stay manual on purpose: the same immutable revision is deployed to every stage, and a schedule there would be a production-shaped workload on a development catalog. You add PROD in lesson 9, and the schedule appears in that stage's Dagster. ## Check it worked ```bash olf infra e2e run --env local --suite full ``` It launches every product's job, `campaign_performance_pipeline` included, verifies the Silver and Gold tables, and requires rows in every Gold mart. It ends with: ```text Local OpenLakeForge full e2e validation passed. ``` ## What you learned - Each product has one `_pipeline` job that runs Bronze, Silver and Gold in order. - Rerunning a job is safe; Silver and Gold are overwritten. - Recurring schedules belong to PROD, which you add in lesson 9. ## Next [Publish a dashboard](https://openlakeforge.dev/docs/tutorial/06-publish-a-dashboard/): put Gold marts in front of analysts in Superset. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/tutorial/05-orchestrate-and-schedule.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/tutorial/05-orchestrate-and-schedule.md). --- # Publish a dashboard > This lesson switches the project from Slim to the Full preset, which adds Superset, and treats a dashboard as code: you change a chart in the Superset UI… Source: https://openlakeforge.dev/docs/tutorial/06-publish-a-dashboard/ This lesson switches the project from Slim to the Full preset, which adds Superset, and treats a dashboard as code: you change a chart in the Superset UI and export it back into `lakehouse_code/`, where it is versioned like any other file. **You will** turn on Superset, edit a demo dashboard and export it, in about 20 minutes. **Start from** the project of [lesson 5](https://openlakeforge.dev/docs/tutorial/05-orchestrate-and-schedule/): the `campaign_performance` product is deployed on the Slim preset, and the end-to-end run of lesson 5 filled every Gold mart. The dashboards in this lesson are the ones the demo project ships; `campaign_performance` has none yet. ## 1. Switch to the Full preset Set `preset: full` under `spec` in `openlakeforge.yaml`: ```yaml spec: provider: type: local preset: full ``` **Full** adds OpenMetadata (governance and lineage, lesson 7) and Superset (dashboards) to the Slim data path. The data path itself does not change. ## 2. Deploy the change ```bash olf infra deploy --provider local ``` `olf infra deploy` applies the change to the running deployment: Terraform adds OpenMetadata and Superset and leaves the data path, your product and its tables as they are. The deploy imports every dashboard under `lakehouse_code/dashboards/superset/` into Superset in its artifacts phase. ## 3. Open Superset ```text http://superset-dev.olf.localhost ``` With sign-in off, Superset opens already signed in as its local Admin. Open **Dashboards**: the project ships `Sales Customer Health`, `Sales Order Revenue` and `Supply Chain Inventory Reliability`, each reading the Gold marts of its product through the `OpenLakeForge Trino` database. ## 4. Change a chart Open `Sales Customer Health`, edit the chart `Health Score by Segment`, rename it `Health Score by Segment (edited)` and save it. ## 5. Export the dashboard as code Export the dashboard back into its bundle directory, which `olf infra report export` does for the stage you authored in: ```bash SUPERSET_REPORT_SOURCE_DIR=lakehouse_code/dashboards/superset/sales_customer_health \ olf infra report export --stage dev ``` `SUPERSET_REPORT_SOURCE_DIR` picks the bundle; without it the command exports the first dashboard bundle it finds. The bundle's YAML files, charts, datasets and the Trino database, are rewritten under that directory: ```bash grep -rl "(edited)" lakehouse_code/dashboards/superset/sales_customer_health ``` The export keeps the bundle stage-neutral: it replaces DEV's live Trino connection with a placeholder that each deploy rewrites, so the same bundle can be promoted to PROD. A directory is a promotable report once the export has written its `metadata.yaml`. Its datasets name the Gold schema they read, which is how OpenLakeForge knows the products the dashboard serves. One dashboard can consume several products. The next `olf infra deploy` (or `olf infra report import`) imports the bundle into Superset, and `olf infra project build` packages it into a project revision. ## Check it worked ```bash olf report validate ``` It checks every bundle for stable identities, resolvable references and no stage-bound values, and prints: ```text 3 report bundle(s) are promotable. ``` ## What you learned - `spec.preset: full` plus `olf infra deploy` adds Superset and OpenMetadata in place; the deploy imports every dashboard bundle in the project. - Dashboards live in `lakehouse_code/dashboards/superset//` and are found by their `metadata.yaml`; their datasets name the products they read. - `olf infra report export` pulls UI edits into git; `olf infra report import` and `olf infra deploy` push the bundle back. ## Next Govern and trace lineage (lesson 7): see the same project's domains, data products and lineage in OpenMetadata. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/tutorial/06-publish-a-dashboard.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/tutorial/06-publish-a-dashboard.md). --- # Govern and trace lineage > This lesson opens OpenMetadata, which the Full preset deploys, and follows the domains, data products and lineage that OpenLakeForge fills in from your project. Source: https://openlakeforge.dev/docs/tutorial/07-govern-and-trace-lineage/ This lesson opens OpenMetadata, which the Full preset deploys, and follows the domains, data products and lineage that OpenLakeForge fills in from your project. **You will** find your `marketing` domain and `campaign_performance` product in OpenMetadata and trace a Gold table back to Bronze, in about 15 minutes. **Start from** the project of [lesson 6](https://openlakeforge.dev/docs/tutorial/06-publish-a-dashboard/): the Full preset is deployed and every product's job has run once (the end-to-end run of [lesson 5](https://openlakeforge.dev/docs/tutorial/05-orchestrate-and-schedule/) did it). ## 1. Open OpenMetadata ```text http://openmetadata.olf.localhost ``` Sign in as `admin@open-metadata.org`. The deployment generated the password into Secret `openmetadata-admin`; read it with: ```bash kubectl -n olf-system get secret openmetadata-admin -o jsonpath='{.data.admin-password}' | base64 -d ``` ## 2. Find the domain and data product You wrote no OpenMetadata configuration. The artifacts phase of `olf infra deploy` reads `lakehouse_code/governance.yml` and creates: | governance.yml | OpenMetadata | | --- | --- | | A domain such as `marketing` | A domain, shown as `Marketing` | | A product such as `campaign_performance` | A data product named `campaign_performance`, shown as `Campaign Performance`, inside that domain | In the left menu, open **Domains** and select `Marketing`. Its data product `Campaign Performance` is listed, with the description from `governance.yml`. To change either, edit that file and run `olf infra deploy --provider local --phase artifacts`. ## 3. Find the tables OpenMetadata crawls the Iceberg catalog through Trino, so every Silver and Gold table is listed under the database of your stage, `lakehouse_dev`. Search for `mart_campaign_performance`. Its full name is `polaris.lakehouse_dev.campaign_performance_gold.mart_campaign_performance`. ## 4. Trace the lineage Open the table and select its **Lineage** tab. Floe and dbt each emit OpenLineage events to OpenMetadata every time the job runs, so the graph shows the Silver table `marketing_silver.campaigns` feeding the Gold mart. Nothing in your project turns this on. :::note Lineage appears after a job has run. If the tab is empty, launch `campaign_performance_pipeline` in Dagster again and refresh. ::: ## Check it worked ```bash olf infra e2e run --env local --suite full ``` With the Full preset the suite also checks OpenMetadata: it requires every domain and data product from `governance.yml`, and the Gold lineage of the stage. It ends with: ```text Local OpenLakeForge full e2e validation passed. ``` ## What you learned - Governance metadata is derived from `governance.yml`: one OpenMetadata domain per domain, one data product per product. - Lineage comes from the runs themselves, through Floe and dbt, not from configuration. - Change names and descriptions in the descriptor and redeploy the artifacts. ## Next [Sign in with GitHub](https://openlakeforge.dev/docs/tutorial/08-sign-in-with-github/): control who may open these services. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/tutorial/07-govern-and-trace-lineage.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/tutorial/07-govern-and-trace-lineage.md). --- # Sign in with GitHub > This lesson turns sign-in on for the local deployment. People sign in with GitHub, and the GitHub team they belong to decides which services they can open. Source: https://openlakeforge.dev/docs/tutorial/08-sign-in-with-github/ This lesson turns sign-in on for the local deployment. People sign in with GitHub, and the GitHub team they belong to decides which services they can open. **You will** add `spec.identity` to the profile, create and install a GitHub App during `olf infra deploy`, and sign in as an analyst, in about 25 minutes. **Start from** the project of [lesson 7](https://openlakeforge.dev/docs/tutorial/07-govern-and-trace-lineage/): the Full preset on a local deployment, so that Superset, Dagster and OpenMetadata all run. You also need a GitHub organization where you can create teams and install an app, and a GitHub account that is a member of it. ## How sign-in works Without `spec.identity`, authentication is off and every service opens with administrator rights. With it, a sign-in perimeter sits in front of every service. The perimeter sends people to Dex, which asks GitHub who they are and which of the mapped teams they belong to, and the highest role among those teams is the role they get. The four roles, highest first, are `platform-admin`, `data-engineer`, `analyst` and `viewer`. The rights per service are in [Roles and permissions](https://openlakeforge.dev/docs/reference/roles-and-permissions/). Owning the GitHub organization grants nothing: only members of a mapped team can sign in. ## 1. Create the teams In your GitHub organization, create four teams. The slugs below are the ones this lesson uses; any slugs work if the profile names them: | Team | Role | | --- | --- | | `olf-platform-admins` | `platform-admin` | | `olf-data-engineers` | `data-engineer` | | `olf-analysts` | `analyst` | | `olf-viewers` | `viewer` | Add your own account to `olf-platform-admins` for now. ## 2. Add `spec.identity` Keep the profile from the earlier lessons and add the `identity` block under `spec`. Replace `my-org` with the organization login exactly as GitHub shows it, case included: ```yaml spec: access: tls: none identity: issuer: github github: organization: my-org teams: platform-admin: [olf-platform-admins] data-engineer: [olf-data-engineers] analyst: [olf-analysts] viewer: [olf-viewers] oauth_app_secret_ref: name: github-oauth-app ``` `oauth_app_secret_ref` names the Kubernetes Secret that will hold the GitHub App's credentials. You do not create it: the next step does. A role you leave out of `teams` is held by nobody. Every field is in the [Deployment Profile reference](https://openlakeforge.dev/docs/reference/deployment-profile/#specidentity). ```bash olf profile validate --project . ``` ## 3. Deploy and connect GitHub This lesson turns sign-in on for a fresh deployment. Start it clean: ```bash olf infra destroy --provider local olf infra deploy --provider local ``` Switching an existing authentication-off stack to GitHub sign-in in place is not covered yet. The GitHub step comes first, while you are still at the terminal: 1. `olf infra deploy` notices that the Secret `github-oauth-app` does not exist and prints a URL to confirm a GitHub App. The browser opens on it; on WSL the URL is opened through Windows when `explorer.exe` is available. Either way the URL is printed, so you can open it yourself. 2. In the browser, select **Create GitHub App**. The app is created in your organization, private to it, with read access to members and email addresses. 3. GitHub sends the browser back to `olf`, which stores the app's credentials in the Secret and sends the browser on to the app's install page. 4. On the install page, install the app on your organization. `olf infra deploy` waits up to 15 minutes for step 2. After that it runs unattended and no further input is needed. It only asks in an interactive terminal; in CI it fails on a missing Secret instead, and `--no-github-connect` does the same by choice. Credentials are never printed. The deployment ends with the portal URL and the state of the app: ```text GitHub App installed on my-org ``` If it prints `Install the GitHub App on my-org: ` instead, open the link and install the app. Without the installation, nobody can sign in. To run the GitHub step on its own later, see [Connect GitHub](https://openlakeforge.dev/docs/guides/identity/connect-github/). ## 4. Sign in on the portal Open a private browser window on the portal: ```text http://olf.localhost ``` You are sent to GitHub, then back through Dex to the portal, with no password prompt from OpenLakeForge: GitHub owns your password and two-factor authentication. The portal lists the services. As `platform-admin` you can open all of them, and the portal links to the organization's teams page in GitHub, where membership is managed. :::note Open a fresh private window for each sign-in below. A browser that keeps a session keeps the role it was signed in with until the session refreshes. ::: ## 5. What each role sees Move your account between teams in GitHub (organization, Teams) and sign in again to see each role. The portal, Dagster, Trino UI and Superset follow at sign-in. OpenMetadata roles come from a role sync that runs every 5 minutes, not from sign-in: wait for it, or run it now: ```bash export KUBECONFIG="$HOME/.openlakeforge/state/local/kubeconfig.yaml" "$(olf toolchain path kubectl)" -n olf-system create job --from=cronjob/openmetadata-role-sync role-sync-now ``` Use a new job name each time you run it. | Role | Superset | Dagster | Trino UI | OpenMetadata | | --- | --- | --- | --- | --- | | `platform-admin` | `Admin` | opens | opens | `Admin` | | `data-engineer` | `Alpha` | opens | opens | `write` | | `analyst` | `Gamma` | denied | denied | `read` | | `viewer` | read-only | denied | denied | `read` | A service the role does not open answers with an "Access is role-restricted" page and a link back to the portal. ## 6. Plain HTTP or HTTPS The default profile serves plain HTTP on `*.olf.localhost` (`tls: none`). It needs no certificate step, and it is allowed only on a `*.localhost` domain, which is reachable from your machine alone. Sign-in works over it. To serve HTTPS, name the platform's own CA as the issuer: ```yaml spec: access: tls: local-ca ``` Run `olf infra deploy --provider local` again, then trust the CA in your browser: ```bash olf infra access trust ``` It writes the CA certificate and prints the commands for your platform. Skip it and the browser warns on every host. Trino has no sign-in of its own: every caller sends its own token, and Polaris decides what each query reads. The Trino UI opens as a fixed user behind the perimeter, which admits data engineers and platform admins. The GitHub App records the callback URL for the scheme it was created with. After switching scheme, run `olf infra secrets rotate github-app` to register an app with the new URL, and install it again. ## 7. Authentication off A profile with no `spec.identity` runs with authentication off: every service opens with administrator rights and nobody signs in. `olf` allows that only where nothing is published beyond your machine: on a `*.localhost` domain locally, and on AWS or Azure without `spec.access`. It is what `olf init` writes, and what lessons 1 to 7 used. :::caution Once OpenMetadata has been deployed with sign-in on, removing `spec.identity` does not bring back its `admin@open-metadata.org` login. Destroy and recreate the deployment to go back. ::: ## 8. Try the access model This procedure uses one GitHub account that plays every role by moving between teams. Your account must be in `olf-platform-admins` only at the start. Use a fresh private window for each sign-in. 1. **The admin adds an analyst.** In GitHub, move your account from `olf-platform-admins` to `olf-analysts`. Note the time. 2. **The analyst signs in.** Open the portal (`http://olf.localhost`, or `https://olf.localhost` if you switched to HTTPS). You pass through GitHub and Dex to the portal, with no password prompt, and the portal lists the services. 3. **The analyst reaches Superset.** Open it from the portal. It opens signed in, with no login form. Open a dashboard and check it renders. 4. **The analyst is denied Dagster.** Open Dagster from the portal. The page answers 403 "Access is role-restricted", with a link back to the portal. The Trino UI is denied the same way. 5. **A user outside the teams is denied.** Remove your account from every OpenLakeForge team. If you own the organization, you stay an owner, and that is the point. Sign in from a fresh window. The sign-in is refused, with Dex's page explaining why, and no session exists. 6. **A removed member loses access.** Add your account back to `olf-analysts` and sign in. Then remove it from the team without signing out. At the first request at least 4 minutes after your sign-in or the last refresh, the perimeter re-reads your teams and refuses you. Note the time from removal to refusal; it stays within about 5 minutes. 7. **Automation is unaffected.** While you try the steps above, `olf infra e2e run --env local` still passes, and the OpenMetadata ingestion and dbt runs keep working. They use service credentials, not a person's session. When you finish, put your account back in `olf-platform-admins`. ## Sign out Select **Sign out** in the portal header to end your session on every service behind the perimeter. It clears the perimeter cookie and lands on a "signed out" page. Superset keeps its own session: its Logout menu item does the same. GitHub's session stays open, so signing in again usually does not prompt; Dex re-reads your teams at each sign-in. The easy alternative is a private window: closing it drops every cookie. A team change also takes effect without signing out, within the 5-minute refresh bound described in [Add, change or remove a member](https://openlakeforge.dev/docs/guides/identity/manage-members/#how-fast-a-change-takes-effect). ## Check it worked This lesson ends on a person's access, so check it in the browser. Signed in as an analyst, Superset opens and renders a dashboard, and Dagster answers "Access is role-restricted". Signed in with an account that is in no mapped team, GitHub's sign-in is followed by Dex's refusal page, which links to the [troubleshooting steps](https://openlakeforge.dev/docs/guides/identity/connect-github/#troubleshooting). ## What you learned - `spec.identity` turns sign-in on; a GitHub team decides each person's role. - `olf infra deploy` creates and stores the GitHub App for you, then you install it on the organization. - Membership is managed in GitHub, and a removed member is refused within minutes, not at the next deploy. - Plain HTTP is the default locally; `tls: local-ca` with `olf infra access trust` gives HTTPS. ## Next [Add PROD and promote a revision](https://openlakeforge.dev/docs/tutorial/09-add-prod-and-promote/). To manage members, rotate secrets or recover when GitHub is unreachable, see the [identity guides](https://openlakeforge.dev/docs/guides/identity/connect-github/). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/tutorial/08-sign-in-with-github.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/tutorial/08-sign-in-with-github.md). --- # Add PROD and promote a revision > This lesson adds a PROD stage to the project, builds the project once into an immutable revision, activates that revision in DEV and then unchanged in PROD,… Source: https://openlakeforge.dev/docs/tutorial/09-add-prod-and-promote/ This lesson adds a PROD stage to the project, builds the project once into an immutable revision, activates that revision in DEV and then unchanged in PROD, and shows the GitHub Actions that automate those steps. **You will** run a project through DEV and PROD and see the PROD-only schedule, in about 30 minutes. **Start from** the project of [lesson 8](https://openlakeforge.dev/docs/tutorial/08-sign-in-with-github/): the Full preset on a local deployment with GitHub sign-in on. You also need an account on a container registry such as GHCR or Docker Hub. ## How stages work A Deployment Profile can enable `dev`, an optional `uat` and `prod`. Every stage runs in the same cluster, in its own `olf-` namespace with its own Dagster (and Superset with the Full preset), its own buckets and its own `lakehouse_` catalog. The platform services in `olf-system` are shared. A change is built **once** into an immutable project revision: the project's code plus one image pinned by digest. That revision is activated in DEV, validated, and then activated unchanged in PROD. PROD never rebuilds, and no data is copied between stages: each stage computes from its own Bronze. Stage promotion: a merged pull request builds one image and one project revision, which is activated in the DEV namespace, tested, approved, and then activated unchanged in PROD ## 1. Enable the PROD stage Add `prod` under `spec.stages` in `openlakeforge.yaml`: ```yaml spec: stages: dev: enabled: true prod: enabled: true ``` Then create the namespaces, buckets and catalogs for every enabled stage: ```bash olf infra platform apply -f openlakeforge.yaml ``` ## 2. Choose a registry A revision is identified by an image digest, and an image built straight into kind has none. Local runs therefore push to a registry you control: ```bash export PROJECT_CODE_IMAGE_REPOSITORY=ghcr.io//project-code export PROJECT_CODE_IMAGE_TAG=dev docker login ghcr.io # or docker.io ``` ## 3. Build the revision once ```bash IMAGE="$(olf infra project image -f openlakeforge.yaml | tee /dev/stderr | tail -n 1)" ``` It builds the project-code image, pushes it and loads it into kind, showing its progress, and ends with a digest-pinned reference, `@sha256:`. `tail -n 1` keeps only that last line in `IMAGE`. Build the revision from it the same way: ```bash REVISION="$(olf infra project build --project . --image "$IMAGE" | tee /dev/stderr | tail -n 1)" echo "$REVISION" ``` It prints the revision id, `sha256:`. The revision freezes your descriptors, Floe contracts, dbt projects, Dagster code, reports and the image digest. ## 4. Activate it in DEV, then in PROD Activate it in DEV and validate it there first: ```bash olf infra project deploy -f openlakeforge.yaml --stage dev --revision "$REVISION" olf infra e2e run --env local -f openlakeforge.yaml --stage dev --suite full ``` Only when DEV passes, activate the same revision in PROD: ```bash olf infra project deploy -f openlakeforge.yaml --stage prod --revision "$REVISION" ``` Activation reconciles the stage's catalog namespaces, activates its Floe revision, imports its reports and metadata, and rolls out its Dagster code location. It never rebuilds source. ## 5. Find the schedule Open the PROD Dagster, listed under `URLs` by `olf infra status --provider local`, and open the **Automation** or **Schedules** page. The schedule `campaign_performance_daily` (`0 3 * * *`, UTC) exists in PROD only, and it is stopped: deploying a revision never starts it. Switch it on there when you want recurring runs. DEV has no schedules. ## 6. Automate with the CI actions OpenLakeForge ships two composite GitHub Actions. Each is a few `olf` commands, so any CI can run the same ones: | Action | Does | | --- | --- | | `OpenLakeForge/openlakeforge/.github/actions/build-revision` | `olf infra project image`, then `olf infra project build`; outputs `image` and `revision` | | `OpenLakeForge/openlakeforge/.github/actions/deploy-stage` | `olf infra project deploy --stage --revision `, fails unless `olf infra project status` records exactly ``, and optionally runs `olf infra e2e run --suite full` | Behaviour follows the stage and revision you pass, never the branch name. A workflow runs `build-revision` once, then `deploy-stage` for DEV, then for PROD behind a GitHub environment with required reviewers, so the PROD activation waits for approval. The complete workflow, the runner it needs and how to protect the `prod` environment are in [CI/CD and environment promotion](https://openlakeforge.dev/docs/guides/promote-dev-to-prod/#automate-with-github-actions). ## Check it worked ```bash olf infra e2e run --env local -f openlakeforge.yaml --stage prod --suite full ``` It validates PROD with the topology the profile recorded: it launches every product's job in the PROD Dagster and requires rows in every Gold mart of the `lakehouse_prod` catalog. It ends with: ```text Local OpenLakeForge full e2e validation passed. ``` ## What you learned - Stages share a cluster but not data: each has its own namespace, buckets and catalog. - You build one revision and activate that same revision in every stage. - Schedules exist only in PROD, and start stopped. - The two CI actions are thin wrappers over `olf infra project image`, `build` and `deploy`. ## Next [Deploy to the cloud](https://openlakeforge.dev/docs/tutorial/10-deploy-to-the-cloud/): run the same project on AWS. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/tutorial/09-add-prod-and-promote.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/tutorial/09-add-prod-and-promote.md). --- # Deploy to the cloud > This lesson runs the same project on AWS: EKS for Kubernetes, ECR for images, S3 for storage, RDS PostgreSQL for service state and AWS Glue as the Iceberg… Source: https://openlakeforge.dev/docs/tutorial/10-deploy-to-the-cloud/ This lesson runs the same project on AWS: EKS for Kubernetes, ECR for images, S3 for storage, RDS PostgreSQL for service state and AWS Glue as the Iceberg catalog. **You will** deploy the project you built to your own AWS account and validate it, in about 60 minutes plus the time AWS needs to create the cluster. **Start from** the project of [lesson 9](https://openlakeforge.dev/docs/tutorial/09-add-prod-and-promote/), and an AWS account that meets the [prerequisites of the AWS guide](https://openlakeforge.dev/docs/guides/cloud/deploy-to-aws/#prerequisites). Your `lakehouse_code/` does not change: only the Deployment Profile does. :::caution This creates billable AWS resources and is not production-hardened. Run the teardown step when you are done. The limits are listed in [Deploy to AWS](https://openlakeforge.dev/docs/guides/cloud/deploy-to-aws/#limitations-and-costs). ::: ## 1. Point the profile at AWS In `openlakeforge.yaml`, set the provider and the region, keep only the DEV stage, and remove the `access:` and `identity:` blocks: ```yaml spec: provider: type: aws region: eu-west-1 stages: dev: enabled: true ``` The cloud deployment is validated with one stage, so the DEV-to-PROD promotion of lesson 9 stays on your local platform. The cloud deployment publishes no routes, so there is no sign-in: you reach its services with `olf infra forward`, and an `access:` block would require `identity:`. ```bash olf profile validate --project . ``` ## 2. Authenticate ```bash olf infra auth login --provider aws ``` It reuses your `default` AWS profile, or asks for your IAM Identity Center start URL and region. The other sign-in options are in [Deploy to AWS](https://openlakeforge.dev/docs/guides/cloud/deploy-to-aws/#1-authenticate). The cloud pushes your image to its own ECR registry, so clear the registry settings of lesson 9: ```bash unset PROJECT_CODE_IMAGE_REPOSITORY PROJECT_CODE_IMAGE_TAG ``` ## 3. Deploy The same phases you used locally: ```bash olf infra deploy --provider aws --phase foundation # VPC, EKS, ECR, IAM olf infra deploy --provider aws --phase platform # S3, Glue, RDS, Trino, Dagster, Superset, OpenMetadata olf infra deploy --provider aws --phase artifacts # build and push images, load your code ``` The cloud has no public endpoint. To open the services, port-forward them to your machine, then stop with Ctrl-C; Dagster is at `http://localhost:3000`: ```bash olf infra forward --provider aws ``` ## Check it worked Stop `olf infra forward` first: run one `olf` command at a time. ```bash olf infra e2e run --env aws ``` It launches every product's job on EKS and verifies the Silver and Gold tables, the dashboards and OpenMetadata. It ends with a line of the form ` OpenLakeForge e2e validation passed.` ## Tear down ```bash olf infra destroy --provider aws ``` On Azure the steps are the same with `--provider azure`, plus a variables file for the resource group and node size; see [Deploy to Azure](https://openlakeforge.dev/docs/guides/cloud/deploy-to-azure/). ## What you learned - The project does not change between local, AWS and Azure; the profile's provider does. - A cloud deploy is the same foundation, platform and artifacts phases. - Cloud services are reached with `olf infra forward`, and `olf infra e2e run --env aws` validates them. ## Next - [Deploy to AWS](https://openlakeforge.dev/docs/guides/cloud/deploy-to-aws/): every option, the limitations and the costs. - [CI/CD and environment promotion](https://openlakeforge.dev/docs/guides/promote-dev-to-prod/): build and deploy revisions from CI. - [Architecture](https://openlakeforge.dev/docs/architecture/overview/): how the same project runs on each provider. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/tutorial/10-deploy-to-the-cloud.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/tutorial/10-deploy-to-the-cloud.md). --- # Install and configure a local deployment > The options around a local OpenLakeForge deployment: how to install olf, create a project, choose a preset, reach the services over HTTP or HTTPS, and tear… Source: https://openlakeforge.dev/docs/guides/local-installation/ The options around a local OpenLakeForge deployment: how to install `olf`, create a project, choose a preset, reach the services over HTTP or HTTPS, and tear everything down. For the shortest path, follow the [Quickstart](https://openlakeforge.dev/docs/get-started/quickstart/) instead. The local platform runs in a [kind](https://kind.sigs.k8s.io/) cluster on your Docker engine. It does not touch your own `~/.kube/config`, and it is local evaluation infrastructure: do not expose it beyond your workstation. ## Requirements | You need | Check | | --- | --- | | A running Docker engine | `docker ps` succeeds | | Python 3.12 or newer, or [uv](https://docs.astral.sh/uv/) | `python3.12 --version` or `uv --version` | | Ports 80 and 443 free on `127.0.0.1` | Nothing else serves `http://localhost` | Terraform, Helm, kubectl and kind are not prerequisites: `olf` downloads the versions pinned in the release and keeps them under `~/.openlakeforge`. ### On WSL2 WSL2 already sets its clock from Windows. If `systemd-timesyncd` also runs, the two fight and the clock steps back every half minute, which makes Polaris reject tokens and Trino fail at random with `Not authorized`. Check, and stop the second service once: ```bash systemctl is-active systemd-timesyncd # "active" means it must be stopped sudo systemctl disable --now systemd-timesyncd ``` `olf infra doctor` reports this as `WSL clock`, and a local deploy warns about it. See [Trino fails at random with Not authorized on WSL2](https://openlakeforge.dev/docs/guides/troubleshooting/#trino-fails-at-random-with-not-authorized-on-wsl2). The step goes away once the platform moves to a Polaris release that tolerates the skew (#941). ### Hardware The resources Docker can use, not the whole machine: | Deployment | CPU | Memory | Free disk | | --- | --- | --- | --- | | Slim, one stage (the Quickstart) | 4 | 16 GB | not yet measured; less than Full | | Full, DEV and PROD | 4 | 16 GB | 100 GB | These are the tested sizes; smaller machines are untested. The CI Slim smoke test and the nightly Full DEV+PROD deployment both pass on a GitHub-hosted runner with 4 vCPUs and 16 GB of memory. With Full and two stages running, the host used about 9 GB of memory and Docker held about 100 GB: about 15 GB of images and about 84 GB in the three kind nodes' volumes, which keep a copy of every image. On Docker Desktop, raise its memory and disk limits to these values. ## Install `olf` With uv, which fetches Python 3.12 if your machine has none: ```bash uv tool install "openlakeforge==0.6.0a3" --python 3.12 ``` Or with pip, in a virtual environment: ```bash python3.12 -m venv ~/.venvs/olf source ~/.venvs/olf/bin/activate python3.12 -m pip install "openlakeforge==0.6.0a3" ``` With pip, activate the environment again in each new shell. Check the install with `olf version`. ### Toolchain mode `OLF_TOOLCHAIN_MODE` decides where `olf` finds Terraform, Helm, kubectl and kind. Docker is always yours. | Mode | Behaviour | | --- | --- | | `managed` (default) | Downloads and verifies the pinned versions under `~/.openlakeforge`. Never changes your `PATH`. | | `host` | Uses the tools on your `PATH`, for a machine that cannot download them. | `OLF_HOME` moves the toolchain, the platform payload and `olf`'s state away from `~/.openlakeforge`. `olf toolchain list` shows what is installed and `olf toolchain install` downloads everything in advance. ## Create a project Run `olf init` in an empty directory: ```bash mkdir my-lakehouse && cd my-lakehouse olf init ``` It writes `openlakeforge.yaml`, the Deployment Profile, and `lakehouse_code/` with three demo data products. The profile enables one DEV stage on the Slim preset, with plain HTTP and no sign-in. `olf init` refuses to overwrite either. | Option | Effect | | --- | --- | | `--stages dev,prod` | Enable other stages: `dev`, `dev,prod` or `dev,uat,prod`. | | `--preset full` | Add Superset and OpenMetadata to the Slim data path. | | `--name ` | Name the profile something other than the directory. | | `--profile-only` | Write only `openlakeforge.yaml`, into an existing project. | | `--empty` | Skip the demo products. | An `--empty` project cannot deploy until it holds a source and a product. Scaffold them first: ```bash olf source new crm --resource accounts olf product new sales/accounts_report --input crm/accounts --gold-table mart_accounts ``` ## Deploy ```bash olf infra deploy ``` The first deploy takes several minutes while images download. `olf infra deploy` runs four phases in order; `--phase` runs one of them: | Phase | What it does | Rerun it when | | --- | --- | --- | | `foundation` | Creates the kind cluster `openlakeforge-local` (one control plane, two workers) | The cluster was deleted | | `prefetch` | Pulls the large runtime images into the kind nodes | An image pull failed or timed out | | `platform` | Deploys the shared services and one namespace per stage with Terraform and Helm | You changed the preset or the stages | | `artifacts` | Builds the project-code image from `lakehouse_code/` and deploys your data products | You changed code under `lakehouse_code/` | Every phase reconciles what already exists, so running it again is safe. ## Choose Slim or Full | Preset | Includes | | --- | --- | | `slim` (default) | dlt, Floe, Iceberg, Polaris, Trino, dbt and Dagster: the whole ingestion-to-Gold path | | `full` | Slim plus OpenMetadata (governance, lineage) and Superset (dashboards) | Set `preset: full` under `spec` in `openlakeforge.yaml` and run `olf infra deploy` again. The change applies in place: nothing already deployed is removed. Setting `preset: slim` removes the two services the same way. ## Local defaults | Setting | Default | Change it with | | --- | --- | --- | | Cluster | `openlakeforge-local` | `--cluster-name` | | Kube context | `kind-openlakeforge-local` | follows the cluster name | | Kubeconfig | `~/.openlakeforge/state/local/kubeconfig.yaml` | `--kubeconfig-path` | | Shared services | namespace `olf-system` | | | Stage services | namespace `olf-`, one per enabled stage | `spec.stages` in the profile | | Stage selected by `olf` commands | `dev` | `--stage` | In a source checkout of the repository, the kubeconfig is `.tmp/kubeconfigs/local.yaml` instead. ## Access the services ```bash olf infra status ``` The `URLs` section lists every service. With the default profile: | Service | URL | | --- | --- | | Portal, linking every service | `http://olf.localhost` | | Dagster, per stage | `http://dagster-dev.olf.localhost` | | Trino, per stage | `http://trino-dev.olf.localhost` | | Superset, per stage (Full) | `http://superset-dev.olf.localhost` | | OpenMetadata (Full) | `http://openmetadata.olf.localhost` | Browsers resolve every `*.localhost` name to your machine. Command-line tools often do not; `olf` pins them itself, and for `curl` pass `--resolve`: ```bash curl --resolve dagster-dev.olf.localhost:80:127.0.0.1 http://dagster-dev.olf.localhost/server_info ``` With sign-in off, Superset opens as its local Admin and OpenMetadata accepts `admin@open-metadata.org` with the password in Secret `openmetadata-admin`: ```bash kubectl -n olf-system get secret openmetadata-admin -o jsonpath='{.data.admin-password}' | base64 -d ``` Over plain HTTP, the Trino Web UI shows a fixed user, `olf-web`, instead of a login form; per-person identity in the UI needs HTTPS (#425). To require sign-in, see [Connect GitHub](https://openlakeforge.dev/docs/guides/identity/connect-github/). ### Serve HTTPS `spec.access.tls` defaults to `none`, which serves plain HTTP, and `olf init` writes it out. To serve HTTPS from a local certificate authority (CA), set `tls: local-ca` and deploy again: ```yaml spec: access: tls: local-ca ``` `olf infra deploy` creates the CA once, in the cluster (it is there with plain HTTP too, for the pods that call Trino over HTTPS). Your browser rejects the routes until it trusts that CA. Export it and print the trust commands for your system: ```bash olf infra access trust ``` It writes `openlakeforge-local-ca.crt` and prints the commands for Linux, macOS or WSL2; each needs your own privileges, so `olf` prints rather than runs them. Firefox keeps its own store: Settings, Privacy & Security, View Certificates, Authorities, Import. On WSL2 the CA must go into the Windows store, because the browser runs on Windows. ### Reach Polaris and SeaweedFS Polaris and SeaweedFS have no route. `olf infra forward` port-forwards every service to fixed ports on `localhost` until you press Ctrl-C: ```bash olf infra forward ``` | Port | Service | | ---: | --- | | 3000 | Dagster | | 8080 | Trino | | 8088 | Superset (Full) | | 8181 | Polaris API | | 8585 | OpenMetadata (Full) | | 8888 | SeaweedFS Filer UI | | 9000 | SeaweedFS S3 API | | 9333 | SeaweedFS Master UI | `OLF_PORT_FORWARD=1` makes `olf`'s own commands, such as `olf infra e2e run`, port-forward instead of using the ingress, for example while you debug it. ## Try a portal preview image To test a portal change before it is released, deploy a preview image published by the portal repository's CI for a pull request. The portal is deployed only when the profile has `spec.access`. The image replaces the pinned portal image until you deploy again without it. 1. Take the preview image's digest from the portal pull request. 2. Write `portal-preview.tfvars` in the project root, with `` the pull request number and `` the 64 hex digits after `sha256:`: ```hcl portal_image = "ghcr.io/openlakeforge/openlakeforge-portal:pr-@sha256:" ``` 3. Deploy with the file: ```bash olf infra deploy --var-file portal-preview.tfvars ``` 4. To go back to the pinned image, deploy without the file: ```bash olf infra deploy ``` The reference must be pinned by digest, or Terraform refuses the plan. `olf` does not prefetch this image: the kind nodes pull it from the registry. ## Tear down ```bash olf infra destroy ``` It destroys the platform services, then the kind cluster. The cluster holds all state, so this deletes your Bronze, Silver and Gold data and Dagster's run history. `openlakeforge.yaml` and `lakehouse_code/` are not touched, and the next `olf infra deploy` rebuilds the same platform from them. With HTTPS, a rebuilt cluster has a new CA: run `olf infra access trust` again. | To remove | Run | | --- | --- | | Only the platform, keeping the cluster | `olf infra destroy --phase platform` | | Only the cluster, after the platform | `olf infra destroy --phase foundation` | | The managed toolchain under `~/.openlakeforge` | `olf toolchain clean --all` | `--phase foundation` refuses to run while platform namespaces exist; `--force` overrides that and loses them. After `--phase platform`, bring the platform back with `olf infra deploy --phase platform`, then `--phase artifacts`. ## Contributor checkout To work on OpenLakeForge itself, clone the repository and run the same commands through uv from its root: ```bash git clone https://github.com/OpenLakeForge/openlakeforge.git cd openlakeforge uv run --project tools/olf --locked olf infra deploy ``` The contributor workflow and its gates are in [AGENTS.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/AGENTS.md). ## Check it worked ```bash olf infra e2e run --env local --suite full ``` It launches every product's job and checks the Silver and Gold tables through Trino; on Full it also checks Superset and OpenMetadata. It ends with `Local OpenLakeForge full e2e validation passed.` --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/local-installation.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/local-installation.md). --- # Build and manage data products > How to add sources, domains, data products, resources and Gold models to a project, how their names line up, and how to check and deploy a change. For a… Source: https://openlakeforge.dev/docs/guides/data-products/ How to add sources, domains, data products, resources and Gold models to a project, how their names line up, and how to check and deploy a change. For a guided first walkthrough of the same steps, follow the [tutorial](https://openlakeforge.dev/docs/tutorial/02-ingest-a-source/). Run every command from the project directory, on a deployed local platform. The examples use the source `marketing_platform`, the domain `marketing` and the product `campaign_performance`. ## How a project is laid out Ownership follows the medallion layer: | Layer | Owned by | Directory | Built by | | --- | --- | --- | --- | | Bronze | A source | `lakehouse_code/bronze//` | dlt | | Silver | A domain | `lakehouse_code/silver//` | Floe | | Gold | A data product | `lakehouse_code/gold/models//` | dbt-trino | | Dashboards | A dashboard | `lakehouse_code/dashboards/superset//` | Superset | `lakehouse_code/governance.yml` names the domains and, nested under each, its products; each source has a `source.yaml`, and each dashboard is a bundle directory. OpenLakeForge derives every platform name from these, so you never create catalog namespaces or edit Terraform to register a product: | Derived name | Example | Shared by | | --- | --- | --- | | Silver namespace `_silver` | `marketing_silver` | Every product of the domain | | Gold namespace `_gold` | `campaign_performance_gold` | The product only | | Dagster job `_pipeline` | `campaign_performance_pipeline` | The product only | Every identifier matches `^[a-z][a-z0-9_]*$`, so `campaign_performance`, not `campaign-performance`. A product id is unique across the whole lakehouse. Field-by-field rules are in the [descriptor reference](https://openlakeforge.dev/docs/reference/descriptors/). ## Add a source ```bash olf source new marketing_platform --resource campaigns ``` Repeat `--resource` for each table-like input. The command writes `bronze/marketing_platform/` with a `source.yaml`, a dlt loader under `dlt/` and one placeholder CSV per resource under `examples/`. It validates its result first and writes nothing if validation fails. Replace each placeholder CSV with your real columns **before** you create a domain or product that reads it: the Silver contract's columns are inferred from that file at creation time. :::note The scaffold loads CSV files from `examples/`, which gives the same result on every run. For an API or a database, `--kind api` or `--kind sql` writes an incremental dlt connector instead; see [Load an external source incrementally](https://openlakeforge.dev/docs/guides/incremental-sources/). ::: ## Add a domain ```bash olf domain new marketing --input marketing_platform/campaigns ``` A domain owns a set of Silver tables. Each `--input /` becomes a Silver table of the same name, validated by its own entity file, `silver/marketing/contracts/.yml`. The domain's `silver/marketing/domain.yml` sets the Iceberg namespace, the rejected-rows path and the policy for all of them. An entity declares column types and a primary key; every column starts as `nullable: false`, so loosen a column by hand when a value may be empty. [Floe validation](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/floe-validation.md) describes the layout. `olf product new` also creates the domain when its `--input` names a domain that does not exist yet, so this step is optional. ## Add a data product ```bash olf product new marketing/campaign_performance \ --silver-input campaigns \ --gold-table mart_campaign_performance ``` | Option | Use | | --- | --- | | `--silver-input
` | A Silver table the domain already has. Repeatable. | | `--input /` | A Bronze resource to add to the domain's Silver and read. Creates the domain if needed. Repeatable. | | `--gold-table ` | A Gold mart the product produces. Repeatable, at least one. | | `--with-report` | Also scaffold a draft Superset report; see [Dashboards as code](https://openlakeforge.dev/docs/guides/dashboards-as-code/). | It creates the product's folder `gold/models/campaign_performance/` in the Gold dbt project and a Dagster module `pipelines/dagster/campaign_performance.py`, and registers the product in `governance.yml`. It also adds the product's `+group` block to `gold/dbt_project.yml` and declares any Silver table the domain's `gold/models/_sources/.yml` lacks; the first product creates the project itself. Dagster loads every module in `pipelines/dagster/` by itself. The generated model `mart_campaign_performance.sql` selects everything from the first Silver input. Replace it with your SQL, reading Silver through `{{ source('', '
') }}`, and describe and test it in the product's `schema.yml`; dbt runs the tests in the same build, so a failing test fails the run. Do not hard-code Trino hosts or catalogs: OpenLakeForge renders the dbt profile for each stage. ## Add a resource to an existing source 1. Add it under `resources` in `bronze/marketing_platform/source.yaml`. 2. Add its data as `examples/.csv`. 3. Add its name to the entity tuple in `dlt/marketing_platform.py`: ```python MARKETING_PLATFORM_ENTITIES = ("campaigns", "ad_groups") ``` 4. Carry it into Silver. The simplest way is a new product that reads it, which also adds the Silver table and its Floe entity: ```bash olf product new marketing/ad_group_report \ --input marketing_platform/ad_groups --gold-table mart_ad_groups ``` To let an existing product read the resource instead, make these edits by hand: | File | Add | | --- | --- | | `silver/marketing/contracts/ad_groups.yml` | An entity file, copied from an existing one, with `source: { ref: marketing_platform, resource: ad_groups }` | | `gold/models/_sources/marketing.yml` | `- name: ad_groups` under the `marketing` source | | `gold/models//.sql` | A read of `{{ source('marketing', 'ad_groups') }}` | ## Add a Gold model to an existing product 1. Add `gold/models//.sql` and describe it in the product's `schema.yml`. No descriptor lists it: its folder puts it in `_gold`, and a table there belongs to the product. The product's Dagster job picks the model up from the dbt project; nothing in `pipelines/dagster/.py` lists it. A product's models are private to it: `gold/dbt_project.yml` sets `+access: private`, and each product is a dbt group. To let another product `ref()` a mart, set `access: public` on that model in its `schema.yml`: ```yaml models: - name: mart_campaign_performance access: public ``` A `ref()` to a model that is not public fails to parse. The reading product's job uses the mart as it is and never rebuilds it. Keep one model's reads to about 150 tables or fewer. Trino counts about two stages per table a query reads and stops at `max_stage_count` (300 in every `query.size`, see [the deployment profile](https://openlakeforge.dev/docs/reference/deployment-profile/)) with `QUERY_HAS_TOO_MANY_STAGES`. A union over a whole domain should be split into staging models. ## Remove a product Delete its entry from `governance.yml`, its `gold/models//` folder, its block in `gold/dbt_project.yml` and its Dagster module. Dagster loads every module under `pipelines/dagster/`, declared or not, so a leftover module keeps the job alive. Renaming a source, domain, product or table changes the derived namespaces, so on a deployed stage treat it as a data migration, not an edit. `displayName`, `description` and `status` are metadata only. ## Validate and deploy | Command | Checks | | --- | --- | | `olf check contracts` | Each descriptor against its schema: identifiers, duplicates, a domain or product without its directory; each Floe domain writes its own `_silver` namespace | | `olf check project-code` | The whole inventory loads in Dagster, including references between descriptors | | `olf check dbt` | Every product's dbt project parses and compiles, and its models and sources sit in the schemas the descriptors name. Incremental models are parsed (refs, sources, Jinja) but not compiled: `is_incremental()` needs a warehouse connection, so their rendered SQL is not checked | Then deploy only the artifacts phase, which covers everything derived from `lakehouse_code/`: ```bash olf infra deploy --provider local --phase artifacts ``` It reconciles the catalog namespaces, builds the project-code image and restarts Dagster's code location. ### Python dependencies A project that needs a Python package (an API client, a dlt source) lists it in `lakehouse_code/requirements.txt`, with plain pins or ranges. The image installs the file in its own layer after the platform dependencies, constrained to their exact versions, so a project cannot change a platform pin. `olf check project-code` and the image build resolve the file against those pins and fail on a conflict. Unlike the platform lock, this layer is not hash-verified. Without the file the image is unchanged. ## Check it worked Launch `campaign_performance_pipeline` in Dagster, then query the mart: ```bash olf infra query "SELECT * FROM campaign_performance_gold.mart_campaign_performance" ``` `olf infra e2e run --env local --suite full` also covers the new product, because it discovers products from `governance.yml`. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/data-products.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/data-products.md). --- # Load an external source incrementally > How to load an API or a database into Bronze one change at a time, carry it through Silver and Gold incrementally, and rebuild them when you need to. For… Source: https://openlakeforge.dev/docs/guides/incremental-sources/ How to load an API or a database into Bronze one change at a time, carry it through Silver and Gold incrementally, and rebuild them when you need to. For the contract each file follows, see the [descriptor reference](https://openlakeforge.dev/docs/reference/descriptors/): its `source.yaml`, **Load modes** and **Full refresh** sections are the canonical rules this guide applies. The examples use a source `shop` with an HTTP API resource `products` and a database resource `orders`, in a domain `sales`. ## Start from the scaffold ```bash olf source new shop --kind api --resource products --cursor updated_at --primary-key sku ``` `--kind api` (or `--kind sql`) writes everything the rest of this guide describes for one source: `source.yaml` with each resource incremental and its `runtime` keys, a connector on `openlakeforge_runtime.bronze_incremental`, and an example CSV per resource. The example is not loaded; give it the real columns, because ```bash olf domain new sales --input shop/products ``` infers the Silver contract's columns from it, and writes the entity with `incremental_mode: file`, `merge_scd1` on the declared primary key, and a Parquet entry in `silver/sources.yml`. The sections below explain each piece, for adapting the scaffold or writing a source by hand. ## Declare the source In `lakehouse_code/bronze/shop/source.yaml`, give each resource its load mode and name the settings and credentials the connector reads: ```yaml apiVersion: openlakeforge.io/v1beta1 kind: Source name: shop displayName: Shop description: Products from the shop API and orders from its database. status: active resources: - name: products load: { mode: incremental, cursor: updated_at, primary_key: [sku] } - name: orders load: { mode: incremental, cursor: id, primary_key: [id] } runtime: config: [base_url, host, port, database] secrets: [api_token, username, password] ``` A cursor is a column that only grows when a row is added or changed: a modification time, or a key that increases. A resource with no usable cursor stays `full` and is replaced on every run. ## Write the connector The connector lives in `lakehouse_code/bronze/shop/dlt/shop.py`. It is a dlt source whose incremental resources declare their cursor with `dlt.sources.incremental`, on the column `source.yaml` names. A loader runs it through `openlakeforge_runtime.bronze_dlt.load_dlt_source`, which applies the declared modes and refuses a cursor that differs from the descriptor. `openlakeforge_runtime.bronze_incremental` holds the two read patterns most sources fit, so the connector keeps only the request, the query and the row shape: | Helper | For | What it guarantees | | --- | --- | --- | | `newest_first_pages` | An API that sorts by modification time but cannot filter on it | Stops at the cursor; reads a changed item once; waits between requests; with no cursor yet, loads the newest pages the budget allows; with one, fails rather than skip items when the budget runs out | | `keyset_batches` | A table with an increasing key | Reads past the cursor in key order, at most `max_rows` a run, so a large table backfills a slice per run and a killed run resumes | | `sql_engine` | A database source | A SQLAlchemy engine from the bound `host`, `port`, `database`, `username`, `password` | ```python from collections.abc import Iterator, Sequence from typing import Any import dlt import sqlalchemy as sa from dlt.sources.helpers import requests from openlakeforge_runtime.bronze_csv import BronzeLoadResult from openlakeforge_runtime.bronze_dlt import load_dlt_source from openlakeforge_runtime.bronze_incremental import keyset_batches, newest_first_pages, sql_engine _ORDERS = sa.text("select id, sku, quantity, placed_at from orders where id > :last order by id limit :limit") @dlt.source(name="shop") def shop( base_url: str = dlt.config.value, api_token: str = dlt.secrets.value, host: str = dlt.config.value, port: int = dlt.config.value, database: str = dlt.config.value, username: str = dlt.secrets.value, password: str = dlt.secrets.value, ) -> Any: def page(number: int) -> list[dict[str, Any]]: response = requests.get( f"{base_url}/products", params={"sort": "-updated_at", "page": number, "per_page": 100}, headers={"Authorization": f"Bearer {api_token}"}, ) response.raise_for_status() return response.json()["items"] @dlt.resource(name="products", primary_key="sku") def products(updated_at: Any = dlt.sources.incremental("updated_at", initial_value=0)) -> Iterator[Any]: yield from newest_first_pages( page, updated_at, cursor_field="updated_at", key="sku", page_size=100, max_pages=20, interval_seconds=1 ) @dlt.resource(name="orders", primary_key="id") def orders(id: Any = dlt.sources.incremental("id", initial_value=0)) -> Iterator[Any]: engine = sql_engine( "postgresql+psycopg2", {"host": host, "port": port, "database": database, "username": username, "password": password}, connect_args={"connect_timeout": 30}, ) with engine.connect() as connection: yield from keyset_batches(connection, _ORDERS, id, cursor_field="id", batch_size=10_000, max_rows=100_000) return products, orders def load_shop_entities_to_bronze(resources: Sequence[str]) -> dict[str, BronzeLoadResult]: return load_dlt_source("shop", shop(), resources) ``` Choose the budgets from the source's limits: an API that serves at most N pages, or allows N requests a minute, sets `max_pages` and `interval_seconds`; a database's load sets `max_rows`. Declare the column types of anything a page or batch can leave empty (`columns=` on the resource), or a later run can land the column under another type. Batches land at `/shop//` as Parquet, one file per run, named so the newest sorts last; dlt keeps each cursor in the same bucket, per stage. ## Read it into Silver In `lakehouse_code/silver/sources.yml`, name the source's Parquet files: ```yaml sources: - name: "shop" format: "parquet" path: "shop/{{resource}}" storage: "lakehouse_bronze" options: { glob: "*.parquet" } ``` An entity reading an incremental resource reads new files only and merges them on the primary key: `incremental_mode: "file"` with `sink.write_mode` `merge_scd1` (`merge_scd2` and `append` are also allowed). `olf check contracts` rejects a mode that does not fit the resource; the rules are in **Load modes** in the [descriptor reference](https://openlakeforge.dev/docs/reference/descriptors/). ## Bind each stage Every stage that runs the source binds the keys `runtime` lists: a ConfigMap `olf-source-shop` and a Secret `olf-source-shop-credentials` in the stage namespace (the naming rules are in the `source.yaml` section of the [descriptor reference](https://openlakeforge.dev/docs/reference/descriptors/)): ```bash kubectl -n olf-dev create configmap olf-source-shop \ --from-literal=base_url=https://api.example.test --from-literal=host=db.example.test \ --from-literal=port=5432 --from-literal=database=shop ``` ```bash kubectl -n olf-dev create secret generic olf-source-shop-credentials \ --from-literal=api_token="$SHOP_API_TOKEN" --from-literal=username=reader \ --from-literal=password="$SHOP_DB_PASSWORD" ``` `olf infra project deploy` refuses to activate a revision in a stage that has not bound every key. On `local`, a stage's run pods reach nothing outside the cluster unless its Deployment Profile opens the ports the source needs (see [`spec.stages`](https://openlakeforge.dev/docs/reference/deployment-profile/)): ```yaml stages: dev: source_egress: ports: [443, 5432] ``` ## Test it offline `load_dlt_source` takes a local bucket and project root, so a test can run the real connector against a controlled server or a temporary database and assert on the Parquet it lands: ```python from openlakeforge_runtime.bronze_dlt import load_dlt_source def test_a_second_run_with_no_change_loads_nothing(tmp_path, monkeypatch): monkeypatch.setenv("SOURCES__SHOP__BASE_URL", fake_api.url) # ... the other SOURCES__SHOP__* bindings def load(): return load_dlt_source( "shop", shop(), ("products",), environ={"OPENLAKEFORGE_STAGE": "dev"}, bucket_url=(tmp_path / "bronze").as_uri(), lakehouse_root=LAKEHOUSE_CODE, )["products"].rows assert load() > 0 assert load() == 0 ``` Cover the first run, a run with no change, a changed row, a page budget that runs out, and DEV and PROD keeping their own cursor. ## Run it ```bash olf infra product run --stage dev ``` A run is incremental: Bronze takes the rows past each cursor, Floe merges the new files, and dbt runs the product's incremental models. To rebuild Silver and Gold from everything Bronze holds, without extracting again: ```bash olf infra product run --stage dev --full-refresh bronze ``` A row deleted at the source never reaches Bronze, so no run removes it from Silver; the known limits are listed under **Full refresh** in the [descriptor reference](https://openlakeforge.dev/docs/reference/descriptors/). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/incremental-sources.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/incremental-sources.md). --- # Dashboards as code > How to keep Superset dashboards in git: edit a dashboard in the Superset UI, export it back into lakehouse_code/dashboards/superset/, validate it and import… Source: https://openlakeforge.dev/docs/guides/dashboards-as-code/ How to keep Superset dashboards in git: edit a dashboard in the Superset UI, export it back into `lakehouse_code/dashboards/superset/`, validate it and import it again. Dashboards need the Full preset, which adds Superset. ## 1. Use the Full preset Set `preset: full` under `spec` in `openlakeforge.yaml`, then deploy: ```yaml spec: provider: type: local preset: full ``` ```bash olf infra deploy --provider local ``` The deploy applies the change in place: Terraform adds OpenMetadata and Superset and leaves the data path and its tables as they are. Its artifacts phase imports every dashboard bundle under `lakehouse_code/dashboards/superset/`. `olf infra status --provider local` lists the Superset URL, for example `http://superset-dev.olf.localhost`. With sign-in off, Superset opens as its local Admin. ## 2. Know the bundle Each dashboard is a directory, a bundle, holding what Superset exports: ```text lakehouse_code/dashboards/superset/sales_customer_health/ ├── metadata.yaml ├── databases/ ├── datasets/ ├── charts/ └── dashboards/ ``` A directory under `dashboards/superset/` is a dashboard once it holds a `metadata.yaml`, which the export writes. Its datasets name the Gold schema they read (`schema: customer_health_gold`), and that is how OpenLakeForge knows which products the dashboard serves. One dashboard can read several products. The deploy requires exact parity between the declared dashboards and the bundle directories. ## 3. Start a new dashboard `olf product new` accepts `--with-report` when it creates a product. Use it for a new product, not one that already exists. The example reads the `campaigns` Silver table of a `marketing` domain, which must already exist; if it does not, create the source and the domain as in [Build and manage data products](https://openlakeforge.dev/docs/guides/data-products/). ```bash olf product new marketing/campaign_summary \ --silver-input campaigns --gold-table mart_campaign_summary \ --with-report ``` It writes a draft under `lakehouse_code/dashboards/superset/campaign_summary/`: the Trino database, one dataset per Gold mart and a README. It adds no `metadata.yaml`, so the draft is not a dashboard or promotable yet, and the deploy does not import it into Superset. Deploy the new product so the platform knows it, then build its table: ```bash olf infra deploy --provider local --phase artifacts ``` In Dagster, launch `campaign_summary_pipeline` once, so `campaign_summary_gold.mart_campaign_summary` has rows. Then build the dashboard in Superset: open **Datasets**, add a dataset from the `OpenLakeForge Trino` database, the `campaign_summary_gold` schema and the `mart_campaign_summary` table, chart it and save a dashboard. Then export it. ## 4. Export a dashboard After you build or change a dashboard in the Superset UI, export it back into its bundle. `olf infra report export` takes the stage you authored in; author in DEV. For the `campaign_summary` draft of step 3, which has nothing exported yet, name the dashboard by the slug you gave it in Superset (its **Properties**): ```bash SUPERSET_REPORT_SOURCE_DIR=lakehouse_code/dashboards/superset/campaign_summary \ SUPERSET_DASHBOARD="campaign-summary" \ olf infra report export --stage dev ``` For a dashboard that is already in a bundle, such as the demo `sales_customer_health`, set only `SUPERSET_REPORT_SOURCE_DIR` to its directory. - `SUPERSET_REPORT_SOURCE_DIR` picks the bundle. It must be a directory directly under `lakehouse_code/dashboards/superset/`. Without it the command exports the first dashboard bundle it finds. - The dashboard is found by the uuid stored in the bundle, which survives a rename in Superset. For a draft with nothing exported yet, set `SUPERSET_DASHBOARD` to its uuid or slug. - `SUPERSET_ADMIN_USERNAME` defaults to `admin`. The password is read from the `superset-credentials` Secret in the stage namespace; set `SUPERSET_ADMIN_PASSWORD` to use another Superset. The export writes a stage-neutral bundle: it replaces DEV's live Trino connection with the placeholder each deploy rewrites, so the same bundle can be promoted to PROD. The export writes `campaign_summary`'s `metadata.yaml`, which makes it a dashboard next to the demo ones. ## 5. Import a bundle The next `olf infra deploy` imports every bundle. To import without a full deploy: ```bash olf infra report import --stage dev ``` `olf infra project build` packages the bundles into a project revision, so a revision promoted to PROD carries its dashboards. ## Check it worked ```bash olf report validate ``` It checks every bundle for stable identities, resolvable references and no stage-bound values. With the three demo dashboards and `campaign_summary` exported, it prints: ```text 4 report bundle(s) are promotable. ``` Pass a dashboard name to check only that one. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/dashboards-as-code.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/dashboards-as-code.md). --- # Deploy to AWS > How to run your project in your own AWS account: EKS for Kubernetes, ECR for images, S3 for storage, RDS PostgreSQL for service state and AWS Glue as the… Source: https://openlakeforge.dev/docs/guides/cloud/deploy-to-aws/ How to run your project in your own AWS account: EKS for Kubernetes, ECR for images, S3 for storage, RDS PostgreSQL for service state and AWS Glue as the Iceberg catalog. Your `lakehouse_code/` does not change; only the Deployment Profile does. :::caution The AWS deployment is alpha. It has passed the end-to-end suite in a test account but is not production-hardened, and it creates billable resources. Read [Limitations and costs](#limitations-and-costs) first, and tear it down when you are done. ::: ## Prerequisites - An initialized project (`olf init`) and `olf` installed as in [Install and configure a local deployment](https://openlakeforge.dev/docs/guides/local-installation/). - A running Docker engine: the deploy builds and pushes images. - An AWS identity allowed to create a VPC, an EKS cluster and its node group, an ECR repository, IAM roles and EKS Pod Identity associations, an RDS instance, S3 buckets and Glue databases. `AdministratorAccess` in a dedicated account is the simplest choice. You do not need the AWS CLI, Terraform, Helm or kubectl: `olf` uses the AWS SDK and its own pinned tools. ## 1. Authenticate `olf` reads credentials through the AWS SDK, from the first source it finds: | Source | How | | --- | --- | | Automation credentials | `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`, a web identity token (GitHub Actions OIDC), a container role or an EC2 instance profile | | An existing AWS profile | `olf infra auth login --provider aws --profile ` | | IAM Identity Center (SSO) | `olf infra auth login --provider aws --start-url --sso-region ` | For IAM Identity Center, the start URL is your AWS access portal URL, and `--sso-region` is the region of your Identity Center instance, which can differ from the region you deploy to. The command opens a browser to approve the device; add `--no-browser` to print the URL and code instead. With no option at all, `olf infra auth login --provider aws` reuses the `default` profile, or asks for the start URL. Check which identity `olf` will use: ```bash olf infra auth status --provider aws ``` ## 2. Point the profile at AWS Edit `openlakeforge.yaml`: ```yaml spec: provider: type: aws region: eu-west-1 stages: dev: enabled: true ``` - `region` is where everything is created. Without it, `AWS_REGION` applies, then `eu-west-1`. - Delete any `access:` block: the cloud publishes no routes, and an `access:` block would require `spec.identity`. - Leave out `spec.identity`. The cloud deployment publishes no routes, so there is nothing to sign in to: you reach the services with `olf infra forward` from your machine, and authentication stays off. - Keep DEV as the only stage: the cloud guides are validated with one stage. ```bash olf profile validate --project . ``` ## 3. Optional configuration Everything has a default. Override with environment variables in the shell that runs `olf`: | Variable | Default | Meaning | | --- | --- | --- | | `AWS_CLUSTER_NAME` | `eks-openlakeforge`, or the name an existing deployment already uses | EKS cluster name, also the prefix of the IAM roles | | `AWS_NODE_INSTANCE_TYPES` | `m7i.large` | Node instance type(s) | | `AWS_NODE_DESIRED_SIZE`, `AWS_NODE_MIN_SIZE`, `AWS_NODE_MAX_SIZE` | `3`, `1`, `4` | Node group size | | `AWS_TFVARS_FILE` | none | A Terraform variables file, for resource tags | Set the same values for every later command, including `olf infra e2e run` and `olf infra destroy`: they find the cluster by its name. To tag every resource, for cost tracking or because your organization requires it, put the tags in a variables file and export its path: ```bash cat > aws.tfvars <<'HCL' default_tags = { Project = "openlakeforge" Owner = "you@example.com" } HCL export AWS_TFVARS_FILE="$(pwd)/aws.tfvars" ``` Keep it out of git. The same file applies to the cluster and the platform. ## 4. Deploy ```bash olf infra deploy ``` It runs three phases, which you can also run one at a time with `--phase`: | Phase | Creates | | --- | --- | | `foundation` | VPC with two public subnets, EKS and its node group, an ECR repository, IAM roles | | `platform` | S3 buckets, Glue databases, RDS PostgreSQL, Trino, Dagster; Superset and OpenMetadata with the Full preset | | `artifacts` | Builds and pushes the project-code image to ECR and deploys your data products | Creating the EKS cluster takes most of the time. If this shell still exports `PROJECT_CODE_IMAGE_REPOSITORY` from a local promotion, unset it: the cloud pushes to its own ECR. ## 5. Open and validate the platform The cloud deployment has no public endpoint. Port-forward the services to your machine, on the same ports as locally (Dagster on `http://localhost:3000`, Trino on `8080`, Superset on `8088`, OpenMetadata on `8585`), and stop with Ctrl-C: ```bash olf infra forward ``` Run the end-to-end suite after you stop `olf infra forward`: `olf` runs one command at a time, and the suite opens its own port-forwards. ```bash olf infra e2e run --env aws ``` It launches every product's job on EKS, checks the Silver and Gold tables through Trino and Glue, and on Full also the dashboards and OpenMetadata. It ends with `... e2e validation passed.` ## 6. Tear down ```bash olf infra destroy ``` It removes the platform (RDS, buckets, Helm releases), then the foundation (EKS, ECR with its images, networking). Run it from the same machine and project as the deploy: Terraform state is local (see below). With `--phase`, destroy `platform` before `foundation`; the foundation refuses to go first. ## Limitations and costs | Area | Today | | --- | --- | | Access | No ingress, DNS, TLS or sign-in. Services are reached with `olf infra forward` only, by whoever has credentials to the cluster, with no OpenLakeForge sign-in in front of them. | | Stages | Validated with DEV only. | | State | Terraform state stays on your machine under `~/.openlakeforge`. There is no remote backend, so losing that directory loses the ability to update or destroy the deployment with `olf`. | | Secrets | Generated service passwords live in Kubernetes Secrets and in the local Terraform state. | | Network | Nodes run in public subnets, and the EKS API endpoint accepts connections from any address (`0.0.0.0/0`), protected by IAM authentication. | | Data | RDS is a single `db.t4g.micro` instance with no final snapshot on destroy. There are no backups. | | `olf infra query` | Not supported on AWS yet. | The main running costs are the EKS control plane, three `m7i.large` nodes and the RDS instance, plus S3 storage and data transfer. They accrue until `olf infra destroy` finishes. Workload identity uses EKS Pod Identity rather than IRSA, because the restricted test account the AWS deployment was built in denied creating an OIDC provider. Deployments created before 0.5 keep their `limited-eks-openlakeforge-poc` cluster name: `olf` reads it from the foundation state. ## Troubleshooting | Symptom | Fix | | --- | --- | | `AWS is not authenticated` | Run `olf infra auth login --provider aws`, then `olf infra auth status --provider aws`. | | `x509: certificate signed by unknown authority` from the SDK | A proxy intercepts TLS: `export AWS_CA_BUNDLE=/path/to/your-ca-bundle.pem`. | | An `AccessDenied` or `UnauthorizedOperation` error | Your identity lacks a permission from the prerequisites. Organization policies (SCPs) can also require tags or names; set them with `AWS_TFVARS_FILE` and `AWS_CLUSTER_NAME`. | | `olf infra e2e run` cannot find the cluster | Export the same `AWS_CLUSTER_NAME` as for the deploy. | To promote revisions from CI, see [CI/CD and environment promotion](https://openlakeforge.dev/docs/guides/promote-dev-to-prod/). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/cloud/deploy-to-aws.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/cloud/deploy-to-aws.md). --- # Deploy to Azure > How to run your project in your own Azure subscription: AKS for Kubernetes and ACR for images, with the same in-cluster storage (SeaweedFS), catalog… Source: https://openlakeforge.dev/docs/guides/cloud/deploy-to-azure/ How to run your project in your own Azure subscription: AKS for Kubernetes and ACR for images, with the same in-cluster storage (SeaweedFS), catalog (Polaris) and PostgreSQL as the local platform. Your `lakehouse_code/` does not change; only the Deployment Profile does. :::caution Azure is a preview. It runs the same platform modules as local, but its latest changes are checked with `terraform validate` and `plan` only, not yet deployed to a live subscription. It creates billable resources. Read [Limitations and costs](#limitations-and-costs) first, and tear it down when you are done. ::: ## Prerequisites - An initialized project (`olf init`) and `olf` installed as in [Install and configure a local deployment](https://openlakeforge.dev/docs/guides/local-installation/). - A running Docker engine: the deploy builds and pushes images. - An Azure identity allowed to create a resource group, an AKS cluster, an ACR registry and a role assignment in the subscription. `Owner` on the subscription is the simplest choice; `Contributor` cannot create the role assignment that lets AKS pull from ACR. You do not need the Azure CLI, Terraform, Helm or kubectl: `olf` uses the Azure SDK and its own pinned tools. ## 1. Authenticate `olf` reads credentials through the Azure SDK, from the first source it finds: | Source | How | | --- | --- | | A service principal or workload identity | `ARM_CLIENT_ID`, `ARM_TENANT_ID` and `ARM_CLIENT_SECRET` (or a certificate or OIDC token), the `AZURE_*` equivalents, or a managed identity | | An existing `az login` session | `olf infra auth login --provider azure` reuses it when the `az` CLI is installed | | Browser sign-in | `olf infra auth login --provider azure`, then pick the subscription | On a machine without a browser, add `--device-code`. `--tenant-id` and `--subscription-id` skip the prompts. Check which identity `olf` will use: ```bash olf infra auth status --provider azure ``` ## 2. Point the profile at Azure Edit `openlakeforge.yaml`: ```yaml spec: provider: type: azure stages: dev: enabled: true ``` - Do not set `region`: Azure takes its region from `location` in the variables file below. - Delete any `access:` block: the cloud publishes no routes, and an `access:` block would require `spec.identity`. - Leave out `spec.identity`. The cloud deployment publishes no routes, so there is nothing to sign in to: you reach the services with `olf infra forward` from your machine, and authentication stays off. - Keep DEV as the only stage: the cloud guides are validated with one stage. ```bash olf profile validate --project . ``` ## 3. Configure the resource group and nodes Azure needs a Terraform variables file. Create one outside git and export its path: ```bash cat > azure.tfvars <<'HCL' create_resource_group = true resource_group_name = "rg-openlakeforge" location = "westeurope" node_vm_size = "Standard_D4s_v5" HCL export AZURE_TFVARS_FILE="$(pwd)/azure.tfvars" ``` | Variable | Required | Meaning | | --- | --- | --- | | `node_vm_size` | yes | A VM size your subscription and region offer | | `location` | no, default `westeurope` | The Azure region | | `create_resource_group` | no, default `true` | `true` lets Terraform create and later delete the group; `false` deploys into an existing group you manage | | `resource_group_name` | no, default `rg-openlakeforge-azure-poc` | The group to create, or the existing one to use | Keep `AZURE_TFVARS_FILE` exported for every later command, including `olf infra destroy`: the foundation cannot be read without it. Other settings are environment variables: | Variable | Default | Meaning | | --- | --- | --- | | `AZURE_CLUSTER_NAME` | `aks-openlakeforge-poc` | AKS cluster name | | `AZURE_NODE_COUNT` | `3` | Node count | | `AZURE_ACR_NAME_PREFIX` | `openlakeforgepoc` | ACR name prefix; a random suffix makes it globally unique | ## 4. Deploy ```bash olf infra deploy ``` It runs three phases, which you can also run one at a time with `--phase`: | Phase | Creates | | --- | --- | | `foundation` | The resource group (when `create_resource_group = true`), AKS, ACR and the AKS-to-ACR pull role | | `platform` | Deploys SeaweedFS, Polaris, PostgreSQL, Trino and Dagster; Superset and OpenMetadata with the Full preset | | `artifacts` | Builds and pushes the project-code image to ACR and deploys your data products | If this shell still exports `PROJECT_CODE_IMAGE_REPOSITORY` from a local promotion, unset it: the cloud pushes to its own ACR. ## 5. Open and validate the platform The cloud deployment has no public endpoint. Port-forward the services to your machine, on the same ports as locally (Dagster on `http://localhost:3000`, Trino on `8080`, Polaris on `8181`, SeaweedFS S3 on `9000`, and on Full Superset on `8088` and OpenMetadata on `8585`), and stop with Ctrl-C: ```bash olf infra forward ``` Run the end-to-end suite after you stop `olf infra forward`: `olf` runs one command at a time, and the suite opens its own port-forwards. ```bash olf infra e2e run --env azure ``` It launches every product's job and checks the Silver and Gold tables, and on Full also the dashboards and OpenMetadata. It ends with `... e2e validation passed.` ## 6. Tear down ```bash olf infra destroy ``` It removes the platform, then AKS and ACR. With `create_resource_group = true` the resource group goes too; with `false` it is left in place. Run it from the same machine and project as the deploy, with the same `AZURE_TFVARS_FILE`. With `--phase`, destroy `platform` before `foundation`. ## Limitations and costs | Area | Today | | --- | --- | | Access | No ingress, DNS, TLS or sign-in. Services are reached with `olf infra forward` only, by whoever has credentials to the cluster, with no OpenLakeForge sign-in in front of them. | | Stages | Validated with DEV only. | | Services | SeaweedFS, Polaris and PostgreSQL run inside the cluster on its disks, with no backups or high availability. Azure Blob Storage and managed PostgreSQL are not used. | | State | Terraform state stays on your machine under `~/.openlakeforge`. There is no remote backend. | | Secrets | Generated service passwords live in Kubernetes Secrets and in the local Terraform state. | The main running costs are the AKS nodes (three of `node_vm_size`), their disks and ACR, plus data transfer. They accrue until `olf infra destroy` finishes. ## Troubleshooting | Symptom | Fix | | --- | --- | | `Azure is not authenticated` | Run `olf infra auth login --provider azure`, then `olf infra auth status --provider azure`. | | `Azure foundation configuration not found` | Export `AZURE_TFVARS_FILE` pointing at your variables file. | | A VM size or quota error | Pick a `node_vm_size` your region offers and your subscription has quota for. | | A policy forbids creating resource groups | Ask for a group, then set `create_resource_group = false` and its `resource_group_name` and `location`. | | `certificate verify failed` from the SDK | A proxy intercepts TLS: `export REQUESTS_CA_BUNDLE=/path/to/your-ca-bundle.pem`. | --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/cloud/deploy-to-azure.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/cloud/deploy-to-azure.md). --- # Connect GitHub > How to turn on GitHub sign-in for a local OpenLakeForge deployment: create the GitHub App, install it on your organization, and fix a refused sign-in. Source: https://openlakeforge.dev/docs/guides/identity/connect-github/ How to turn on GitHub sign-in for a local OpenLakeForge deployment: create the GitHub App, install it on your organization, and fix a refused sign-in. Without `spec.identity` in `openlakeforge.yaml`, authentication is off and every service opens with administrator rights. `olf` allows that only when nothing is published beyond your machine: locally on a `*.localhost` domain, and on AWS or Azure without `spec.access`. With `spec.identity`, every service sits behind a sign-in perimeter, and each person gets the role their GitHub team grants. Lesson 8 of the tutorial walks through this once: [Sign in with GitHub](https://openlakeforge.dev/docs/tutorial/08-sign-in-with-github/). :::note Sign-in is implemented for the local provider. The AWS and Azure deployments publish no routes yet, so they are reached with `olf infra forward` and never ask anyone to sign in. ::: ## Turn on sign-in 1. Add an identity block to `openlakeforge.yaml`. Each role maps to one or more team slugs, as they appear in the team URL; a role you leave out is held by nobody. See [Map teams to roles](https://openlakeforge.dev/docs/guides/identity/map-teams-to-roles/). ```yaml spec: access: tls: none identity: issuer: github github: organization: my-org teams: platform-admin: [olf-platform-admins] data-engineer: [olf-data-engineers] analyst: [olf-analysts] viewer: [olf-viewers] oauth_app_secret_ref: name: github-oauth-app ``` `organization` is the login exactly as GitHub shows it, case included. Only members of the mapped teams can sign in; organization ownership grants nothing. Sign-in works over plain HTTP or HTTPS. 2. Deploy: ```bash olf infra deploy --provider local ``` In an interactive terminal, `olf infra deploy` notices the missing GitHub credentials and runs the GitHub step first. It prints a URL and opens it in your browser (on WSL through Windows' `explorer.exe`, when present), where you select **Create GitHub App** with your own session. It stores the app's credentials in the Kubernetes Secret named by `oauth_app_secret_ref`, and the rest of the deploy runs unattended. You can also run this step on its own, once the cluster exists: ```bash olf infra github connect --project . ``` 3. Install the app on the organization on the install page GitHub shows after you create it. The app reads team membership only in organizations it is installed on. The deploy ends with the portal URL and either "GitHub App installed on " or the install link. `--no-browser` (on `olf infra github connect`) prints the URL without opening it; without a click within 15 minutes, nothing is written. Credentials are never printed. To replace the app, use `olf infra secrets rotate github-app`, which registers a new app, replaces the Secret and restarts Dex ([Rotate secrets](https://openlakeforge.dev/docs/guides/identity/rotate-secrets/#the-github-app)); then delete the old app and its private key in the organization settings yourself. To make `olf infra deploy` fail on a missing Secret instead of creating the app, pass `--no-github-connect`. In CI (no terminal, or `CI` set) it never asks. ## Use an OAuth App instead When you cannot create a GitHub App, create an organization-owned OAuth App (Settings, Developer settings, OAuth Apps, New OAuth App): | Field | Value | | --- | --- | | Homepage URL | `https://olf.localhost`, or `http://olf.localhost` with `tls: none` | | Authorization callback URL | `https://auth.olf.localhost/callback`, or `http://auth.olf.localhost/callback` with `tls: none` | Replace `olf.localhost` with your `spec.access.base_domain` if you changed it. Generate a client secret, then store both values. The first `olf infra deploy` creates the `olf-system` namespace and stops with the exact command; run it with the managed kubectl: ```bash export KUBECONFIG="$HOME/.openlakeforge/state/local/kubeconfig.yaml" "$(olf toolchain path kubectl)" -n olf-system create secret generic github-oauth-app \ --from-literal=client-id="$GITHUB_CLIENT_ID" \ --from-literal=client-secret="$GITHUB_CLIENT_SECRET" ``` Then run `olf infra deploy --provider local` again, with `--no-github-connect` so it does not offer to create a GitHub App. An OAuth App has no installation step, but without the GitHub App's `app-id` the OpenMetadata role sync is skipped ([Add, change or remove a member](https://openlakeforge.dev/docs/guides/identity/manage-members/)). ## Troubleshooting Dex's refusal page ("Internal Server Error", with the two likely causes) and the perimeter's "Sign-in was refused" page both link here. | Symptom | Cause and fix | | --- | --- | | "Sign-in was refused" | The GitHub App is not installed on the organization, or you are in no mapped team. Check `olf infra deploy`'s last lines for the install link; add yourself to a mapped team in GitHub. | | "Access is role-restricted" | Your role does not open this service; see [Roles and permissions](https://openlakeforge.dev/docs/reference/roles-and-permissions/). A platform-admin changes team membership in GitHub. | | `olf infra deploy` stops on a missing Secret | Run `olf infra github connect --project .`, or create the OAuth App Secret as above. | | The organization is spelled differently | `organization` is compared exactly, case included. Use the login as GitHub shows it. | | A request from `curl` answers `302` or `401` | Every route except `auth.` requires a browser session; `olf`'s own commands port-forward instead. | ## Check it worked Open the portal, `http://olf.localhost`. It sends you to sign in with GitHub, then shows the portal. With the Full preset, a person in the `analyst` team reaches Superset and is refused Dagster. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/identity/connect-github.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/identity/connect-github.md). --- # Map teams to roles > How spec.identity.github.teams turns GitHub teams into the four OpenLakeForge roles, and what to check when a person gets the wrong one. Source: https://openlakeforge.dev/docs/guides/identity/map-teams-to-roles/ How `spec.identity.github.teams` turns GitHub teams into the four OpenLakeForge roles, and what to check when a person gets the wrong one. ## The mapping ```yaml spec: identity: issuer: github github: organization: my-org teams: platform-admin: [olf-platform-admins] data-engineer: [olf-data-engineers] analyst: [olf-analysts, partner-analysts] viewer: [olf-viewers] ``` | Rule | Detail | | --- | --- | | Keys | The canonical roles: `platform-admin`, `data-engineer`, `analyst`, `viewer`. Any other name is rejected. | | Values | A non-empty list of team slugs, as they appear in the team URL. `olf` lowercases them. | | Repeats | A slug may not repeat within a list, and one team may not map to two roles. | | Omitted roles | A role you leave out is held by nobody. At least one role must be mapped. | | Organization | The login exactly as GitHub shows it, case included. | Several teams can feed one role. A person in teams of more than one role holds the highest of them: the grants are cumulative, so a `platform-admin` also holds everything below. Roles and what they open are in [Roles and permissions](https://openlakeforge.dev/docs/reference/roles-and-permissions/). ## Apply a change The mapping is part of the deployment, so changing which teams feed a role takes a deploy: ```bash olf infra deploy --provider local ``` Changing who is in a team does not: see [Add, change or remove a member](https://openlakeforge.dev/docs/guides/identity/manage-members/). ## Check a person's role Sign in as that person in a fresh private window and open Superset and Dagster. The table in [Roles and permissions](https://openlakeforge.dev/docs/reference/roles-and-permissions/) says what each role opens. A person who is refused at sign-in is in no mapped team, or the GitHub App is not installed: [Troubleshooting](https://openlakeforge.dev/docs/guides/identity/connect-github/#troubleshooting). Map direct teams only for OpenMetadata. The OpenMetadata role sync reads each team's members, which include the people of its child teams, so it refuses to run when a mapped team has child teams (`map direct teams only; has child teams`). Map the child teams instead, or flatten the hierarchy. Only teams in the organization named by `organization` count. A team elsewhere with the same slug grants nothing. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/identity/map-teams-to-roles.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/identity/map-teams-to-roles.md). --- # Add, change or remove a member > How to give a person access, change their role or take it away. People and roles live in your GitHub organization, so there is no olf command for users and… Source: https://openlakeforge.dev/docs/guides/identity/manage-members/ How to give a person access, change their role or take it away. People and roles live in your GitHub organization, so there is no `olf` command for users and none of these steps needs a deploy. | To | Do this in GitHub | What happens | | --- | --- | --- | | Give the first administrators access | Put them in the team mapped to `platform-admin` | They hold `platform-admin` at their first sign-in. Nothing is created at deploy. | | Add a person | Add them to the organization and to a mapped team | They sign in with GitHub on the portal. GitHub owns their password, two-factor authentication and recovery. | | Change a role | Move them between mapped teams | Their next token carries the new teams. | | Remove every role | Remove them from every mapped team | Dex refuses their next sign-in or refresh. | | Offboard | Remove them from the organization | The same, and GitHub ends their organization access everywhere else at once. | Only members of a mapped team can sign in. Being an organization owner grants nothing in OpenLakeForge. ## How fast a change takes effect A person with no open session is affected at their next sign-in. For a person who is signed in: | Where | Delay | Why | | --- | --- | --- | | Portal, Dagster, Trino UI and every route (the perimeter) | About 4 to 5 minutes | The perimeter refreshes the session against Dex at most every 4 minutes, and Dex re-reads team membership on a refresh. The change shows on the first request after a refresh; access tokens last 5 minutes. | | OpenMetadata roles | Up to 5 minutes plus the run | A CronJob, `openmetadata-role-sync`, reads the mapped teams every 5 minutes and sets the administrator flag and the `DataSteward` role. It needs the GitHub App (the Secret's `app-id` and `private-key`); with a hand-made OAuth App it is skipped and OpenMetadata users stay at the read baseline. | | Superset roles | At most 15 minutes (designed; not measured) | Superset's own session is designed to last 15 minutes without sliding, and its roles are read again at each sign-in. The perimeter refuses a removed person first. | Measured once, against real GitHub: a member moved to another team lost the old role on the first request after the 4-minute refresh. The bound is "the next request at least 4 minutes after sign-in or the last refresh", not a timer, so a person who stays idle is refused at their next request. A person's session also ends 30 minutes after their last request and 10 hours after sign-in, whatever else is true. :::note Ownership outlives a role. In OpenMetadata, the owner of an asset keeps full control of it after a demotion until the ownership is reassigned. Reassign the assets of someone you demote or offboard. ::: ## Sign out A person does not need to sign out for a team change to apply: it takes effect within the refresh bounds above. To end a session anyway, select **Sign out** in the portal header. It clears the perimeter cookie. - Superset keeps its own session. Its Logout menu item does the same. - GitHub's own session stays open, so signing in again usually does not prompt; Dex re-reads teams at each sign-in. - A private window is the easy alternative: closing it drops every cookie. ## Check a change took effect 1. Make the change in GitHub and note the time. 2. In a fresh private window, sign in as the person (or use their open session) and open a service their new role should deny. 3. Expect the "Access is role-restricted" page, or Dex's refusal when they have no role at all. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/identity/manage-members.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/identity/manage-members.md). --- # Bring your own OIDC issuer > How to sign people in through an identity provider you run, such as Okta, Entra ID or Auth0, instead of GitHub. OpenLakeForge then deploys no issuer of its own. Source: https://openlakeforge.dev/docs/guides/identity/external-issuer/ How to sign people in through an identity provider you run, such as Okta, Entra ID or Auth0, instead of GitHub. OpenLakeForge then deploys no issuer of its own. ```yaml spec: access: tls: none identity: issuer: external issuer_url: https://login.example.com/ role_claim: groups role_mapping: platform-admin: [olf-admins] analyst: [analysts] ``` | Field | Meaning | | --- | --- | | `issuer_url` | An `https://` URL. The token's `iss` claim must equal it. | | `role_claim` | The token claim that holds group values, such as `groups`. | | `role_mapping` | Each canonical role and the claim values that grant it. A value may not map to two roles. | | `client_ids` | Optional issuer-assigned client ids, keyed by consumer. | Every field is in the [Deployment Profile reference](https://openlakeforge.dev/docs/reference/deployment-profile/#specidentity). ## Register the clients Register three confidential OIDC clients in your issuer: `perimeter`, `superset` and `openmetadata`, or the ids you set under `client_ids`. Store each client secret in a Kubernetes Secret named `oidc-client-` in `olf-system`, with the key `client-secret`. The contract names all three, so create all three; only the `perimeter` client is used by a deployed service today (see Limits). For the `perimeter` client, register this redirect URI, with the scheme you deploy (`http` with `access: {tls: none}`, `https` otherwise): ```text ://oauth2./oauth2/callback ``` For example `http://oauth2.olf.localhost/oauth2/callback`. `olf-system` does not exist on a fresh stack, and `olf` creates it early only for `issuer: github`. Do not create it by hand: Terraform owns it and cannot adopt a hand-made one. The order to use: run `olf infra deploy --provider local`, which creates the namespace and may fail or wait on the pods that need the Secrets; then create the Secrets below and run `olf infra deploy --provider local` again. This order has not been run end to end; the missing early namespace step for `external` is tracked in #521. ```bash export KUBECONFIG="$HOME/.openlakeforge/state/local/kubeconfig.yaml" "$(olf toolchain path kubectl)" -n olf-system create secret generic oidc-client-perimeter \ --from-literal=client-secret="$PERIMETER_CLIENT_SECRET" ``` Repeat for `superset` and `openmetadata`. Also register a fourth, public client for the command line: `olf-cli`, or the id you set under `client_ids`. It has no secret and no Kubernetes Secret. | Setting | Value | | --- | --- | | Client type | Public (no client secret) | | Grant | Authorization Code with PKCE (S256) | | Redirect URIs | Loopback addresses on any port (`http://127.0.0.1:/...`, `http://localhost:/...`, `http://[::1]:/...`) | | Scopes | `openid`, `email`, `profile` and `groups` (or whichever scope carries your `role_claim`), plus `offline_access` for refresh tokens | | Claims | The `role_claim` and `preferred_username`: OpenMetadata names users by it | The perimeter accepts a bearer token whose `iss` is your `issuer_url` and whose `aud` is this client id, but only when your `role_claim` is `groups`: oauth2-proxy reads the roles of a bearer token from that claim name alone, so with another `role_claim` every bearer token is refused with 401. No `olf` command signs in with it yet. ## Limits - **The issuer must be public and trusted.** The perimeter gets the local CA only when Dex is deployed. With an external issuer, the issuer must be reachable from inside the cluster and present a publicly trusted certificate; a private CA is not supported. - **Refresh must return the role claim.** The perimeter re-reads roles when it refreshes a session. If your issuer's refresh response carries no ID token with the role claim, a removed role stays usable until the issuer's session ends, which can be hours. Test removal before you rely on it. - **Only the perimeter uses your issuer.** With `external`, OpenMetadata and Superset are deployed with no OIDC configuration (`oidc = null`), so they keep their own logins behind the perimeter. The OpenMetadata role sync, which reads GitHub teams, does not apply either. The per-service roles in [Roles and permissions](https://openlakeforge.dev/docs/reference/roles-and-permissions/) are therefore enforced by the perimeter only: which services a person opens. - **Rotation is yours.** `olf infra secrets rotate` works for `issuer: github` only. Rotate the client secrets in your issuer and in the `oidc-client-` Secrets, then restart the consumers. - **Local provider.** Sign-in is implemented for the local provider only. The mapping, roles and what they open are the same as with GitHub: [Roles and permissions](https://openlakeforge.dev/docs/reference/roles-and-permissions/). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/identity/external-issuer.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/identity/external-issuer.md). --- # Rotate secrets > How to rotate the secrets sign-in depends on with olf infra secrets rotate, and the manual procedure for the clients the command does not cover. Source: https://openlakeforge.dev/docs/guides/identity/rotate-secrets/ How to rotate the secrets sign-in depends on with `olf infra secrets rotate`, and the manual procedure for the clients the command does not cover. Rotate after a suspected leak, when someone who could read the Secrets leaves, or on a schedule. The command is for `provider: local` with `identity.issuer: github`. With `issuer: external`, rotate the client secrets in your issuer and in the `oidc-client-` Secrets, then restart the consumers ([Bring your own OIDC issuer](https://openlakeforge.dev/docs/guides/identity/external-issuer/)). ## `olf infra secrets rotate` ```bash olf infra secrets rotate dex-client-perimeter ``` Add `-f ` if you deployed from a profile file. The command prints what it rotated and restarted, and never prints a secret value. | Target | Rotates | Restarts | | --- | --- | --- | | `dex-client-perimeter` | The perimeter's Dex client secret | `deployment/dex` and the perimeter deployments | | `github-app` | Registers a new GitHub App through `olf infra github connect` and replaces its Secret | `deployment/dex` | For a Dex client, the command deletes the Secret, applies only the credentials Job (a targeted Terraform apply with `-replace`) so the Secret is made again, restarts what reads it, waits for the rollouts, and ends with `Confirm: sign in at `. Signing in succeeds only when Dex and the service hold the same secret. ### What it refuses Before it deletes anything, it stops and names the cause when: - the provider is not `local`, or `identity.issuer` is not `github`; - the platform state has drifted: run `olf infra deploy` first; - the Secret lacks the `client-secret` key; - another `dex-client-*` Secret is missing, because the shared Job would regenerate that one too, without restarting its consumers: run `olf infra deploy` first. ### The GitHub App `olf infra secrets rotate github-app` registers a new GitHub App in your browser, replaces the Secret named by `oauth_app_secret_ref` and restarts Dex. Then: 1. Install the new app on the organization (the command prints the link). 2. Delete the old GitHub App and its private key in the organization settings. `--no-browser` prints the URL instead of opening it. To rotate only the client secret by hand, generate a new one in GitHub, update the Secret, and restart Dex: ```bash export KUBECONFIG="$HOME/.openlakeforge/state/local/kubeconfig.yaml" KUBECTL="$(olf toolchain path kubectl)" "$KUBECTL" -n olf-system rollout restart deployment dex ``` Rotating `dex-client-perimeter` is exercised in the local end-to-end run; it took about 100 seconds there. That is one measurement, not a bound. ## Manual: the Superset and OpenMetadata clients The command does not cover `superset` and `openmetadata`: Superset keeps a copy of its secret per stage, and OpenMetadata has no consumer step documented. For `superset`, with the managed kubectl and kubeconfig set as above: 1. Delete the Secret: ```bash "$KUBECTL" -n olf-system delete secret dex-client-superset ``` 2. Re-run the platform phase with the Dex credential Job replaced, so it recreates the missing Secret. Each stage keeps its own Superset copy, made by the one-shot `kubernetes_job_v1.oidc_secret` of that stage's `module.superset`: add a `-replace` of that Job for each stage. ```bash TF_CLI_ARGS_apply='-replace=module.dex[0].kubernetes_job_v1.credentials -replace=module.superset[""].kubernetes_job_v1.oidc_secret[0]' \ olf infra deploy --provider local --phase platform ``` 3. Restart Dex, then the Superset web deployment in each stage namespace (`olf-`, for example `olf-dev`): ```bash "$KUBECTL" -n olf-system rollout restart deployment dex "$KUBECTL" -n olf- rollout restart deployment/superset ``` 4. Sign in through the portal. If the Dex credential Job fails with `Secret exists without key client-secret`, something else created that Secret: fix or delete it and re-run step 2. An interrupted bootstrap is safe to re-run. ## The session cookie secret Rotating it signs everyone out (with `KUBECTL` set as above): ```bash "$KUBECTL" -n olf-system delete secret oauth2-proxy-cookie --ignore-not-found TF_CLI_ARGS_apply='-replace=module.perimeter[0].kubernetes_job_v1.cookie_secret' \ olf infra deploy --provider local --phase platform "$KUBECTL" -n olf-system rollout restart deployment -l openlakeforge.io/role-floor ``` Polaris token-key rotation has no documented procedure and is not covered. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/identity/rotate-secrets.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/identity/rotate-secrets.md). --- # Break-glass access and issuer recovery > How a cluster administrator reaches a service when the issuer (Dex, and behind it GitHub) is unavailable, and how to bring sign-in back. It applies to the… Source: https://openlakeforge.dev/docs/guides/identity/break-glass/ How a cluster administrator reaches a service when the issuer (Dex, and behind it GitHub) is unavailable, and how to bring sign-in back. It applies to the local provider. ## What happens when the issuer is down The perimeter fails closed. It does not extend a session it cannot refresh and has no grace period. Sessions that are already open keep working until their access token expires, at most 5 minutes, then every protected route refuses requests. New sign-ins fail. The portal is behind the perimeter, so it refuses too. Superset's and OpenMetadata's own sessions cannot be renewed either. Break-glass is the way in that does not depend on the issuer: your Kubernetes access. ## Use `olf infra break-glass` ```bash olf infra break-glass dagster --local-port 3000 --reason "Dex is down; checking the daily run" ``` Then open `http://127.0.0.1:3000`. The command runs until you exit (Ctrl-C) or the time limit passes, and prints the record it left. `--reason` is required and recorded. Dagster's remote port is 80, which an unprivileged user cannot bind locally, hence `--local-port`. | Service | What you get | | --- | --- | | `dex` | A port-forward to the Dex Service on `127.0.0.1:5556`, for diagnosis. Dex has no admin console or account. | | `trino` | A port-forward to the stage's Trino Service on `127.0.0.1:8080`, plain HTTP, for diagnosis (for example `/v1/info`). Trino has no authentication of its own, and its Web UI opens as the fixed user `olf-web`. Reading a table still needs a Polaris token sent as the `token` extra credential, which Dex cannot issue during the outage. | | `dagster` | A port-forward to the Dagster webserver (remote port 80), in the DEV stage only. | | `superset`, `openmetadata` | A shell in the service's pod, for its CLI. Their UIs accept only issuer login and are not reachable during an outage. `superset` reaches the DEV stage only. | There is no `--stage` option: `dagster` and `superset` always target the DEV namespace (tracked in #521). | Option | Default | Meaning | | --- | --- | --- | | `--ttl-minutes` | 30 | Hard stop. The access ends when the process exits or the time passes. | | `--local-port` | the remote port | Local port for the port-forward. | Properties: - **Time-boxed.** Nothing persistent grants access: the port-forward ends with its process, so there is nothing to remove afterwards. - **Recorded.** Each use writes one ConfigMap, `break-glass-
` or `--input /`; `--with-report` adds a Superset draft. | All `new` commands validate the result before writing and accept `--display-name`. ## Deploy and operate | Command | Does | | --- | --- | | `olf infra deploy` | Deploy all phases, or one with `--phase foundation`, `prefetch` (local), `platform` or `artifacts`. | | `olf infra destroy` | Tear down the platform, then the foundation; `--phase platform` or `foundation` for one. `--force` destroys the foundation with platform resources left. | | `olf infra status` | Service URLs, then pods, services and PVCs per namespace. `--json` for JSON. | | `olf infra forward` | Port-forward every service to `localhost` until Ctrl-C. | | `olf infra doctor` | Check the host, tools, project and cloud authentication without changing anything. | | `olf infra restore --from ` | Local provider only. Restores a backup onto a platform already deployed without the project (`olf infra platform apply`, which also recreates a destroyed cluster; `olf infra deploy --phase platform` when the cluster still exists) from the same release and `openlakeforge.yaml`; it refuses a backup whose release, profile, stages or checksums differ. Pauses the Dagster daemons and refuses while a run is in flight, suspends the stages' CronJobs, then scales Dagster, Superset, OpenMetadata, Polaris, Trino, Dex and the platform API to 0, replaces the backed-up Secrets, drops and reloads every database, makes each bucket equal to the backup's (objects written after it are deleted, then the listing is checked against the inventory by key and size), scales back up (shared services, then stages, then the daemons) and resumes the CronJobs, then reconciles the platform (`olf infra deploy --phase platform`) and reactivates, per enabled stage, the project revision the restored `ACTIVE.json` names, building nothing from the current checkout (a stage with no pointer is left alone; if a revision's image no longer exists, for example one built with `olf infra project image --no-push`, the restore fails naming the stage, revision and image). When the backup holds `local-ca`, restore also deletes the `publish-local-ca-*` Job and the Secret of every Certificate that ClusterIssuer `local-ca` issued before the reconcile, so the apply republishes the `olf-local-ca` ConfigMaps and cert-manager signs the Certificates again; after the revisions are back it waits for them and restarts the workloads that mount the ConfigMap or those Secrets. The Secrets bundle passphrase comes from `OLF_BACKUP_PASSPHRASE` or a prompt. If a step fails the workloads stay at 0: rerun the same command. | | `olf infra source bind --stage dev -f openlakeforge.yaml` | Bind the source's declared runtime keys; `--set KEY=VALUE`, `--secret-from-env KEY=VAR`, or `--secret-from-file KEY=PATH`. `--partial` keeps existing declared keys; `--dry-run` prints key names without writing. | | `olf infra source bindings --stage dev -f openlakeforge.yaml` | Report bound, missing and extra keys for every source. Reads Secret key names only; exits 1 for missing or unreadable bindings. | | `olf infra source unbind --stage dev -f openlakeforge.yaml` | Delete the source's ConfigMap and Secret in the selected stage. | | `olf infra plan` | Show the Terraform plan of the foundation or platform. | | `olf infra product run ` | Launch a product's pipeline in a stage and wait for it (`--stage`, `-f`). `--full-refresh bronze\|gold` asks that run only for a full refresh; see [Full refresh](https://openlakeforge.dev/docs/reference/descriptors/#full-refresh). | | `olf infra maintenance run --layer silver\|gold` | Launch the stage's Iceberg maintenance job and wait for it (`--stage`, `--dry-run`, `--json`, `-f`); prints per-table snapshots and orphans. See [Silver table maintenance](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/floe-validation.md#silver-table-maintenance). | | `olf infra query ""` | Run SQL against a stage's catalog (`--stage`, `--format table\|csv\|json`, `--file`). Local and Azure only. | | `olf infra backup --output ` | Back up a local deployment into a new directory (`-f `, `--project-root`): a `pg_dump` of each database (`polaris` first), a copy of every stage bucket and the ops bucket with a key-and-size inventory, the data-bound Secrets (including the platform API's Superset service-user passwords) and, with `tls: local-ca`, `local-ca` sealed in `secrets.enc`, then `manifest.json` and `SHA256SUMS`. It stops every stage's Dagster daemon for the length of the backup, refuses to start while a run is in flight, and always starts the daemon again. The passphrase for `secrets.enc` comes from `OLF_BACKUP_PASSPHRASE` or a prompt, never an argument; without it the Secrets cannot be restored. The directory holds all the data, so store it as you would the cluster. | | `olf infra access trust` | Export the local CA and print the commands to trust it. Needed only for `tls: local-ca`; plain HTTP routes have nothing to trust, and with `tls: external` it refuses because your own edge holds the certificate. | | `olf infra github connect` | Create the GitHub App for sign-in and store its credentials. | | `olf infra auth login\|status\|logout --provider aws\|azure` | Authenticate to a cloud through its SDK. | | `olf infra diagnostics collect ` | Write host and cluster evidence for a bug report (`--namespace`, `--kube-context`). | ## Validate | Command | Checks | | --- | --- | | `olf profile validate --project .` | `openlakeforge.yaml` | | `olf profile resolve --project . --json` | Prints the resolved stages and capabilities | | `olf check contracts` | `governance.yml`, every `source.yaml`, and the Floe project's namespaces | | `olf project migrate [--dry-run]` | Rewrites `openlakeforge.yaml` from `v1alpha1` to `v1beta1` (`spec.access.issuer` becomes `tls`), `governance.yml` from `v1beta1` to `v1beta2` and each `source.yaml` from `v1alpha3` to `v1beta1`; `--dry-run` prints the diff and changes nothing. See [Migrate from v0.5 alpha](https://openlakeforge.dev/docs/guides/migrate-from-v0-5-alpha/) | | `olf project graph --project .` | Prints the Source → Domain → Product → Dashboard lineage as Mermaid text | | `olf check dbt` | The Gold dbt project parses and compiles, each product's models sit in its `_gold` and read only its own domain's Silver, and every source sits in its domain's schema. Incremental models are parsed (refs, sources, Jinja) but not compiled: `is_incremental()` needs a warehouse connection, so their rendered SQL is not checked | | `olf check resources` | Every `container` and `init_container` in `infra/terraform/modules` sets `requests` (cpu and memory) and a memory limit; an expression such as `var.x` is accepted unchecked. Helm chart containers are sized through the values files and are not covered | | `olf check disruption` | A Terraform module that sets `replicas`, `replicaCount` or `workers` to anything but 0 or 1, or a Helm values file with `replicaCount`/`replicas` above 1, defines a PodDisruptionBudget. Single-replica workloads are exempt by design: a budget on one pod blocks node drains | | `olf check security` | Every entry in `.trivyignore.yaml` has an owner and an unexpired date within 90 days; not part of `olf check all` | | `olf report validate []` | Superset bundles are promotable; needs no cluster or cloud credentials | | `olf infra e2e run --env local\|aws\|azure` | The deployed platform end to end. `--suite smoke` runs the preflight checks only; `--stage` and `-f ` select what to check. | | `olf infra e2e durability capture --output ` | Reads one local stage (`--stage`, `-f `) without launching a pipeline and writes a JSON baseline: Gold and Silver row counts and current Iceberg snapshot ids through Trino, Dagster run ids, Superset dashboard uuids, OpenMetadata entity names and one search hit count, the `ACTIVE.json` activation pointer, and every object in the stage's Bronze, Silver and Gold buckets and the ops bucket as key and size. Superset and OpenMetadata are skipped, and recorded empty, for a stage that does not run analytics or governance (Slim). It refuses to write a file that holds the value of a Secret `olf infra e2e run` scans for. | | `olf infra e2e durability verify --baseline ` | Reads the same state again and lists every loss: a missing table, run, dashboard, entity or object, fewer rows, a changed snapshot id or object size, a changed activation pointer, or an empty search. It exits non-zero if there is any; new runs and objects are not differences. Run it after an upgrade or restore with the `--stage` the baseline was captured with. | | `olf infra e2e secret-scan --path ` | Fails if a platform Secret's value appears in Terraform state, ConfigMaps, the diagnostics bundle or a pod log (what `olf infra e2e run` checks), or in a file under any `--path` (repeatable; `--exclude ` skips a file name such as `secrets.enc`; `--also-env ` adds an environment variable's value). It launches no pipeline, reads files as bytes so binary dumps are covered, and names the file and the Secret, never the value. The restore drill runs it over the backup and the drill logs. | | `olf infra e2e stage-drill crawl\|namespaces\|principals` | Checks, between the deploys of the stage drill (`stage_drill` in `local-full-e2e.yml`, dispatch only), what each stage holds. Name stages with `--present ` and `--absent ` (repeatable; `--stage` and `-f ` select the deployment to read). `crawl` is the Trino crawl's `polaris-om-creds` copy and its CronJob and Jobs: a stage with governance on must hold the Secret and the CronJob, one with it off none of the three kinds. `namespaces` is the stage namespace. `principals` is `olf--processing`, `deployer-` and `trino-catalog-` in Polaris, listed as root; a stage removed with `--allow-stage-removal` must have none. Reports every violation, never a Secret value. | | `olf infra e2e registry-pull` | Proves a local stage's user-code pods pull the project image through its `spec.project.image.pull_secret_ref` Secret. It reads the image from the stage's active revision, checks that every workload running it and the `dagster` ServiceAccount list the Secret, and fails for an image that answers an anonymous pull (`--allow-public` to run anyway). Unless `--static-only`, it removes the image from every kind node with no host Docker credentials, restarts the code locations, launches one run and reschedules the code locations off one node, requiring a `Successfully pulled` event from a pod on each node each time. It launches a run, so it is not for a stage mid-restore. `--stage` and `-f ` select the stage. | ## Stages and revisions | Command | Does | | --- | --- | | `olf infra platform apply -f openlakeforge.yaml` | Create the cluster, shared services and every enabled stage, without your code. | | `olf infra project image -f openlakeforge.yaml` | Build and push the project-code image; prints a digest-pinned reference. On `local` it pushes to `spec.project.image.repository`, else `PROJECT_CODE_IMAGE_REPOSITORY`; edited code with neither is refused rather than pushed over the public example. For the unmodified public example it prints the release-pinned reference and builds nothing. | | `olf infra project build --project . --image ` | Build and publish an immutable revision; prints its id. | | `olf infra project deploy -f openlakeforge.yaml --stage --revision ` | Activate a revision in a stage without rebuilding. | | `olf infra project status -f openlakeforge.yaml` | The revision active in each stage. | | `olf infra project revision inspect\|verify --revision ` | Read or verify a published revision. | | `olf infra report export --stage dev` | Export Superset dashboards into their bundles. | | `olf infra report import` | Import the bundles into a stage's Superset. | ## Sign in from the CLI `olf login`, `olf whoami` and `olf logout` keep a Dex or external-issuer session for the deployment in `openlakeforge.yaml`. They need no kubeconfig and read no Secret. | Command | Does | | --- | --- | | `olf login` | Authorization Code with PKCE in your browser. `--no-browser` prints the URL instead. | | `olf whoami` | Instance, issuer, username, email, groups and ID token expiry. Refreshes an expired ID token. | | `olf logout` | Deletes the stored session. | Each takes `--profile-file` (`-f`, default `openlakeforge.yaml`). The issuer is `https://auth.` with `identity.issuer: github`, or `issuer_url` with `external`. The client id is `identity.client_ids['olf-cli']`, else `olf-cli`. With access `tls: none` the Dex issuer is `http://`. A profile with `spec.access` and no `spec.identity` has authentication off: `olf login` and `olf whoami` say that sign-in is disabled and exit 0, `olf logout` does nothing, and platform commands run without login. A profile without `spec.access` publishes no routes, so these commands fail and point to `olf infra`. The session is `$OLF_HOME/sessions/.json`, mode 0600, and holds the ID, access and refresh tokens. Run `olf login` again when `olf` reports the session expired. A local deployment serves the issuer with its own CA, which Python does not read from the system store. Export it, then point `olf` at it: ```bash olf infra access trust --output ./olf-local-ca.crt export REQUESTS_CA_BUNDLE="$PWD/olf-local-ca.crt" # SSL_CERT_FILE also works olf login ``` ## Query as yourself `olf query` runs SQL against a stage's data as the signed-in person, through the stage's Trino at `https://trino-./v1`. It needs `spec.identity.issuer: github` and `olf login` first. What you may read or write on each stage and layer is your role's `data_access` row in `release/identity-roles.yaml`, which Polaris enforces ([ADR 0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/)). When Polaris or the object store refuses a query, `olf query` says why. ```bash olf query --stage prod "SELECT count(*) FROM order_revenue_gold.mart_order_revenue_by_day" ``` | Option | Default | Meaning | | --- | --- | --- | | `--stage` | `dev` | `dev`, `uat` or `prod`: the stage's catalog, `lakehouse_`, is the session default, so SQL names `.
` | | `--format` | `table` | `table`, `csv` or `json` (one object per row) | | `--file` | — | Read the SQL from a file instead of the argument | | `--profile-file`, `-f` | `openlakeforge.yaml` | Deployment Profile of the deployment | `olf infra query` runs the same SQL as the stage's workload user through `kubectl exec`, for operators: it needs cluster access, not a sign-in. ## Read the platform These commands read the platform as the signed-in person, through the platform API at `https:///api` ([ADR 0021](https://openlakeforge.dev/docs/adr/0021-platform-api/)). They need `olf login` first, no kubeconfig, and no infra credential: the API decides what your role may read, and what it may launch. | Command | Reads | Lowest role | | --- | --- | --- | | `olf jobs list` | The stage's pipeline jobs | `data-engineer` | | `olf runs list` | The stage's most recent runs, newest first; `--job` for one job, `--limit` 1 to 100 (default 20) | `data-engineer` | | `olf runs show ` | One run's status, times and tags | `data-engineer` | | `olf runs launch ` | Launches the job as you, on `dev` only; the API stores an audit record first and launches nothing if it cannot | `data-engineer` | | `olf logs` | The stage's archived pod log lines for a day (`--date`, default today in UTC) or one `--hour`; `--pod`, `--container`, `--limit` 1 to 5000 (default 500) | `data-engineer` | | `olf domain list` | Governance domains, as OpenMetadata shows them to you | `viewer`, then your OpenMetadata roles | | `olf product list` | Data products and their domains, as OpenMetadata shows them to you | `viewer`, then your OpenMetadata roles | | `olf report import ` | Imports one report directory into the stage's Superset, on `dev` only, overwriting the assets it carries. Only `metadata.yaml`, `datasets/`, `charts/` and `dashboards/` are sent, at most 500 files, 2 MiB each and 10 MiB in all; datasets use the stage's existing connections, and every schema they read must already be granted by the artifacts phase | `data-engineer` | | `olf report export ` | Exports one dashboard, by uuid or slug, into a report directory, stage-neutral; its managed assets are replaced | `data-engineer` | Each but `report export` takes `--json` to print the API's JSON instead of a table, and `--profile-file` (`-f`). `jobs`, `runs`, `logs` and `report` take `--stage` (default `dev`). When the API refuses, the command says why: an expired or rejected session asks you to run `olf login`, and a role below the operation's floor names the role it needs. ## Installation and toolchain | Command | Does | | --- | --- | | `olf version` | The installed version. | | `olf toolchain list\|install\|path\|clean` | Inspect, download or remove the managed Terraform, Helm, kubectl and kind. | | `olf distribution path\|verify` | The platform payload the package ships, such as the Terraform roots. | ## Environment variables | Variable | Default | Meaning | | --- | --- | --- | | `OLF_HOME` | `~/.openlakeforge` | Toolchain, platform payload, state, kubeconfigs and sign-in sessions | | `REQUESTS_CA_BUNDLE`, `SSL_CERT_FILE` | unset | CA file `olf login` verifies the issuer against | | `OLF_TOOLCHAIN_MODE` | `managed` | `host` uses Terraform, Helm, kubectl and kind from `PATH` | | `OLF_PORT_FORWARD` | unset | `1` makes `olf` port-forward instead of using the local ingress | | `PROJECT_CODE_IMAGE_REPOSITORY`, `PROJECT_CODE_IMAGE_TAG` | `ghcr.io/openlakeforge/openlakeforge/project-code`, `local` | Where `olf infra project image` pushes on the local provider when the profile has no `spec.project.image.repository` | | `AWS_*`, `AZURE_*` | | Cloud settings; see [Deploy to AWS](https://openlakeforge.dev/docs/guides/cloud/deploy-to-aws/) and [Deploy to Azure](https://openlakeforge.dev/docs/guides/cloud/deploy-to-azure/) | ## Contributor commands A source checkout runs the same commands through `uv run --project tools/olf --locked olf`. Commands that only make sense there, such as `olf check all`, `olf infra smoke run` and `olf release`, are described in [AGENTS.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/AGENTS.md) and [tools/olf/README.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/tools/olf/README.md). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/reference/cli.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/reference/cli.md). --- # Deployment Profile reference > openlakeforge.yaml at the project root says where a project deploys, which stages it runs, how people reach its services and who may sign in. This page… Source: https://openlakeforge.dev/docs/reference/deployment-profile/ `openlakeforge.yaml` at the project root says where a project deploys, which stages it runs, how people reach its services and who may sign in. This page lists every field, its type and default, and the rules `olf` checks across fields. The file is validated against `docs/schema/deployment-profile.schema.json` and then by `tools/olf/olf/common/profile.py`, which is the authority where the two differ. Check a profile without deploying: ```bash olf profile validate --project . olf profile resolve --project . --json ``` Every object rejects fields it does not list. The decisions behind the model are in [ADR 0011](https://openlakeforge.dev/docs/adr/0011-deployment-profile-and-stages/) (profile and stages), [ADR 0013](https://openlakeforge.dev/docs/adr/0013-service-access-and-ingress/) (access) and [ADR 0014](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/) (identity). --- ## A complete example ```yaml apiVersion: openlakeforge.io/v1beta1 kind: DeploymentProfile metadata: name: openlakeforge spec: provider: type: local preset: slim stages: dev: enabled: true prod: enabled: true access: base_domain: olf.localhost tls: local-ca identity: issuer: github github: organization: my-org teams: platform-admin: [platform-team] analyst: [analysts] oauth_app_secret_ref: name: github-oauth-app ``` --- ## Envelope | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `apiVersion` | string | yes | Must be `openlakeforge.io/v1beta1`. A `v1alpha1` file is refused until `olf project migrate` rewrites it ([migration guide](https://openlakeforge.dev/docs/guides/migrate-from-v0-5-alpha/)). | | `kind` | string | yes | Must be `DeploymentProfile`. | | `metadata` | object | yes | See below. | | `spec` | object | yes | See below. | ### `metadata` | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `name` | string | yes | Names this deployment. Must match `^[a-z](https://github.com/OpenLakeForge/openlakeforge/tree/v0.6.0-alpha.3/docs/reference/[a-z0-9-]{0,61}[a-z0-9])?$`: it becomes the `openlakeforge.io/profile` label on every namespace the deployment owns, and teardown finds them by it. It is also the prefix of the local and Azure buckets (`--`, `-ops`, ADR 0004), so it is at most 51 characters and cannot start with `xn--`. Changing it on a deployed local or Azure platform renames the buckets: see "Renaming buckets" in [Back up and restore](https://openlakeforge.dev/docs/guides/backup-and-restore/). | --- ## `spec` | Field | Type | Required | Default | Meaning | | --- | --- | --- | --- | --- | | `provider` | object | yes | | Where the platform runs. | | `preset` | `slim` or `full` | yes | | Default optional capabilities for every stage. | | `stages` | object | yes | | Which lifecycle stages exist. | | `access` | object | no | absent: no ingress | How user-facing services are published. | | `identity` | object | no | absent: sign-in off | Who may sign in and which roles they hold. | | `project` | object | no | absent: the public example image | Your project's source repository and image registry. | | `query` | object | no | `size: small` | Default Trino size for every stage. | | `storage` | object | no | provider adapter; `size: small` | Object storage adapter and self-hosted size. `size` is rejected on `aws`. | | `cluster` | object | no | provider default | Cluster adapter selector. | | `catalog` | object | no | provider default | Catalog adapter selector. | | `metadata_database` | object | no | provider default | Metadata database adapter selector. | | `state` | object | no | `backend: local` | Terraform state backend selector. | ### `spec.provider` | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `type` | `local`, `aws` or `azure` | yes | The deployment target. `local` is a kind cluster on this machine. `aws` and `azure` are preview: the schema accepts them, but the beta compatibility promise covers `local` only (see [releasing.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/release/releasing.md#lifecycle-stages)). `olf profile validate` prints a notice for them. | | `region` | string, non-empty | no | Cloud region. Rejected when `type` is `local`. Used for `aws`; when unset, `AWS_REGION` and then `eu-west-1` apply. For `azure` the region comes from the foundation tfvars (`AZURE_TFVARS_FILE`). | `type` selects the deployment target and the default adapter for each capability. The optional selectors below currently accept only those defaults. Unsupported selections name their implementation issue; they never silently deploy the provider default instead. | Field under `spec` | Local | AWS (preview) | Azure (preview) | Other selections | | --- | --- | --- | --- | --- | | `cluster.adapter` | `kind` | `eks` | `aks` | Existing Kubernetes: #802 | | `storage.adapter` | `seaweedfs` | `s3` | `seaweedfs` | External S3-compatible: #803 | | `catalog.adapter` | `polaris` | `glue` | `polaris` | AWS Polaris: #681 | | `metadata_database.adapter` | `postgresql` | `rds` | `postgresql` | External PostgreSQL: #335 | | `state.backend` | `local` | `local` | `local` | Remote state: #905/#132 | `olf profile resolve --project . --json` includes an `adapters` object with all five resolved choices. Omitting the selectors has the same effect as writing the provider defaults. These selectors add no support for existing clusters or external services yet; their connection settings arrive with the corresponding implementation. ### `spec.preset` | Value | `analytics` default | `governance` default | | --- | --- | --- | | `slim` | `false` | `false` | | `full` | `true` | `true` | The preset is the default for each stage's `capabilities` (below); a stage that states its capabilities keeps its own values. ### `spec.query` and `spec.storage` Each takes one optional field, `size`, which defaults to `small`. `spec.storage.size` is one size for the whole platform. `spec.query.size` is the default for every stage, and `stages..query.size` overrides it for one stage (a small DEV beside a larger PROD). On the local provider each stage runs its own coordinator at its own size; AWS and Azure still render one shared Trino, at the largest enabled stage's size. | Field | Type | Default | Meaning | | --- | --- | --- | --- | | `spec.query.size` | `small` | `small` | Default Trino size for every stage. `small` is coordinator only, no workers. | | `spec.stages..query.size` | `small` | `spec.query.size` | That stage's Trino size; same values and rejections as `spec.query.size`. | | `spec.storage.size` | `small`, `medium`, `large` | `small` | The SeaweedFS object storage volumes. Not valid on `aws`. | `query.size` accepts only `small`: `medium` and `large` fail validation with a message naming the issue that will implement them (#324), so a profile never asks for capacity the deployment does not provide. Any other value, and any CPU, memory, worker or volume field, is rejected as an unknown value or field. A profile that omits both fields deploys exactly as it did before they existed, and `olf profile resolve` prints `sizes: storage=small` and each enabled stage's `query=` size (`query` and `storage` in `--json`, `query` per stage). `query.size` picks one row of `release/query-sizes.yaml`, which sets Trino's workers, heap, memory, per-query limits and `query.max-stage-count`. It changes only the Trino Helm values, never the project image or a ProjectRevision. The `medium` and `large` rows are defined but not yet accepted: workers still need network flows to the coordinator, authentication across nodes ([#367](https://github.com/OpenLakeForge/openlakeforge/issues/367)) and a kind run (#324). Their values are placeholders until the [#328](https://github.com/OpenLakeForge/openlakeforge/issues/328) and [#329](https://github.com/OpenLakeForge/openlakeforge/issues/329) baseline. Every `query.size` row sets `max_stage_count: 300`, twice Trino's default of 150. A query uses about two stages per table it reads, so one Gold query can read at most about 150 tables; Trino refuses a wider one with `QUERY_HAS_TOO_MANY_STAGES`. Split such a model into staging models, each over fewer tables. Each stage costs the coordinator scheduling work and memory, so raise the value in `release/query-sizes.yaml` only together with the coordinator heap. `storage.size` picks one row of `release/storage-sizes.yaml`, which sets the PVC size of the SeaweedFS master, filer and volume server and the number of volume slots on the volume server. The Terraform SeaweedFS module and `olf` read that one file. The `medium` and `large` rows are provisional starting values taken from the rough ranges below; the #329 report will calibrate them, and nothing here has measured how much data a host or cluster needs for them. | Size | Trino (`release/query-sizes.yaml`) | SeaweedFS volume server | Master / filer metadata | Aimed at (provisional) | Available | | --- | --- | --- | --- | --- | --- | | `small` | Coordinator only (`workers: 0`), 2G heap, 4Gi memory limit | 20Gi, 80 slots | 1Gi / 5Gi | Tens of GB: laptop, evaluation | Yes | | `medium` | Row defined (coordinator plus 2 workers), not yet selectable | 300Gi, 380 slots | 2Gi / 20Gi | A few hundred GB: one team, one or two domains | Storage only; Trino: [#324](https://github.com/OpenLakeForge/openlakeforge/issues/324) | | `large` | Row defined (coordinator plus 4 workers), not yet selectable | 2Ti, 2128 slots | 5Gi / 50Gi | 1-5 TB: several domains of about 100 tables each | Storage only; Trino: [#324](https://github.com/OpenLakeForge/openlakeforge/issues/324) | #### Changing the storage size A volume only grows. `olf deploy` compares `storage.size` with the PersistentVolumeClaims it finds before it changes anything: | Change | Result | | --- | --- | | Same size, or a first deployment | Nothing to do. | | Larger, and the claim's StorageClass sets `allowVolumeExpansion: true` | `olf` expands the claims, then applies. The data stays. | | Larger, and the StorageClass does not allow expansion | Refused before anything is applied. The message names the StorageClass. | | Smaller | Refused before anything is applied, whatever the StorageClass allows. | `olf` never deletes and recreates a volume to apply a size. Kubernetes does not let a StatefulSet's volume claim template change, which is where the SeaweedFS chart writes the size, so when it expands claims `olf` also deletes the three SeaweedFS StatefulSets with `--cascade=orphan` (the controller objects only; pods and volumes are left alone) and the apply recreates them. On the local profile the kind cluster's default StorageClass, `standard`, is the `rancher.io/local-path` provisioner. kind v0.32.0 installs it from `pkg/build/nodeimage/const_storage.go` without `allowVolumeExpansion`, which defaults to false, so a deployment on kind can start at any size but cannot grow or shrink afterwards. Check what your cluster allows: ```bash kubectl get storageclass -o custom-columns=NAME:.metadata.name,EXPANDABLE:.allowVolumeExpansion ``` To change the size where expansion is refused, start a deployment at the size you want and move the data over. On the local profile that means rebuilding the cluster, which deletes all Bronze, Silver and Gold data and the run history: 1. Set `spec.storage.size` in `openlakeforge.yaml`. 2. Run `olf destroy --provider local`. 3. Run `olf deploy --provider local`. 4. Re-run your pipelines to rebuild the tables from their sources. `olf infra restore` cannot carry data across this change: it refuses a backup taken with a different `openlakeforge.yaml` ([Back up and restore](https://openlakeforge.dev/docs/guides/backup-and-restore/#limits)). If the tables cannot be rebuilt from their sources, do not change the size. ### `spec.stages` An object with at least one of the keys `dev`, `uat` and `prod`. Any other key is rejected. A stage left out is disabled: `prod` is never created implicitly. Each stage takes: | Field | Type | Default | Meaning | | --- | --- | --- | --- | | `enabled` | boolean | `true` | Whether the stage is deployed. | | `capabilities` | object | the preset's defaults | Optional services in this stage. | | `source_egress` | object | absent: no external egress | External ports this stage's Bronze sources reach. | `capabilities` takes: | Field | Type | Default | Meaning | | --- | --- | --- | --- | | `analytics` | boolean | `false` | Deploy Superset in this stage. | | `governance` | boolean | `false` | Deploy OpenMetadata governance for this stage. | The preset defaults apply only when the stage has no `capabilities` object at all. Once `capabilities` is written, a capability it leaves out is `false`. A disabled stage resolves both capabilities to `false` whatever was written. `source_egress` takes one field, `ports`: a non-empty list of distinct TCP port numbers. On `local`, the stage's Dagster run pods may open those ports to any address outside the cluster's pod and Service ranges, and no other pod gets them; a stage without `source_egress` reaches nothing outside the cluster ([ADR 0017](https://openlakeforge.dev/docs/adr/0017-local-network-policy-and-rbac/), F34). NetworkPolicy cannot name a host, so the hosts themselves stay in the stage's source bindings. The AWS and Azure roots apply no NetworkPolicy, so there the field has no effect. A disabled stage gets no egress whatever was written. ```yaml stages: dev: source_egress: ports: [443, 5432] # an HTTPS API and a PostgreSQL source ``` ### `spec.project` Omit the block and the deployment uses OpenLakeForge's public example image (`ghcr.io/openlakeforge/openlakeforge/project-code`). Declare it and the deployment is yours: it never falls back to the example. | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `repository` | `https://` or `ssh://` URL | no | Where the project's source lives. Provenance only: `olf infra project image` and `build` use the checked-out directory, never a fetched ref. | | `image.repository` | `host[:port]/path` | no on `aws`/`azure` (the provider registry, ECR or ACR, is used), yes on `local` | The project-code image repository. Registry host first, lowercase, no tag or digest. A bare `acme/code` is rejected, not read as Docker Hub. | | `image.pull_secret_ref.name` | Kubernetes Secret name | no | A `kubernetes.io/dockerconfigjson` Secret you create in each stage namespace, for a private image. The profile holds the name, never the credential. | The block must declare `repository` or `image`. Unknown fields (`password`, `token`, ...), credentials or a query string in a URL, and a tag or digest on the image are rejected, as is a pull secret without an `image`. The image repository resolves in this order, first match wins (`olf profile resolve` prints the winner as `project.source`): 1. `spec.project.image.repository` (`profile`); 2. `PROJECT_CODE_IMAGE_REPOSITORY`, or its `AWS_`/`AZURE_` alias (`environment`; a malformed value is an error); 3. the provider registry, for a project that declares only `repository` on `aws` or `azure` (`provider-default`); 4. the public example, only when `spec.project` is absent (`public-example`). Existing profiles have no `spec.project` and keep working unchanged. On the `local` provider the public example is the project-code image the release published, pinned by digest in the `project_code` entry of the package's `release/component-catalog.yaml`. `olf infra deploy` pulls it once on the workstation and loads it into kind, so no Docker build and no registry credential is needed and the pods pull nothing. A source checkout carries no such entry (a release stamps in the digest of the image built from its own commit), so there `olf infra deploy` builds the example locally. So does anything that is not the unmodified example: a `lakehouse_code/` in your project that differs from the bundled one, `PROJECT_CODE_IMAGE_TAG`, or a machine that is not amd64 (the release image is amd64 only). On `aws` and `azure` the same pin is deployed as it is, with the same conditions (a non-amd64 `*_IMAGE_PLATFORM` also builds): the cluster pulls the public package, and nothing is built or pushed to ECR or ACR. Anything else builds and pushes to the provider registry. For the example, `olf infra project image` prints that pinned reference without building, so `olf infra project build` and `olf infra project deploy` promote one image digest through the stages. On `local`, `olf infra project image` pushes to the resolved repository above; a `lakehouse_code/` that differs from the bundled one with neither `spec.project.image.repository` nor `PROJECT_CODE_IMAGE_REPOSITORY` is refused, never pushed to the public example's package. ```yaml # Local, your own image on GHCR (private: also name the pull secret). project: repository: https://github.com/acme/lakehouse.git image: repository: ghcr.io/acme/lakehouse-code pull_secret_ref: {name: ghcr-pull} # AWS: ECR is the default registry, so only the source is declared. project: repository: https://github.com/acme/lakehouse.git # AWS/Azure with an explicit registry. project: image: repository: 123456789012.dkr.ecr.eu-west-1.amazonaws.com/acme/lakehouse-code # or acme.azurecr.io/... ``` :::note `olf infra project deploy` consumes `pull_secret_ref`. `olf infra deploy` does not read `spec.project` yet: it still takes the image from the environment variables above (deploying the example image is #539). ::: #### Pulling a private image `olf` never creates the pull Secret and never reads a registry credential. Create it yourself in each stage namespace that runs the project, with a read-only token (for GHCR, a personal access token with `read:packages`; not the Actions `GITHUB_TOKEN`, which expires with the workflow run): ```bash kubectl create secret docker-registry ghcr-pull -n olf-dev \ --docker-server=ghcr.io --docker-username= --docker-password= ``` Repeat for `olf-uat` and `olf-prod`. To rotate, recreate the Secret under the same name; running pods keep their pulled image and the next pull uses the new token. Before rolling anything out, `olf infra project deploy` checks that the Secret exists in the stage namespace, has type `kubernetes.io/dockerconfigjson` and lists the image's registry. A failed check leaves the running revision and `ACTIVE.json` untouched. It does not contact the registry, so an expired or revoked token shows up as `ImagePullBackOff` on the pod. The activation then names the Secret in `imagePullSecrets` on the code-location Deployments (and, through them, Dagster run pods) and on the `openlakeforge-k8s-log-archive` CronJob, and adds it to the stage's `dagster` ServiceAccount, which Floe Jobs run as. A rollback restores the Secret the previous release used. ### `spec.access` Declaring the block turns the ingress on; `access: {}` asks for the defaults. Without it there is no ingress at all. | Field | Type | Default | Meaning | | --- | --- | --- | --- | | `base_domain` | string | `olf.localhost` | Lowercase DNS name with at least one dot. Every service host is `.` or `-.`, and the portal is served at the base domain itself. | | `tls` | `none`, `local-ca` or `external` | `none` on `local`, `local-ca` elsewhere | Who terminates TLS for the routes. `none` serves plain HTTP and is valid only on `local` with a `*.localhost` base domain. `local-ca` signs the routes with a CA the platform creates; it is for evaluation, because every browser must trust that CA (`olf infra access trust`). `external` means your own proxy, tunnel or load balancer terminates HTTPS in front of OpenLakeForge: Traefik serves HTTP and every generated URL, callback and cookie is `https://`; it needs a `base_domain` that does not end in `.localhost`. `issuer` was the v1alpha1 name of this field and is rejected in v1beta1. cert-manager and the CA exist either way, for Trino's certificate (ADR 0016). | | `trusted_proxies` | list of CIDR blocks | none | Required with `tls: external`, refused with any other `tls`. The address range your proxy connects to Traefik from; only those peers' `X-Forwarded-Proto` and `X-Forwarded-Host` are believed, and a request from anywhere else is handled as plain HTTP whatever headers it carries. `0.0.0.0/0` and `::/0` are refused. | ### `spec.identity` Declares who signs in. `issuer` selects one of two shapes, and the other shape's fields are rejected. | Field | Type | Applies to | Meaning | | --- | --- | --- | --- | | `issuer` | `github` or `external` | both | **Required.** Which OIDC issuer signs people in. | | `github` | object | `github` | **Required** for `github`; rejected for `external`. | | `issuer_url` | string, `https://` URL | `external` | **Required.** The issuer's URL; the token `iss` claim must equal it. It needs a host and no query, fragment, whitespace or control characters. | | `role_claim` | string, non-empty | `external` | **Required.** The token claim holding role values, for example `groups` or `cognito:groups`. | | `role_mapping` | object | `external` | **Required.** Canonical role to the claim values that grant it. | | `client_ids` | object | `external` | Optional issuer-assigned client ids, keyed by consumer. | For `github`, `issuer_url`, `role_claim`, `role_mapping` and `client_ids` must not be written: `olf` derives them (`role_claim` becomes `groups`, and each role maps to `:` for its teams). The canonical roles, highest first, are `platform-admin`, `data-engineer`, `analyst` and `viewer` (`release/identity-roles.yaml`). Any other role name is rejected. #### `spec.identity.github` | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `organization` | string, `^[A-Za-z0-9-]+$` | yes | The organisation login exactly as GitHub shows it, case included: Dex compares it exactly. | | `host` | hostname string | no | A GitHub Enterprise Server hostname, with no scheme or path. Absent means `github.com`. Dex then trusts the platform CA for it. | | `teams` | object | yes | Canonical role to a list of GitHub team slugs. At least one role. | | `oauth_app_secret_ref` | object | yes | The Secret holding the GitHub OAuth App client id and secret. | `teams` rules: each key is a canonical role; each value is a non-empty list of team slugs as GitHub shows them in the team URL (`olf` lowercases them). A slug may not repeat within a list, and one team may not map to two roles. `oauth_app_secret_ref`: | Field | Type | Default | Meaning | | --- | --- | --- | --- | | `name` | string | none; **required** | The Kubernetes Secret's name: a DNS subdomain of at most 253 characters, each label at most 63. You create the Secret; the profile never carries a value. | | `client_id_key` | string | `client-id` | The Secret key holding the client id. | | `client_secret_key` | string | `client-secret` | The Secret key holding the client secret. Must differ from `client_id_key`. | Keys match `[-._a-zA-Z0-9]+` and are at most 253 characters. #### `spec.identity.role_mapping` (`external` only) An object whose keys are canonical roles (at least one). Each value is a non-empty list of non-empty claim-value strings. A value may not repeat within a role, and one claim value may not map to two roles. #### `spec.identity.client_ids` (`external` only) An object with at least one key from `perimeter`, `superset`, `openmetadata` and `olf-cli`; each value is a non-empty string. A consumer left out uses its own name as the client id. `external` deploys no issuer: you provide the three client Secrets the contract names, as described in ADR 0014. `olf-cli` is a public client and has no Secret. --- ## Cross-field rules | Rule | Rejected when | | --- | --- | | At least one stage runs | Every stage is disabled. | | DEV gates the others | `uat` or `prod` is enabled while `dev` is disabled or absent: every promotion sources from DEV. | | Storage size is not for managed storage | `spec.storage` is set with `type: aws`: S3 is managed, so there is no volume to size. | | Region is cloud-only | `spec.provider.region` is set with `type: local`. | | Identity needs access on local | `type: local` has `spec.identity` but no `spec.access`: sign-in needs the route hostnames. | | Authentication off publishes nothing | There is no `spec.identity`, and `spec.access` is declared on `aws` or `azure`, or with a `base_domain` not ending in `.localhost` on `local`. Without identity no one signs in, so it is allowed only where nothing is reachable beyond the operator's machine: locally on `*.localhost`, and on the clouds without `spec.access`, where services are reached with `olf infra forward`. | | A local project names its image | `type: local` declares `spec.project` without `image.repository`: kind has no default registry. | | Plain HTTP is local-only | `spec.access.tls` is `none` and the provider is not `local`, or `base_domain` does not end in `.localhost`. | | External TLS needs a public name | `spec.access.tls` is `external` and `base_domain` ends in `.localhost`: no upstream proxy can terminate TLS there. | | Renamed TLS field | `spec.access` says `issuer`, the v1alpha1 name of `tls`. | | Trusted proxies | `tls` is `external` without `trusted_proxies`; `trusted_proxies` with another `tls`; an entry that is not a CIDR block, or that is `0.0.0.0/0` or `::/0`. | | Issuer shape | `external` lacks `issuer_url`, `role_claim` or `role_mapping`; `github` lacks `github` or sets `issuer_url`, `role_claim` or `role_mapping`; `github` is set without `issuer: github`; `client_ids` is set without `issuer: external`. | On `local`, `olf infra deploy` also refuses a `spec.access.tls` other than `local-ca`, `none` or `external` before it creates the cluster. :::note `olf init` writes a profile with `access: {tls: none}` and no `spec.identity`: plain HTTP on `*.olf.localhost` with authentication off. ::: --- ## Related * [ADR 0011: Deployment Profile and stages](https://openlakeforge.dev/docs/adr/0011-deployment-profile-and-stages/) * [ADR 0013: service access](https://openlakeforge.dev/docs/adr/0013-service-access-and-ingress/) * [ADR 0014: identity and authorization](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/) * [`olf` CLI](https://openlakeforge.dev/docs/reference/cli/) --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/reference/deployment-profile.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/reference/deployment-profile.md). --- # Roles and permissions > The four OpenLakeForge roles and what each can do in every service. The roles are fixed for v0.5-alpha and defined in release/identity-roles.yaml; this page… Source: https://openlakeforge.dev/docs/reference/roles-and-permissions/ The four OpenLakeForge roles and what each can do in every service. The roles are fixed for v0.5-alpha and defined in `release/identity-roles.yaml`; this page is derived from that file. A person holds the highest role among the GitHub teams they belong to, and GitHub teams are mapped to roles in `spec.identity` ([Map teams to roles](https://openlakeforge.dev/docs/guides/identity/map-teams-to-roles/)). With authentication off, everyone is an administrator everywhere. ## Roles Highest first. A role holding a service's grant implies that every role above it holds one too. | Role | Intended for | | --- | --- | | `platform-admin` | Running the platform: administrator in every service | | `data-engineer` | Building and running pipelines, models and metadata | | `analyst` | Reading and building dashboards on published data | | `viewer` | Reading dashboards and metadata | ## What each role opens A role with no entry for a service is denied at the perimeter, before the request reaches the service. The cell is the role the person gets inside the service. A grant applies on every enabled stage. | Service | `platform-admin` | `data-engineer` | `analyst` | `viewer` | | --- | --- | --- | --- | --- | | Portal | opens | opens | opens | opens | | Dagster | full | full | denied | denied | | Trino UI | opens | opens | denied | denied | | Superset | `Admin` | `Alpha` | `Gamma` | read-only | | OpenMetadata | `Admin` | `write` | `read` | `read` | | Trino `/v1` (`olf query`) | opens | opens | opens | opens | A person refused a service sees an "Access is role-restricted" page. ## What each role reads and writes With GitHub sign-in, `olf query` runs SQL as you ([CLI reference](https://openlakeforge.dev/docs/reference/cli/#query-as-yourself)). Your role then decides, per stage and medallion layer, which tables you read and write. Polaris enforces it, and the storage credentials your query reads with are issued for those tables only. | Role | DEV | UAT | PROD | | --- | --- | --- | --- | | `platform-admin` | write every layer | write every layer | write every layer | | `data-engineer` | write every layer | read every layer | read every layer | | `analyst` | read Gold | read Gold | read Gold | | `viewer` | none | read Gold | read Gold | Writing includes creating schemas and tables. A role that may only read is refused when it writes: by Polaris for a new schema or table, and by storage for new rows, because its credentials are read-only. The rows apply only with GitHub sign-in. Pipelines, dbt and Superset do not use them: they run as the stage's service principal, as does `olf infra query`. ## Per service ### Portal Every signed-in person with a role opens it. It lists the services and, with GitHub sign-in, links to the organization's teams page where membership is managed. ### Dagster Dagster has no authorization of its own, so the perimeter is the only control. `platform-admin` and `data-engineer` have full capability: launching jobs with run configuration, terminating and deleting runs, reloading code locations and toggling schedules. The pods that run those jobs hold the stage's storage and catalog credentials, so assign `data-engineer` on that basis. ### Trino UI `platform-admin` and `data-engineer` open the Trino web UI. `analyst` and `viewer` do not. The UI opens as the fixed user `olf-web` behind the perimeter. Opening it changes nothing about what a query may read: Trino holds no credential and no access rules of its own, and Polaris decides each table access from the token the query carries (see [CLI and automation](#cli-and-automation)). Your own queries go through `olf query` ([What each role reads and writes](#what-each-role-reads-and-writes)). ### Superset | Action | `platform-admin` (`Admin`) | `data-engineer` (`Alpha`) | `analyst` (`Gamma`) | `viewer` (read-only) | | --- | --- | --- | --- | --- | | View published dashboards | all | all | granted schemas | granted schemas | | Create and edit own charts and dashboards | yes | yes | yes, on granted datasets | no | | Create and edit datasets | yes | yes | no | no | | SQL Lab | yes | no | no | no | | Add, edit, delete database connections | yes | no | no | no | | Import and export dashboards, alerts and reports | yes | yes | no | no | | User and role administration | yes | no | no | no | `analyst` and `viewer` see the Gold schemas of the imported dashboards. SQL Lab is for administrators only. The `viewer` role is a custom read-only role (`olf_viewer`), because Superset has no read-only dashboard role of its own. :::note These rows are the design in the permission specification and the pinned Superset's role definitions. Schema limits shape what Superset offers; every Superset query reaches Trino as the stage's service principal, so they do not restrict what a connection could read. ::: ### OpenMetadata | Action | `platform-admin` | `data-engineer` | `analyst` | `viewer` | | --- | --- | --- | --- | --- | | Search, browse, view assets and lineage | yes | yes | yes | yes | | Edit descriptions, tags, glossary terms, tier, certification | yes | yes | no | no | | Edit display names and lineage; trigger ingestion pipelines | yes | yes | no | no | | Change owners | yes | yes | no | no | | Create or delete entities | yes | no | no | no | | Roles, policies, teams, users, bots, settings | yes | no | no | no | With a GitHub App (not a hand-made OAuth App), a CronJob, `openmetadata-role-sync`, applies these roles every 5 minutes from the mapped GitHub teams: the administrator flag for `platform-admin`, the `DataSteward` role for `data-engineer`, and neither for the others. A person in no mapped team cannot sign in. The CronJob is applied from the `openlakeforge.yaml` at the project root; a profile passed with `-f` is not read for it. Mapped teams must have no child teams. An asset's owner keeps full control of it whatever their role, so reassign owned assets when you demote someone. OpenMetadata's local `admin@open-metadata.org` login does not work once sign-in is on. ### CLI and automation `olf infra` commands, CI and the pods of the platform are not people and hold no role; the platform commands `olf login`, `olf whoami` and `olf query` are the exception and act as you, with your role. The others authenticate with Kubernetes RBAC (your kubeconfig) or with a service credential from a Secret (to Trino's catalogs, the stage's processing principal's Polaris token), and reach services through port-forwards or their in-cluster addresses, never through the sign-in perimeter. Whoever holds the kubeconfig can therefore reach every service; a role limits people, not cluster access. `olf infra break-glass` is the recorded way to use that when the issuer is down ([Break-glass access](https://openlakeforge.dev/docs/guides/identity/break-glass/)). OpenLakeForge roles are never cloud IAM permissions. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/reference/roles-and-permissions.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/reference/roles-and-permissions.md). --- # Descriptor reference > The fields and rules of the two descriptors that declare a project's data: lakehouse_code/governance.yml, one per project, and… Source: https://openlakeforge.dev/docs/reference/descriptors/ The fields and rules of the two descriptors that declare a project's data: `lakehouse_code/governance.yml`, one per project, and `lakehouse_code/bronze//source.yaml`, one per source. It also lists the names OpenLakeForge derives from them. Both are validated against JSON Schemas, [`governance.schema.json`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/schema/governance.schema.json) and [`source.schema.json`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/schema/source.schema.json), and by the canonical inventory, with `olf check contracts`. Unknown fields are rejected at every level, and every identifier matches `^[a-z][a-z0-9_]*$`. Descriptors are provider-neutral: they name logical things only. They never contain Polaris, Glue, S3 or SeaweedFS names, endpoints, Kubernetes resources, account ids or credentials; OpenLakeForge derives those from the active provider. ## `source.yaml` ```yaml apiVersion: openlakeforge.io/v1beta1 kind: Source name: marketing_platform displayName: Marketing Platform description: Marketing campaign performance source system. status: active resources: - name: campaigns description: Raw CSV marketing campaign performance data. ``` | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `apiVersion` | string | yes | `openlakeforge.io/v1beta1` | | `kind` | string | yes | `Source` | | `name` | identifier | yes | Must equal the directory name and be unique in the lakehouse. | | `displayName` | string, non-empty | yes | Human-readable name. | | `description` | string | yes | May be empty. | | `status` | string, non-empty | yes | Free text; typically `planned`, `active` or `deprecated`. | | `resources` | array, at least one | yes | The source's table-like inputs. | | `resources[].name` | identifier | yes | Unique within the source. | | `resources[].description` | string | no | Human-readable description. | | `resources[].load.mode` | `full` or `incremental` | no | `full` (the default) replaces the resource's Bronze files on every run. `incremental` declares that only the rows past the cursor should load. No loader reads it yet; see [Load modes](#load-modes). | | `resources[].load.cursor` | column name | with `incremental` | The column whose last loaded value the next run starts after. Not allowed with `full`. | | `resources[].load.primary_key` | array of column names | with `incremental` | The row's identity, which Silver merges a changed row onto. | | `runtime.config` | array of key names | no | Names of the non-secret settings the loader reads, such as an API base URL. | | `runtime.secrets` | array of key names | no | Names of the credentials the loader reads, such as an API token. A name appears in at most one of the two lists. | `openlakeforge.io/v1alpha3` Source documents are the same document with the older version line and do not load as `v1beta1`. `olf project migrate` changes that line, in every `source.yaml` and in `governance.yml` together (see [`governance.yml`](#governanceyml)), and refuses, leaving all files as they were, if a document does not validate afterwards. No field was removed or renamed between the two versions. A resource has no schema here: its columns belong to the Floe contract of each domain that reads it. `runtime` lists key names, never values: each stage binds its own. For a source `crm_api` with `runtime: {config: [base_url], secrets: [api_token]}`: | Key | Bound by the stage in | Reaches the loader as | | --- | --- | --- | | `base_url` | ConfigMap `olf-source-crm-api` | `SOURCES__CRM_API__BASE_URL` | | `api_token` | Secret `olf-source-crm-api-credentials` | `SOURCES__CRM_API__API_TOKEN` | Create those bindings through `olf`, using the same profile and stage you will deploy to. Export `CRM_API_TOKEN` in your shell first: ```bash olf infra source bind crm_api --stage dev -f openlakeforge.yaml \ --set base_url=https://api.example.com \ --secret-from-env api_token=CRM_API_TOKEN olf infra source bindings --stage dev -f openlakeforge.yaml ``` `bind` checks key names against the descriptor. Pass secret values through `--secret-from-env KEY=VAR`, `--secret-from-file KEY=PATH` (one trailing newline is stripped), or the terminal's hidden prompt. Output contains key names only. `--partial` retains existing declared keys; `--dry-run` reads the current bindings and prints the plan without writing or prompting. `bindings` warns about extra keys and exits 1 for missing or unreadable objects or keys. Use `olf infra source unbind crm_api --stage dev -f openlakeforge.yaml` to remove both objects. Repeat the binding for each stage with that stage's values. These are the names dlt itself resolves for a `@dlt.source` in `bronze/crm_api/dlt/crm_api.py`, so the loader reads them with `dlt.config.value` and `dlt.secrets.value`, and fails if one is missing. In the Kubernetes names, `_` becomes `-`. Because of both conversions, a source with a `runtime` block, and each of its keys, must be underscore-separated words: `crm_api` and `base_url`, not `crm_`, `_url` or `a__b`. Where they apply: - Each product job carries the bindings of the sources it loads. They reach that job's run pod only, never the code-location server. - Steps of one run share its pod, so every loader in a job sees every binding the job carries. - A Bronze asset materialized outside its product job gets no binding and fails with dlt's missing-config error. - `olf infra deploy` refuses to activate a revision whose sources the stage has not bound. It reads Secret key names only, never values. - On `local`, a run pod reaches a host outside the cluster only on a port the stage declares in its Deployment Profile, `spec.stages..source_egress` ([reference](https://openlakeforge.dev/docs/reference/deployment-profile/#specstages)). A loader that is a real dlt source runs it through `openlakeforge_runtime.bronze_dlt.bronze_pipeline()`: - Files land at `///`, the path Floe reads Bronze from. - dlt's incremental state lives in that same bucket, under the pipeline `__`. Each run starts from an empty working directory and restores its cursor from its own stage, so a DEV run cannot move PROD's. - `olf check project-code` proves this with a mocked API source run as DEV and as PROD. `openlakeforge_runtime.bronze_incremental` provides the read side of an incremental connector for an API or a database; [Load an external source incrementally](https://openlakeforge.dev/docs/guides/incremental-sources/) walks through one. ### Load modes Each layer declares its load mode where its owner keeps it: | Layer | Declared in | Incremental | Full | | --- | --- | --- | --- | | Bronze | `resources[].load` in `source.yaml` | dlt appends the rows past `cursor` as new files | dlt replaces the files | | Silver | the entity's Floe contract | `incremental_mode: file` with `merge_scd1`, `merge_scd2` or `append` | `overwrite` | | Gold | the dbt model's `materialized` config | `incremental` with a `unique_key` and the `merge` strategy | `table` | `olf check contracts` rejects a Silver entity whose mode does not fit its Bronze resource. An entity reading an incremental resource needs `incremental_mode: file` and `merge_scd1`, `merge_scd2` or `append`. An entity reading a full resource cannot use `append`, which would add every row again on each run. A loader with an incremental resource runs its dlt source through `openlakeforge_runtime.bronze_dlt.load_dlt_source`. The connector declares the cursor with `dlt.sources.incremental` on the column `load.cursor` names, and the load fails if the two differ. A run with nothing new past the cursor writes no Bronze file, so Floe has no new file to read either. The CSV loader has no incremental mode: it replaces its files on every run. Floe merges an entity's pending files in one `MERGE`, in file order, and keeps the latest file's row when a key repeats across them. dlt names Bronze files after the load id, so a Silver run catching up on several batches merges each row's newest version. ### Full refresh A run is incremental unless it carries the run tag `openlakeforge/full_refresh`. Run `olf infra product run --full-refresh `, or set the tags yourself in the Dagster launchpad: | Scope | Bronze | Silver | Gold | | --- | --- | --- | --- | | `bronze` | Incremental, as on any run | Rebuilt from every Bronze file (`floe run --full-refresh`) | `dbt build --full-refresh` | | `gold` | Incremental | Incremental | `dbt build --full-refresh` | A full refresh re-ingests what Bronze already holds; it never extracts from a source again, so cursors and Bronze files are untouched. Incremental Bronze keeps every batch and Floe merges a repeated key from the latest file, so Silver rebuilt from all of them holds each row's newest version. A `bronze` refresh needs a second tag, `floe/full_refresh=true`, which makes dagster-floe run the job's Floe entities with `--full-refresh`. `olf infra product run` sets both. A run that carries only the first fails at its first step, before Silver or Gold change. Known limits: - A row deleted at the source never reaches Silver: incremental extraction sees only rows that still exist, and a full refresh rebuilds from the same Bronze. Removing it takes a source-specific step, such as reloading that resource's Bronze. - Floe cannot rebuild a `merge_scd2` table's version history from its inputs, so a `bronze` refresh fails at a `merge_scd2` entity. - A run killed after dlt wrote some files of a batch but before it saved the cursor leaves those files in Bronze. The rerun extracts the same rows again into a newer batch. A merge keeps the newer rows and reports the killed batch's rows as rejected duplicates; Bronze keeps both. Incremental state is per stage. dlt keeps cursors under the pipeline `__` in the stage's Bronze bucket. Floe keeps its file state under the source path in that same bucket, and dbt's state is the stage's Gold table itself. ## `governance.yml` ```yaml apiVersion: openlakeforge.io/v1beta2 kind: Governance domains: - name: marketing displayName: Marketing description: Marketing analytics data products. status: active products: - id: campaign_performance displayName: Campaign Performance description: Campaign spend and conversion performance. status: active ``` The file names domains and the data products nested under them, and nothing else. Tables belong to a domain or a product by the schema they live in, so no table is listed: | Schema | Owner | | --- | --- | | `_silver` | the domain | | `_gold` | the product, and through it the product's domain | Sources are the `bronze/*/source.yaml` files on disk. Dashboards are the `dashboards/superset/*/` directories that hold a `metadata.yaml`; a dashboard serves the products whose `_gold` schema its dataset files read. ### Top level | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `apiVersion` | string | yes | `openlakeforge.io/v1beta2` | | `kind` | string | yes | `Governance` | | `domains` | array, at least one | yes | The business domains. | ### `domains[]` | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `name` | identifier | yes | Unique across the lakehouse; also the directory `silver//`. | | `displayName` | string, non-empty | yes | Human-readable name. | | `description` | string | no | | | `status` | string, non-empty | no | Free text. | | `products` | array, may be empty or omitted | no | The data products of this domain. A project needs at least one product across all its domains to be checked or deployed. | ### `domains[].products[]` A product belongs to the domain it is nested under, so it carries no `domain` field. Moving a product to another domain changes which Silver tables it may read, so it is a deliberate edit of the directory layout as well as the file. | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `id` | identifier | yes | Unique across the whole lakehouse, not only within its domain; also the directory `gold//`. | | `displayName` | string, non-empty | yes | Human-readable name. | | `description` | string | no | | | `status` | string, non-empty | no | Free text. | A root `products:` list, a `domain` inside a product, or the same `id` under two domains is rejected, with the location written as `domains[sales].products[order_revenue]`. `openlakeforge.io/v1beta1` documents declared the products in a root `products:` list that named their domain. They do not load as `v1beta2`. Run `olf project migrate --dry-run` to see the rewrite as a diff, then `olf project migrate` to apply it. The command keeps comments with the entry they sit above, and the order, and refuses, leaving the file as it was, on an unknown domain, a duplicate `id`, a file that already nests products, or a layout it cannot rewrite safely. The migration changes the project revision digest and no asset name: schemas, jobs, buckets and catalog entries derive from the same domain and product names (see [ADR 0012](https://openlakeforge.dev/docs/adr/0012-project-revisions-and-promotion/)). `olf check contracts` also requires one `silver//` directory per domain and one `gold/models//` directory per product, and rejects a dbt model that dbt resolved into any schema but its folder's `_gold` (when the Gold project's `target/manifest.json` exists), since its tables would belong to no product. ## Implementation files Each identity selects the files that implement it: | Identity | Files | | --- | --- | | Source `name` | `lakehouse_code/bronze//` | | Domain `name` | `lakehouse_code/silver//`, whose `domain.yml` holds the domain's Floe defaults and whose `contracts/` holds one file per entity | | Product `id` | `lakehouse_code/gold//dbt/` and `lakehouse_code/pipelines/dagster/.py` | | Dashboard | `lakehouse_code/dashboards/superset//`, once it holds a `metadata.yaml` | ## Derived names For a `crm` source, a `sales` domain and an `order_revenue` product: | Name | Value | | --- | --- | | Silver namespace | `sales_silver`, shared by every product of the domain | | Gold namespace | `order_revenue_gold` | | Dagster job | `order_revenue_pipeline` | | Dagster module | `lakehouse_code.pipelines.dagster.order_revenue` | | Floe report prefix | `floe/reports/sales/` | | dbt artifact prefix | `run-artifacts/dbt/sales/order_revenue/` | Tables are addressed as `..
`, for example `lakehouse_dev.order_revenue_gold.mart_order_revenue_by_day`. The stage catalog is `lakehouse_`. Table names are not declared in a descriptor: Silver tables are the entities of the domain's Floe files and Gold tables are the product's dbt models. Renaming a source, resource, domain, product or table changes these names, so on a deployed stage plan it as a data migration. `displayName`, `description` and `status` are metadata only. ## Validation errors ```bash olf check contracts ``` | Error | Cause | | --- | --- | | Name must match source directory | `bronze/marketing_platform/source.yaml` says `name: marketing`. | | Invalid identifier | A name such as `campaign-performance`; use `campaign_performance`. | | Duplicate product id | Two products declare the same `id`. | | Product names an unknown domain | A product's `domain` is not in `domains`. | | Domain or product has no directory | `silver//` or `gold/models//` is missing, or exists without an entry in `governance.yml`. | | Silver entity reads an unknown Bronze resource (`olf check project-code`) | A Floe entity's `source.ref`/`resource` is not a resource of a `source.yaml`. | | Model outside `_gold` | A dbt model sets its own schema and a manifest shows it. | `olf check contracts` reads each descriptor on its own. `olf check project-code` loads the whole inventory, and catches a reference between descriptors that does not resolve. `olf init --empty` writes no `governance.yml`; the first `olf domain new` or `olf product new` creates it. Only the scaffolding commands accept a project without one; every check and deploy needs at least one product. ## Graph the lineage ```bash olf project graph --project . ``` This prints the ownership chain the descriptors declare as Mermaid text: | Edge | Read from | | --- | --- | | Source → Domain | `source.ref` of the domain's Floe entity files | | Domain → Product | `products[].domain` | | Product → Dashboard | the `_gold` schema of the dashboard's dataset files | Nodes and edges are sorted, so the same descriptors always print the same text. Paste it into a `mermaid` code block on GitHub or into the [Mermaid Live Editor](https://mermaid.live) to see it drawn. For the CRM/ERP demo it prints: ```text flowchart LR dashboard_sales_customer_health["sales_customer_health"] dashboard_sales_order_revenue["sales_order_revenue"] dashboard_supply_chain_inventory_reliability["supply_chain_inventory_reliability"] domain_sales["Sales"] domain_supply_chain["Supply Chain"] product_customer_health["Sales Customer Health"] product_inventory_reliability["Supply Chain Inventory Reliability"] product_order_revenue["Sales Order Revenue"] source_crm["CRM"] source_erp["ERP"] domain_sales --> product_customer_health domain_sales --> product_order_revenue domain_supply_chain --> product_inventory_reliability product_customer_health --> dashboard_sales_customer_health product_inventory_reliability --> dashboard_supply_chain_inventory_reliability product_order_revenue --> dashboard_sales_order_revenue source_crm --> domain_sales source_erp --> domain_supply_chain ``` --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/reference/descriptors.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/reference/descriptors.md). --- # Runtime API > openlakeforge_runtime is the package your lakehouse_code/ imports. Only the modules and names below are public. Everything else in the package, such as… Source: https://openlakeforge.dev/docs/reference/runtime-api/ `openlakeforge_runtime` is the package your `lakehouse_code/` imports. Only the modules and names below are public. Everything else in the package, such as `floe_profile`, `s3_artifacts`, `gold_maintenance` and `dbt`, and any name that starts with an underscore, is private: it can change in any release, including a patch release. `olf check project-code` prints a warning for every import in `lakehouse_code/` of a module or name outside this page. ## Public modules | Module | Public names | | --- | --- | | `openlakeforge_runtime.product_dagster` | `ProductDefinitionSpec`, `ResolvedProductInputs`, `build_product_definitions`, `SourceDefinitionSpec`, `build_source_definitions`, `build_silver_definitions`, `build_maintenance_definitions`, `build_gold_maintenance_definitions`, `build_stage_schedules` | | `openlakeforge_runtime.bronze_csv` | `BronzeLoadResult`, `load_entities_to_bronze`, `load_entity_to_bronze` | | `openlakeforge_runtime.bronze_dlt` | `load_dlt_source` | | `openlakeforge_runtime.bronze_incremental` | `CursorNotReached`, `keyset_batches`, `newest_first_pages`, `sql_engine` | Each module lists its public names in `__all__`, and `openlakeforge_runtime.PUBLIC_MODULES` lists the modules. ## Compatibility promise While the project is in beta (`v1beta1`): - A public name is not removed or given an incompatible signature in a patch or minor release. - A name that has to go is first deprecated: it stays importable and keeps working for at least one minor release, and the release notes say what replaces it. - A test (`tools/olf/tests/runtime/test_public_api.py`) holds the published names, so removing one fails the build. - New public names and new optional arguments can appear in any release. ## `ProductDefinitionSpec` `domain` and `product` are required. The three lists default to what the project declares, and a list you pass wins over its default: | Field | Default | | --- | --- | | `gold_assets` | The models under `gold/models//` in the Gold dbt project | | `silver_inputs` | The domain's Silver tables those models read; a source of another domain is refused | | `bronze_inputs` | The Bronze resource each of `silver_inputs` reads, from the domain's Floe entities | ```python defs = build_product_definitions(ProductDefinitionSpec(domain="sales", product="order_revenue")) ``` A dbt source that is not a Silver table of the domain fails when the definitions load, naming the source. `ProductDefinitionSpec.resolve()` returns the effective lists. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/reference/runtime-api.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/reference/runtime-api.md). --- # Components and services > The open-source components OpenLakeForge deploys, the version this release pins, which providers run each one, and the URL each user-facing service is… Source: https://openlakeforge.dev/docs/reference/components/ The open-source components OpenLakeForge deploys, the version this release pins, which providers run each one, and the URL each user-facing service is published at. Exact image digests, Helm charts and Terraform providers are in the [Compatibility matrix](https://openlakeforge.dev/docs/reference/compatibility-matrix/). ## Platform services | Component | Role | Version | Local | AWS | Azure | | --- | --- | --- | --- | --- | --- | | [Dagster](https://dagster.io/) | Orchestration: one asset graph and one job per data product, one instance per stage | 1.13.7 | yes | yes | yes | | [Trino](https://trino.io/) | SQL engine over the Iceberg catalog; dbt builds Gold through it | 480 | yes | yes | yes | | [Apache Polaris](https://polaris.apache.org/) | Iceberg REST catalog | 1.8.0 | yes | AWS Glue instead | yes | | [SeaweedFS](https://github.com/seaweedfs/seaweedfs) | S3-compatible object storage for Bronze, Silver, Gold and run artifacts | 4.48 | yes | Amazon S3 instead | yes | | [PostgreSQL](https://www.postgresql.org/) | Metadata databases of the platform services | 16 | yes | Amazon RDS instead | yes | | [Apache Superset](https://superset.apache.org/) | Dashboards over Gold tables, one instance per stage with `analytics` on | 6.1.0 | Full | Full | Full | | [OpenMetadata](https://open-metadata.org/) | Governance: domains, data products and lineage, with an [OpenSearch](https://opensearch.org/) 3.3.2 index | 1.13.6 | Full | Full | Full | | [Traefik](https://traefik.io/) and [cert-manager](https://cert-manager.io/) | Ingress and route certificates | v3.7.13, v1.21.2 | with `spec.access` | no | no | | [Dex](https://dexidp.io/) and [oauth2-proxy](https://oauth2-proxy.github.io/oauth2-proxy/) | GitHub sign-in and the role-checking perimeter | v2.46.0, v7.15.5 | with `spec.identity` | no | no | ## Data tooling These run your pipelines from the `project-code` image built from `lakehouse_code/`. | Component | Role | Version | | --- | --- | --- | | [dlt](https://dlthub.com/) | Extracts a source into Bronze | 1.29.0 | | [Floe](https://github.com/malon64/floe) | Validates Bronze against a domain contract and writes Silver Iceberg tables; rejected rows are quarantined | `floe-python` 0.10.1, `dagster-floe` 0.6.0 (in the project-code image) | | [dbt](https://www.getdbt.com/) with dbt-trino | Builds Gold models on Trino | dbt-core 1.11.12, dbt-trino 1.10.2 | | [Apache Iceberg](https://iceberg.apache.org/) | Table format of Silver and Gold | | | [DuckDB](https://duckdb.org/) | Runs Floe's merge write modes (`merge_scd1`, `merge_scd2`) against the Iceberg catalog; the `httpfs`, `aws`, `iceberg` and `avro` extensions are installed at image build, so a Floe Job downloads nothing | 1.5.6 (in the project-code image) | ## Service URLs Routes exist on the local provider when the Deployment Profile declares `spec.access`, which `olf init` does. `` is `spec.access.base_domain`, `olf.localhost` by default. The scheme is `http` with `tls: none` and `https` otherwise. | Service | URL | Present when | | --- | --- | --- | | Portal | `://` | always | | Dagster | `://dagster-.` | one per enabled stage | | Superset | `://superset-.` | one per stage with `analytics` on | | Trino UI | `://trino-.` | one per enabled stage | | OpenMetadata | `://openmetadata.` | a stage has `governance` on | | Sign-in (Dex) | `://auth.` | `spec.identity.issuer` is `github` | Polaris, SeaweedFS, the databases and code servers are never published; reach them with `olf infra forward`. On AWS and Azure every service is reached with `olf infra forward`. Which role may open each service is in [Roles and permissions](https://openlakeforge.dev/docs/reference/roles-and-permissions/). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/reference/components.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/reference/components.md). --- # OpenLakeForge 0.6.0-alpha.3 compatibility matrix > Generated from release/component-catalog.yaml. Every version below is the exact input pinned for this release; see docs/reference/component-catalog.md for… Source: https://openlakeforge.dev/docs/reference/compatibility-matrix/ Generated from `release/component-catalog.yaml`. Every version below is the exact input pinned for this release; see [docs/reference/component-catalog.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/reference/component-catalog.md) for the update process. ## Platform | Component | Required version | | --- | --- | | Terraform | >= 1.10.0 | ## Project revision runtime contract A ProjectRevision built for any accepted contract version activates on this distribution without a rebuild, whatever distribution version built it. A revision outside the range must be rebuilt (ADR 0012). | Current contract | Accepted contracts | | --- | --- | | 1 | 1 | ## Terraform providers The tracked/approved version for each provider. Individual Terraform roots can lock an older compatible version (below) -- consult that table for the exact version actually applied to a given target. | Provider | Tracked version | | --- | --- | | hashicorp/aws | 6.62.0 | | hashicorp/azurerm | 4.77.0 | | hashicorp/helm | 3.2.0 | | hashicorp/kubernetes | 2.38.0 | | hashicorp/random | 3.9.0 | | hashicorp/tls | 4.3.0 | ### Terraform providers by root The exact version `.terraform.lock.hcl` pins for each root -- what a consumer of that target actually gets, not the tracked version above. | Provider | infra/terraform/environments/aws-poc/.terraform.lock.hcl | infra/terraform/environments/azure-poc/.terraform.lock.hcl | infra/terraform/environments/local/.terraform.lock.hcl | infra/terraform/foundations/aws-eks/.terraform.lock.hcl | infra/terraform/foundations/azure-aks/.terraform.lock.hcl | | --- | --- | --- | --- | --- | --- | | hashicorp/aws | 6.62.0 | | | 6.62.0 | | | hashicorp/azurerm | | | | | 4.77.0 | | hashicorp/helm | 3.2.0 | 3.2.0 | 3.1.1 | | | | hashicorp/kubernetes | 2.38.0 | 2.38.0 | 2.38.0 | | | | hashicorp/random | 3.9.0 | 3.9.0 | 3.9.0 | | 3.9.0 | | hashicorp/tls | | | | 4.3.0 | | ## Helm charts | Chart | Version | | --- | --- | | cert-manager | v1.21.2 | | dagster | 1.13.7 | | openmetadata | 1.13.6 | | openmetadata-dependencies | 1.13.6 | | polaris | 1.8.0 | | seaweedfs | 4.48.0 | | superset | 0.15.5 | | traefik | 41.6.1 | | trino | 1.42.2 | ## Managed toolchain Terraform, Helm, kubectl, and kind are provisioned by `olf toolchain` (#127) rather than installed by the consumer; versions below are what the current release provisions. | Tool | Version | | --- | --- | | helm | 3.18.6 | | kind | 0.32.0 | | kubectl | 1.31.4 | | terraform | 1.16.4 | ## Container images | Image | Reference | | --- | --- | | cert_manager_acmesolver | `quay.io/jetstack/cert-manager-acmesolver:v1.21.2@sha256:699b40d622211ab7accad8a21b04c5fbaa1841ef7a12621e8de492dbe27b2503` | | cert_manager_cainjector | `quay.io/jetstack/cert-manager-cainjector:v1.21.2@sha256:c85268c64f2e0e76684bf5fe8906caff34b82523561c6affe0fae3546bd87562` | | cert_manager_controller | `quay.io/jetstack/cert-manager-controller:v1.21.2@sha256:70f532fd9cfde0b09d55687200942399d89838bc2d5d5b45152eb799a15912b8` | | cert_manager_startupapicheck | `quay.io/jetstack/cert-manager-startupapicheck:v1.21.2@sha256:46e75b6866359ffb5d82624f41e3ed1c70b2994982702ced547ce5edb418a8f5` | | cert_manager_webhook | `quay.io/jetstack/cert-manager-webhook:v1.21.2@sha256:a60e2dac46dbb8a7f3df95c54ce941012f54c2fe022f0ee55aaa1ab40ed957ae` | | dagster_busybox | `docker.io/busybox:1.28@sha256:141c253bc4c3fd0a201d32dc1f493bcf3fff003b6df416dea4f41046e0f37d47` | | dagster_control_plane | `docker.io/dagster/dagster-celery-k8s:1.13.7@sha256:7e9fa5d3f9724bdf382932f34294dbfe5c9ca550641795dff793d6b59f3cc4ee` | | dex | `ghcr.io/dexidp/dex:v2.46.0@sha256:933fcd3f523338c847b88ef84a7145fb2fcb7b9917f08418612afeaaa2001777` | | k8s_bootstrap | `alpine/k8s:1.30.0@sha256:bd01dae02676ce4cab62fc744e43443eee5bf660054e94d3496d23bfc35d384e` | | oauth2_proxy | `quay.io/oauth2-proxy/oauth2-proxy:v7.15.5@sha256:8498b0d0ef0a7b29686414000a08aee467f02d0299c9ed1e006a8f33fc017916` | | openmetadata_ingestion | `docker.getcollate.io/openmetadata/ingestion-base:1.13.6@sha256:29f8dcafc52bdbdb60dc3901569d9cd752cd10cb942375f5e08b53d38b05239e` | | opensearch | `opensearchproject/opensearch:3.3.2@sha256:798cf28e226a32f5c928dd1ed9478dd3a33d2212176aad3679020088ad3afa1a` | | polaris | `apache/polaris:1.8.0@sha256:347615e736cab2c9be0d8c464552ac930be4755302bb0aeb745216bbae99ba5b` | | polaris_admin_tool | `apache/polaris-admin-tool:1.8.0@sha256:34dde19bb321aef5925a14ba90b69e26e982a5dcbda76a9d0cfc1aac1534ba4e` | | portal | `ghcr.io/openlakeforge/openlakeforge-portal:0.6.0@sha256:32f2232588f4048da3ff4c56d8672032e1302d9b1976256272cefaf63df09e9c` | | postgres | `postgres:16-alpine@sha256:57c72fd2a128e416c7fcc499958864df5301e940bca0a56f58fddf30ffc07777` | | project_code_base | `python:3.12-slim@sha256:57cd7c3a7a273101a6485ba99423ee568157882804b1124b4dd04266317710de` | | seaweedfs | `chrislusf/seaweedfs:4.48@sha256:4e61d15fd35994cb1e43e1e553dff106794841fd9a99ade2fc8c8bfce4d7872d` | | superset | `ghcr.io/openlakeforge/openlakeforge/superset:0.5.1-alpha.3@sha256:e884c3ee1c3fa9ad78685a6867b9b809a125661df76b65f19dc17e2057b3698b` | | superset_base | `apache/superset:6.1.0@sha256:fb3464528ec7076f91195f0ff7835755aa023e281f1bb78a84782ce7a36b3705` | | superset_init | `apache/superset:dockerize@sha256:afe59523a6c8774c3b16d0f44146b2e52f327a7d26a47b4cc63b904fcdedf057` | | superset_redis | `docker.io/redis:7.4.12-bookworm@sha256:b6b6e3dc0c0952737748e55d5d885272840c7e42ba41ab1d5489f693419882f5` | | traefik | `docker.io/traefik:v3.7.13@sha256:24841fe2de7304c149343d877d2923b4c8800a38ba015dea9174c23b20e344a0` | | trino | `trinodb/trino:480@sha256:1565e8cac299a32dd9177a4da2d748da4ceb9f1560a9c409d1d18fd72ea5253e` | ## Cloud services (deployment targets) | Target | Kubernetes foundation | Object storage | Catalog | Managed database | | --- | --- | --- | --- | --- | | Local | kind | SeaweedFS (in-cluster), STS on | Polaris (in-cluster) | PostgreSQL (in-cluster) | | Azure POC (preview) | AKS | SeaweedFS (in-cluster), STS on | Polaris (in-cluster) | PostgreSQL (in-cluster) | | AWS POC (preview) | EKS | S3 | AWS Glue | RDS PostgreSQL | A Polaris catalog reads only with the credentials Polaris vends through the object store's STS, so its store must offer one (provider contract `stages..storage.sts_endpoint`). A generic S3-compatible store (#803) and AWS on Polaris (#681) are not qualified yet. ## Supported upgrade paths OpenLakeForge is in the Alpha lifecycle stage (see [releasing.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/release/releasing.md#lifecycle-stages)): breaking changes are allowed between alpha releases, with migration notes published in `CHANGELOG.md` for every tag. Until Beta, only the latest alpha tag is maintained; there is no supported upgrade path guarantee prior to `v0.1.0-alpha.1`. Platform state written before v0.3 is not supported: `olf` refuses its schema `2.0.0` provider contract. Upgrade from state written by v0.3 or later. Older state keeps its shared services in the `lakehouse` namespace, which the platform apply refuses to replace: migrate the SeaweedFS, PostgreSQL and Polaris data into the current shared namespace by hand, then run `olf infra deploy --phase platform`, or run it with `--allow-stage-removal` to start over and lose that data. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/reference/compatibility-matrix.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/reference/compatibility-matrix.md). --- # Glossary > The terms the OpenLakeForge documentation uses, each in a line or two, in alphabetical order. Each entry names the file or command that defines it. Source: https://openlakeforge.dev/docs/reference/glossary/ The terms the OpenLakeForge documentation uses, each in a line or two, in alphabetical order. Each entry names the file or command that defines it. | Term | Meaning | | --- | --- | | Access | The `spec.access` block of the Deployment Profile. Declaring it publishes the user-facing services through one ingress at `.` names; omitting it publishes nothing. | | Artifacts phase | The third `olf infra deploy` phase. It deploys everything derived from `lakehouse_code/`, so a code change reruns only this phase. | | Base domain | `spec.access.base_domain`, `olf.localhost` by default. Every route host ends with it, and the portal is served at the base domain itself. | | Bronze | The landing layer: source data as files in object storage, loaded by dlt and not yet validated. It has no catalog namespace. | | Canonical role | One of `platform-admin`, `data-engineer`, `analyst` and `viewer`, highest first, defined in `release/identity-roles.yaml`. A role decides which services a person can open. | | Capability | A per-stage optional service: `analytics` (Superset) or `governance` (OpenMetadata). The preset sets the defaults. | | Catalog | The Apache Iceberg catalog that registers the tables. Polaris locally, AWS Glue on AWS. Each stage has its own, `lakehouse_`. | | Component catalog | `release/component-catalog.yaml`: the pinned versions and image digests of everything a release ships. | | Dagster | The orchestrator. It runs the data path as an asset graph, with one job per data product. | | Data product | A unit a domain publishes: it reads Silver tables of its domain and publishes Gold tables. Each has one Dagster job, `_pipeline`. | | dbt-trino | The dbt adapter that builds Gold models by running SQL on Trino. | | Deployment Profile | `openlakeforge.yaml`: provider, preset, stages, access and identity for one deployment. | | Descriptor | A YAML file that names logical things only: `governance.yml` and each `source.yaml`. Physical names are derived, never written. | | Dex | The OIDC issuer OpenLakeForge deploys to sign people in through GitHub. | | dlt | The loader that extracts a source into Bronze. | | Domain | A business area that owns a set of Silver tables and the data products built on them. | | Floe | The engine that validates Bronze against a domain's contract and writes accepted rows to Silver; rejected rows go to a quarantine location. | | Foundation phase | The first `olf infra deploy` phase: it creates the cluster and registry. | | Gold | The business layer: marts that dbt-trino builds from Silver. Namespace `_gold`. | | Iceberg | The open table format for Silver and Gold tables. | | Identity | The `spec.identity` block: which OIDC issuer signs people in (`github` or `external`) and how its claims map to canonical roles. Without it, authentication is off. | | TLS mode (access) | `spec.access.tls`: who terminates TLS for the routes. `none` (the local default) serves plain HTTP; `local-ca` signs the routes with a CA the platform creates; `external` leaves HTTPS to your own proxy. | | Issuer (identity) | `spec.identity.issuer`: the OIDC issuer, `github` or `external`. | | Lakehouse | The whole project: the sources, domains, products and dashboards that `lakehouse_code/` holds, with domains and products named in `governance.yml`. | | Medallion layers | Bronze, Silver and Gold: three layers, each owned by one tool. | | Namespace (catalog) | A single-level catalog schema: `_silver` or `_gold`. Not a Kubernetes namespace. | | Perimeter | The oauth2-proxy layer in front of every route except the login page. It admits a user only when their role holds a grant for the service. | | Platform phase | The second `olf infra deploy` phase: it deploys the shared services in `olf-system` and each stage's services. | | Portal | The landing page at the base domain that links every published route. | | Preset | `slim` or `full`. `full` turns on `analytics` and `governance` by default. | | Project revision | An immutable build of the project (descriptors, contracts, dbt, Dagster code, image digest) made by `olf infra project build` and promoted between stages unchanged. | | Provider contract | A provider-neutral description of a capability (catalog, storage, access, identity), so local, AWS and Azure expose the same shape with different implementations. | | Provider | The deployment target: `local` (kind), `aws` or `azure`. | | Resource | A table-like entity a source exposes in Bronze, declared under `resources` in `source.yaml`. | | Route | A published URL for a user-facing service, defined in `contracts.tf`. See [Components and services](https://openlakeforge.dev/docs/reference/components/#service-urls). | | Silver | The validated layer: Iceberg tables Floe writes per domain. Namespace `_silver`. | | Source | One system you ingest from, declared in `lakehouse_code/bronze//source.yaml`. | | Stage | A lifecycle boundary: `dev`, `uat` or `prod`. Stages share one cluster; each has its own namespace, Dagster, buckets and catalog. | | Topology | The effective shape `olf profile resolve` computes from a profile: stages with their capabilities resolved, plus access and identity. | | Trino | The SQL engine over the Iceberg catalog, used by dbt, Superset and `olf infra query`. | --- ## Related * [Components and services](https://openlakeforge.dev/docs/reference/components/) * [Concepts](https://openlakeforge.dev/docs/get-started/concepts/) * [Architecture overview](https://openlakeforge.dev/docs/architecture/overview/) --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/reference/glossary.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/reference/glossary.md). --- # Architecture > How OpenLakeForge is put together: the services it runs, how data moves from Bronze to Gold, how one pipeline run uses them, and what changes between the… Source: https://openlakeforge.dev/docs/architecture/overview/ How OpenLakeForge is put together: the services it runs, how data moves from Bronze to Gold, how one pipeline run uses them, and what changes between the local, AWS and Azure providers. OpenLakeForge architecture: Dagster orchestrates dlt, Floe and dbt-trino over Bronze, Silver and Gold Iceberg tables in object storage, queried by Trino and Superset and governed by OpenMetadata ## Services and responsibilities Everything runs on one Kubernetes cluster that `olf infra deploy` creates. | Concern | Service | Responsibility | | --- | --- | --- | | Orchestration | Dagster | Runs one job per data product and records every run | | Ingestion | dlt | Lands source data in Bronze | | Validation | Floe | Checks Bronze against the domain's contract and writes Silver | | Transformation | dbt-trino | Builds Gold marts in SQL | | Compute | Trino | Runs queries and the dbt SQL (one coordinator per stage on local); the only query engine | | Table format | Apache Iceberg | Silver and Gold tables | | Catalog | Polaris, or AWS Glue | Registers every Iceberg table | | Storage | SeaweedFS, or Amazon S3 | Holds Bronze files, Iceberg data and run artifacts | | Service state | PostgreSQL, or Amazon RDS | Databases of Dagster, Superset, OpenMetadata and Polaris | | Governance (Full) | OpenMetadata | Domains, data products and lineage | | Analytics (Full) | Superset | Dashboards over Gold tables | Component versions are in [Components and services](https://openlakeforge.dev/docs/reference/components/). ## Bronze, Silver and Gold Each layer has one owner in your project and one tool that writes it: | Layer | Owned by | Written by | Holds | Namespace | | --- | --- | --- | --- | --- | | Bronze | A source | dlt | Source files as they arrived | none, raw files in the Bronze bucket | | Silver | A domain | Floe | Validated Iceberg tables; rejected rows go to a quarantine path instead | `_silver` | | Gold | A data product | dbt-trino | Business marts | `_gold` | dbt reads the Silver tables Floe writes and keeps no staging layer of its own. Every Silver and Gold write is committed through the catalog, so Trino, Superset and OpenMetadata see the same tables. ## One pipeline run When you launch `_pipeline` in Dagster: 1. Dagster starts a short-lived run pod from your project-code image. 2. The run pod loads each Bronze resource with dlt. 3. For each domain the product reads, the run pod launches one Floe Kubernetes Job on the same image; it validates the selected Silver tables one after another, writing accepted rows to Silver and a report to the ops bucket. 4. dbt-trino sends the Gold SQL to Trino, which does the work and writes the Gold tables. 5. Floe and dbt emit OpenLineage events to OpenMetadata on Full, so lineage comes from the runs themselves. Run pods and Floe Jobs are removed after the run, so nothing computes between runs except the long-lived services. Logs, Floe reports and dbt artifacts are archived in the ops bucket. ## Deployment model `olf infra deploy` runs three phases: | Phase | Creates | Changes when | | --- | --- | --- | | Foundation | The cluster and image registry | Rarely | | Platform | The shared services and each stage | You change the preset or stages | | Artifacts | Your code: image, catalog namespaces, Dagster code, dashboards, metadata | You change `lakehouse_code/` | A code change only reruns artifacts and never touches Terraform. Shared services run once in the `olf-system` namespace. Each enabled stage (`dev`, `uat`, `prod`) gets its own `olf-` namespace with its own Dagster and Superset, its own buckets and its own catalog `lakehouse_`. A change is built once into an immutable project revision and promoted between stages unchanged; see [CI/CD and environment promotion](https://openlakeforge.dev/docs/guides/promote-dev-to-prod/). Stage promotion: a merged pull request builds one image and one project revision, which is activated in the DEV namespace, tested, approved, and then activated unchanged in PROD ## Providers The platform components talk to infrastructure through provider-neutral contracts, so your project and its descriptors are identical on every provider: | | Local | AWS | Azure (preview) | | --- | --- | --- | --- | | Kubernetes | kind on Docker | EKS | AKS | | Images | Loaded into kind | ECR | ACR | | Storage | SeaweedFS | S3 | SeaweedFS | | Catalog | Polaris | AWS Glue | Polaris | | Service state | PostgreSQL | RDS PostgreSQL | PostgreSQL | | Workload identity | Kubernetes service accounts | EKS Pod Identity | Kubernetes service accounts | | Access | Ingress on `*.olf.localhost`, optional sign-in | `olf infra forward` | `olf infra forward` | On AWS, every stage shares the account's Glue catalog, with stage-prefixed database names scoped by IAM. OpenLakeForge on AWS: Dagster on EKS orchestrates dlt, Floe and dbt-trino over per-stage S3 buckets registered in the Glue Data Catalog, with RDS PostgreSQL for service state, ECR for images, and Route 53, an ALB with ACM, oauth2-proxy and Dex for sign-in The AWS chart shows the target shape. Its access path (Route 53, an ALB with ACM, oauth2-proxy and Dex) is not built yet: today the AWS services are reached with `olf infra forward`. ## Further reading - [Kubernetes runtime charts](https://openlakeforge.dev/docs/architecture/diagrams/): every pod, the service wiring, the jobs of one pipeline run, the data path and the provider contracts. - [Architecture Decision Records](https://openlakeforge.dev/docs/adr/): the decisions behind this design, with their trade-offs. - [Maintainer architecture pages](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/README.md): provider contracts, Terraform roots and identity policy, for contributors. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/architecture/overview.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/architecture/overview.md). --- # Kubernetes runtime charts > Five charts of how OpenLakeForge runs on Kubernetes: every pod, how the services talk to each other, the short-lived jobs of a pipeline run, the medallion… Source: https://openlakeforge.dev/docs/architecture/diagrams/ Five charts of how OpenLakeForge runs on Kubernetes: every pod, how the services talk to each other, the short-lived jobs of a pipeline run, the medallion data path through the catalog, and the provider contracts that let the same platform run on kind, EKS and AKS. They use the official Kubernetes icon language and complement the [Architecture](https://openlakeforge.dev/docs/architecture/overview/) page, which shows *what* the platform does; these show *how* it runs. | **31** | **1+N** | **3** | **0** | | --- | --- | --- | --- | | pods at steady state — Full preset, DEV + PROD, identity on: 24 Deployments, 7 StatefulSets | nested ephemeral Kubernetes Jobs per ingestion run — one run pod, one Floe Job per domain | deployment targets sharing one contract — kind, AKS, EKS | run/Floe pods between runs (Gold runs in Trino) | ### Reading key — used identically in every chart | Signal | Means | | --- | --- | | Blue heptagon icon | Kubernetes workload — the badge names the kind (`deploy`, `sts`, `svc`, `secret`) | | **Purple icon / dashed purple border** | **On-demand Job or CronJob** — created by something other than a Deployment, and never counted in the 20 | | Green box | Long-lived service, grouped by Helm release | | Blue box / badge | Control plane — Terraform, contracts, `olf` | | Cylinder | Bucket or datastore; bronze / grey / amber follow the medallion layers | | Orange | Managed service (AWS adapters) | > Purple splits three ways by **what creates the Job**, which is also how chart 1 groups > them. *Per pipeline run*: Dagster's `K8sRunLauncher` creates the run pod, which creates > one Floe Job per domain — both TTL-collected within the hour, so the pipeline scales > to zero between runs. *Bootstrap*: for one full stage, four Terraform > `kubernetes_job_v1` resource blocks (Polaris's metastore, OpenMetadata's Fernet key, > PostgreSQL, SeaweedFS) plus two Helm hooks (Superset's init, cert-manager's startup > API check) — the SeaweedFS block uses `for_each` over four bucket names, so it alone > creates four Jobs, for nine Jobs total. Terraform's Jobs and Superset's hook run per platform > apply; cert-manager's hook is `post-install` only, so it runs on the first apply. The > Helm hooks are deleted on success and the rest persist until the next apply. > *Scheduled*: two `kubernetes_cron_job_v1` > resources on the cluster clock (log-archive every 15 min keeping 1 succeeded / 3 failed, > OM catalog refresh hourly keeping 3 / 3), plus OpenMetadata's ingestion pipelines, which > its own scheduler creates — not Terraform, and not Dagster. --- ## Chart 1 — Cluster Pod Census *Every pod across the deployment's namespaces, grouped by service — counted from this repo's Terraform modules and Helm values (`infra/terraform/environments/local/main.tf`, `infra/helm/values/local/`).* Thirty pods run at steady state for the Full preset with DEV and PROD and `spec.identity` set (the shape of `openlakeforge.conformance.yaml`). Per stage, Dagster runs three (webserver, daemon, and the merged `openlakeforge-dagster` code server loading `lakehouse_code.definitions`) and Superset runs three (node, worker and Redis); the Dagster and Superset modules are instantiated once per enabled stage and per stage with analytics (`for_each` in `infra/terraform/environments/local/main.tf`), so DEV and PROD give 6 + 6. Trino runs one coordinator per stage (`olf-`, #965), so DEV and PROD give 2; it is deliberately coordinator-only at the default `spec.query.size`, and each `small` coordinator requests 500m CPU and 2Gi (limit 4Gi, `release/query-sizes.yaml`), so the second one adds that much to the stack's requests. Shared, SeaweedFS runs four (three StatefulSets and an S3-gateway Deployment), OpenMetadata two, and PostgreSQL and Polaris one each. The ingress adds five single-replica Deployments in `olf-system`: Traefik, the cert-manager controller, cainjector, and webhook, and the portal, which serves the landing page at the base domain. With `spec.identity` the identity row adds four more: Dex, one oauth2-proxy per distinct role floor (two: `viewer` and `data-engineer`, from `release/identity-roles.yaml`) and the platform API, answering `/api` on the base domain. The icons show one stage's Dagster and Superset pods; a profile with fewer stages, no analytics or governance, or no ingress or identity runs fewer. The purple band underneath is everything that is *not* in that 30, split by what creates it. **Per pipeline run**: the run pod and its Floe Jobs, TTL-collected within the hour, so ingestion scales to zero between runs — Gold is the exception, running as SQL inside the long-lived Trino coordinator above rather than in a Job. **Bootstrap**: six grouped categories — Polaris (its metastore; `olf` bootstraps the catalogs and principals after the apply, with no Job), SeaweedFS (one Job per bucket, four buckets), PostgreSQL, OpenMetadata (its Fernet key; `olf` bootstraps OpenMetadata after the apply, with no Job), Superset's Helm hook, and cert-manager's startup API check hook — nine one-shot Jobs for one full stage, firing once per platform apply (phase 2), except cert-manager's check, which runs only on first install. **Scheduled**: the two CronJobs on the cluster clock (log archive every 15 minutes, OpenMetadata catalog refresh hourly). ![Cluster Pod Census](https://openlakeforge.dev/docs-assets/docs/architecture/diagrams/chart1-cluster-pod-census.svg) `infra/helm/values/local/*.yaml` · orchestration/dagster + storage/postgresql + governance/openmetadata + access/{traefik,cert-manager,portal} Terraform modules ## Chart 2 — Namespace Runtime Topology *What talks to what — the service DNS on the wires is what consumers actually read from the contracts.* Superset queries Trino; Trino resolves tables through Polaris and reads data over s3a; Polaris persists catalog state in PostgreSQL through JDBC, so a plain pod restart preserves catalog and table identity. Polaris points at the Iceberg warehouse files in SeaweedFS; Dagster, OpenMetadata, Superset, and Polaris share one PostgreSQL service. The per-run pair does the data work: the run pod lands raw data in object storage with **dlt**, launches a **Floe** Job per domain (which authenticates to Polaris and reads/writes SeaweedFS), then calls **Trino** through dbt-trino to build Gold. Both Floe and dbt-trino also push OpenLineage events straight to OpenMetadata's native endpoint — that lineage ingestion was restored, not deferred. ![Namespace Runtime Topology](https://openlakeforge.dev/docs-assets/docs/architecture/diagrams/chart2-namespace-topology.svg) [docs/architecture/local-stack-contracts.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/local-stack-contracts.md) · `infra/terraform/modules/**` ## Chart 3 — Ephemeral Job Lifecycle *Launch → run pod → one Floe Job per domain → Gold via Trino → everything garbage-collected.* The differentiating behavior: the Dagster run pod is itself an ephemeral Job, and it creates **one Floe Job per domain** on the same project-code image, which validates the domain's selected entities one after another — so `order_revenue`, whose six Silver inputs all belong to domain `sales`, runs one Floe Job per pipeline run. Silver memory is bounded by that Job, not the run pod; failures isolate per domain; TTL returns the per-run footprint to zero (Gold SQL executes in the standing Trino service, not a per-run pod). Ephemeral job lifecycle: the user launches a product job in Dagster; the daemon creates the run pod, which lands Bronze with dlt, creates one Floe Job per domain, which validates the domain's entities in sequence and commits Silver through the catalog, then runs dbt-trino so Trino builds Gold; every run and Floe pod is garbage-collected after the run > Observe it live: `kubectl -n olf-dev get jobs -w` — the run Job appears, then one > Floe Job per domain while it is still Running, then all of them vanish an hour later. Full detail — the per-engine execution table and the Job state machine — is in **[chart3-ephemeral-job-lifecycle.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/diagrams/chart3-ephemeral-job-lifecycle.md)**. ## Chart 4 — Medallion & Catalog Data Path *Bucket = lane, and the Iceberg catalog governs Silver and Gold — one product traced end to end.* Raw data lands in Bronze as-is via dlt (CSV in the seed products, any raw source); the domain's Floe Job validates it against the contract and commits Silver Iceberg tables through the catalog; dbt builds the Gold marts with the SQL executing **in Trino** (dbt-trino). The catalog — Polaris locally, AWS Glue on the AWS POC — spans both curated layers: per-product namespaces, allowed locations, and every write committed through it, never to raw paths. Rejected rows are quarantined as CSV; exit code 0 covers `success_or_rejected`. ![Medallion and Catalog Data Path](https://openlakeforge.dev/docs-assets/docs/architecture/diagrams/chart4-medallion-catalog.svg) environments/local/main.tf · catalog/polaris/main.tf · lakehouse_code/governance.yml · ADR 0003, 0004 ## Chart 5 — Provider Contracts *Engines consume interfaces, never implementations — swap the adapters, keep the engines.* The modularity chart. The engines across the top are byte-identical in every deployment. Provider-contract v3 supplies shared platform bindings plus a selected stage's endpoint, storage, catalog, and identity bindings. The matrix records the stable capability fields (`catalog_type`, buckets, Secret references) and the adapter selected in each target. Every root (local, AWS, Azure) emits this v3 shape, with one stage entry per enabled stage. Cell colour is the argument: grey means the module is the same one `local` uses, orange means it was swapped. **`azure-poc` instantiates the same seven platform modules as `local`** — SeaweedFS, Polaris, PostgreSQL, Trino, OpenMetadata, Superset, Dagster all reuse the identical modules — and `contracts.tf` pins that with a `check "azure_poc_keeps_s3_compatible_storage"` block. But the foundation root (AKS vs kind), artifact registry (ACR vs kind image load), and identity adapter (AKS OIDC-ready vs local dev credentials) do differ from the foundation's perspective; since the matrix groups artifacts and foundation together, two Azure cells appear orange. `aws-poc` swaps a different set: exactly three platform modules (`storage/aws-s3`, `catalog/aws-glue`, `storage/rds-postgresql`) and reuses Trino, OpenMetadata, Superset, Dagster. ![Provider Contracts](https://openlakeforge.dev/docs-assets/docs/architecture/diagrams/chart5-provider-contracts.svg) `infra/terraform/environments/{local,aws-poc,azure-poc}/contracts.tf` · [provider-contracts.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/provider-contracts.md) · ADR 0003, 0010 --- # Reference tables *Comparisons and inventories — content that reads better as tables than as boxes.* ## Provider portability | Contract | Local | Azure POC | AWS POC | | --- | --- | --- | --- | | Foundation | kind, 1 control-plane + 2 workers | AKS + ACR | VPC + EKS + node group + ECR | | Object storage | SeaweedFS in-cluster | SeaweedFS on AKS | **S3** | | Metadata database | PostgreSQL in-cluster | PostgreSQL in-cluster | **RDS PostgreSQL** | | Iceberg catalog | Polaris REST | Polaris REST | **AWS Glue** | | Container registry | kind image load | ACR | ECR | | Workload identity | Kubernetes service account | AKS OIDC readiness | **EKS Pod Identity** — no static keys | | Query + Gold engine | Trino | Trino | Trino | `catalog_type` is the one field consumers branch on: `rest` selects the Polaris runtime profile, `glue` the native Glue profile. Naming stays stable across Glue's two-level model, so SQL and dbt models are unchanged. Not implemented (declared future adapters): Vault/External Secrets, Athena, Lake Formation and remote Terraform state. Traefik, cert-manager and the Dex identity issuer run on the local profile only (ADR 0013, ADR 0014); AWS and Azure still use port-forward. OpenLineage is live, not deferred — Floe and dbt-trino emit lineage events directly to OpenMetadata's native `openlineage` endpoint. The governance bootstrap creates the endpoint credentials; runners receive them only through Secret references. [ADR 0007](https://openlakeforge.dev/docs/adr/0007-governance-and-lineage/) covers the full history: a normalising proxy first hid upstream correctness problems, lineage was then deferred while those were fixed, and native emission was restored once Floe and dbt-trino could target OpenMetadata's endpoint directly. The proxy and a custom REST push both remain rejected. ## Three phases, one CD boundary `olf infra deploy` runs three ordered phases: **foundation** (the cluster and registry), **platform** (Terraform-managed services), then **artifacts** (everything derived from `lakehouse_code/`). The CD boundary is not "foundation is outside, the rest is the deploy" — it is the static/dynamic split between platform and artifacts. A domain commit triggers the artifacts phase only; CI never runs Terraform for a domain change ([ADR 0002](https://openlakeforge.dev/docs/adr/0002-deployment-lifecycle/)). | Phase | Target | Deploys | | --- | --- | --- | | 1 — Foundation | `olf infra deploy --provider local --phase foundation` | Terraform: the Kubernetes cluster + container registry — kind locally, EKS + ECR on AWS, AKS + ACR on Azure | | 2 — Platform | `olf infra deploy --provider local --phase platform` | Terraform-managed platform resources: Helm releases for SeaweedFS, Polaris, Trino, OpenMetadata, Superset, Dagster — plus PostgreSQL, which Terraform creates directly as a StatefulSet + Service + bootstrap Job (no Helm release) | | 3 — Artifacts | `olf infra deploy --provider local --phase artifacts` | **the CD phase** — dynamic artifacts: catalog namespaces, the project-code image (Dagster definitions, Floe contracts, dbt code), Superset dashboards, OpenMetadata data products | Phases 1 and 2 are static infrastructure that Terraform owns; phase 3 is dynamic and code-derived. `olf infra deploy --provider local` with no `--phase` chains 1 → 2 → 3; phases 1 and 2 are idempotent no-ops when nothing changed. Phase 3, in order: build + push (or, with no repository of its own, build + load) `project-code` and publish its ProjectRevision → `deploy_revision`, which runs `olf infra catalog sync-namespaces` → `olf infra report import` (analytics layer on) → `olf infra openmetadata deploy-metadata` (governance layer on) → the Dagster rollout of the `openlakeforge-project` release, which carries the run launcher's image, every code location, and the log-archive CronJob. The Floe contracts ship inside the project-code image; nothing Floe-specific is compiled or uploaded. CI validates structure, infrastructure, contracts, project-code, tooling, dbt, and release readiness; pull requests also run the bounded slim kind smoke. ## Identity — one principal per engine | Principal | Secret | Roles | | --- | --- | --- | | olf-\-processing (dbt through Trino, and Floe) | `polaris--processing-creds` | processing-\ / catalog-processing | | trino-catalog-\ (the stage Trino's catalogs) | `polaris--trino-catalog-creds` | none: each query carries its caller's token | | openmetadata | `polaris-om-creds` | data-reader / catalog-reader | | (root) | `polaris-bootstrap-credentials` | the metastore Job and `olf`'s bootstrap only | dbt has **no** Polaris principal — the bootstrap deletes the old `polaris-dbt-creds`; Gold SQL runs in Trino, so Gold catalog access uses the processing credential. Plus `seaweedfs-s3-creds` for object storage. A leaked writer credential cannot administer the catalog. Delivery is Terraform → Kubernetes Secret → `envSecrets`/`envFrom` into long-lived pods *and* ephemeral Jobs; the Trino catalog file holds `${ENV:...}` placeholders, never literal secrets. The AWS POC replaces static storage keys entirely with EKS Pod Identity ([ADR 0010](https://openlakeforge.dev/docs/adr/0010-cloud-provider-implementations/)). ## Observability — object storage is the sink No Loki/Grafana/Prometheus in v1 (`observability.object_log_archive`). Ephemeral pods are deleted on TTL; their evidence is not: ```text s3://openlakeforge-ops/ ├── project/revisions/sha256/{digest}/ ← olf infra project build └── activations/{stage}/ ├── floe/reports/{domain}/run_{id}/ ← the domain's Floe Job ├── logs/dagster/compute/ ← S3ComputeLogManager ├── logs/k8s/namespace={ns}/date={YYYY-MM-DD}/hour={HH}/ ← log-archive CronJob └── run-artifacts/dbt/{domain}/{product}/{dagster_run_id}/ ← run pod, post-dbt-build ``` The dbt run-artifacts are keyed by Dagster run ID (`run-artifacts/dbt/{domain}/ {product}/{dagster_run_id}/`) and each Floe Job writes its reports under its own `floe/reports/{domain}/run_{id}/` (the project's `report.path` beneath the stage's artifact prefix, `openlakeforge_runtime/floe_profile.py`), so both stay isolable per run after the pods are gone. The archived Kubernetes pod logs are partitioned only by namespace / date / hour (`openlakeforge_runtime/k8s_log_archive.py`), so isolating a single run from raw pod logs needs a timestamp, not just a prefix. ## Medallion-oriented code structure — the dynamic code Everything in Phase ③ is **user code under `lakehouse_code/`**, and nothing about the platform changes when a source, domain, or product is added. This is the "dynamic" half of the platform (the artifacts phase); the charts above are the static half. Unlike the earlier layout, ownership is no longer domain-vertical: Bronze is source-owned, Silver is domain-owned, Gold is product-owned, dashboards are consumption-owned, and each concern still maps to exactly one engine: ```text lakehouse_code/ ├── governance.yml ← governance: domain · data-product metadata → OpenMetadata ├── definitions.py ← pipeline entry: the Dagster Definitions the code server loads ├── bronze// ← source-owned │ ├── source.yaml resource inventory │ └── dlt/.py ← extract: raw source → Bronze → dlt ├── silver/ ← the Floe project: floe.yml · sources.yml │ └── / ← domain-owned │ ├── domain.yml ← contract: domain defaults · sinks · reject policy → Floe │ └── contracts/.yml one per entity: schema · PK ├── gold/ ← the Gold dbt project: dbt_project.yml · packages.yml · macros/ │ └── models/ │ ├── _sources/.yml each domain's Silver, declared once │ └── / ← product-owned: *.sql · schema.yml Silver→Gold SQL → dbt-trino → Trino ├── pipelines/dagster/.py ← pipeline: asset graph wiring bronze→floe→dbt → Dagster ├── dashboards/superset// ← consumption-owned │ └── metadata.yaml charts · dashboards · datasets · databases → Superset └── bronze//examples/*.csv seed data for the local demo ``` Two products can share one source-owned Bronze asset and one domain-owned Silver asset without duplicating ingestion: `sales` (`order_revenue`, `customer_health`) uses one `crm/accounts` asset and one `sales/accounts` asset, while `supply_chain` (`inventory_reliability`) consumes `erp`. Adding a data product changes only its bronze, silver, gold, dashboard, and pipeline slices, then runs the artifact phase. `olf infra catalog sync-namespaces` derives the Silver and Gold namespaces from `governance.yml` (a domain owns `_silver`, a product `_gold`; Bronze has no namespace, only files in the Bronze bucket) and reconciles them before Floe, dbt, or OpenMetadata use them. A new product, domain, or source therefore needs no environment Terraform edit or platform apply; see ADR 0002 and ADR 0004. `lakehouse_code/governance.yml` is the canonical, human- and machine-readable descriptor of every domain and product. --- **About these charts.** Charts 1, 2, 4, 5 are self-contained SVGs (official CNCF Kubernetes icons embedded, no external references) generated by the Python sources in [src/](https://github.com/OpenLakeForge/openlakeforge/tree/v0.6.0-alpha.3/docs/architecture/diagrams/src/) — regenerate with `python3 docs/architecture/diagrams/src/spec_chartN.py`. Chart 3 is the Mermaid sequence diagram in [chart3-ephemeral-job-lifecycle.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/diagrams/chart3-ephemeral-job-lifecycle.md), rendered to the light and dark SVGs in `docs/assets/` with `@mermaid-js/mermaid-cli` 11.4.2; the dark copy swaps the three box tints for dark ones. Every count and identifier is traceable to a cited source file; nothing aspirational is drawn as existing. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/architecture/diagrams.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/architecture/diagrams.md). --- # Identity classes > Every authentication path on the platform belongs to exactly one of three identity classes, and the class names the mechanism that governs it. A workload… Source: https://openlakeforge.dev/docs/architecture/identity/identity-classes/ Every authentication path on the platform belongs to exactly one of three identity classes, and the class names the mechanism that governs it. A workload can use several paths: a run pod is class 2 to Trino and class 3 to S3. This page is the contract documentation for those classes (#178); the path-by-path inventory is in [identity-callers.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-callers.md). | Class | Who | Governed by | Never | | --- | --- | --- | --- | | 1. Human | A person reaching a service UI through the issuer: a GitHub account, or a user of an external OIDC issuer | Canonical roles from the GitHub team mapping, or from the external issuer's claim mapping (`role_claim`, `role_mapping`), enforced at the perimeter ([ADR 0014](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/), [ADR 0018](https://openlakeforge.dev/docs/adr/0018-github-is-the-forge/)) | Used by a deploy, a pipeline or any other automated path (the e2e perimeter test below is the one exception) | | 2. In-cluster workload and automation | A pod calling another component, or `olf infra` commands and CI calling the cluster | A service credential from a Kubernetes Secret, or Kubernetes RBAC | A human account; routed through the perimeter; a member of a canonical role | | 3. Cloud workload | A pod calling a cloud API (object storage, catalog, secrets) | Cloud IAM through EKS Pod Identity or Azure workload identity | A canonical role | ## The classification rule The class belongs to the operation, not to the `olf` executable. A caller that reaches a service **through the issuer** is class 1. A caller that authenticates with a service credential or with Kubernetes RBAC is class 2, whether it runs in a pod or on a workstation, and even when a person started it. A command that needs neither has no identity. For `olf` that gives three surfaces ([ADR 0020](https://openlakeforge.dev/docs/adr/0020-infrastructure-common-and-platform-cli-surfaces/)): | Surface | Commands | Class | | --- | --- | --- | | Infra | Everything under `olf infra` (`deploy`, `plan`, `query`, `project deploy`, ...), and CI running them | 2, with Kubernetes RBAC or cloud IAM as the identity | | Common | `olf init`, `check`, `profile`, `project validate` and the other commands that need no permissions | None | | Platform | `olf login`, `whoami`, `logout` and `query` through a Dex session; `domain list` planned | 1 | The four canonical roles apply to class 1 only. A role never grants a pod anything, and a service credential never signs a person in. ## Class 1: human | Item | Detail | | --- | --- | | Identity | A GitHub account, brokered by Dex into an OIDC token; or, with `issuer: external`, a user of that issuer | | Authorization | The highest canonical role among the person's mapped teams, or among the roles the external issuer's claim maps to ([Roles and permissions](https://openlakeforge.dev/docs/reference/roles-and-permissions/)) | | Automated test of the perimeter | `olf e2e` signs in through Dex as stub users, one per mapped role, against a stub GitHub it runs in `olf-system`. These users exist for the run, hold canonical roles, and are never used by a deploy or a pipeline: the one place a class 1 path is driven by automation, so that the perimeter's redirects, role refusals and logout are tested through the public hostnames | | Enforcement | The perimeter (oauth2-proxy behind Traefik forwardAuth) refuses a route the role does not hold; with GitHub sign-in, Superset also maps the role to its native roles, and OpenMetadata gets its native roles only from the GitHub role sync. With `issuer: external`, Superset and OpenMetadata get no OIDC configuration: users pass the perimeter and then need each service's own login | | Lifetime | Perimeter cookie 30 min idle, 10 h absolute; access token 5 min; with Dex, a revocation reaches the perimeter within about 5 min. With an external issuer, a removed role can last up to the issuer's 10 h SSO lifetime when its refresh responses carry no ID token with the role claim ([identity-sessions-and-recovery.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-sessions-and-recovery.md)) | | Operations | [Add, change or remove a member](https://openlakeforge.dev/docs/guides/identity/manage-members/) | | Command line | The `olf-cli` public OIDC client (no secret): the perimeter accepts its bearer tokens and applies the same role floor as for a session. `olf query` uses it: the perimeter checks the token, Trino has no authentication of its own and passes the token on, and Polaris grants the role's `data_access` row ([ADR 0016](https://openlakeforge.dev/docs/adr/0016-trino-workload-authentication/), [ADR 0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/) section 9). `olf infra query` stays class 2 | ## Class 2: in-cluster workload and automation | Item | Detail | | --- | --- | | Identity | A ServiceAccount or kubeconfig user, or a service credential created in the cluster | | Examples | `olf infra deploy`, `olf infra e2e` and CI (RBAC, port-forward or in-cluster exec); Superset, dbt and OpenMetadata ingestion to Trino; Trino and Floe to Polaris; pods to PostgreSQL and object storage | | Authorization | Kubernetes RBAC for operators and CI. For pods, a per-service credential from a Secret that a bootstrap Job generates once and reuses | | Network | Reachability between pods is decided by default-deny NetworkPolicy ([identity-network-policy-and-rbac.md](https://openlakeforge.dev/docs/architecture/identity/identity-network-policy-and-rbac/)) | | Trino | No authentication of its own: every caller sends its own Polaris token, and Polaris decides what each query reads ([ADR 0016](https://openlakeforge.dev/docs/adr/0016-trino-workload-authentication/), [ADR 0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/) section 9) | | Rotation | `olf infra secrets rotate` for `dex-client-perimeter` and `github-app`; the Superset and OpenMetadata clients are rotated by hand ([Rotate secrets](https://openlakeforge.dev/docs/guides/identity/rotate-secrets/)); other credentials as the inventory states ([identity-credentials.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-credentials.md)) | Workstation and CI automation reaches services by an RBAC-authorized `kubectl port-forward` or by in-cluster execution for routes protected by the perimeter, never through those public hostnames and never as a human or administrator account. With `spec.access` but no perimeter, `olf` uses the ingress hostname (`access.service_url()`). Who may automate is who holds `pods/portforward` and the Secret reads in RBAC. Known limitation: a service credential is shared by every user of the component it fronts, so it cannot tell two people apart. Data access is not decided by one: Superset sends each signed-in viewer's own token to Trino, a query that carries no token is refused, and Polaris grants what that person's role reads ([ADR 0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/) section 9). ## Class 3: cloud workload | Item | Detail | | --- | --- | | Identity | The cloud's workload identity of a pod | | Mechanism | `identity.aws_pod_identity` on AWS, `identity.azure_workload_identity_ready` on Azure, both fields of the provider contract | | Authorization | Cloud IAM policy on that identity | | Status, AWS | Implemented: IAM roles with EKS Pod Identity | | Status, Azure | OIDC readiness only (`identity.azure_workload_identity_ready`) | | Scope | Exercising cloud credentials is outside the v0.5 scope | OpenLakeForge roles are never cloud IAM permissions, and a cloud identity never holds a canonical role. ## Break-glass When the issuer is down, a cluster administrator is a class 2 caller: their kubeconfig, not the issuer, is the authority. `olf infra break-glass` uses that to reach a service for a bounded time and records the use ([Break-glass access](https://openlakeforge.dev/docs/guides/identity/break-glass/)). It does not turn the perimeter off. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/architecture/identity/identity-classes.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/architecture/identity/identity-classes.md). --- # Network policy and RBAC > How the local stack limits which pods can reach which services and what each ServiceAccount may do in the Kubernetes API. This is the control that keeps… Source: https://openlakeforge.dev/docs/architecture/identity/identity-network-policy-and-rbac/ How the local stack limits which pods can reach which services and what each ServiceAccount may do in the Kubernetes API. This is the control that keeps class 2 paths from being used by anyone else (#46, #178). The design and every flow are in [ADR 0017](https://openlakeforge.dev/docs/adr/0017-local-network-policy-and-rbac/); the flows as data are in `release/network-flows.yaml`. Scope: the local provider. AWS and Azure enforcement is outside it. ## The model | Rule | Detail | | --- | --- | | Default deny | Ingress and egress are denied in every stage namespace (`olf-`). In `olf-system` only the workloads listed under `workloads` in the flow file (`var.workloads` of the policy module) are selected; the rest of `olf-system` stays unisolated. DNS is allowed. | | One flow, one row | Every other flow is a row of `release/network-flows.yaml`, read by the policy module (`modules/security/network-policy`) and by `olf e2e`. `olf check flows` validates the file. For a pod that a policy selects, a flow that is not listed is denied. | | Both sides | When both pods are selected by a policy, a flow needs a row on both sides: egress on the source, ingress on the destination. A side that no policy selects (such as an `olf-system` pod outside `workloads`) is not restricted on that side. | | Stage namespace = one trust domain | Inside a stage namespace pods talk freely, because run pods and Floe Jobs are created with labels that user code controls. Between namespaces, and between `olf-system` workloads, every flow is an allow row. | | Exceptions | `kube-system` is not a policy target: a default-deny there could take down DNS, kube-proxy or the CNI. | Examples of what the rows deny: one stage reaching another stage's Dagster or Superset, a stage namespace reaching Dex, PostgreSQL from outside its listed sources, and any pod reaching Dagster except Traefik and the stage's own namespace. ## Enforcement is checked, not assumed `olf infra deploy --provider local` runs a canary after the foundation. It proves a client and server pair connect with no policy, then requires an ingress-only and an egress-only deny to block it. Last, an ingress deny must block, adding a rule that allows the client must let it connect, and removing that rule must block it again. The deploy fails if the cluster does not enforce NetworkPolicy or does not admit what an allow rule permits. The canary runs in the deploy only. `olf e2e` runs `check_network_and_rbac` (flow probes and service-account RBAC checks) in the full suite, after the catalog, pipeline, restart-recovery and certificate checks. The local kind cluster's default CNI (kindnet) passed on the pinned kind version, so no other CNI is installed. ## Dex and GitHub egress Dex calls `github.com` and `api.github.com` at every sign-in and refresh, and the role-sync CronJob calls the GitHub API every 5 minutes. NetworkPolicy has no hostname selector, so the rules allow port 443 to any address outside the pod and Service ranges, on those pods only. | Flow | From | To | Port | | --- | --- | --- | --- | | F28 | Dex pods | Any address outside the cluster's pod and Service ranges | 443 | | F30 | The `openmetadata-role-sync` CronJob | Any address outside the cluster's pod and Service ranges | 443 | | F29 | Dex pods | The stub GitHub pod of the identity e2e (label `openlakeforge.io/e2e=github-stub`) | 8443 | | F23 | oauth2-proxy | An `issuer: external` host | 443 | F29 exists only so `olf e2e` can sign in against a stub instead of real GitHub; F28 excludes the pod and Service ranges, so the stub needs its own row. F23 is rendered from the profile when `issuer: external` is set. The cluster-side behaviour of F23, F28, F29 and F30 is marked as to-verify in the flow file. With `spec.identity.github.host` set to a GitHub Enterprise Server, Dex and the role sync reach that host over the same port-443 rule. ## Source egress from run pods A Bronze source that reads an external API or database runs in the Dagster run pod of its product job. Run pods get no egress outside the cluster unless the stage's Deployment Profile declares the ports its sources need: ```yaml spec: stages: dev: source_egress: ports: [443, 5432] ``` | Flow | From | To | Port | | --- | --- | --- | --- | | F34 | Run pods (`app.kubernetes.io/component=run_worker`) of that stage | Any address outside the cluster's pod and Service ranges | The declared ports, TCP | The rule is its own policy, `olf-flows-f34`, in that stage's namespace only; the other pods of the namespace and the other stages get nothing. Because stage pods carry labels user code controls, the label narrows the grant without isolating it (ADR 0017, decision 4). The cluster-side behaviour of F34 is marked as to-verify. ## RBAC The kind kubeconfig is cluster-admin, and the operator and CI are trusted. Inside the cluster the Roles are narrowed where the platform owns them and the rest are recorded as named exceptions: | Exception | Subject | Why it stays | | --- | --- | --- | | E1 | Bootstrap Jobs (Dex credentials, perimeter cookie, local CA, Polaris, OpenMetadata) | `create` on Secrets or ConfigMaps cannot be limited by `resourceNames`; `get`, `update`, `patch` and `delete` on Secrets are pinned to named objects. The local CA publisher is the exception for ConfigMaps: it holds `get`, `patch` and `update` on all ConfigMaps in each trust namespace, and only its Secret read is pinned | | E2 | OpenMetadata server and ingestion (chart Role) | Pod, Job and Secret verbs in `olf-system`, which its UI pipeline client needs; the widest grant | | E3 | Dagster run launcher, per stage | Creates run Jobs and pods; no Secret verbs, but a stage's user code already holds the stage's Secrets | | E4 | Traefik | Reads TLS Secrets in all namespaces | | E5 | cert-manager | Issues certificates, with Secret verbs cluster-wide | The `default` ServiceAccount of every namespace has no Role. `olf e2e` asserts the denials with `kubectl auth can-i` as each ServiceAccount, and lists every Role bound in the OpenLakeForge namespaces that grants a Secret verb or pod creation, failing on any not named above. No break-glass Role exists in the repository: `olf infra break-glass` uses the operator's own kubeconfig ([identity-sessions-and-recovery.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-sessions-and-recovery.md)). ## Limits - Anything running in a stage namespace can reach everything that namespace may reach. - Any pod allowed to reach Traefik can request the Dex route, `auth.`, because the network cannot name a path. Flow F4 lets every pod in a stage namespace reach Traefik, so stage pods, run pods included, can reach it. - `kubectl port-forward`, `exec` and `logs` are RBAC paths, not network paths, and policy does not apply to them. A cluster administrator stays trusted. - Resource limits, Pod Security Standards, hostname-based egress filtering, service meshes and AWS or Azure enforcement are not covered. Callers and credentials these rules protect: [identity-callers.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-callers.md), [identity-classes.md](https://openlakeforge.dev/docs/architecture/identity/identity-classes/). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/architecture/identity/identity-network-policy-and-rbac.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/architecture/identity/identity-network-policy-and-rbac.md). --- # Architecture Decision Records > These twenty-one records describe the decisions that shape OpenLakeForge today. Each is binding: if the code disagrees with one, either the code is wrong or… Source: https://openlakeforge.dev/docs/adr/ These twenty-one records describe the decisions that shape OpenLakeForge **today**. Each is binding: if the code disagrees with one, either the code is wrong or the ADR is, and one of them gets fixed. An ADR is rewritten in place when its decision changes, with a History footer recording what it absorbed. The log is not an append-only archive — a superseded decision is interesting until it stops explaining anything about the current system, and then it lives in `git log` rather than here. ## Start here `0001` for what the platform is made of, `0002` for how it deploys, `0004` for how user code is laid out, and `0008` for why `olf` is the only interface. | ADR | Decision | | --- | --- | | [0001](https://openlakeforge.dev/docs/adr/0001-platform-baseline-and-component-stack/) | **Platform baseline and component stack** — Kubernetes-native, batch-first, Iceberg; dlt → Floe → dbt-trino → Trino, with Dagster orchestrating and OpenMetadata/Superset optional | | [0002](https://openlakeforge.dev/docs/adr/0002-deployment-lifecycle/) | **Deployment lifecycle** — three ordered phases (foundation, platform, artifacts) in two lifecycle categories (static infrastructure vs. code-derived artifacts); the static/dynamic split is the CD boundary | | [0003](https://openlakeforge.dev/docs/adr/0003-provider-contracts/) | **Provider contracts are the portability boundary** — typed Terraform contracts per capability; components consume contracts, never providers; consumers branch on `catalog_type` | | [0004](https://openlakeforge.dev/docs/adr/0004-medallion-layout-and-catalog-namespaces/) | **Medallion layout, ownership, and catalog namespaces** — `lakehouse_code/` replaces `domains/`; Bronze is source-owned, Silver domain-owned, Gold product-owned; per-layer buckets and flat namespaces | | [0005](https://openlakeforge.dev/docs/adr/0005-descriptor-model/) | **The descriptor model** — `governance.yml` (domains and products) + `source.yaml`, one shared `openlakeforge-core` implementation; tables belong to a domain or product by schema | | [0006](https://openlakeforge.dev/docs/adr/0006-dagster-runtime-and-code-locations/) | **Dagster runtime and code locations** — one `project-code` image, one merged code location by default, Kubernetes run launcher, Floe as one Kubernetes Job per domain on the same image | | [0007](https://openlakeforge.dev/docs/adr/0007-governance-and-lineage/) | **Governance and lineage** — OpenMetadata with native OpenLineage emitted by the engine that performed the write; the proxy and custom REST push stay rejected | | [0008](https://openlakeforge.dev/docs/adr/0008-olf-owns-orchestration-and-toolchain/) | **`olf` owns orchestration and its managed toolchain** — no tracked shell, `olf` provisions its own Terraform/Helm/kubectl/kind, cloud auth through SDKs | | [0009](https://openlakeforge.dev/docs/adr/0009-distribution/) | **Distribution** — a PyPI package carrying a verified platform payload; installed project root is the current directory; `olf init` | | [0010](https://openlakeforge.dev/docs/adr/0010-cloud-provider-implementations/) | **Cloud provider implementations** — AWS replaces contract implementations (S3, RDS, Glue, Pod Identity), Azure relocates hosting (AKS/ACR); both POC maturity | | [0011](https://openlakeforge.dev/docs/adr/0011-deployment-profile-and-stages/) | **Deployment Profile v1beta1** — provider, stage, and preset are separate typed concepts; `openlakeforge.yaml` resolves to one effective `DeploymentTopology` before any Terraform, Helm, or Kubernetes object exists | | [0012](https://openlakeforge.dev/docs/adr/0012-project-revisions-and-promotion/) | **Project revisions** — a build-once, content-addressed `ProjectRevision` covering descriptors, Floe contracts, dbt, Dagster, reports, and the project-code image digest; excludes deployment intent and every stage-rendered artifact | | [0013](https://openlakeforge.dev/docs/adr/0013-service-access-and-ingress/) | **Service access** — one ingress everywhere, configured by `access.base_domain` + `access.tls`; stage-derived HTTPS routes in `shared.access`; internal endpoints cannot be user-facing; port-forward only as a dev fallback | | [0014](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/) | **Identity and authorization** — three seams (role model, issuer, perimeter), each with its own adapter; canonical roles are the only vocabulary and provider mappings are keyed by them; GitHub teams through Dex are the deployed issuer, with `external` for any other OIDC issuer; user administration is GitHub's; OpenLakeForge roles are never cloud IAM | | [0015](https://openlakeforge.dev/docs/adr/0015-polaris-identity-provider-evaluation/) | **Polaris identity-provider evaluation** — Polaris 1.4.0 can validate issuer tokens but still owns principals and grants; deferred, with the catalog-side findings for the data-plane assessment (#179) | | [0016](https://openlakeforge.dev/docs/adr/0016-trino-workload-authentication/) | **Trino workload authentication — none** — Trino has no authentication, no access rules and no HTTPS listener on the local root; every caller sends its own token and Polaris decides (ADR 0019 section 9, #983); the Web UI signs in as a fixed user behind the perimeter; AWS keeps claim-based rules for Glue until it moves to Polaris (#681) | | [0017](https://openlakeforge.dev/docs/adr/0017-local-network-policy-and-rbac/) | **Local NetworkPolicy and RBAC** — default-deny ingress and egress for `olf-system` and stage namespaces with a derived flow table, an enforcing-dataplane gate and canary, the RBAC inventory with its exceptions, and the conformance plan; built for the local root (canary, flow table, policies, RBAC), with the cluster-side behaviour of the access-plane rows still unproven; kindnet stays the CNI | | [0018](https://openlakeforge.dev/docs/adr/0018-github-is-the-forge/) | **GitHub is the forge** — source, CI, release and project images on GitHub today; client CD in GitHub Actions and people and roles from GitHub organisation teams through Dex are decided; `olf users` removed | | [0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/) | **Data-plane authorization — Dex identity, Polaris grants** — built for local (#674): `olf query` runs a person's SQL with their Dex sign-in, and their canonical role reaches Polaris, whose per-stage catalog grants decide read and write by layer (`analyst` Gold, `viewer` UAT and PROD Gold, `data-engineer` DEV write, UAT and PROD read); engine-agnostic: no engine carries roles, and Polaris vends the storage credentials a person's query reads with, so DuckDB can follow Trino; AWS to follow on Polaris instead of Glue (#681); Superset stays on the shared principal (V/T marked, #367); section 9 (#960, decided, not built) extends Polaris to every caller: one Trino per stage, per-stage processing principals, a keyless engine, Superset per user, OpenMetadata governing its own users | | [0020](https://openlakeforge.dev/docs/adr/0020-infrastructure-common-and-platform-cli-surfaces/) | **Infrastructure, common and platform CLI surfaces** — a command's surface follows the credential it needs: `olf infra` for cluster and cloud permissions, top-level for no permissions, and a Dex-session platform surface (`login`, `query`, and reads through the platform API); old paths stay as hidden aliases; non-interactive platform authentication is short-lived, scoped and never a human token | | [0021](https://openlakeforge.dev/docs/adr/0021-platform-api/) | **The platform API** — decided, build step 1 done (every service client and operation is in `packages/lakehouse-services`) and build steps 3 and 4 begun (`packages/platform-api` serves Dagster jobs and runs and OpenMetadata domains and data products, which `olf jobs`, `runs`, `domain list` and `product list` read): one Python backend in this repository serves the portal, `olf`'s platform commands and agents; a call carries the person's token wherever the service authorizes it (Trino through Polaris grants, OpenMetadata by its own roles), directly from the CLI or forwarded unchanged by the API; only calls to services that cannot take it (Superset, Dagster, the object store) use the API's narrowest service credentials, and for those the API validates tokens and enforces a tested role matrix; service operations move to a shared library both `olf infra` and the API call, and the artifacts phase keeps calling it directly | ## Related - [`../technical-debt.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/technical-debt.md) — known weaknesses, mitigations, and the fix path for each - [`../architecture/README.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/README.md) — how the platform works, as opposed to why it was decided --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/README.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/README.md). --- # ADR 0001: Platform baseline and component stack > Binding. Source: https://openlakeforge.dev/docs/adr/0001-platform-baseline-and-component-stack/ ## Status Binding. ## Context OpenLakeForge is a self-hosted lakehouse platform for small data teams. It has to prove a complete ingestion-to-analytics path while staying open-source, portable across local and cloud Kubernetes, and small enough that a team without a platform engineer can run it. That target audience constrains component choice more than a generic "enterprise distribution" framing would: every always-on service is runtime footprint a small team pays for, and every component is one more thing they have to understand when it breaks. ## Decision ### Baseline - **Kubernetes-native** from the beginning, deployed with Terraform and Helm. - **Cloud-agnostic** across local, on-prem, and cloud Kubernetes. Portability is expressed through provider contracts (ADR 0003), not through per-provider forks. - **Batch-first.** Streaming is out of scope before `v1.0`. - **Apache Iceberg** is the table format. Storage stays independent of the engines operating on it. ### Component stack | Capability | Component | Notes | | --- | --- | --- | | Extraction | dlt | Writes Bronze from source systems | | Validation & Silver materialization | Floe | Owns Bronze→Silver; runs as one Kubernetes Job per domain on the project-code image | | Table format | Apache Iceberg | — | | Gold transformation | dbt-trino | Executes through Trino; see below | | Query engine | Trino | Both the Gold compute engine and the analytics query path | | Orchestration | Dagster | See ADR 0006 | | Catalog | Apache Polaris (local, Azure) / AWS Glue (AWS) | ADR 0003, ADR 0010 | | Object storage | SeaweedFS (local) / AWS S3 (AWS) | Per-layer buckets, ADR 0004 | | Metadata database | In-cluster PostgreSQL / AWS RDS | Dagster, OpenMetadata, Superset, Polaris | | Governance | OpenMetadata *(optional)* | ADR 0007 | | Dashboards | Superset *(optional)* | — | The data path is: ```text CSV / source -> dlt -> Bronze -> Floe -> Silver Iceberg -> dbt-trino -> Gold Iceberg -> Trino -> Superset ``` ### Trino is the Gold compute engine Gold dbt models run through Trino's Iceberg connector with `table` materialization and `on_table_exists: replace`, producing Iceberg `CREATE OR REPLACE TABLE` commits. A failed replacement preserves the previous snapshot. This replaced an earlier dbt-duckdb implementation, which needed a custom Iceberg materialization, a Glue UDF/plugin, and dbt-held catalog credentials, and whose Gold replacement was non-atomic. Routing Gold through the Trino service that already exists removes all four. Trino exposes the provider catalog name (normally `lakehouse_dev`) as a second catalog alias sharing the `iceberg` connector configuration. dbt uses that canonical alias for execution and for its manifest database, so lineage events carry names that resolve to real catalog entities. Consequence: Trino is sized for transformation load, not only for interactive queries. ### Local object storage is SeaweedFS The first implementation used Garage. Polaris writes through AWS SDK v2 failed against it until optional S3 checksum behaviour was disabled with a JVM system property, the chart had to be maintained in-repo, and the failure surfaced in Trino as a catalog error even though the cause was S3 compatibility — an actively misleading first-run experience for a contributor. SeaweedFS is used instead: mature upstream Helm chart, no S3-compatibility workarounds. Garage is not a bad project; it is not the right default while the platform is trying to be reproducible for newcomers. ### Superset needs a custom image The upstream Superset chart ships no Trino or PostgreSQL driver. The platform builds an image extending `apache/superset` with `trino` and `psycopg2-binary`, plus a patch for Trino Iceberg partition discovery. Installing drivers at runtime instead would make startup depend on a package index. Superset connects to Trino read-only (`allow_dml: false`) and holds no copy of the data. It uses the shared PostgreSQL for metadata and a chart-managed Redis for cache and workers. ### Deferred Vault or External Secrets is a production requirement the platform does not yet meet; Traefik, cert-manager and the identity issuer (Dex, ADR 0014) are built for the local profile only. Local and POC deployments use development credentials, Kubernetes Secrets, and `kubectl port-forward`. These are named here so their absence reads as a known gap rather than an oversight; the roadmap schedules them for the secure beta profile. ## Consequences Slim and Full are the two supported footprints from one codebase. Slim is the core path above; Full adds OpenMetadata and Superset. The optional layers change nothing about ingestion-to-Gold, and e2e assertions for a disabled layer are skipped rather than failed. Every component version and chart digest is pinned in `release/component-catalog.yaml` and verified before Terraform applies it. ## History Merges the decisions previously recorded as ADR 0001 (v1 platform baseline), 0002 (SeaweedFS), 0007 (Superset over Trino), and 0018 (Trino Gold materialization, which superseded ADR 0005's dbt-duckdb Gold). 2026-10-28: Floe moved into the project-code image (`floe-python` 0.8, `dagster-floe`) and runs as one Kubernetes Job per domain on that image; the separate Floe runner image is removed (#533). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0001-platform-baseline-and-component-stack.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0001-platform-baseline-and-component-stack.md). --- # ADR 0002: Deployment lifecycle — foundation, platform, artifacts > Binding. Source: https://openlakeforge.dev/docs/adr/0002-deployment-lifecycle/ ## Status Binding. ## Context Deployment has to answer two different questions at once, and conflating them has been a recurring source of confusion: - **What runs, in what order?** Creating a cluster, applying Terraform services, and deploying code are genuinely three different operations with different inputs and different failure modes. - **What is safe to re-run in CI on a code commit?** Terraform-managed infrastructure and code-derived artifacts have different lifetimes. A change to a dbt model must not put a Terraform apply in the CI path. Earlier records answered these separately and left the count ambiguous — one ADR described a "two-phase deploy", later ones described foundation/platform/ artifacts sequencing, and a reader had no way to tell whether that was two steps or three. It is three phases, in two lifecycle categories. Those are different axes. ## Decision ### Three ordered phases `olf infra platform apply -f openlakeforge.yaml` runs the static prefix in order. The deprecated `olf infra deploy --provider P` retains the old single-DEV path. | Phase | Creates | Engine | | --- | --- | --- | | `foundation` | Kubernetes cluster and container registry — kind locally, EKS + ECR on AWS, AKS + ACR on Azure | Terraform | | `platform` | Kubernetes namespaces plus the long-lived platform services: SeaweedFS, PostgreSQL, Polaris, Trino, Dagster, and (analytics/governance enabled) Superset and OpenMetadata | Terraform + Helm, then `olf` bootstraps Polaris and OpenMetadata | | `artifacts` | Deprecated single-DEV compatibility path derived from `lakehouse_code/` | `olf` | `DeploymentPhase` (`tools/olf/olf/infra/deployment/engine.py`) also carries a `prefetch` value that runs between `foundation` and `platform`. It is a local kind image warm-up — it pulls the large runtime images and loads them into the kind nodes so the Helm releases do not each wait on a cold pull. On cloud providers it is a deliberate no-op (`deployment/cloud/provider.py`). It is an optimization inside the foundation→platform transition, not a fourth phase, and is named here only so a reader counting `DeploymentPhase` members is not misled. Once the apply finishes, the platform phase runs the Polaris bootstrap (`olf/infra/polaris_bootstrap.py`) and then the OpenMetadata bootstrap (`olf infra openmetadata bootstrap`) from the operator's side, as `olf infra catalog sync-namespaces` runs in artifacts: `deployment/governance.py`, called by the engine after `platform_up`. Its inputs come from the applied provider contract alone, so it reads no user code. The Polaris bootstrap creates each stage catalog, the workload principals with their credential Secrets and grants, and people's roles (ADR 0019), as root through a port-forward. The OpenMetadata bootstrap runs before artifacts because `deploy-metadata` logs in with the credentials it creates. It then copies the ingestion-bot Secret into each governed stage's namespace, where Dagster mounts it, and deletes it from the enabled stages that are not governed. On a fresh install those Dagster pods wait in `CreateContainerConfigError` until then; the Dagster release does not wait for its pods (`wait = false`), so the apply is not held up by them. ### The platform phase owns namespaces, and which services repeat The resolved `DeploymentTopology` (ADR 0011) is a typed input to the platform root, which derives every namespace from it: one shared `olf-system` holding the services a deployment runs once -- PostgreSQL, SeaweedFS, Polaris, Trino, OpenMetadata -- and one `olf-` per enabled stage holding that stage's Dagster and, where analytics is enabled, its Superset. Stage-scoped services are `for_each` instances over the enabled stages, never copied module blocks, and each owns its own metadata database on the shared PostgreSQL server. Because a stage's namespace holds its services, disabling a stage is destructive. `olf infra platform apply -f` (and the deprecated `olf infra deploy`) compares the resolved topology against the root's applied `stage_names` output and refuses an apply that would drop a stage unless `--allow-stage-removal` says so. The multi-stage nightly proves both halves: the refusal, and removal with the opt-in. Removal deletes the stage's namespace, its services, and their credentials. Its databases on the shared PostgreSQL server are retained: dropping a stage's run and report history as a side effect of a profile edit is not an apply's decision to make, so re-enabling a stage reconnects to the state it had. A deployment that wants that history gone drops those databases deliberately. ### Two lifecycle categories The three phases divide in two: ```text foundation + platform -> static infrastructure (Terraform owns state and drift) artifacts -> dynamic, code-derived (rebuilt from lakehouse_code/) ``` **This split is the CD boundary.** A commit that changes only `lakehouse_code/` triggers the artifacts phase and nothing else; CI never invokes Terraform for a code change. Terraform runs are a deliberate platform action. In v0.3 the dynamic lifecycle is split into immutable project build and stage activation. `olf infra project build` publishes a `ProjectRevision`; `olf infra project deploy -f openlakeforge.yaml --stage STAGE --revision REVISION` verifies it, renders stage-bound Floe output, and changes that stage only. It never invokes Terraform or reads the caller's `lakehouse_code/`. `ACTIVE.json` is committed only after the user-code Helm release is ready, so an unsuccessful activation leaves the prior executable revision active. The corollary is a rule: **a platform apply must never wait on an artifact.** Anything requiring domain code to exist belongs in the artifacts phase. Catalog namespaces are the worked example — they are derived from descriptors, so `olf infra catalog sync-namespaces` runs first inside artifacts, before any table is written, rather than being templated into a Terraform-managed bootstrap job. That keeps `platform` from reading user code on either catalog provider. ### Teardown is not symmetric `olf infra destroy` accepts `all`, `platform`, and `foundation` only. There is no artifacts teardown: artifacts have no independent lifetime to reclaim: they live inside the platform services and the object store, and are replaced wholesale on the next artifacts run. `all` tears down platform then foundation. ## Consequences `olf infra deploy --provider local --phase artifacts` is the inner development loop. It is the only command needed after a change to a dbt model, a Floe contract, a Dagster definition, or a descriptor. It builds the project's revision and activates it, as `olf infra project deploy` does. Phases are idempotent. Re-running `foundation` or `platform` reconciles existing state rather than requiring a teardown. `--profile` is not a phase, and it is not an environment or a stage either — it names the *preset* axis of the Deployment Profile (ADR 0011): which optional services `platform` deploys and which layers `artifacts` targets. It must be passed consistently: running `--phase artifacts` with the default `full` profile against a Slim platform regenerates governance-enabled manifests for services that are not deployed. `--provider local --profile slim|full` is the deprecated single-DEV-stage shorthand for the general profile/stage model; ADR 0011 defines the typed resolver it is a special case of. ## History 2026-08-29: Recorded that the platform phase owns the shared and stage namespaces derived from the resolved topology, and that removing a stage needs an explicit opt-in (#133). The three phases and their ordering are unchanged. 2026-09-03: Split the v0.3 dynamic lifecycle into immutable project build and stage activation (#115). Platform commands are profile-only and never inspect project source; the legacy artifacts phase remains a single-DEV compatibility path. 2026-09-28: `olf platform apply -f` gained `--allow-stage-removal` (#155). Before, the profile path ran the removal guard with no way to opt in, so a stage could only be removed through the deprecated `olf deploy`. 2026-11-05: Recorded why catalog namespaces left Terraform (#89). PR #88, finishing #39, first had each Terraform root derive the namespace list from the descriptors at plan time; that made `platform` read user code, so it was reverted. Namespaces were created by a Terraform-templated Polaris bootstrap job and `aws_glue_catalog_database` resources, so a new product still needed a platform apply. `olf infra catalog sync-namespaces` now creates them at the start of artifacts. Reconciling also deletes, so the delete path is guarded: | Rule | Where it holds | | --- | --- | | Prune is opt-in: `--prune`, or `OPENLAKEFORGE_CATALOG_PRUNE_NAMESPACES` in the artifacts phase; otherwise an undeclared managed namespace is reported and kept | `test_plan_deletes_orphans_only_when_pruning` | | `--dry-run` prints the plan and changes nothing | `_reconcile_and_report` in `olf/infra/commands/catalog.py` | | A prune drops catalog metadata only; object-store files stay | `drop_namespace` in `olf/infra/polaris.py` (`purgeRequested=false`) and `olf/infra/glue.py` | | A namespace without the `openlakeforge.io/managed-by` property is never pruned or relocated | `test_plan_never_prunes_a_foreign_undeclared_namespace`, `test_plan_refuses_to_relocate_foreign_namespace` | | Creates run before drops | `test_apply_creates_before_it_drops` | The tests are in `tools/olf/tests/infra/test_catalog.py`. The command's flags are in the [`olf` README](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/tools/olf/README.md); how a prune takes its Gold grants with it is in [ADR 0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/#5-polaris-objects). 2026-11-05: The platform phase runs the OpenMetadata bootstrap from `olf` after the apply, then replicates the ingestion-bot Secret into the governed stage namespaces (#562). The Terraform bootstrap and credential-replication Jobs that did both inside the apply, and their shell templates, are deleted. 2026-11-05: The platform phase also runs the Polaris bootstrap from `olf` after the apply (#562). 2026-11-06: The Terraform `polaris-bootstrap-*` Job and its shell templates are deleted (#562), so `olf`'s run is the only one. Trino reads its Polaris credentials only at start, so `olf` stamps a digest of them on Trino's pod template: a changed credential rolls Trino out, including one rotated by a run that failed before the restart. `olf` waits for Trino's rollout on every deploy: Helm no longer waits for a Trino whose credentials exist only once the apply has finished. Merges the decisions previously recorded as ADR 0008 (two-phase deploy), 0017 (shell/Python split), 0022 (Phase 2 catalog namespace reconciliation), 0025 (`olf` owns the local lifecycle), and 0027 (`olf` owns the cloud lifecycles). Ownership of the orchestration itself is ADR 0008 in the current numbering. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0002-deployment-lifecycle.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0002-deployment-lifecycle.md). --- # ADR 0003: Provider contracts are the portability boundary > Binding. Source: https://openlakeforge.dev/docs/adr/0003-provider-contracts/ ## Status Binding. ## Context OpenLakeForge runs the same data project on local, AWS, and Azure providers. That claim fails if a runtime reads provider details directly, or if a multi-stage profile requires each consumer to infer physical storage and catalog names independently. ## Decision Terraform owns physical provider values and exports provider contracts. `olf` owns parsing, fail-closed validation, and runtime environment generation. Product descriptors remain provider-neutral. Provider contract v3 has one `shared` platform family and a `stages` mapping. The stages must equal the enabled DEV, optional UAT, and PROD stages in the resolved `DeploymentTopology`. Shared bindings are declared once; a stage may refer only to a shared binding or to its own stage binding. Every stage owns distinct Bronze, Silver, and Gold storage identities, a catalog binding, query binding, runtime identity, orchestration endpoint, and activation prefix in shared ops storage. Reporting and governance bindings are present exactly when their stage capability is enabled. Credential values never appear in the contract; Secret and workload-identity references do. Logical SQL identity is provider-neutral: ```text lakehouse_._.
``` Catalog and object-store physical identities are derived by the provider adapter. **Consumers branch on `catalog_type`**, not on a provider name, and must not assume Polaris REST/OAuth fields are present. This is the single rule that makes the Glue implementation possible without touching every consumer, and it is worth stating separately because it is the one most easily broken by a change that only ever gets tested locally. Contract shapes are documented for capabilities that have no second implementation yet (`secrets`, `identity`, `access`, `observability`). Those carry local-development values today; naming the contract now is what keeps the eventual hardening work from being a rewrite. Every root (local, AWS, Azure) now emits v3 natively. `olf` no longer parses v2: a `2.0.0` contract, left by a pre-v0.3 deploy, is refused with the supported version and the remedy: migrate the pre-v0.3 shared `lakehouse` namespace's data by hand, or start over with `--allow-stage-removal`, before the platform phase is redeployed. The `2.0.0` shape is still exported to runtimes by `as_v2_environment_contract`. A native v3 contract requires an explicit stage, and every root now names distinct storage identities and a catalog per stage (#114). Unknown versions, fields, missing/extra stages, cross-stage bindings, duplicate physical identities (including storage bucket names, not only physical IDs), unknown or mismatched catalog type/provider pairs, and provider/region/topology mismatches fail closed. Trino query connectivity is a deliberate exception to stage isolation: `shared.query` is one service used by every enabled stage, isolated by catalog rather than by endpoint. `query.catalog_name` is also the Trino catalog name (v2 kept this separate as `trino_catalog_name`, deployed as the fixed value `iceberg` before #114). Every root now provisions the Trino catalog as `lakehouse_` — for a Polaris-backed root (local, Azure) this is a real, separate physical catalog per stage; for AWS's Glue adapter it is the *logical* alias only, since this account's Glue service cannot create a native catalog per stage (see ADR 0010's rewritten decision) — every stage's `lakehouse_` catalog name resolves to the same shared, bare AWS-account Glue catalog ID underneath. ## Consequences Adding a provider or stage-scoped capability starts by extending v3 and its fixtures, then implementing provider adapters; a provider must not invent a competing wire shape. `olf.common.contract_state.load_provider_contracts` returns a v3 contract unchanged and refuses any other version; `build_contract_env` is where a v3 payload resolves, given a `DeploymentTopology` plus a stage. Every current deploy/e2e/artifact code path now resolves and passes that stage explicitly (#114). `tools/olf/tests/common/test_provider_contracts.py` validates the v3 schema and local, Azure, and AWS fixtures against the typed parser; `olf check contracts` covers the current Terraform v3 surface, structured HCL, and rendered profile/Floe output. The architecture guide records the field families and migration boundary. The optional `shared.artifact_registry.image_repository` advertises a provider-owned fallback for project images. It never includes a tag, digest or credentials. Explicit project repositories retain precedence, and existing contracts can omit the field. The adapter that offers it owns publishing and workload availability; project descriptors remain provider-neutral. ## History 2026-11-06: Removed the v2 reader. Platform state written before v0.3 is no longer supported; a `2.0.0` contract is refused, and the v2 export to runtimes stays (#114). 2026-11-03: Added the optional image repository contract before the local registry adapter (#558), preserving the local workflow without an external registry account. 2026-08-31: Every root (local, AWS, Azure) now emits v3 natively; the v2 adapter is compatibility-only. Documented that AWS's `lakehouse_` catalog name is a logical alias over one shared Glue catalog, not a distinct physical catalog per stage (#114's AWS/Azure completion). 2026-08-29: Recorded that the local root is stage-aware but still exports v2, and that the loader no longer refuses a v3 payload (#133). 2026-08-28: Rewritten for provider-contract v3. The prior flat-capability contract remains supported only through the v2 compatibility adapter while #133 and #114 migrate Terraform output and provisioning. Merges the decisions previously recorded as ADR 0010 (provider-contract-first cloud readiness), 0011 (the Iceberg catalog contract allowing Glue), and 0012 (contract-driven provider-first hardening) — those ADR numbers have since been reused for unrelated decisions. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0003-provider-contracts.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0003-provider-contracts.md). --- # ADR 0004: Medallion layout, ownership, and catalog namespaces > Binding. Source: https://openlakeforge.dev/docs/adr/0004-medallion-layout-and-catalog-namespaces/ ## Status Binding. ## Context The platform originally organised user code by domain: `domains//` contained that domain's Bronze, Silver, Gold, reports, and a `domain.yaml` describing all of it. Every downstream namespace followed the product — `{asset_prefix}_silver` and `{asset_prefix}_gold` — which made the *product* the owner of all three medallion layers. That does not match how the medallion architecture actually divides ownership, and the mismatch had costs: - **Bronze is not domain-owned.** It is a raw representation of an external source, reused by whatever domains need it. Nesting it under one domain meant ingesting the same CRM feed twice when two domains wanted different slices, duplicating both the extract and the storage. - **Silver is not product-owned.** Validated entities are a domain asset. Keying the Silver namespace on `asset_prefix` gave two products in the same domain two separate Silver namespaces for the same conceptual table. - **Only Gold is genuinely product-owned.** ## Decision ### `lakehouse_code/` replaces `domains/` User code is organised by medallion layer, and each layer names its owner: ```text lakehouse_code/ ├── bronze// source-owned: source.yaml + dlt extract ├── silver/floe.yml, sources.yml the Floe project and its named Bronze sources ├── silver// domain-owned: Floe domain defaults and one file per entity ├── gold/dbt_project.yml, packages.yml, macros/ the dbt project and what every product shares ├── gold/models/_sources/.yml each domain's Silver tables, declared once ├── gold/models// product-owned: dbt models and their schema.yml ├── dashboards/superset// consumption-owned: exported report bundles ├── pipelines/dagster/ user-maintained orchestration └── governance.yml the descriptor (ADR 0005) ``` The domain-oriented layout is **removed**, not deprecated. `domains/`, `domain.yaml`, and `asset_prefix` do not exist. ### Ownership rule ```text Source -> raw files in the Bronze bucket (no catalog namespace) Domain -> _silver Product -> _gold ``` Bronze holds raw source files, not Iceberg tables, so it has no catalog namespace. A Bronze source is ingested once and referenced by any domain. A domain validates its sources into one Silver namespace. A product consumes Silver tables from its domain and owns only its Gold namespace. Product `id` is unique across the whole lakehouse, so `_gold` needs no domain prefix. ### Gold is one dbt project; a product is a folder in it Gold has the same shape as Silver: one project for the whole lakehouse, and an owner's folder inside it. Silver is one Floe project with a folder per domain. Gold is one dbt project at `lakehouse_code/gold/` with a folder per product under `models/`. The folder name is the product `id` from `governance.yml`, and `olf check contracts` requires each one to match a product. | Shared by every product | Owned by one product | | --- | --- | | `dbt_project.yml`: materialization, `on_table_exists`, `view_security` | `models//*.sql` | | `packages.yml`: `openlakeforge_dbt` and any other dbt package | `models//schema.yml`: descriptions, tests, the product's dbt `group` | | `macros/`: the `generate_schema_name` wrapper, and project macros any product calls | | | `models/_sources/.yml`: one dbt source per domain | | **A source is named after its domain.** `source('sales', 'orders')` reads `sales_silver.orders`. Each Silver table is declared once, and a product does not redeclare it. The source's name and table name are the domain and entity names, which are also the Dagster asset key of the Silver table. **The schema comes from the folder.** `generate_schema_name` in `openlakeforge_dbt` names every model's schema `_gold`, where `` is the model's folder under `models/`. dbt takes `generate_schema_name` only from the root project, so the Gold project's `macros/generate_schema_name.sql` delegates to the package's. A model outside a product folder fails to parse. A `schema` config that names any other schema is still rejected by `olf check contracts` (ADR 0005). The profile's target schema is never written to. **A product is a dbt group, and its models are private by default.** Each product's `schema.yml` declares a dbt `group` named after the product, and `dbt_project.yml` defaults every model to `access: private`. dbt then refuses a `ref()` from one product to another product's model unless that model is marked `access: public`. Unless a product publishes a mart this way, it still reads only Silver. A `ref()` to a public mart is an asset dependency in Dagster. The reading product's job does not rebuild it. **Dagster selects each product out of one manifest.** The image parses the project once. Each product's assets are `dbt_assets(select="group:")` over that manifest. Its Silver inputs are the sources its models read, not every source in the project, and are empty for a product that reads only public marts. Its job still builds only its own models. Run artifacts keep their per-product prefix. The namespace contract is **flat** — a single-level name, not a hierarchy. This is deliberate: it is the shape both Polaris and AWS Glue implement natively, so the identical namespace names work on either catalog with no translation layer. ### Per-layer buckets Each medallion layer gets its own bucket rather than a path prefix inside one: | Bucket (DEV) | Layer | Written by | | --- | --- | --- | | `-dev-bronze` | Bronze | dlt | | `-dev-silver` | Silver | Floe | | `-dev-gold` | Gold | dbt-trino | | `-ops` | operational artifacts | the artifacts phase | The naming rule is `--` on the self-hosted providers (local and Azure), where `` is the Deployment Profile's `metadata.name`. Bucket names are global per endpoint or account and renaming one means migrating its data, so the name is derived once by the resolver (`DeploymentTopology.bucket_names()`), passed to each Terraform root as the `bucket_names` variable, and never rebuilt in a root. `metadata.name` is therefore validated as a bucket component: at most 51 characters, so `-prod-bronze` stays within 63. There is no separate prefix override in the profile; to share an object store with other tenants, choose a distinctive `metadata.name`. The ops bucket is `-ops`. `olf infra deploy` refuses to rename a bucket that is already deployed (Terraform would create an empty one and Polaris would keep the old locations); the opt-in is `--allow-stage-removal`. A provider contract whose bucket names differ from the derived ones is rejected. **AWS keeps a suffix.** S3 bucket names are global across accounts, so `--` can collide with a bucket in another account, and replacing a bucket on AWS deletes its objects. On AWS the stage buckets stay `---`, with the random suffix the `aws-s3` module appends, and the ops bucket stays `-ops-` (a root variable, not `metadata.name`). DEV keeps the names of the v0.2 POC. Existing AWS names do not change; a Terraform test on the `aws-s3` module pins them. Buckets are the unit at which IAM policies, lifecycle rules, retention, and replication apply. A single bucket cannot grant BI consumers read access to Gold without also exposing raw Bronze, and cannot give raw CSVs a different retention policy from validated tables. Path prefixes inside one bucket cannot express either. Because the layer is implied by the bucket, table paths carry no `bronze/`, `silver/`, or `gold/` prefix. ### Stage catalogs allow drop with purge Each stage catalog (`lakehouse_`) is created with the property `polaris.config.drop-with-purge.enabled=true`, and `olf`'s Polaris bootstrap (`tools/olf/olf/infra/polaris_bootstrap.py`) sets it on a catalog that already exists. Trino drops tables with purge, and Polaris drops a view only with purge; without the property Polaris answers both with HTTP 403. Every dbt incremental run after the first drops its `__dbt_tmp` view, so with purge off every incremental Gold model failed on its second run (#741). The property is set per catalog rather than as the realm-wide `DROP_WITH_PURGE_ENABLED` feature, so it covers only the catalogs the bootstrap creates for stages. Purge deletes the dropped table's files. That stays inside one stage: a stage catalog's `allowedLocations` are that stage's own three buckets, and Polaris refuses a table or view located outside them, so a purge in `lakehouse_dev` cannot reach `-prod-*`. Who may drop is unchanged: dropping still needs the catalog grants the stage's principals hold. ### Operational artifact prefixes `-ops` is outside the medallion split and uses stable prefixes: ```text floe/reports// logs/ run-artifacts/dbt/// ``` Floe run reports are keyed by domain, matching domain-owned Silver, and land under the stage's own artifact prefix (`activations//`) once a stage is activated. The local observability adapter is `observability.object_log_archive`: metrics and tracing are disabled, and logs, Floe reports, and dbt run artifacts are archived to object storage. A Loki/Grafana/Prometheus stack is a later observability adapter, not a replacement for this baseline. ## Consequences Adding a product that reuses an existing source touches `lakehouse_code/gold/models//`, `governance.yml`, and one Dagster module at `lakehouse_code/pipelines/dagster/.py`; no Bronze or Silver work is duplicated, and no dbt project configuration is copied. A single Gold project costs some isolation. A model that fails to parse fails `olf check dbt` and the image's manifest bake for every product, not just its own. The code location already failed as a whole before this change, because it baked every product's manifest at import, so a deployed stack is no worse off. Each run also parses the whole Gold project, not just one product's models. Catalog namespaces are derived from descriptors, so they are reconciled in the artifacts phase by `olf infra catalog sync-namespaces` (ADR 0002), never templated into Terraform. Migrating an installation from the `domains/` layout is a manual rewrite. There is no automated path and no parser for the old descriptor shape (ADR 0005). ## History Merges the decisions previously recorded as ADR 0013 (medallion bucket split), 0014 (ops artifact bucket and prefixes), and 0026 (medallion ownership and the flat catalog namespace contract, which superseded ADR 0021's product-owned Silver). Bucket names follow `lakehouse--` for every stage, matching the `lakehouse_` catalogs. DEV previously kept the v0.2 names (`lakehouse-bronze`, `-silver`, `-gold`) and the other stages used `--`; the local and Azure environments now use the single scheme, and the AWS environment is still on the old one. 2026-10-28 (#533): Floe 0.8 builds its manifests in memory in the code location, so `floe/manifests/` is no longer written; the Silver contracts became one multi-file Floe project. 2026-10-29 (#545): the descriptor is `governance.yml`, which names domains and products only. A product no longer lists its Silver inputs or Gold tables; the schema (`_silver`, `_gold`) decides which domain or product a table belongs to. 2026-11-01 (#741): stage catalogs allow drop with purge, so a dbt incremental model's temporary view can be dropped. 2026-11-06 (#562): the stage catalogs are created by `olf`'s Polaris bootstrap after the platform apply; the Terraform Job that did it is deleted. 2026-11-07 (#993): stage buckets are `--` on local, AWS and Azure, derived by the resolver; they were `lakehouse--` on local and Azure and suffixed or legacy names on AWS. 2026-11-12: Gold is one dbt project at `lakehouse_code/gold/`, with a folder per product under `models/`. Before this, each product had its own dbt project at `gold//dbt/`. Those projects differed only in name, so each repeated the same configuration and its own `packages.yml`. Each also declared the Silver tables it read under a source named `silver`, so a table two products read was declared twice. The Gold schema used to come from each product's dbt profile. It now comes from the model's folder, and products are dbt groups whose models are private by default. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0004-medallion-layout-and-catalog-namespaces.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0004-medallion-layout-and-catalog-namespaces.md). --- # ADR 0005: The descriptor model > Binding. Source: https://openlakeforge.dev/docs/adr/0005-descriptor-model/ ## Status Binding. ## Context The descriptor is the contract between a user's data products and everything the platform derives from them: Dagster jobs, catalog namespaces, artifact paths, Terraform inputs, and e2e expectations. Two problems shaped its current form. First, the platform originally parsed descriptors twice — once in the `olf` CLI and once in the project-code runtime. The two implementations had to be kept in parity by hand while naming, validation, and identity rules were still moving. Second, the descriptor kept facts that other tools already own. It listed every Silver and Gold table, which Floe's entity files and dbt's models also define, so each table had two sources of truth and every scaffold or rename had to update both. Business metadata — domains and products — is the one thing nothing else knows. ## Decision ### Two descriptors | Kind | Path | Declares | | --- | --- | --- | | `Governance` (`openlakeforge.io/v1beta2`) | `lakehouse_code/governance.yml` (one per project) | Domains, and the data products nested under them | | `Source` (`openlakeforge.io/v1beta1`) | `lakehouse_code/bronze//source.yaml` (one per source) | A Bronze source and the resources it exposes | A product's `id` is its only identity and is unique across the lakehouse. A table belongs to a domain or product by the schema it lives in, not by a list: `_silver` belongs to the domain, `_gold` to the product and, through it, the product's domain. Silver tables are the entities of the domain's Floe files; Gold tables are the dbt models in the product's folder of the Gold project (ADR 0004); neither is declared in a descriptor. A dbt model that writes outside `_gold` is rejected, because its table would belong to no product. Sources are the `bronze/*/source.yaml` files on disk, and dashboards are the `dashboards/superset/*/` directories that hold a `metadata.yaml`; a dashboard serves the products whose `_gold` schema its datasets read. None of these is declared a second time. Both descriptors are validated against JSON Schema (`docs/schema/governance.schema.json`, `docs/schema/source.schema.json`) and against the typed model. The schemas are closed against unknown fields, which is what enforces provider-neutrality (ADR 0003): a `bucket` or `catalog` key is rejected rather than ignored. ### Load modes are declared where each layer is owned A `Source` resource declares `load.mode`: `full` (the default) or `incremental`, with a `cursor` and a `primary_key`. These are column names, never values or queries. The connector still owns how it reads the cursor. Silver's mode stays in the Floe contract and Gold's in the dbt model, because Floe and dbt own those layers. `olf check contracts` checks that the Bronze and Silver modes fit together. ### `openlakeforge-core` is the only implementation The `packages/core/` distribution, imported as `openlakeforge_core`, owns descriptor constants, loading, validation, the provider-neutral value objects (`Source`, `Domain`, `Product`, `Table`, `FloeEntity`, `Dashboard`, `LakehouseInventory`), logical-to-physical name derivation, and artifact-path derivation. Both `olf` and the project-code image install it. The package has no Dagster, Terraform, or provider dependency. Dagster-specific discovery — importing product modules and merging their `Definitions` — is a runtime adapter in `openlakeforge_runtime/`, not part of the model. ### v1alpha1 and v1alpha2 are removed The legacy `Domain` descriptor, its loaders and validators, and its schemas are deleted. Nothing in the platform parses the old shape. Upgrading a project from `v0.1.0-alpha.1` means rewriting its descriptors by hand into the `Governance` + `Source` pair. This is a real cost, accepted for two reasons: the ownership model changed underneath the descriptor, so a mechanical field-by-field migration would produce a syntactically valid descriptor with the wrong Silver namespaces; and carrying a second descriptor model that no runtime path can reach is a standing invitation for it to drift out of parity with the one that matters — the exact failure the single-implementation decision above exists to prevent. Alpha releases carry no forward-compatibility guarantee, and the affected population is small enough that a documented manual rewrite is the honest option. ### Transitional projects `olf init --empty` writes no `governance.yml`. It deliberately fails strict validation: a project with no product cannot deploy or run e2e. Only the scaffolding commands (`olf source new`, `olf domain new`, `olf product new`) accept it. The first `olf domain new` or `olf product new` creates `governance.yml`, and the first `olf product new` is what turns the project into a schema-valid one. ## Consequences A descriptor change alone moves what the platform discovers — jobs, namespaces, artifact paths, and e2e assertions — with no edit to shared platform code. That property is what `olf check contracts` protects on every pull request. The inventory is cached per resolved project root, so repeated loads within one process are free. ## History Merges the decisions previously recorded as ADR 0021 (the inventory-required descriptor shape), 0024 (the canonical core package), 0026's descriptor half, and 0032's transitional-project rule. ADR 0026 previously required keeping the v1alpha1/v1alpha2 parsers for migration diagnostics; that requirement is withdrawn here. 2026-10-29 (#545): `lakehouse.yaml` (`Lakehouse`, `v1alpha3`) is replaced by `governance.yml` (`Governance`, `v1beta1`), which names domains and products only. The per-domain `silver_tables`, per-product `silver_inputs` and `gold_tables`, `sources` and `dashboards` lists are removed: tables follow the schema rule above, sources and dashboards are found from their directories, and no host command needs a Gold table name. `olf e2e` lists the tables in a stage's `_gold` and `_silver` schemas through Trino. A project still on `lakehouse.yaml` does not load; rewrite it as `governance.yml` (alpha, no production deployments). 2026-10-30 (#342, #343): `Source` resources gained an optional `load` block. It defaults to today's behaviour, so `Source` stays `v1alpha3`. 2026-11-07 (#917): `Governance` is `v1beta2`. Products move from the root `products:` list into `domains[].products`, and a product no longer names its domain: the domain it is nested under owns it. The two layouts are never accepted side by side: a `v1beta1` document fails with a pointer to `olf project migrate`, which rewrites the file textually (comments and order kept) and refuses on an unknown domain, a duplicate id or an already nested domain. Product ids stay unique across domains, and every derived name (`_silver`, `_gold`, jobs, buckets) is unchanged. 2026-11-07 (#995): `Source` is `v1beta1`, frozen with `Governance`. The fields were reviewed and none is removed or renamed; provider names stay forbidden by architectural rule 2. A `v1alpha3` document fails with a pointer to `olf project migrate`, which rewrites its version line. 2026-11-07 (#994): `ProductDefinitionSpec` no longer needs the Gold assets, Silver inputs and Bronze inputs of a product. They default to the dbt models, the dbt sources and the Floe entities' Bronze resources, so the project declares each once. An explicit list still wins. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0005-descriptor-model.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0005-descriptor-model.md). --- # ADR 0006: Dagster runtime and code locations > Binding. Source: https://openlakeforge.dev/docs/adr/0006-dagster-runtime-and-code-locations/ ## Status Binding. ## Context Dagster needs to load user code to build the asset graph, and to execute that code in isolated runs. How user code reaches the Dagster pods determines the runtime footprint, the deploy loop, and how much of the platform a small team has to understand. ## Decision ### Platform control plane and project-code runtime A project image carries everything Dagster needs to load and run user code: Dagster definitions, the `dagster-floe` and `dagster-dbt` connectors, the Floe Python core (`floe-python`), dlt pipelines, the dbt projects, the Floe project, the `openlakeforge-core` package, and the shared `openlakeforge_runtime/`. The Terraform-owned Dagster control plane owns the webserver, daemon, database, RBAC, and a stable external gRPC workspace. It does not own a project image or code location. `olf infra project deploy` owns the separate `openlakeforge-project` user-deployment Helm release, which points the stable workspace at its stage's verified image and revisions. A platform apply can therefore reconcile infrastructure without resetting active user code. The control plane runs a digest-pinned upstream Dagster image from `release/component-catalog.yaml`: neither the webserver nor the daemon imports `lakehouse_code`, so pointing them at a project image made a platform apply depend on a project build having happened first. Where activation owns user code, the K8sRunLauncher is given no image at all (`modules/orchestration/dagster` renders no `job_image`), so Dagster launches each run with its code location's own container image -- the digest that stage activation set. A value configured at platform-apply time would only name a build no stage activated. `olf infra deploy` takes the same path: its artifacts phase activates a revision, so it renders no `job_image` either. The webserver caches each code location's snapshot, and a launched run takes its image and container context from that snapshot rather than from the code server. Activation therefore does not end at the rollout: it reloads every contracted location through the stage webserver's GraphQL (`reloadRepositoryLocation`) and waits, for a bounded time, until each reports the activated digest as its image. A webserver that does not is an activation failure, handled like a pointer that will not commit. The daemon refreshes its own workspace every minute and needs no reload. Anything that does need project code rides the activation release instead. The compute-log archiver (`openlakeforge_runtime.k8s_log_archive`) is rendered into it through the user-deployments subchart's `extraManifests`, which also keeps it on the digest its stage actually runs. ### Floe runs one Kubernetes Job per domain, from the project's own contracts Floe 0.8 is a Python library, and the project-code image installs it. The code location builds the Floe manifest in memory from the Floe project under `lakehouse_code/silver/` and an EnvironmentProfile it renders for its own stage (`openlakeforge_runtime/floe_profile.py`). No manifest is generated, published or versioned, and there is no separate Floe runner image. The profile's runner is `kubernetes_job` with `job_scope: domain`: dagster-floe builds one subsettable asset per domain, and a run that materializes it launches one Kubernetes Job per domain in the stage namespace, under the `dagster` service account the run launcher already uses. The Job runs on the same project-code image digest as the run pod, runs plain `floe run`, and validates the selected entities one after another (`sequential` orchestration). Only the entities the run selected are passed to it. The profile is rendered on the pod rather than at activation because it is the only stage-bound Floe input: rendering it from the contract values the activation release already sets keeps one image digest valid for every stage. dagster-floe hands the Job that profile's text (`-p env:FLOE_PROFILE_CONTENT`); credentials reach it only as Secret references, which the profile names as `${...}`, so no credential value enters the profile, the manifest or the Job spec. The trade-off is a pod per domain per run against isolation: Floe does not share the run pod's memory or mounted credentials, and each domain's Job holds only the Secrets its runner names. [Floe validation](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/floe-validation.md) describes the layout and the catalogs Floe 0.8 supports. ### dbt reads its stage from the pod environment The image holds one dbt profile, rendered at build from `openlakeforge_runtime/dbt/profiles/trino.yml` into `generated/dbt-profiles/`. Every connection value in it (host, port, TLS, user, catalog, schema prefix) is an `env_var()` reference with no stage default. The build also parses the Gold dbt project's manifest once, with placeholder values (`openlakeforge_runtime/dbt/render_profiles.py`). Dagster reads that manifest for the asset graph, and each product's assets select the product's folder from it (ADR 0004). Its asset keys come from domain, product and node names, never from a catalog or schema, so the graph is the same in every stage. The Gold project reaches the shared `openlakeforge_dbt` package through `OPENLAKEFORGE_DBT_PACKAGES_DIR`, which the image sets, never through a path relative to the project, so a customer repository resolves it too. Each `dbt build` gets its own target path from dagster-dbt and re-parses with the run pod's environment. The image ships no partial-parse state, so the SQL a run executes, its lineage and the run artifacts it uploads name that stage's relations. A stage that leaves a required variable unset fails the run. It cannot fall back to another stage's catalog. The cost is a full dbt parse of the Gold project per run, which takes seconds. ### One merged code location by default The deployed configuration is a single location named `openlakeforge-dagster`, loading `lakehouse_code.definitions`, which aggregates every product's Dagster definitions from `lakehouse_code/pipelines/dagster/`. An earlier design deployed one location per domain. Every location used the same image and image tag, so they were always rebuilt and redeployed together: the split cost one always-on pod per domain and delivered none of the independent release cadence or dependency isolation that would justify it. `code_locations` remains a list in the orchestration contract. A deployment that genuinely builds domains separately, or that wants load and restart failures isolated to one pod, can configure the split explicitly — the trade-off is a merged location's blast radius (one bad module fails the whole graph) against a pod per domain. ### The contract owns the code-location set The set has two consumers with no shared code between them: Terraform renders the webserver's `workspace.yaml` from it, and `olf infra project deploy` renders one user deployment per entry. `dagster-user-deployments` names each Service after its deployment, so a location name is also its in-cluster host — the two sides must produce the same names or the webserver points at Services that do not exist, and the stage comes up with no code server reachable and no error at apply time. The provider contract is therefore the single owner: `stages..orchestration.code_locations` carries `{name, definitions_module}` per entry, emitted by every environment root from the same Terraform local it passes to the Dagster module, and read back by `olf` through `olf.common.provider_contracts`. Neither consumer holds its own copy. ### A full refresh is a run tag A full refresh is a property of one run, not of a descriptor. The run tag `openlakeforge/full_refresh` (`bronze` or `gold`) is the contract between whoever launches the run (the Dagster launchpad, or `olf infra product run --full-refresh`) and the project-code runtime; `openlakeforge_core.runs` holds it. A tag reaches every asset of the job without each one declaring a config schema, including the Floe assets dagster-floe builds. Both scopes run `dbt build --full-refresh`. `bronze` also carries dagster-floe's own tag, `floe/full_refresh=true`, so Floe rebuilds Silver from every Bronze file. A full refresh re-ingests Bronze and never re-extracts: the sources' cursors and files stay, so a refresh cannot lose history a source no longer serves, or depend on that source being reachable. The runtime rejects a `bronze` run without the Floe tag at its first step, since Silver would otherwise not be rebuilt. ### Kubernetes run launcher Runs execute in isolated pods using the project-code image, so a run's dependencies and failures are contained. Every run pod carries the same requests and limits, set in `modules/orchestration/dagster` (`run_pod_resources`): 250m CPU and 512Mi memory requested, a 2Gi memory limit, no CPU limit. The dlt Bronze extract and dbt run inside that pod, so this also sizes them. The values are a safe default for the Slim footprint, not a measurement; a run that outgrows the limit is OOMKilled. Floe Jobs are sized by their own runner, not here. A local image that was built and never pushed is loaded into kind and runs with `imagePullPolicy: Never`, so Kubernetes never pulls it. Activation puts it back on the nodes before the rollout (`olf.local/project-code@`, see [project revisions](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/project-revisions.md)). ## Consequences The v0.3 promotion loop is `olf infra project build` followed by `olf infra project deploy` for each stage. `olf infra deploy --phase artifacts` builds the same revision and activates it on its one DEV stage. Durable product jobs are named `_pipeline` and derived from the descriptor (ADR 0005), so adding a product adds a job with no platform edit. ## History Merges the decisions previously recorded as ADR 0003 (the local Dagster project-code runtime), 0004 (manifest-first Floe ingestion, generalized from the Sales seed product), 0014's code-location half, and 0019 (the merged code location default, which superseded ADR 0014's per-domain split). 2026-09-03: Moved project user-deployment ownership from the Terraform Dagster release to stage activation (#115); the control plane keeps a stable external workspace endpoint. The control plane and run launcher stopped referencing the project-code image in the same change, and the compute-log archiver moved into the activation release. 2026-09-09: Recorded the provider contract as the owner of the code-location set (#185). The #115 split left Terraform and activation deciding it independently, agreeing only because both repeated the module variable's default; a rename or a configured split broke the stage silently. The shipped default — one merged location — is unchanged. 2026-10-28: Floe moved into the project-code image (#533). Floe 0.8's Python core lets dagster-floe build the manifest in memory, so the separate runner image and the `s3://` manifests published at activation are gone. Floe still runs in Kubernetes Jobs, now one per domain on the project-code image rather than one per entity. 2026-10-28: dbt reads its stage from the pod environment (#546). The provider-specific profiles (`local`, `aws`, `azure`) and the image's `DBT_PROFILE_ENV` choice are replaced by one profile of `env_var()` references, and the manifest baked at build is parsed with placeholders instead of the local DEV catalog. 2026-10-30 (#342, #344): a run tag asks one run for a full refresh, and `olf product run` launches a product with it. 2026-10-30 (#342): a `bronze` refresh also carries dagster-floe 0.4.3's `floe/full_refresh` tag, so Floe rebuilds Silver in the same run instead of merging the reloaded Bronze onto the old table. 2026-11-01 (#740): activation reloads each contracted code location in the stage webserver and requires it to report the activated digest before the pointer moves; a webserver restarted by a platform apply had kept launching the previous revision. The run launcher's `job_image`, which platform apply still rendered, is now rendered only for the deprecated `olf infra deploy` path, so the statement that the run launcher has no image holds again. 2026-11-04 (#558): the artifacts phase of `olf infra deploy` builds a ProjectRevision and activates it through `deploy_revision`, and Terraform no longer owns the Dagster user deployments for any entry point. A stack applied before this keeps its Terraform-owned code location until the next platform apply removes it, then the artifacts phase installs `openlakeforge-project`. 2026-11-01 (#627): product `packages.yml` files name the shared dbt package through `OPENLAKEFORGE_DBT_PACKAGES_DIR` instead of `../../../../libs/dbt`, and the code location reads its profiles from `OPENLAKEFORGE_DBT_PROFILES_DIR` when set, so `olf check project-code` parses a customer repository's products against the distribution. 2026-11-02 (#342): a `bronze` full refresh no longer drops and re-extracts incremental Bronze. It rebuilds Silver from every Bronze file and Gold from Silver. On the local stack, re-extraction had replaced a source's history with whatever its connector could still fetch, which was nothing in a quiet week. 2026-11-02 (#325): run pods get default requests and limits through the launcher's `runK8sConfig.containerConfig.resources`; they had none. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0006-dagster-runtime-and-code-locations.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0006-dagster-runtime-and-code-locations.md). --- # ADR 0007: Governance and lineage > Binding. Source: https://openlakeforge.dev/docs/adr/0007-governance-and-lineage/ ## Status Binding. ## Context The platform emits lineage naturally at two points — Floe writing Silver Iceberg tables, and dbt writing Gold Iceberg tables. Surfacing that in a governed catalog with end-to-end lineage is the goal. Getting there took two failed attempts, and what was learned from them is worth more than the final configuration. ## Decision ### OpenMetadata is the governance target, and it is optional OpenMetadata provides catalog discovery, domain and data-product entities, and lineage. It is deployed only in the Full profile; Slim omits it entirely and e2e assertions for it are skipped rather than failed. The artifacts phase seeds domains, data products, and medallion bucket containers over REST. ### One OpenMetadata, stage-qualified service roots A deployment runs one OpenMetadata however many stages enable governance. Stage is carried by service identity, never by a Domain: every governed stage gets its own `.lakehouse_` database root, a `dagster_` pipeline service, and a `superset_` dashboard service when that stage also enables analytics. The bootstrap removes the services of a stage that stopped being governed. The lakehouse database service (named `polaris`, or `aws_glue` on AWS) crawls through Trino: OpenMetadata 1.13 removed its Iceberg connector, and in Trino every stage is one catalog, `lakehouse_`, which OpenMetadata lists as one database. The crawl is filtered to the governed stages' catalogs, so every governed stage is crawled into its own root, as the read-only `openmetadata` Trino user. `olf infra openmetadata deploy-metadata` adds each stage's domains and descriptions under that root. It sets a domain on the `_silver` and `_gold` schemas, and the tables the crawl finds inherit it. A data product's assets are the tables under its Gold schema, attached once the crawl has found them; its Silver inputs appear as lineage. Every governed stage emits its own lineage. OpenMetadata 1.13+ resolves a lineage dataset by `...
`, so a stage's edges land on its own `lakehouse_` tables even though schema and table names are identical across stages; 1.12 matched on schema and table alone, and could attach one stage's lineage to another's. Each stage emits under its own `dagster_` namespace. An edge needs both of its tables registered before the lineage arrives: OpenMetadata 1.13.6 fails to auto-create the tables and pipelines an event references (an upstream bug: the entity is inserted without `updatedAt`), so an event naming an unknown table records no edge. `olf infra openmetadata deploy-metadata` therefore registers, at activation, each `_silver` and `_gold` schema and every table the stage's pipelines write: one per Floe entity under the Silver schema and one per dbt model under the Gold schema. A table is only ever created, never overwritten, and the crawl adopts it by name and fills in its columns. The crawl never deletes schemas or tables, so a crawl before the stage's first run cannot retire them. Edges are recorded without a pipeline reference, and nothing may rely on pipeline entities. The nightly asserts that each stage's Gold lineage exists and never reaches another stage's database. The local root registers every governed stage; the AWS and Azure roots still register one until their adapters follow (#131). ### Lineage is emitted natively, directly to OpenMetadata Floe and dbt-trino each emit OpenLineage events straight to OpenMetadata's `/api/v1/openlineage/lineage` endpoint. - The Floe environment profile the code location renders carries the endpoint; each domain's Floe Job receives the ingestion-bot JWT as `OPENLINEAGE_API_KEY` through a Kubernetes Secret reference (`secretKeyRef`), and Floe reads it from the environment, so the token never enters the profile or the Job spec. - `openlineage-dbt` ships in the project-code image; Dagster sets the product job name around the dbt invocation so events carry stable logical identities. - The dataset namespace matches the catalog identity: `polaris` locally and on Azure, `aws_glue` on AWS. dbt-trino's namespace is the Trino URI it connects to, so both of Trino's listeners are mapped to the catalog service: the HTTP port, and the HTTPS port dbt uses once workload authentication is on. - OpenMetadata owns entity resolution and lineage persistence. ### Two rejected approaches, still rejected **A normalising OpenLineage proxy.** An earlier design deployed a proxy that rewrote Floe and dbt events before forwarding them. It ran successfully and produced incomplete or wrongly-attached lineage, because the real problems were upstream: Floe emitted non-UUID run IDs and omitted dataset context, and dbt-duckdb resolved datasets under the local DuckDB file namespace rather than the Iceberg catalog. The proxy converted those into a silent correctness problem instead of a visible failure. **A custom Dagster REST push.** Constructing lineage edges from Dagster and pushing them directly was rejected for the same reason: it produces lineage that looks right without the engines actually reporting what they did. Both remain rejected. The rule they establish: **lineage is emitted by the engine that performed the write, or it is not emitted.** Anything else is a plausible graph that nobody has verified. Native emission only became viable once the upstream causes were fixed — Floe began passing its entities to its lineage observer with resolved Bronze source URIs and Silver outputs, and Gold moved from dbt-duckdb to dbt-trino, whose dataset namespaces resolve to the real catalog (ADR 0001). ### The Dagster connector stays deferred OpenMetadata's Dagster pipeline service and ingestion pipeline are registered but not triggered: the connector queries the deprecated `PipelineRuns` GraphQL type while Dagster 1.x exposes `Runs`. Registering without triggering keeps the service definition in place for when the connector is corrected, without scheduling an ingestion that would fail on every run. ## Consequences The complete Bronze→Silver→Gold graph resolves in OpenMetadata when the governance layer is enabled. The Floe profile stays credential-free; this ADR does not create an exception to that rule. Superset dashboards appear in OpenMetadata only after its dashboard ingestion pipeline crawls the Superset API. Report import and metadata crawl are separate operations, and Superset — not OpenMetadata — is the source of dashboard runtime state. ## History Merges the decisions previously recorded as ADR 0006 (OpenMetadata governance with an OpenLineage proxy), 0009 (deferring lineage, and rejecting both the proxy and a custom REST push), and 0023 (restoring native emission). 2026-09-23 (#131): stage-qualified service roots replace the single unqualified `dagster` and `superset` services, and the one-governed-stage limit is lifted on the local root. 2026-09-29 (#131): every governed stage emits lineage under its own namespace, OpenMetadata auto-creates lineage entities, and OpenMetadata moves to 1.13.6 for database-qualified dataset resolution. 1.13 has no Iceberg connector, so the lakehouse service crawls through Trino, which also crawls every governed stage instead of only the canonical one. 2026-10-01 (#131, #257): table stubs survive the crawl, and lineage pipeline entities are recorded as not created on OpenMetadata 1.13.6. 2026-10-29 (#545): domains are set on schemas, not tables, and table stubs are no longer seeded; products attach their Gold tables only. 2026-10-31: tables are registered at activation again, named from the Floe entities and dbt models, because OpenMetadata 1.13.6 cannot auto-create them and dropped every Gold edge without them. 2026-10-31: Trino's HTTPS listener is mapped beside its HTTP one. dbt has reported its datasets under the TLS port since workload authentication; OpenMetadata 1.13.6 still resolved them by table name, but its main branch drops a dataset whose namespace is not mapped. 2026-10-28 (#533): Floe emits lineage from one Kubernetes Job per domain, with the endpoint in the profile the code location renders and the JWT as a Secret reference on the Job; there is no generated manifest left to keep credential-free. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0007-governance-and-lineage.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0007-governance-and-lineage.md). --- # ADR 0008: olf owns orchestration and its managed toolchain > Binding. Source: https://openlakeforge.dev/docs/adr/0008-olf-owns-orchestration-and-toolchain/ ## Status Binding. ## Context Deployment automation was once ~6,900 lines of shell across `scripts/local`, `scripts/azure`, and `scripts/aws`. Environment-agnostic logic was duplicated three times, and several concerns lived as Python heredocs inside bash — contract resolution, OpenMetadata REST seeding, Superset bundle handling, object-storage uploads, and Kubernetes image bookkeeping. A first correction split responsibilities: shell stayed the CLI orchestrator (invoking terraform, kubectl, helm, docker) while Python owned cross-environment logic. That left two runtime paths and meant a distribution could still depend on checkout-local shell files. A second problem sat alongside it. Even with orchestration solved, a user had to install Terraform, Helm, kubectl, and kind globally at compatible versions before `olf infra deploy` would run — OpenLakeForge's implementation details were the user's prerequisites. ## Decision ### `olf` is the only orchestration implementation `tools/olf` owns deployment sequencing, artifact preparation, validation, diagnostics, and release helpers. It invokes Terraform, Helm, kubectl, Docker, and kind as managed external processes with structured argv, retries, and diagnostics. Terraform remains the state and drift engine; Helm remains the chart and release engine. `olf` does not reimplement either — it sequences them. There is **no tracked shell**. `olf check structure` rejects shell scripts in the repository, so this is enforced rather than conventional. `olf` is the only orchestration surface: there is no `Makefile` and no other entry point. Every target it once carried was a one-line delegate to an `olf` command, so deleting it removed a duplicated compatibility surface that drifted despite its tests. The substrate is a `DeploymentEngine` sequencing a `DeploymentProvider`, with typed adapters per external tool under `tools/olf/olf/common/tooling/` (the cloud `aws` and `azure` ones under `tools/olf/olf/infra/tooling/`). Cloud providers share one `CloudProvider`; a `CloudBackend` protocol isolates the genuine AWS and Azure differences (foundation variables, kubeconfig population, registry login, default image repository, Floe profile selection) rather than forking the lifecycle. ### `olf` provisions its own toolchain `olf` downloads, checksum-verifies, and privately invokes its own Terraform, Helm, kubectl, and kind under `OLF_HOME` (default `~/.openlakeforge`), at the exact versions `release/component-catalog.yaml` pins. This follows from the pins being immutable at all: a catalog that pins Terraform 1.16.4 while the user's `PATH` supplies 1.5 is a pin in name only. `OLF_TOOLCHAIN_MODE=host` resolves from `PATH` instead, for users who need to supply their own binaries. ### Cloud authentication goes through SDKs AWS IAM Identity Center and Microsoft Entra authentication run through boto3 and the Azure SDKs. Neither the `aws` nor the `az` CLI is a prerequisite — `olf infra auth login --provider aws|azure` opens the vendor-hosted sign-in page and OpenLakeForge never collects or hosts credentials itself. Two provider constraints survive as narrowly-scoped credential bridges, because the alternative is worse: - EKS kubeconfigs normally use an `exec` plugin that invokes `aws` for every token. `olf` supplies its own credential process instead of requiring the CLI. - The pinned AzureRM provider asks an executable named `az` for account metadata and tokens under interactive user auth. A minimal bridge satisfies that without a full CLI install. These are documented deliberately: they are the seams where the "no vendor CLI" claim is doing real work, and any change to them is a change to that claim. ## Consequences A clean machine needs Docker and Python 3.12. Everything else `olf` provides. Adding a deployment step means adding it to a provider implementation with tests, not to a script. New `olf` behaviour ships with tests in the same change. The managed toolchain is cached in CI by `release/component-catalog.yaml` hash, so pinning a new version invalidates exactly the right cache entry. ## History Merges the decisions previously recorded as ADR 0028 (Python owns repository orchestration, which fully superseded ADR 0017's shell/Python split after ADRs 0025 and 0027 ported the local and cloud lifecycles), 0029 (the managed toolchain), and 0030 (SDK-managed cloud authentication). Issue #212 deleted the `Makefile`: every target was a one-line `olf` delegate, so its only remaining function was a duplicated compatibility surface that had drifted despite its tests (PR #207 fixed `local-e2e`/`local-slim-e2e` invocations that could not have worked). `olf` is now the only orchestration surface, not merely the supported one; `_check_makefile_target_wiring` in `tools/olf/olf/contracts_check.py` and its test coverage were removed along with it. 2026-11-06 (#562): the OpenMetadata and Polaris bootstraps moved from Terraform shell templates into `olf`, after the platform apply. Ten small `*.sh.tftpl` templates stay shell on purpose: the credential Jobs and the CA publisher that a release in the same apply reads at start, the Postgres init hooks (the database image's own entrypoint hook, and the in-cluster Job that is the only route to a private RDS instance), and the Polaris metastore bootstrap that only the Polaris image can run. Porting them to an `olf` step after the apply would make those releases wait on `olf`. Each is listed with its reason in `SHELL_TEMPLATES` (`tools/olf/olf/common/commands/checks/_structure.py`), and `olf check structure` fails on an unlisted template or a stale entry. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0008-olf-owns-orchestration-and-toolchain.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0008-olf-owns-orchestration-and-toolchain.md). --- # ADR 0009: Distribution — a PyPI package carrying the platform payload > Binding. Source: https://openlakeforge.dev/docs/adr/0009-distribution/ ## Status Binding. ## Context The deployment engine was only useful from a repository checkout: Terraform roots, Helm values, image build assets, schemas, and the demo project were all resolved relative to the checkout. A published release was not installable — a user who wanted to run OpenLakeForge cloned it, which is a contributor workflow being handed to consumers. That also confused two things a checkout keeps in one place: the platform (which the user should never edit) and the project (which is entirely theirs). ## Decision ### Three published distributions `openlakeforge` owns the `olf` console command and pins `openlakeforge-core` and `openlakeforge-lakehouse-services` exactly. The second holds the service clients `olf` shares with the platform API (ADR 0021). `release/component-catalog.yaml` is the canonical release identity; its alpha form (`0.2.0-alpha.1`) maps to PEP 440 (`0.2.0a1`), and the release-readiness gate fails if the catalog and any of the three `pyproject.toml` files disagree. Publication uses GitHub OIDC Trusted Publishing. GitHub Releases keep signed checksums, SBOMs, and build provenance. ### The wheel carries a verified platform payload The `openlakeforge` wheel and sdist embed a deterministic, allowlisted `platform.tar.gz` — Terraform roots, Helm values, schemas, Dockerfiles, shared libraries, the release catalog, and the demo project — plus a per-file manifest. An installed `olf` verifies that manifest and extracts atomically under `OLF_HOME/distributions` before use. Helm charts stay **outside** the wheel. The catalog pins each chart's repository, exact version, and archive SHA-256; `olf` caches and verifies the archive before Terraform is allowed to use it. Charts are large, independently versioned, and already have an upstream distribution channel; what matters is that the digest is checked, not that the bytes ship in the wheel. ### Platform and project are separate roots | Root | Holds | Mutability | | --- | --- | --- | | `distribution_root` | Terraform, Helm values, schemas, Dockerfiles, `openlakeforge_runtime/`, release catalog | Immutable, shared between projects | | `project_root` | `openlakeforge.yaml` and `lakehouse_code/` — descriptors, Floe contracts, dashboards, pipelines | The user's, writable | | state / work / cache roots | Terraform state and data, generated artifacts, Docker staging, Helm downloads | Derived | An installed `olf` resolves `project_root` to the **current working directory**. `OPENLAKEFORGE_PROJECT_ROOT` and `--project-root`/`--repo-root` override it. A source checkout keeps the checkout as the contributor default; the two modes stay distinct rather than one emulating the other. `ProjectSpec` is the typed project/distribution boundary for project consumers. It supplies canonical paths for the profile, descriptors, Bronze, Silver, Gold, dashboard, and Dagster directories. `olf project validate --project PATH` emits a JSON report for the structural layout, the Deployment Profile, descriptors, inventory, and declared assets. The profile's typed model and its resolution into one effective topology are ADR 0011; `olf project validate` parses it, `olf profile resolve` resolves it. The consequence worth naming: scaffolding validates user descriptors against schemas that live outside the project, because the schema is platform material and the descriptor is not. ### `olf init` makes a directory into a project It verifies the payload, provisions or reuses the pinned toolchain, checks Docker, and copies the packaged demo `lakehouse_code/` into the current directory — or writes a transitional skeleton under `--empty` (ADR 0005). It renders `openlakeforge.yaml` from the requested stages (`--stages`, DEV by default), preset (`--preset`, Slim by default) and name (the directory's, normalised to a label value), and validates it with the profile parser before writing anything. `--profile-only` writes only that profile, into a project that already has `lakehouse_code/`, and needs neither the toolchain nor Docker. A full initialization stages into a sibling directory and renames into place, and refuses to overwrite either existing project path; `--profile-only` creates `openlakeforge.yaml` directly with an exclusive create, refusing an existing one. It never installs Docker or uses Git. Within the project directory it touches only `openlakeforge.yaml` and `lakehouse_code/`; the toolchain and payload verification steps write outside it, to the shared, immutable `OLF_HOME` (ADR 0008) — never to the project itself, and never requiring the user to know that boundary exists to run `olf init` successfully. ## Consequences The supported consumer path is: ```text mkdir my-lakehouse && cd my-lakehouse pip install openlakeforge olf init # or: olf init --stages dev,prod olf infra platform apply -f openlakeforge.yaml ``` No subsequent command needs `--project-root .`. Automatic Terraform state migration between releases is out of scope for the alpha. Upgrading is documented per release, not automated. ## History Merges the decisions previously recorded as ADR 0031 (the PyPI embedded platform payload) and 0032 (the installed project root). ADR 0032's transitional-project rule is recorded in ADR 0005 alongside the descriptor model it waives. Updated for the v0.3 external project contract: `ProjectSpec` makes the project/distribution split explicit, and `openlakeforge.yaml` is the required project-root Deployment Profile, parsed and resolved per ADR 0011. 2026-10-01: `olf init` renders and validates the Deployment Profile from `--stages`, `--preset` and `--name` instead of copying a fixed one, and `--profile-only` gives an existing project its profile. The consumer path ends with `olf platform apply -f`. `openlakeforge-lakehouse-services` became the third published distribution, the library ADR 0021 shares between `olf` and the platform API. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0009-distribution.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0009-distribution.md). --- # ADR 0010: Cloud provider implementations (AWS, Azure) > Binding. Both are proof-of-concept maturity; secure identity, ingress, and network policy remain outside the active profile. Source: https://openlakeforge.dev/docs/adr/0010-cloud-provider-implementations/ ## Status Binding. Both are proof-of-concept maturity; secure identity, ingress, and network policy remain outside the active profile. ## Context Local and Azure use Polaris while AWS uses Glue. v0.3 adds shared DEV, optional UAT, and PROD stages in one cluster. Reusing a default Glue catalog with the same unqualified database names would collide across stages or force a provider-specific SQL naming scheme. A native Glue catalog per stage (this decision's original design) turned out to be unavailable: this account's Glue service rejects `CreateCatalog` (`InvalidInputException: Create glue native catalog is not supported`), confirmed directly against the account, independent of any Terraform configuration. That is an account/region-level restriction, not a provisioning bug, so the decision below replaces the custom-catalog design with a shared-catalog fallback instead. ## Decision Local and Azure retain a shared Polaris service with one physical catalog per enabled stage — a real, separate physical catalog, so their owner/layer namespaces (e.g. `sales_silver`) need no further qualification. AWS instead provisions every stage against the account's one default Glue catalog (bare 12-digit account ID, no catalog-name suffix); no `aws_glue_catalog` resource is created. The logical SQL alias is still `lakehouse_` for every provider, but on AWS it names a set of namespace-prefixed physical databases inside that one shared catalog rather than a distinct catalog: `resolve_physical_names` prefixes every physical Glue database/schema name with `_` (e.g. `lakehouse_dev_sales_silver` instead of bare `sales_silver`), keeping every stage's databases collision-free in the shared catalog. `lakehouse_dev.sales_silver.orders` and `lakehouse_prod.sales_silver.orders` therefore select the *same* Glue catalog ID and differ only in which prefixed database Trino resolves the bare `sales_silver` namespace to. Isolation between stages moves from the catalog boundary to this namespace_prefix, enforced in two layers: - IAM scopes each stage's Pod Identity role to `database/_*` and `table/_*/*` Glue ARNs (bare `catalog` resource, since the catalog itself is shared and cannot be scoped per stage). - Trino's file-based access control adds a second, defense-in-depth layer: a `tables` rule grants a stage's identity full privileges only on `_.*`-matching schemas within the shared catalog, denying everything else — necessary because the `catalogs` rule alone only gates which catalog a client may use, not which schemas it can see once inside a Glue-provider stage's catalog (every stage's schemas are physically visible from every other Glue-provider stage's catalog, since they all resolve to the same underlying Glue catalog ID). AWS stage contracts carry Glue region, catalog ID (the bare account ID, shared across stages), and workload-identity reference, never credentials. Runtime access is stage-scoped: a stage runtime receives only its storage, catalog alias, activation prefix, and identity reference. EKS Pod Identity remains the AWS workload identity mechanism. Azure retains AKS OIDC readiness, and local retains development-only Kubernetes Secrets. ### Existing provider substitutions remain binding AWS continues to use EKS, S3 for Bronze/Silver/Gold/ops, RDS PostgreSQL, ECR, and Pod Identity behind the existing capability interfaces. Azure continues to use AKS and ACR while retaining SeaweedFS, Polaris, and in-cluster PostgreSQL. Trino remains the shared query path; Athena is deferred because it would change query cost, Superset connectivity, validation, and runtime contracts. Polaris on local and Azure uses its dedicated persistent PostgreSQL role and database. Its catalog state must survive a pod restart; an in-memory metastore would lose catalogs, namespaces, principals, and tables. Polaris credentials reach workloads through Kubernetes Secret references, never Terraform outputs or rendered Helm values. AWS Pod Identity replaces IRSA because the validation environment cannot create the required IAM OIDC provider. Its contract remains `identity.aws_pod_identity`; AWS storage and catalog authentication use the stage workload-identity reference rather than static keys. Account-specific tags, ownership, region, and cluster naming remain in ignored `sandbox.tfvars` files or environment variables. All providers retain local Terraform state, Kubernetes Secrets, port-forward access, no ingress/TLS, no external secret manager, and no Lake Formation. Secure-state, private-network, least-privilege, and external-secret work belongs to the secure beta profile. ## Consequences The catalog technology remains Polaris for local/Azure and Glue for AWS; no new Iceberg catalog technology is introduced. Physical Glue and S3 names stay out of Deployment Profiles and `lakehouse_code` descriptors, but AWS's shared catalog means every consumer that resolves a physical Glue database/schema name (Floe's per-domain profile rendering, `olf infra catalog sync-namespaces`, dbt profile/source schema config) must apply the same `namespace_prefix`, or it silently resolves to the wrong stage's database, or one IAM denies. External Secrets, ingress, network policy, and live cross-stage isolation probing (proven for local; not yet wired for AWS/Azure) remain follow-on work. ## History 2026-08-31: Reverted the custom-Glue-catalog-per-stage design: this account's Glue service does not support `CreateCatalog`, confirmed directly against the account. AWS now provisions every stage against the account's one default catalog, with a `namespace_prefix` on physical database/schema names carrying the isolation the catalog boundary can no longer provide, backed by a second, defense-in-depth Trino `tables` access-control layer on top of IAM's `database/_*` scoping. Verified end-to-end (deploy, full e2e across three product pipelines, destroy) against a live AWS account; the code that implemented this same v3 stage-aware provisioning for Azure remains `terraform validate`/`plan`-verified only (#114's AWS/Azure completion). 2026-08-28: Rewritten for v3 stages. The former single AWS Glue catalog mapping is replaced by a custom Glue catalog per stage so canonical SQL remains portable. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0010-cloud-provider-implementations.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0010-cloud-provider-implementations.md). --- # ADR 0011: Deployment Profile v1beta1 — provider, stage, and preset > Binding. Source: https://openlakeforge.dev/docs/adr/0011-deployment-profile-and-stages/ ## Status Binding. ## Context v0.3 (`#111`) introduces shared lifecycle stages (`dev`, optional `uat`, `prod`) and exact-revision promotion between them on one Kubernetes cluster. Building that requires one versioned, user-facing description of what a deployment should look like, resolved before any Terraform, Helm, or Kubernetes object exists. Before this record, `olf deploy --provider local --profile slim|full` conflated separate concepts behind two flags: - **provider** — where the deployment runs (`local`, `aws`, `azure`); - **stage** — a shared lifecycle boundary (`dev`, `uat`, `prod`); - **preset** — a named default/override set for optional capabilities (`slim`, `full`); - **runtime** — the query engine a stage uses (only Trino exists today). A fourth profile concept, **sizing**, was added later (#323): how large the shared query engine and the self-hosted object storage are. `--profile` names the preset but reads as an environment; ADR 0002 already warns "`--profile` is not a phase," and ADR 0009 called the project-root `openlakeforge.yaml` "a structural marker pending its semantic resolver." Neither record gave the four concepts distinct types. This ADR does. ## Decision ### The concepts stay distinct types throughout the resolver | Concept | Values (v1) | Lives in | | --- | --- | --- | | Provider | `local`, `aws`, `azure` | `spec.provider.type` | | Stage | `dev`, `uat` (optional), `prod` | `spec.stages.` | | Preset | `slim`, `full` | `spec.preset` | | Sizing | `query`: `small` (`medium`, `large` named but rejected); `storage`: `small`, `medium`, `large` | `spec.query.size`, `spec.storage.size` | | Runtime | not exposed — Trino only | not a v1 field | `spec.provider.type` selects a deployment target and the *defaults* for each capability adapter: cluster, object storage, metadata database and catalog. `spec.cluster.adapter`, `spec.storage.adapter`, `spec.catalog.adapter`, `spec.metadata_database.adapter` and `spec.state.backend` reserve the selection points before the beta freeze. Only the provider's current defaults are accepted; another selection fails with the issue that implements it. Later milestones extend those selectors for existing Kubernetes (#802), external S3 (#803), external PostgreSQL (#335) and remote Terraform state (#905/#132), with their adapter-specific settings. They do not change what `provider.type` means. In the v1beta1 schema `aws` and `azure` are preview: accepted, but the beta compatibility promise covers `local` only. | Selector | Local default | AWS default | Azure default | | --- | --- | --- | --- | | `cluster.adapter` | `kind` | `eks` | `aks` | | `storage.adapter` | `seaweedfs` | `s3` | `seaweedfs` | | `catalog.adapter` | `polaris` | `glue` | `polaris` | | `metadata_database.adapter` | `postgresql` | `rds` | `postgresql` | | `state.backend` | `local` | `local` | `local` | The resolver emits these choices as `adapters` in its JSON output, including when the selectors are omitted. Explicit defaults resolve identically to omitted selectors; they introduce no Terraform or runtime change. On AWS, `storage.adapter: s3` is valid but `storage.size` remains rejected because managed S3 has no self-hosted volume to size. A provider is not a stage. A stage is not a Kubernetes cluster — v0.3 runs every stage on one shared cluster. A preset is a default/override set for optional per-stage capabilities, not a second architecture. Runtime choice stays out of the schema entirely while Trino is the only supported shared-stage runtime; adding it later is an additive schema change, not a retrofit. ### Deployment Profile v1beta1 The project-root `openlakeforge.yaml` describes product intent only: ```yaml apiVersion: openlakeforge.io/v1beta1 kind: DeploymentProfile metadata: name: acme-data spec: provider: type: aws region: eu-west-3 preset: slim stages: dev: enabled: true prod: enabled: true capabilities: analytics: true governance: true ``` `tools/olf/olf/common/profile.py` models this as frozen typed value objects (`DeploymentProfile`, `ProviderSpec`, `StageSpec`, `StageCapabilities`, plus `AccessSpec` and `IdentitySpec` for the optional `spec.access` and `spec.identity`) and resolves it into a separately typed `DeploymentTopology`. The desired and resolved shapes are never the same object: `DeploymentProfile` is what the user wrote, `DeploymentTopology` is the one effective, fully-defaulted result. Validation is layered the same way as the Lakehouse/Source descriptors (ADR 0005): a hand-rolled parser in `olf/common/profile.py` for actionable, fail-closed errors, and `docs/schema/deployment-profile.schema.json` for the versioned, tool-checkable shape. Neither substitutes for the other, and both are exercised by `olf check contracts`. ### Sizing: `spec.query.size` and `spec.storage.size` Two optional fields choose a size for the shared Trino (`query`) and for self-hosted object storage (`storage`, SeaweedFS). The vocabulary is `small | medium | large`; the profile never carries CPU, memory, worker, heap or volume quantities. `spec.query.size` is the default for every stage and `stages..query.size` overrides it (#972); `storage` has one platform-wide size. Both default to `small`, which is today's footprint, so a profile without the fields resolves and renders exactly as before. The per-stage size lets a small DEV sit beside a larger PROD. It landed before the v1beta1 freeze (#532) because a platform-wide query size frozen in the beta could not become per stage without a breaking change. Each stage has its own Trino (ADR 0019 section 9), rendered at that stage's size on the local root (#976). AWS and Azure still render one shared Trino, at the largest enabled stage's size. Only tiers with a tested backend are accepted. For `query`, `medium` and `large` are part of the vocabulary but fail validation, naming the issue that will implement them (#324, Trino workers), rather than being accepted as a promise nothing keeps. `storage.size` accepts all three (#326). Growing the set is the change that implements and tests the tier; existing profiles stay valid. `storage.size` is also rejected on `aws`, whose object storage is managed S3 with no volume to size; it applies on `local` and `azure`, where SeaweedFS is self-hosted. The resolved sizes are carried on `DeploymentTopology` (`query_size`, `storage_size`) and printed by `olf profile resolve`. `query_size` selects a row of `release/query-sizes.yaml`, which the local root receives as its `query_sizing` variable (AWS and Azure keep their Trino values until their own adapter changes); a size change therefore moves only the Trino Helm values, never a ProjectRevision or the project image. `storage_size` reaches the local and Azure roots as the `storage_size` Terraform variable, which selects a row of `release/storage-sizes.yaml`: the one provider-neutral table, read by the SeaweedFS module for the PVC sizes and the volume server's slot count, and by `olf` for the expansion rule. `small` is the sizing the module carried before the profile could choose, so a profile without the field renders the same Helm values. `medium` and `large` are provisional until #329 measures them. The capacity preflight is #327. A volume only grows. Before the platform apply, `olf` reads the SeaweedFS claims in the shared namespace and refuses, before any mutation, a size below a claim's current request, and a larger size when the claim's StorageClass does not set `allowVolumeExpansion: true`. It never deletes and recreates a volume. Where it does expand, it patches the claims and deletes the SeaweedFS StatefulSets with `--cascade=orphan`, because Kubernetes forbids editing their volume claim templates. kind's default `standard` class does not expand, so the local profile is sized at creation; the migration is documented in the Deployment Profile reference. ### `spec.project`: the customer's source and image registry An optional `spec.project` declares `repository` (the source URL, provenance only: `olf` builds the checked-out directory and never trusts a ref's mutable head), `image.repository` (`host[:port]/path`, no tag or digest) and `image.pull_secret_ref.name` (a Kubernetes Secret created out-of-band). The profile carries references, never credentials: unknown fields, credentials in a URL and a registry-less image reference are rejected. `spec.identity.github` stays platform human roles; it never holds registry credentials. ADR 0012 still keeps `openlakeforge.yaml` out of a `ProjectRevision`. `olf.common.profile.resolve_project` picks the image repository in a fixed order: explicit profile, then `PROJECT_CODE_IMAGE_REPOSITORY` (compatibility override), then the provider registry (ECR or ACR) for a declared project without an image, and the public example only when `spec.project` is absent. A declared project never resolves to the example, and a local project must name its image because kind has no registry. Existing profiles are unchanged. The resolver exposes the result; wiring it into the deploy is #539 and #540. ### Resolution is deterministic | Input | Effective result | | --- | --- | | Stage absent from `spec.stages` | Disabled; PROD is never created implicitly | | Stage present, `enabled` omitted | `enabled: true` | | Stage present, no `capabilities` | Preset default (`slim` → both `false`, `full` → both `true`) | | Stage present, capability stated | Explicit value wins over the preset | | Disabled stage | Capabilities always resolve to `false`, regardless of what was written | ### Fail-closed validation Unknown fields at any level, an unsupported `apiVersion`/`kind`, an unknown stage name, an unsupported `preset` or `provider.type`, no stage enabled at all, a `region` set for `provider.type: local`, and a `uat`/`prod` stage enabled while `dev` is disabled (every promotion in the v0.3 model sources from DEV) are all rejected before a resolved topology is produced. ### v1 frozen exclusions The following are not v1 profile fields, because no provider adapter maps them to anything real yet — a field with no implemented, testable mapping becomes a no-op promise, which is worse than deferring it: `runtime`, personal workspace policy, raw CPU/memory/worker/volume sizing (only the `small | medium | large` vocabulary above exists), availability, raw namespaces, replicas, resources, Helm values, Terraform modules or backends, IAM policies, credentials, images, PVCs, buckets, catalogs, and generated endpoints (the project image repository and pull secret *name* of `spec.project` are the declared exception: user-owned references). `DeploymentTopology` carries only logical service identities (`catalog`, `query`, `metadata_database`, `governance` as shared services; `orchestration`, `reporting` per stage) — never namespaces, Helm releases, or endpoints. The one exception is `identity` (`issuer_url`, `role_claim`, `role_mapping`): an external issuer's URL and claim vocabulary are user-owned facts that no provider can generate, and the provider contract must be checked against them (ADR 0014). It is never a credential. The typed provider-contract v3 resolver derives those from this topology (ADR 0003): every platform root emits and provisions the resolved stage bindings through its provider adapter (#133, #114). None belongs in this profile. ### The v0.2 compatibility path `olf infra deploy --profile slim|full` stays as a deprecated shorthand: `olf.common.profile.legacy_single_stage_topology` resolves it to one enabled DEV stage using the preset's capability defaults, proving the shorthand is exactly the single-DEV-stage case of the general model. `DeploymentContext` now carries the resolved topology and the selected stage. The provider comes from the project-root Deployment Profile's `spec.provider.type`; `--provider` is optional and must match it. With no `--profile`, the profile is authoritative; an explicit `--profile slim|full` resolves the single-DEV shorthand for the profile's provider. A project with no profile file at all resolves the shorthand on `--provider`, or `local`. A profile file that exists but is invalid, or that targets another provider than `--provider`, fails closed, with or without `--profile`. Namespaces are derived from the topology but are not part of it: `olf-system` for shared services and `olf-` per enabled stage live in `olf.common.deployment.context`, since ADR 0011 keeps the resolved topology free of namespaces, Helm releases, and endpoints. ## Consequences - `olf profile validate` and `olf profile resolve --json` expose the effective topology before any mutation, for both humans and CI. - The stage-aware platform, data plane, project revision and activation (`#133`, `#114`, `#154`, `#115`) consume `DeploymentTopology`, not `--profile`/`--provider` flags directly: `olf infra platform apply -f` and `olf infra project deploy -f --stage` take the profile file. - Local, AWS, and Azure POC shapes are representable without credentials, raw resource values, or endpoints — those stay behind provider contracts (ADR 0003). ## History New record. No prior ADR modeled provider, stage, and preset as distinct types; ADR 0002 and ADR 0009 are corrected in place to stop describing `--profile` as an environment or the profile file as inert. 2026-08-28: Updated the provider-contract handoff after v3 established the typed topology-to-provider boundary; no profile fields were added. 2026-08-29: The topology reaches Terraform (#133). `DeploymentContext` resolves it, the local platform root consumes it as typed variables, and namespace derivation is recorded as living outside the topology. No profile fields were added. 2026-10-01: Rewritten as current behavior for the 0.3.0-alpha.1 release: the roots provision the resolved bindings, and the lifecycle commands consume the topology. No profile fields were added. 2026-10-02: Added optional `spec.access` (`base_domain`, `issuer`) for service access (#264). It is deployment configuration owned by ADR 0013, not a fifth topology concept; omitted, it defaults to the local evaluation install. 2026-10-09: Added optional `spec.identity` (`issuer`, and for an external issuer `issuer_url`, `role_claim`, `role_mapping`) selecting the OIDC issuer. The seam is owned by ADR 0014; the resolved topology carries it and the provider contract must match it. `spec.project` (#538) added in place: the customer's source and image registry as references, with a fixed resolution order and no credentials. The earlier "images" exclusion is narrowed to what the paragraph above allows. 2026-10-30: Sizing (#323) added as the fourth profile concept: optional `spec.query.size` and `spec.storage.size`, default `small`. Per the v0.6 lightweight-beta decision of 2026-10-27, `medium` and `large` fail validation until a tested backend lands (#324, #326) and `storage` is rejected on `aws`. The "sizing" exclusion is narrowed to raw resource values; the contract slice changes no rendered Terraform or Helm input. 2026-10-30: `storage_size` drives the SeaweedFS volume sizes through `release/storage-sizes.yaml` (#326). `small` renders the Helm values it did before; `medium` and `large` stay rejected until the grow-only rule lands. 2026-10-30: `query.size` renders Trino from `release/query-sizes.yaml` through the local root's `query_sizing` variable (#324). `small` renders the same values as before. The `medium` and `large` rows are defined but still fail validation: workers need network flows, authentication across nodes (#367) and a kind run before the tier counts as tested. 2026-10-30: `storage.size` accepts `medium` and `large` (#326) when a deployment is created; a change to an existing deployment's size is refused before the platform apply until growing in place lands. `query.size` still accepts `small` only. 2026-10-31: an existing deployment's volumes grow in place where the claim's StorageClass sets `allowVolumeExpansion: true` (#326): `olf` patches the claims and releases the SeaweedFS StatefulSets with `--cascade=orphan` before the apply. Shrinking, and growing on a class that cannot expand, stay refused. 2026-11-06: `--provider` defaults to the profile's `spec.provider.type` instead of to `local`. A `--provider` that contradicts an existing profile now fails instead of warning and resolving a single DEV stage, and `--profile slim|full` no longer bypasses the profile file: an invalid or mismatched one fails closed. Without a profile file the shorthand behaves as before. 2026-11-07 (#960): per-stage query size decided with one Trino per stage (#965), before the v1beta1 freeze; nothing built. 2026-11-07 (#996): recorded what `provider.type` promises (target plus per-capability defaults, overridable by later additive fields) and that `aws` and `azure` are preview in v1beta1; `olf profile validate` prints a notice. 2026-11-07: `stages..query.size` added (#972); the resolver carries one query size per stage. Rendering a coordinator per stage is still #965. 2026-11-10 (#1056): reserved capability adapter selectors with provider-derived defaults and explicit rejection of unimplemented choices. The resolver prints the selected adapters. AWS may name `storage.adapter: s3`; its storage size remains unavailable. Remote state and external-service connection settings stay with their adapter implementation issues. 2026-11-11 (#532): the profile is `openlakeforge.io/v1beta1`. The one field change from v1alpha1 is `spec.access.issuer`, now `tls` only. A v1alpha1 file is not read: validation names `olf project migrate`, which rewrites the version line and the key and refuses anything it cannot move safely. `query.engine` and `spec.expose` are not fields; DuckDB stays outside the profile until its Slim conformance gates pass (#547), and public exposure waits for the cloud beta. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0011-deployment-profile-and-stages.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0011-deployment-profile-and-stages.md). --- # ADR 0012: Project revisions — a build-once, content-addressed promotion unit > Binding. Source: https://openlakeforge.dev/docs/adr/0012-project-revisions-and-promotion/ ## Status Binding. ## Context v0.3 (`#111`) promotes one immutable project revision unchanged across shared DEV, optional UAT, and PROD (`#154`). Until Floe 0.8, v0.2's immutable revision (`olf floe revision`) covered Floe runtime artifacts rendered from the live provider contract environment -- configs, profiles and generated manifests. That rendered output is stage-bound. A generated manifest embedded the stage's report bucket, Kubernetes namespace, catalog endpoints and Secret names, so a manifest generated for DEV could not be replayed unmodified in PROD, and hashing it would have put target-stage endpoints inside the unit #154 requires to promote unchanged. The project-code image inherited the problem: it baked the Floe revision it was built against, so "the same digest deploys to DEV and PROD without a rebuild" was unreachable. ## Decision ### A project revision freezes inputs, never rendered stage output `ProjectRevision` (`tools/olf/olf/infra/project_revision.py`) is the one content-addressed revision, covering the complete promotable project: | Component | Source | Excluded because | | --- | --- | --- | | `descriptors` | `lakehouse_code/governance.yml`, `bronze//source.yaml` | — | | `floe` | `silver/floe.yml`, `silver/sources.yml`, `silver//domain.yml`, `silver//contracts/*.yml` | — | | `dbt` | `gold/**` (no `profiles.yml`, `target/`, `dbt_packages/`, `logs/`) | stage connection and build output, not input | | `dagster` | `pipelines/dagster/.py`, `bronze//dlt/.py` | — | | `reports` | `dashboards/superset//**`, when any dashboard exists | — | | `image` | The project-code repository plus an immutable `@sha256:` digest | mutable tags are rejected | | `distribution` | `release/component-catalog.yaml` distribution version and runtime contract version | compatibility gate at activation | `openlakeforge.yaml` (the Deployment Profile), the Floe EnvironmentProfile the code location renders for its stage, and any URI a provider contract resolves are never in a project revision. Enabling UAT, or moving a project between providers, must not invalidate an already-built revision; and a revision that embedded a rendered artifact could not be replayed against a different stage's contract environment, which is exactly what `#115` needs it to do. The Floe runtime version (`floe-python` and `dagster-floe`, pinned in `images/project-code/pyproject.toml`) is part of the image, and so is covered by the `image` component's digest rather than duplicated inside `floe`. ### Content address, publish, and verify Each component is a `{relative project path: sha256}` map. The aggregate revision is a sorted `/\0digest\n` hash over the flattened entries, so an empty project and a tampered entry set fail the same way. Publication is immutable: an existing key with different content is a hard collision error, never a silent overwrite. `tools/olf/olf/infra/artifact_store.py` owns the bucket/client resolution revisions publish through (`RevisionStore`, `S3RevisionStore` for in-cluster or direct cloud S3, `FilesystemRevisionStore` for `olf infra project build --output DIR`). ### A revision is compatible by runtime contract, not by distribution version What a revision depends on is the contract between the platform and the project-code image: the environment variables the code server receives (`RUNTIME_ENV` and `RUNTIME_ALIASES`), both in `olf/common/runtime_contract.py`. `release/component-catalog.yaml` records `distribution.runtime_contract` with the current integer `version`, the `accepts` list of versions this distribution still runs, and a `binding_fingerprint` of that surface. A sidecar with `schema_version` 3 records `runtime_contract_version`, and also writes it into the `distribution` component so the revision digest binds it. `verify` accepts it when the version is in the running distribution's `accepts`, whichever distribution built it, so a patch release does not force a rebuild. Outside the range it fails with both versions and tells the operator to rebuild. Sidecars at `schema_version` 1 and 2 carry no contract version and keep the exact distribution-version match; nothing widens silently. `olf release check` fails when the binding surface changes and the fingerprint in the catalog does not. A change that breaks existing revisions bumps `version` and removes the versions that no longer work from `accepts`; a change they survive keeps `version` and only refreshes the fingerprint. For customers, a bump means revisions built before it must be rebuilt and promoted again before the upgraded platform will activate them. The fingerprint covers names and mount paths. It does not cover the Dagster version the platform runs or what a value means to the code server, so a platform change of that kind must bump the contract by decision, not by detection. The Dagster pin is deliberately not part of the surface: it moves with most releases, and treating each move as a contract change would bring back the rebuild-on-every-patch behaviour this rule removes. Because the running distribution can differ from the one that built a revision, the activation records the running distribution version; re-activating a revision after a platform upgrade therefore rolls out again instead of matching the earlier activation and skipping Helm. ### Validation is layered the same way as descriptors and profiles `ProjectRevisionManifest` has a hand-rolled model (`to_json`/`from_json`/ `validate`) for actionable, fail-closed errors, and `docs/schema/project-revision.schema.json` for the versioned, tool-checkable shape (ADR 0005, ADR 0011). `olf infra project build` runs both: the manifest must round-trip through its own aggregate check, declare every required component (`descriptors`, `floe`, `dbt`, `dagster`, `image`, `distribution`), carry a digest-pinned `project_code_image`, and pass a value scan before it is published and before it is read back by `inspect`/`verify`. The value scan (`_FORBIDDEN_VALUE_PATTERNS` in `project_revision.py`) is deliberately narrower than "no `http(s)://`/`AWS_*`/`SECRET`": a bare env-var *name* (`AWS_REGION`) or Kubernetes Secret *reference* (`secret_name:`/`secretRef`/`client_secret_key`) is the sanctioned way a credential reaches a pod and must never be flagged, only a concrete physical value. It rejects `s3://` (always a bucket location, ADR 0004), bare `http://` (this codebase's own convention for every in-cluster stage endpoint — external APIs are `https://`, which is allowed), a concrete `AKIA...` AWS access-key ID, and an assignment of a bare credential noun (`password: ...`, `api_token = "..."`) to something that is not itself an env-lookup or substitution expression (`os.environ[...]`, `os.getenv(...)`, `${VAR}`) with no default -- a *default/fallback* argument on that same lookup (`os.getenv("TOKEN", "sk-live-...")`, `${DB_PASSWORD:-hunter2}`) is exactly where a real secret hides once the bare reference is exempted, so it is checked and rejected explicitly rather than falling through the exemption. It is a defense-in-depth layer, not a certified secret scanner — the load-bearing guarantee is architectural: frozen inputs are provider-neutral descriptors, checked-in Floe contracts, dbt/Dagster source, and report assets (never a rendered artifact), so a physical endpoint or credential should never appear in them to begin with. ### Stage binding happens on the pod Nothing a revision freezes names a stage. The Floe project's storages and catalog are filled in when the code location loads: `openlakeforge_runtime/floe_profile.py` renders the EnvironmentProfile from the provider-contract values the activation release sets on the pod, and dagster-floe builds the manifest in memory from that profile and the frozen contracts. One project-code image digest therefore serves every stage, and activation publishes no Floe artifact of its own. dbt and dlt bind the same way (#546): - **dbt.** The image carries one profile, `openlakeforge_runtime/dbt/profiles/trino.yml`, whose host, port, user and catalog are `env_var()` references with no default, so a pod missing one fails instead of reaching another stage. The image bakes a manifest parsed with placeholder values that no stage uses. It exists only so Dagster can load definitions. Each run re-parses in a fresh target path with its pod's values, and the run's own manifest is the one uploaded. - **dlt.** A source's `source.yaml` names the keys its loader reads (`runtime.config` / `runtime.secrets`). The stage binds their values in the ConfigMap `olf-source-` and the Secret `olf-source--credentials` in its own namespace. A product job's run pod receives them as dlt's own `SOURCES____` names. Incremental state lives in the stage's Bronze bucket under the pipeline `__`, so no stage reads another's cursor. - **What a pod receives.** The code location's container gets only the contract values the runtime reads (`_RUNTIME_ENV`), plus the stage itself. A source's bindings go to the run pods of the jobs that load it, never to the code server. Changing a stage's endpoint, credential or bucket therefore changes neither the revision digest nor the image. A source binding is read when a run pod starts, so editing its ConfigMap or Secret takes effect on the next run without a redeploy. A provider-contract value reaches the code location through its Helm release, so changing one means activating the same revision again. `olf infra deploy` refuses an activation whose sources the stage has not bound, and reads Secret key names only. The [provider contracts](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/provider-contracts.md#where-stage-bindings-reach-a-workload) document lists each path and its limits. ### CLI surface | Command | Behavior | | --- | --- | | `olf infra project build --project P --image REF` | Validate the project, freeze its content, resolve/require a digest-pinned image, publish | | `olf infra project revision inspect --revision R` | Read a published manifest without rebuilding source | | `olf infra project revision verify --revision R` | Re-verify manifest self-consistency, the distribution-compatibility gate, and every published object's digest | | `olf infra project deploy -f PROFILE --stage STAGE --revision R` | Materialize only verified published content and activate the stage | | `olf infra project status -f PROFILE [--stage STAGE] [--json]` | Compare immutable activation records with the observed user deployment | ## Consequences - `#115` consumes `ProjectRevision.project_code_image` and per-component digests to activate a stage without ever rebuilding from source. - A revision built once is byte-identical regardless of which stage it is later activated in, or which path on disk the project was built from — `openlakeforge.yaml` and every stage binding are outside its content address by construction. - An activation (`ACTIVATION.json`, schema 2) binds the project revision, the stage's provider-contract digest, its capabilities and the image; it carries no Floe revision. Schema-1 records, written while Floe manifests were rendered per stage, still read and hash exactly as published, so a stage activated before the change stays inspectable. They are not a rollback target: the move to Floe 0.8 is one-way, and the platform no longer serves the manifests their image needs, so a deploy whose pointer fails to commit over one keeps its new release and asks to be rerun. ## History 2026-09-03: #115 added the derived `ProjectActivation` identity. It records the project revision, stage contract binding, Floe runtime revision, enabled capabilities, and digest-pinned image under `activations//revisions/sha256//ACTIVATION.json`; the mutable `ACTIVE.json` pointer changes only after the Helm rollout succeeds. 2026-10-28: Floe 0.8 builds its manifest in memory in the code location (#533). The v0.2 Floe runtime-artifact revision, `olf floe revision` and the per-stage manifest rendering at activation are removed, `ProjectActivation` moves to schema 2 without a Floe revision, and the `floe` component covers the multi-file Floe project. 2026-10-28: dbt `profiles.yml` leaves the `dbt` component (#546). The reference products no longer track a rendered copy, and `olf dbt parse` / `olf check dbt` render the profile outside the project, so a local parse cannot change the revision. 2026-10-29: the `descriptors` component freezes `governance.yml` in place of `lakehouse.yaml` (#545). Domains and products are the only business metadata the file carries; sources and dashboards are found from their directories. 2026-10-29: dbt, dlt and the code location bind on the pod (#546). The image carries one environment-variable-only dbt profile and a stage-neutral manifest that every run re-parses. dlt sources declare their runtime keys in `source.yaml` and receive per-stage ConfigMap and Secret bindings on their jobs' run pods. dlt state is scoped to `__` in the stage's Bronze bucket, and the code location receives an explicit allowlist of contract values instead of every `OPENLAKEFORGE_*` key. New record. No prior ADR modeled a promotable project revision distinct from the v0.2 Floe runtime-artifact revision; ADR 0009's distribution-payload identity and ADR 0011's Deployment Profile are the two existing typed identities this one composes with, not supersedes. 2026-11-07: #992 made revision compatibility depend on the runtime contract version instead of the exact distribution version (sidecar `schema_version` 3). The distribution component still records the building distribution's version for reference, but a patch release no longer invalidates the revision active in PROD. 2026-11-11: #1051 dropped `OPENLAKEFORGE_QUERY_TRINO_TLS_PORT` and the query CA mount path from the binding surface, and the runtime package's optional Trino TLS and password reads with them (Trino serves plain HTTP with no authentication since ADR 0016). Contract 1 stays current and accepted: nothing sets the removed variables, so an older revision's runtime takes its defaults (`http`, no method, no password) and runs unchanged. Only the fingerprint moved. 2026-11-12: the `dbt` component is `gold/**`, the single Gold dbt project (ADR 0004). It was each product's `gold//dbt/**`. 2026-11-12: the `floe` component's domain files are `silver//contracts/*.yml`, with the domain file named `domain.yml`. They were `silver//contracts/floe/*.yml` with `_domain.yml`. 2026-11-13: the `floe` component's domain file is `silver//domain.yml`, which loads the entities in `silver//contracts/*.yml` through its `entities` glob (Floe 0.10.1). It was `silver//contracts/domain.yml`. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0012-project-revisions-and-promotion.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0012-project-revisions-and-promotion.md). --- # ADR 0013: Service access — one ingress, configured by domain and TLS mode > Binding. The local root runs the ingress adapter and emits access.ingress with routes for Dagster and Superset per stage, Trino, OpenMetadata when… Source: https://openlakeforge.dev/docs/adr/0013-service-access-and-ingress/ ## Status Binding. The local root runs the ingress adapter and emits `access.ingress` with routes for Dagster and Superset per stage, Trino, OpenMetadata when governance is enabled, the portal landing page at the base domain, and `auth.` for the identity provider; the AWS and Azure roots still emit `access.kubectl_port_forward`. ## Context Users reach Dagster, Superset, OpenMetadata, and Trino through `kubectl port-forward` to fixed localhost ports. That needs a cluster credential on every workstation, breaks on pod restart, and gives no stable URL or trusted TLS. v0.4 (#20) replaces it for local and on-premises installs. ## Decision 1. **One ingress everywhere.** A local evaluation install and a real install run the same ingress and differ only in configuration. The Deployment Profile carries that configuration as `spec.access`: | Field | Default | Real install | | --- | --- | --- | | `base_domain` | `olf.localhost` | e.g. `olf.example.com` | | `tls` | `none` (plain HTTP) | `external`: your reverse proxy, tunnel or load balancer terminates HTTPS | | `trusted_proxies` | none | with `external`: the CIDR blocks of that proxy, the only peers whose `X-Forwarded-*` headers are believed | The defaults need neither a purchased domain nor a public server, nor a certificate. `local-ca`, a CA the platform creates, is opt-in HTTPS for an evaluation install (every browser must trust it); `external` means the customer terminates HTTPS in front of OpenLakeForge, so Traefik serves HTTP while every generated URL, callback and cookie is `https://`, and it is refused on `*.localhost`, where nothing upstream can terminate TLS; the other providers' default stays `local-ca` because they do not read the block yet and `none` is local-only (decision 9). **The block is the switch (#399).** A profile with no `spec.access` is a quickstart: no Traefik, cert-manager, local CA, CoreDNS rewrite, portal or route Ingresses, and `shared.access` is a port-forward contract (`access.port_forward`, no routes), which `olf` clients and `olf infra forward` serve over `http://localhost:`. Declaring the block, even as `access: {}` for the defaults, turns the ingress on. Block presence was chosen over an `access.exposure` field because a second field would let the block and the field disagree (`access:` present with `exposure: none`), and the defaults above already make an empty block meaningful. On the local provider `spec.identity` requires `spec.access` (the cloud roots do not read `spec.access`): sign-in redirects need the route hostnames, so the profile is rejected at validation otherwise. 2. **Routes sit one level under the base domain:** a stage service is `https://-.` (`dagster-dev.olf.localhost`); a shared service (OpenMetadata, Trino) drops the stage suffix. One wildcard level is all that most client certificates and edge providers cover (#340), so a single `*.` certificate serves every route. Stage names are the fixed set `dev`, `uat`, `prod` and the stage services are `dagster` and `superset`, so no `-` host can equal a shared or reserved host (`trino`, `openmetadata`, `auth`, `oauth2`). The one exception is the portal (decision 7), which is the apex, `https://`. With one Trino per stage (ADR 0019 section 9), Trino is a stage service, `trino-.`, and `trino` is no longer a shared host. The stage services are `dagster`, `superset` and `trino`, and the no-collision argument above is unchanged. Built for the local root (#976): the refs are `stage//query` and `stage//query_api` (the `/v1` path). 3. **The provider contract carries the routes.** `shared.access` gains `base_domain`, `tls`, `tls_mode`, and `routes` — declared together or not at all, so a port-forward contract still parses. `routes` is keyed by the service's existing contract ref (`stage/dev/orchestration`, `shared/governance_service`, `shared/portal`, ...), so a route for a disabled capability or an unknown service does not resolve and is rejected. Consumers read URLs from the contract, never from fixed ports. 4. **Internal endpoints cannot be user-facing.** Only orchestration, reporting, governance, query, identity, and portal may be routed with `exposure: user-facing`. Databases, object-store administration, the catalog service, and the registry may only be `internal`; Dagster code servers have no ref and cannot be routed at all. 5. **Port-forward is an explicit development fallback**, not an access path. `olf`'s own clients (`olf.infra.access.service_url`) use a stage's route when its contract has one, and port-forward when it has none (the AWS and Azure contracts today), when `OLF_PORT_FORWARD` is set, or when the route is in `shared.access.perimeter.protected_routes` of an enabled perimeter (ADR 0014 seam 3), because the ingress answers a request with no session by redirecting to login. Only a caller that tests the ingress itself passes `through_ingress=True`. They resolve `*.localhost` to `127.0.0.1` in-process and, for the `local-ca` issuer, verify against the CA read from the cluster — no `/etc/hosts` edit and no disabled verification. Users trust that CA once with `olf infra access trust`. 6. **Local adapter: Traefik terminates TLS, cert-manager issues.** On kind, Traefik binds host ports 80/443 on `127.0.0.1` through the control-plane node. cert-manager signs from a `local-ca` ClusterIssuer whose root is self-signed once and never rotated by a re-deploy; `olf infra deploy` waits for a probe certificate from it. `tls_mode` is therefore `ingress-terminated` for `tls: local-ca` (`none` for plain HTTP, `edge-terminated` for `external`: Traefik serves only `web`, with no TLS store, no certificate and no host port 443, and trusts `X-Forwarded-Proto` and `-Host` only from `forwardedHeaders.trustedIPs`, set from the profile's `spec.access.trusted_proxies` (required with `external`, refused otherwise, never `0.0.0.0/0`); Traefik discards those headers from any other peer, so a forged one is never read as HTTPS; the perimeter's forward-auth middleware keeps them (`trustForwardHeader`) only in this mode, since otherwise it rebuilds them from its own HTTP connection and oauth2-proxy would send the browser back to `http://`). One wildcard certificate, `*.` plus the bare `` (a wildcard does not match the apex), is issued in the shared namespace by cert-manager's ingress-shim and is Traefik's default certificate (`tlsStore.default`). Traefik's TLS store is global and keyed by SNI, so per-namespace copies of the same wildcard would leave one of them serving every route; stage `Ingress` objects carry an empty `tls` block, which enables TLS on the router and names no Secret. Routes are standard `Ingress` objects, which need no CRD at plan time. Traefik attaches middleware per `Ingress`, so a namespace has one `Ingress` per access group (the role floor, ADR 0014 seam 3); only one in the shared namespace carries the issuer annotation and names the TLS Secret. The `Ingress` without a group holds the routes behind no middleware: the identity route and the perimeter's login callback. 7. **The portal is a page at the base domain.** It lists every route of `shared.access.routes` that is enabled and `user-facing`, grouped by stage, plus an Admin link to the GitHub organisation's teams when the issuer is GitHub. Terraform writes those links as `routes.json` in a ConfigMap from the same route data that feeds the contract, so the page cannot list a service the contract does not route. The pinned [openlakeforge-portal](https://github.com/OpenLakeForge/openlakeforge-portal) image renders it, and the page Logout lands on, from the `olf-system` namespace in the platform phase: the route set is static infrastructure (ADR 0002). Links are not filtered by role; the perimeter (#176) denies what a role cannot open and sends an unauthenticated request to login, and the portal sits behind it like every other route. Stage services sit under their stage; shared services (query, governance) sit under a final "Shared" heading. The page omits itself and the identity route: Dex has no account page and GitHub owns accounts, so when the issuer is `github` it links to `https:///orgs//teams` ("Manage your account and teams on GitHub") instead. 8. **Pods reach the issuer at its Service.** The issuer's public URL is the token's `iss` and the browser's login page; it is compared as a string. A service that validates a token fetches keys and redeems codes at the `internal_url` of the `identity.oidc` contract (ADR 0014), Dex's Service (`http://dex.olf-system.svc.cluster.local:5556`), over plain HTTP: the perimeter proxy, Polaris and the platform API do. An `external` issuer has no `internal_url` and is reached at its public, publicly trusted URL. With `tls: external` the rewrite is not applied: the public name belongs to the customer's edge, and Traefik behind it serves no TLS. The two callers below then reach the public name through the customer's DNS and need a publicly trusted certificate; the e2e fixture keeps the rewrite, pointed at a TLS-terminating proxy that stands in for the edge. Two callers do not yet follow the contract and still call the public URL from inside the cluster, each for its own reason. OpenMetadata: its code exchange follows the discovery document, whose endpoints are public URLs, and 1.13.6's `oidcClientConfig` has no token-URL override. Superset: its Authlib discovery names public URLs, and moving it to `internal_url` needs a change to `images/superset/olf_oidc.py`, which the image source-drift guard (#1073) blocks until a release republishes the image (#1092). For them the local root keeps a CoreDNS `rewrite` sending `` and every name under it to the Traefik Service, and publishes the local CA root as ConfigMap `olf-local-ca` (key `ca.crt`) in `olf-system` and every stage namespace. Dex itself mounts the ConfigMap only to trust a GitHub Enterprise host (ADR 0014), which is not an issuer call. The rewrite replaces the cluster's `Corefile` key, so it is removed with the cluster. The shape is provider-neutral. The AWS mapping (#274) is out of v0.4. 9. **Plain HTTP on `*.localhost` is the local default: `tls: none`.** The local provider accepts `spec.access.tls: none` only for a `base_domain` ending in `.localhost`, so a first-time user reaches every service, and tests sign-in, without trusting a certificate. Browsers resolve `*.localhost` to loopback and treat it as a secure context, so the perimeter cookie and the OIDC redirects work over HTTP, and Traefik's `127.0.0.1:80` mapping is the only exposure. Routes and the contract use `http://`, `tls_mode` is `none` (accepted exactly with this mode), Traefik serves the `web` entrypoint with no `tls` block and publishes no host port 443. cert-manager and the local CA stay deployed: the CA ConfigMap the pods mount is independent of the routes. Trino has no certificate since #983 (ADR 0016), and whether cert-manager is still needed with this mode is settled in #391; `tls: external` deploys cert-manager and the CA on the same terms (no route certificate). With this mode the CA is disposable: nothing outside the cluster trusts it and the pods mount it by path, so it is not backed up and a restore or rebuild keeps the platform's own CA. Not for any other provider or a public domain; the validator rejects both, and public exposure (#340) must reject it too. A profile that wants browser HTTPS says `tls: local-ca`; the conformance profile does, so the nightly keeps exercising the TLS routes. ## Consequences - `olf` rejects a contract whose `base_domain` or `tls` differs from the resolved profile, so a contract and profile cannot silently diverge. - Changing `base_domain` changes every user-facing URL; it is deployment configuration, not product intent, and stays out of `governance.yml`. - The ingress and portal add five pods to the local footprint, all in `olf-system`: | Pod | CPU request | Memory request / limit | | --- | --- | --- | | Traefik | 50m | 64Mi / 256Mi | | cert-manager controller | 10m | 64Mi / 256Mi | | cert-manager cainjector | 10m | 64Mi / 256Mi | | cert-manager webhook | 10m | 32Mi / 128Mi | | Portal (openlakeforge-portal) | 5m | 48Mi / 128Mi | | Platform API, with `spec.identity` only ([ADR 0021](https://openlakeforge.dev/docs/adr/0021-platform-api/)) | 10m | 64Mi / 192Mi | The platform API's request is set from about 41 MiB resident, measured in Docker (read-only root filesystem, as `nobody`, after 200 requests), not yet on kind. It answers `https:///api/` behind the perimeter's lowest role floor. - Mapping 80/443 changed the kind cluster shape: an existing local cluster must be recreated (`olf infra destroy` then `olf infra deploy`), and those host ports must be free; `olf infra deploy` checks both ports and the TLS mode before it creates the cluster. ## History #989 renamed `spec.access.issuer` to `spec.access.tls` and added `external`: the customer terminates HTTPS in front of OpenLakeForge, Traefik serves HTTP, and `shared.access.tls_mode` is `edge-terminated` while every route URL is `https://`. `external` is refused on `*.localhost`. v1alpha1 profiles that say `issuer` are refused in v1beta1 (the profile migrates with `olf project migrate`); contracts already in state keep the old key and are read the same way. #990 built the local adapter for `external` (decisions 1, 6, 8): Traefik serves HTTP behind the customer's HTTPS and trusts forwarded headers only from a range the profile names (`spec.access.trusted_proxies`), and every URL, callback and cookie is `https://`. The end-to-end variant runs a TLS-terminating proxy in front of Traefik. Decision 8 (#991): the perimeter proxy, Polaris and the platform API reach Dex at its Service (`internal_url`) instead of through Traefik and the local CA. OpenMetadata (1.13.6 has no token-URL override) and Superset (its image change waits for #1092) still use the public URL, so the CoreDNS rewrite and `olf-local-ca` stay until both move. Decisions 2 and 9 (#960): Trino moved to a per-stage route with one Trino per stage (#965, built for the local root in #976). Its certificate and its Web UI's OAuth2 sign-in were removed with its authentication (#983, ADR 0016). The local CA is backed up only with `tls: local-ca`; with `none` it is disposable (decision 9). `tls: none` became the local default; the other providers keep `local-ca`. cert-manager, the CA and `olf-local-ca` are unchanged: they still serve Trino's certificate (ADR 0016), so only the routes' scheme differs. The conformance profile pins `local-ca`. #666 added the platform API's row to the footprint table: a path (`/api`) on the portal's host, deployed with `spec.identity` (ADR 0021). The `shared/identity` route serves Dex since Keycloak was removed (#384, ADR 0014); the entries below that name Keycloak describe the adapter that existed then. #403 added decision 9 (`tls: none`). New record (#264). No prior ADR covered service access. #265 added the local Traefik/cert-manager adapter (decision 6) and fixed `tls_mode`'s values. #266 added the local routes and wildcard certificates. #267 moved `olf`'s clients onto the routes, added `olf access trust`, and lists the URLs in `olf status`. #268 added the deploy preflight, the not-Ready Certificate section in `olf status`, and the e2e Traefik restart and renewal drills. #24 added the `shared/identity` route (`auth.`, then Keycloak, now Dex) to the local routes; it is never behind the perimeter (ADR 0014). Decision 8 (in-cluster resolution of the routes and the CA ConfigMap) was added with it. #330 added the portal (decisions 2, 3, 4, 6 and 7): the apex route, its certificate name, and the landing page; a follow-up split out the Shared section and dropped the identity link. The portal then moved from a BusyBox-served Terraform page to the openlakeforge-portal image, with the GitHub teams page as its Admin link. #176 put every route except the identity route behind the perimeter (ADR 0014 seam 3): decision 6 now renders one `Ingress` per namespace and access group, and `olf`'s clients port-forward to a protected route instead of taking its ingress URL (decision 5). The login callback host `oauth2.` is answered by the proxy and is not a contract route. #389 flattened stage hostnames to `-.` (decisions 2 and 6): every namespace's certificate is now `*.`. The flat-hostname change also replaced the per-namespace certificates with one shared wildcard served as Traefik's default certificate (decision 6). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0013-service-access-and-ingress.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0013-service-access-and-ingress.md). --- # ADR 0014: Identity and authorization — canonical roles, per-seam adapters > Partly binding. Binding today: the canonical role model (seam 1) — release/identity-roles.yaml, rendered into shared.identity.roles by all three roots and… Source: https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/ ## Status Partly binding. **Binding today:** the canonical role model (seam 1) — `release/identity-roles.yaml`, rendered into `shared.identity.roles` by all three roots and validated by `olf` (#175); the `identity.oidc` contract shape (seam 2); and the local Dex adapter, which the local root deploys for `spec.identity.issuer: github` and which emits `identity.oidc` (#384). The AWS and Azure roots still emit their existing `identity` implementations (`identity.aws_pod_identity`, `identity.azure_workload_identity_ready`). The local perimeter (seam 3, #176) enforces the route grants; how far it has been run on a cluster is recorded in `docs/architecture/identity/identity-sessions-and-recovery.md`. **Built for `issuer: github`:** GitHub teams as the source of people and roles, with Dex as the issuer adapter ([ADR 0018](https://openlakeforge.dev/docs/adr/0018-github-is-the-forge/)). Keycloak, the earlier adapter, is removed (#384): `spec.identity.issuer` is `github` or `external`, and has no default. The Dex adapter ran once against the `OpenLakeForge` organisation (qualification run 1 on #384). **Seam 4 is removed:** user and role administration is GitHub's; `olf users`, the `shared.identity.admin` contract and `bootstrap_admins` no longer exist (#383). ## Context v0.5-alpha is the first release in which a person logs in and their role decides which services they reach. Until #175 that model lived nowhere: baseline roles were a bullet inside the Keycloak issue (#24), which would have made the authorization model an adapter detail and broken ADR 0003 — consumers depend on capability contracts, never on the implementation behind them. ## Decision ### One principle Canonical OpenLakeForge roles are the only vocabulary. Every provider-specific thing is a mapping **keyed by** a canonical role, never the reverse. Three seams each have their own adapter and none leaks into another: | Seam | Contract location | Local / on-prem adapter | Later adapters | | --- | --- | --- | --- | | 1. Role model: what each role may reach | `shared.identity.roles` | none; identical on every provider | identical | | 2. Issuer: who you are, which roles you hold (Dex **built** for local, #384) | `shared.identity` as `identity.oidc` | Dex with the GitHub connector, or an existing external OIDC issuer | Cognito, Entra ID, IAM Identity Center, Okta as other `identity.oidc` issuers | | 3. Perimeter: enforce route grants before the service (**built** for local, #176) | `shared.access.perimeter` | Traefik `forwardAuth` to oauth2-proxy | cloud gateway or ALB OIDC action (#180). Measured on kind, CI runner: a Superset dashboard load (3 charts) adds 8-13 ms median and 132-149 ms p95 (the e2e fails above 100 ms added median; p95 is reported only) | ### Seam 1 — the role model (built) A profile with no `spec.identity` block deploys no issuer and no perimeter (#399); on the local provider, `spec.identity` requires `spec.access` (ADR 0013); the cloud roots read no `spec.access`. Authentication off is allowed only where nothing is published beyond the operator's machine: on `local` with no `spec.access` or a `*.localhost` base domain, and on `aws` or `azure` with no `spec.access`, since those roots publish no routes and are reached only through `olf infra forward`. A cloud `spec.access` asks for routes, so it requires `spec.identity`. The role model does not depend on an issuer, so the contract still carries `shared.identity.roles` and validates it, with `implementation: identity.none` and no `issuer_url`, `role_claim`, `role_mapping` or `clients`. `shared.access` then has no `perimeter`. A consumer that needs an issuer must treat `identity.none` as "unauthenticated, local only". `release/identity-roles.yaml` is product-level and fixed for v0.5-alpha, like the component catalog; it is not deployment-configurable. Terraform reads it with `yamldecode(file(...))` in each root's `contracts.tf`; `olf` reads the same file to validate the contract. | Role (highest first) | Superset (`reporting`) | OpenMetadata (`governance_service`) | Dagster (`orchestration`) | Trino UI (`query`) | Trino `/v1` for `olf query` (`query_api`) | | --- | --- | --- | --- | --- | --- | | `platform-admin` | Admin | Admin | full | yes | yes | | `data-engineer` | Alpha | write | full | yes | yes | | `analyst` | Gamma | read | — | — | yes | | `viewer` | read-only | read | — | — | yes | `query_api` is the query service's `/v1` path, not a route of its own: the ingress routes `trino./v1` to the `viewer` floor when people sign in with GitHub, while the Web UI keeps the `query` floor. What a person reads there is decided by Polaris, not this row ([ADR 0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/)). The perimeter's `path_refs` give it a floor; `protected_routes` does not list it. Rules that bind: | Rule | Consequence | | --- | --- | | Grants are keyed by the service name the access routes already use: the last segment of a route's contract ref | the perimeter derives authorization mechanically: route ref, to service, to allowed roles | | A grant's value is the in-service role it maps to | one table answers both "may an analyst open Dagster" and "what Superset role does an analyst get" | | No entry means the perimeter denies | Dagster OSS has no authorization of its own; the denied route is the control | | Grants are **monotonic**: a role may hold a service's grant only if every higher-precedence role does | the union of held roles equals the highest held role, so the perimeter and every service agree without precedence code | | Multi-role = union | a user holding several roles gets the highest one's reach | | No recognised role = deny | the user is authenticated but denied everywhere, with a "no OpenLakeForge role assigned — ask a platform-admin" response rather than a broken page | | A grant applies to the service on **every enabled stage** | stage-scoped human roles are deferred | | Matrix is fixed for v0.5-alpha | configurable authorization is more to build, test, and document, and can follow once the fixed model is proven | | `identity` and `portal` carry no grant | the login surface is never behind the perimeter, and the portal is the landing page every authenticated user reaches | | Grafana has no column | #210 adds the row when Grafana is integrated | `olf` fails closed when `shared.identity.roles` is absent, names a role outside `precedence`, names a service no route can publish, is not monotonic, or differs in any way from `release/identity-roles.yaml` (read from the distribution root, so an installed payload ships it). The published schema `docs/schema/provider-contracts.schema.json` covers the shape. The same file carries `data_access`, the person's data access by stage and medallion layer ([ADR 0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/)): the mapping keyed by canonical role that the boundary below reserves. It is held to the same rules (closed vocabulary, monotonic on every stage and layer, equal to the release file) plus one of its own: each stage row is a shape a Polaris catalog role can express. Polaris enforces it for a person's own queries (`olf query`): each row becomes the catalog role the person's role holds on that stage's catalog, and the storage credentials a query reads with are vended for the tables that role reaches (ADR 0019, sections 4 and 5). ### Boundary: OpenLakeForge roles versus cloud IAM | | OpenLakeForge roles | Cloud IAM (AWS IAM, Azure managed identity) | | --- | --- | --- | | Governs | which platform services a **human** may use | what a **workload** (pod) may call in a cloud API | | Defined by | this ADR | the provider roots (#178, #45) | | Portable | identical on local, on-prem, AWS, Azure | provider-specific by nature | End-user roles are never expressed in cloud IAM; that would make the product non-portable. Per-user data access binds canonical roles to Polaris catalog roles instead, the fifth mapping keyed by canonical role (`data_access`, ADR 0019), and Polaris vends the storage credentials. It is built for the local provider; the AWS root is to follow with Polaris rather than Glue and Lake Formation (#681). ### Seam 2 — issuer (GitHub through Dex built for local) `shared.identity` with `implementation: identity.oidc` carries, beside `roles`: | Field | Meaning | | --- | --- | | `issuer_url` | https issuer; the token `iss` must equal it. The one exception is `spec.access.tls: none` (ADR 0013, development on `*.localhost`), where Dex issues `http://auth.`, oauth2-proxy sets `--cookie-secure=false` and its callback is `http://oauth2./oauth2/callback` | | `internal_url` | optional; Dex's in-cluster Service base URL, set only for an issuer OpenLakeForge deploys. In-cluster consumers fetch keys (`/keys`) and redeem codes (`/token`) here over plain HTTP and compare the token's `iss` with `issuer_url` as a string. Absent or null for `external`, which is reached at `issuer_url` | | `role_claim` | the claim holding role values (`groups`, `cognito:groups`, ...) | | `role_mapping` | canonical role to a list of claim values; keys outside `precedence` are rejected | | `clients` | exactly `perimeter`, `superset`, `openmetadata`, each `client_id` plus `secret_ref{name,key}`, and `olf-cli`, a public client: `client_id` only, no `secret_ref` | Nothing in these fields is Dex-specific. Dex: `groups` holding `:`. Entra ID: group object IDs. Cognito: `cognito:groups` as the claim. The test fixtures include a Cognito-style issuer to prove an external issuer satisfies the contract unchanged. A secret value in a client is rejected by the parser and by the #181 secret-value check; credentials reach pods only through `secretKeyRef`/`envFrom`. Optional, so an issuer that lacks something says so and consumers degrade rather than break: `adapter` (provenance only for consumers, e.g. `dex`; the validator requires `adapter: "dex"` when the profile selects `github`, to correlate that profile with its binding; external profiles need none) and `capabilities` (`groups_in_token`, `logout_endpoint`, `email_delivery`, each boolean; absent means not declared). `email_delivery` says the issuer can send account recovery mail. It carries no host or credential; Dex declares it false. The contract carries no free-form block: the only credential-shaped data is a `secret_ref{name,key}`. If a cloud adapter later needs adapter-specific data, it adds a typed field then. **Adding a cloud adapter (Cognito or IAM Identity Center, Entra ID, GCP, generic OIDC) is a checklist, not a schema change:** 1. Emit `implementation: identity.oidc` with the adapter in `adapter`. 2. Provide `issuer_url`, `role_claim`, and `role_mapping` keyed by canonical role, in the issuer's own claim values. 3. Provide all four `clients`: `perimeter`, `superset` and `openmetadata` with `client_id` and `secret_ref{name,key}`, and the public `olf-cli` with `client_id` only (a `secret_ref` on it is rejected); secret values never enter Terraform outputs, the provider contract, logs or CI. Secrets the adapter generates are created in-cluster by a bootstrap Job, not by Terraform, so they are not in Terraform state. 4. Declare `capabilities` honestly. 5. Add a perimeter adapter only if the cloud has its own (#176, #180). 6. Add a fixture beside `identity-oidc-dex.json`; the conformance test runs every fixture through the same consumer-facing validation. The Deployment Profile gains `spec.identity`: `issuer: github | external`, which is required. A block without an issuer is rejected, because neither choice can be made for the operator: `github` needs `spec.identity.github` (organisation, teams, OAuth App Secret) and `external` needs `issuer_url`, `role_claim` and `role_mapping`. Leaving out the block still means no issuer and no perimeter (a quickstart). `external` takes optional `client_ids` (issuer-assigned client ids by consumer, default the consumer name). ### Local cluster notes for any issuer `spec.identity.issuer: external` deploys no issuer: the contract comes from the profile, and the operator provides the three client Secrets under the names the contract references (`oidc-client-`, key `client-secret`). Two local-cluster risks were checked rather than assumed. `*.localhost` is loopback for some clients, so back-channel token and JWKS calls need the pod to reach Traefik at `*.` and trust the local CA; the local root does both (ADR 0013, decision 7). curl is such a client: it resolves `*.localhost` to loopback itself without asking DNS, while getaddrinfo-based clients get the Traefik address from cluster DNS. Single sign-on across hosts needs a cookie on `.`: curl (libpsl) and headless Chromium both accepted a `Domain=.olf.localhost` cookie and sent it to a sibling host, and both rejected `Domain=.localhost`. Firefox and Safari were not tested. ### The GitHub adapter through Dex (built for local; #384) The local issuer is Dex with its GitHub connector ([ADR 0018](https://openlakeforge.dev/docs/adr/0018-github-is-the-forge/)). People and their roles live in the client's GitHub organisation; the profile only says which team holds which canonical role: ```yaml spec: identity: issuer: github github: organization: acme teams: # canonical role -> team slugs platform-admin: [data-platform] data-engineer: [data-eng] analyst: [analysts] viewer: [dashboards] oauth_app_secret_ref: # Dex's upstream GitHub OAuth App name: github-oauth-app client_id_key: client-id # default client_secret_key: client-secret # default host: github.example.com # optional: GitHub Enterprise Server; absent is github.com ``` Keys outside `precedence` are rejected, as for `role_mapping`. The team slugs are lowercased by `olf`, because GitHub slugs are always lowercase. The organisation is kept exactly as written and must match its GitHub login's case: GitHub preserves the case of a login, and Dex compares each team's organisation login with the configured name exactly, so `openlakeforge` for the `OpenLakeForge` organisation refuses every member (observed on Dex v2.46.0). A role with no team is held by nobody. Being an organisation owner or a repository admin grants nothing: only the mapped teams count. | Piece | How | | --- | --- | | Upstream app | A GitHub OAuth App owned by the organisation with the one callback `https://auth./callback`. Dex's connector requests `user:email` (it reads the primary, possibly private, address) and `read:org` (teams); both appear on the authorize page and in an organisation's approval request. The operator creates it and stores its client id and secret in the Secret named by `oauth_app_secret_ref` (a Secret name and two distinct keys); neither value enters the profile or state. This is Dex's upstream client, distinct from the four downstream consumer clients of `identity.oidc`. An organisation that restricts third-party access must approve the app | | GitHub App instead of OAuth App | `olf infra github connect` (#420) creates a GitHub App from a manifest in the browser and stores `client-id`, `client-secret` and `private-key` in the `oauth_app_secret_ref` Secret. Dex's connector works with a GitHub App's client credentials: the user-to-server token ignores scopes, `/user/orgs` and `/user/teams` accept it with no extra permission, and `/orgs/{org}/members/{user}` and team visibility need the app's *Members: read* permission with the app installed on the organisation; refresh re-reads teams with the refresh token. `private-key` is stored for the role sync (#25); whether that sync reads this Secret or keeps `members_app_secret_ref` is decided there. The manual OAuth App remains supported | | Admission | The connector's `orgs` lists the organisation with every mapped team. A GitHub user in none of them is refused by Dex at login, before any token exists, so an uninvited identity never reaches the perimeter | | GitHub Enterprise | `host` is rendered as the connector's `hostName`, so Dex uses `https:///login/oauth/*` and `https:///api/v3/*`. Dex requires `rootCA` with `hostName`; the smallest input is no new field: Dex trusts the platform CA from the `olf-local-ca` ConfigMap (public certificate only, local profile). A GHE server behind a different private CA needs a CA input, left until a client has one | | E2E without GitHub | CI cannot sign in to github.com. `olf infra e2e run` runs a stub GHE (`olf/infra/e2e/github_stub.py`, a throwaway pod with a local-CA certificate) when Dex's `hostName` is `olf-e2e-github..svc`, and drives the perimeter role decisions through Dex's real connector with throwaway users per team, plus one in no mapped team who must be refused at login. Otherwise those checks skip | | Groups claim | `teamNameField: slug`; the `groups` claim carries `:` | | `role_mapping` | rendered by the root from `spec.identity.github`: each canonical role to `:` of its teams, `role_claim: groups`. The `identity.oidc` shape does not change, so no consumer changes how it reads roles | | Scopes | Dex returns the `groups` claim only for the `groups` scope and a refresh token only for `offline_access`. The perimeter's default `--scope=openid email profile` becomes `openid email profile groups offline_access` for Dex, and so do the Superset and OpenMetadata clients; without it every user is denied and no refresh re-reads teams. For Dex the perimeter alone also requests `federated:id audience:server:client_id:olf-cli` (module variable `login_audience`), so its ID token carries `aud` `olf-cli` and the connector id Polaris names the principal by (ADR 0019). An external issuer gets neither scope | | Token lifetimes | Pinned to the session policy, not Dex's defaults (24 h ID tokens): `expiry.idTokens: 5m`, `expiry.refreshTokens.validIfNotUsedFor: 30m`, `expiry.refreshTokens.absoluteLifetime: 10h`, and `reuseInterval` kept (Dex default 3s) because the floor-specific oauth2-proxy instances can redeem the same cookie's refresh token concurrently. Asserted by the adapter's e2e, including parallel refreshes. **Revises the 10 h absolute bound for this adapter:** it ends the OpenLakeForge session chain, but a new one starts without a prompt while the person's GitHub session is valid, because Dex cannot force GitHub to re-authenticate. Re-authentication frequency and 2FA are therefore governed by GitHub and the organisation's policy, not by the platform | | Clients | `perimeter`, `superset`, `openmetadata` as static Dex clients, secrets from the existing bootstrap Job (#181); `olf-cli` as a public static client (`public: true`, no secret, no `redirectURIs`), for which Dex accepts loopback redirects (`127.0.0.1`, `localhost`, `[::1]`) on any port and issues refresh tokens without a secret. Dex does not enforce PKCE: the client must send it. `olf-cli` lists `perimeter` and `superset` in `trustedPeers` (module variable `trusted_peers`), so the perimeter's login, and Superset's per-user data access (#968, scope `audience:server:client_id:olf-cli`, token `aud` `[olf-cli, superset]`), may ask for a token whose audience is `olf-cli`: the browser session's token is then the one Trino, Polaris and the platform API accept, and none of them lists the perimeter's client id. `aud` `olf-cli` no longer implies the token was issued to the CLI; `azp` says which client asked | | Login entry | The portal at the base domain is the front door. An unauthenticated visit is sent by the perimeter (`--skip-provider-button`) to Dex; with one connector and `alwaysShowLoginScreen` off, Dex goes straight to GitHub, and `skipApprovalScreen` removes its consent page. The person sees GitHub's authorize page once per app, then lands back on the portal. Dex's own login page is never shown, so it needs no branding | | Single sign-on | Dex keeps no browser session of its own by default; GitHub's session is what makes the next login silent. A native Superset or OpenMetadata login bounces through Dex to GitHub and back without a prompt while the GitHub session lasts. To be verified with the adapter | | Logout | **Revises the platform-wide logout policy for this adapter.** Sign-out still ends the perimeter cookie and the native Superset and OpenMetadata sessions, so user B never reaches a surviving session of user A. Dex has no end-session endpoint and the GitHub session belongs to the person, not the platform: OpenLakeForge does not end it. The signed-out page links to GitHub's sign-out, and states that on a shared browser the next sign-in reuses the GitHub account still signed in there | | Storage | Dex's `postgres` storage on its own `dex` database in the platform PostgreSQL, replacing the removed `keycloak` database. Refresh tokens, the upstream GitHub token and the signing keys stay in a database with the same exposure class, instead of plain `dex.coreos.com` custom resources that the Secret inventory and the exposure scan do not cover. Dex needs no Kubernetes API access, so no RBAC exception; the `identity-credentials.md` inventory gains the `dex` database row with the adapter (#384) | | Network | Dex calls `github.com` (token exchange) and `api.github.com` (user and team lookups) at every login and refresh. ADR 0017 has no internet egress today; the adapter adds that flow row, scoped to Dex, before default-deny egress is enforced (#384) | | Revocation | team membership is read at login and again on each refresh; the perimeter refreshes at most every 4 min, so removing someone from a team or the organisation ends perimeter access within the #177 bound. Measured once (qualification run 1): a member moved to another team lost the old role on the first request after the 4 min refresh point | | Mail | none. Dex sends no mail, and the profile has no `smtp` setting | | Break-glass | the issuer-outage procedure of `identity-sessions-and-recovery.md` for Dex: the cluster administrator's kubeconfig, the Superset and OpenMetadata in-pod CLIs, Dagster and Trino through their internal Services. Dex has no admin account; the recovery drill runs in the local e2e (#177, #520) | A member of several mapped teams holds the union of their roles, which by the monotonic rule is the highest one. Whether membership of a child team counts for a parent team mapped here is to be verified on the adapter; until then, map the teams people are direct members of. ### Seam 3 — perimeter (built for local; #176) `modules/access/perimeter` runs oauth2-proxy behind Traefik `forwardAuth`. Route grants are read from `release/identity-roles.yaml` and nowhere else. | Piece | How | | --- | --- | | Role floor | Grants are monotonic, so what a service admits is a prefix of `precedence`, fully described by its lowest role. The module computes each protected route's floor from its service name (`portal` has none: the lowest role) | | Instances | One oauth2-proxy Deployment per distinct floor, started with `--allowed-group` for the `role_mapping` claim values of every role at or above it. Today: `oauth2-proxy-viewer` (any recognised role: portal, Superset, OpenMetadata, Trino `/v1` with people's access) and `oauth2-proxy-data-engineer` (Dagster, Trino UI). A new service is a row in the matrix; a new floor is a new instance without new code | | Middleware | Traefik file-provider middlewares (a `Middleware` CRD cannot be planned before the Traefik release installs it): `olf-strip-identity` deletes every inbound `X-Forwarded-*` / `X-Auth-Request-*` identity header, then `olf-auth-` forwards to that floor's proxy and copies only the proxy's `X-Auth-Request-*` headers upstream. The proxies run with `--set-authorization-header=true`, which puts `Authorization: Bearer ` on the auth response; the one extra middleware, `olf-auth--api`, copies it upstream and is attached only to the platform API's `/api` route (ADR 0021, decision 1). Superset, OpenMetadata, Dagster, Trino and the portal never receive the ID token | | Ingress | One `Ingress` per namespace and floor (`openlakeforge-routes[-]`) carrying the middleware annotation; the namespace's one wildcard certificate is still issued from a single primary `Ingress` (ADR 0013 decision 6) | | Protected set | Every route of `shared.access.routes` except `shared/identity`, derived, never listed. `olf` rejects a contract whose `shared.access.perimeter.protected_routes` differs | | Login callback | One host, `oauth2./oauth2/*`, answered by the any-role instance and not behind the perimeter; the `perimeter` client has that single redirect URI, and the cookie on `.` carries the session to every route | | Cookie secret | Created by an in-cluster Job only if missing (`oauth2-proxy-cookie`); Terraform never reads it. Rotation: delete the Secret, replace the Job, restart the proxies (signs everyone out once) | | Client secret | `secretKeyRef` to `identity.oidc.clients.perimeter.secret_ref` | | Bearer tokens | Every instance starts with `--skip-jwt-bearer-tokens=true`. With an `internal_url` (Dex) the proxy runs `--skip-oidc-discovery` with `--login-url=/auth`, `--redeem-url=/token` and `--oidc-jwks-url=/keys`, and its own verifier accepts bearer tokens of the `olf-cli` audience (`--oidc-extra-audience`). For an `external` issuer it starts with `--extra-jwt-issuers==` (discovery at the public URL), and the forwardAuth middleware passes the `Authorization` header on. A bearer token issued to `olf-cli` is checked for issuer, audience, signature and expiry, then meets the instance's `--allowed-group` like a session, so the role floor still decides. A token issued to a client other than `olf-cli` or `perimeter` gets 401. The `perimeter` client's own tokens are accepted as well, which neither mechanism can exclude. With Dex each instance also starts with `--oidc-extra-audience=olf-cli`, so the session's ID token, whose `aud` is `olf-cli`, passes the proxy's own verification when it refreshes the session. With an `internal_url` the proxy's own verifier reads the roles of a bearer token from `--oidc-groups-claim`, so any `role_claim` works. An extra issuer's bearer token is read from a hardcoded `groups` claim, so for an `external` issuer `--skip-jwt-bearer-tokens` and `--extra-jwt-issuers` are set only when `role_claim` is `groups`; with any other claim a bearer token gets 401 | Behaviour, all decided by the proxy before a request reaches a service: | Request | Answer | | --- | --- | | No session, browser | 302 to the issuer's login (the one login page for every service); after login back to the original URL | | No session, `Accept: application/json`, `X-Requested-With`, or path under `/api`, `/graphql`, `/v1` | 401, never an HTML login page | | `Authorization: Bearer` token issued to `olf-cli`, role permitted | 2xx from the service | | That token, role not permitted | 403 | | Bearer token expired, with a tampered signature, or issued to another client (`superset`) | 401 on an API path | | Session, role not permitted, or no recognised role | 403 with the "Access is role-restricted" page and a link to the portal. The proxy clears the session cookie on this path, so the next page load passes silently through the issuer's SSO session | | Issuer down | A session the proxy cannot refresh expires with its 5 min access token and is not extended; a new login fails | | Proxy down | forwardAuth cannot reach it and Traefik answers an error, never the service | | Forged `X-Forwarded-*` / `X-Auth-Request-*` | Deleted before forwardAuth; the decision is the proxy's, from its own cookie | Exempt from the perimeter, exhaustively: `auth.` (Dex's login, callback, token and JWKS endpoints) and `oauth2./oauth2/*`. Nothing else is. Dex has no admin console to expose on that route. The perimeter protects ingress only. Internal Services are reached directly and bypass it by design; a pod, or an operator holding `pods/portforward`, needs no session. That is the documented development fallback (`kubectl port-forward`, `OLF_PORT_FORWARD=1`) and the break-glass path in [`identity-sessions-and-recovery.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-sessions-and-recovery.md). `olf` itself takes it for every protected route (`olf.infra.access.service_url`); only the perimeter and ingress e2e checks go through the public hostnames. Containing internal traffic is #46 ([ADR 0017](https://openlakeforge.dev/docs/adr/0017-local-network-policy-and-rbac/)). Dagster in particular has no native authentication or per-user authorization, so the perimeter is its only human access control and anyone admitted has full Dagster capability; the boundary and its internal paths are in [`identity-callers.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-callers.md#dagster-boundary). `olf infra e2e run --env local` exercises the seam (`e2e/_perimeter.py`): per route, an unauthenticated request is redirected to the issuer (or gets 401 with `Accept: application/json`), also with forged identity headers; signed in as per-team stub users for each mapped role and one in no mapped team (refused by Dex at login), each route answers as `release/identity-roles.yaml` says, a denial is the 403 role-restricted page with a portal link, and a direct API call carrying only a denied user's session cookie is refused too. Session settings are the policy document's: cookie `--cookie-expire=30m`, re-issued on every refresh (Traefik `addAuthCookiesToResponse` carries the refreshed cookie to the browser), refresh at most every 4 min; Dex sets ID tokens 5 min, refresh tokens unused 30 min, absolute 10 h. The 10 h absolute bound is the refresh token's absolute lifetime ending the refresh chain, not a cookie lifetime. ### Catalog credentials (Polaris) Polaris keeps its own OAuth client-credentials model in v0.5-alpha. Whether the `identity.oidc` issuer could authenticate the catalog callers was evaluated and deferred in [ADR 0015](https://openlakeforge.dev/docs/adr/0015-polaris-identity-provider-evaluation/), which also records where table-level policy would be enforced for Polaris and for Glue with Lake Formation (the different-mechanism case the "fifth mapping" above refers to). ### User and role administration — GitHub There is no admin seam. Inviting someone, changing their role and offboarding them are GitHub team and organisation changes, made in GitHub's web UI, with `gh`, or with the client's own GitHub Terraform, under GitHub's audit log and the organisation's 2FA policy. They need no `olf` command and no apply. The first `platform-admin` is whoever is in the team mapped to it. OpenMetadata cannot read roles from the token (`identity-service-permissions.md`), so its roles follow a role sync, built by #25 as a CronJob that `olf infra openmetadata deploy-metadata` applies. It runs only for `issuer: github`: an `external` issuer or authentication off does not sync (OIDC alone cannot enumerate members), so those users stay at the read baseline. With SSO on, OpenMetadata's `adminPrincipals` is empty and `deploy-metadata` clears `isAdmin` on the local `admin` user, so an issuer login named `admin` is not an admin (OM-11, closed by #25). | Piece | Decision | | --- | --- | | Credential | the GitHub App `olf infra github connect` created, read from the `oauth_app_secret_ref` Secret (`app-id`, `private-key`), so there is no second Secret reference; a hand-made OAuth App has neither key and gets no sync. The job mints a short-lived installation token per run and reads each mapped team's members with it (*Members: read*) | | Where it runs | `openmetadata-role-sync`, a CronJob in `olf-system` on the pinned `openmetadata_ingestion` image, the OLF-owned ingestion CronJob's image. The Python script is mounted from a ConfigMap because that image has no `olf`; it imports the standard library only and carries a copy of `github_app.app_jwt`'s signing, using the image's `cryptography` or else the `openssl` CLI, and exits naming what is missing. The App Secret and the `olf-automation` token reach it as secretKeyRefs, so the Secret read needs no RBAC. A project-code image was rejected: it is stage-scoped and exists only with user code | | GitHub Enterprise | the job calls `https:///api/v3` and trusts only the image's public CAs; a server behind a private CA is not supported by the sync yet | | Child teams | GitHub's team-members API includes the members of child teams, which would hand a parent team's role to its children's people. The sync therefore stops, changing nothing, when a mapped team has child teams ("map direct teams only"). The precedence between roles is read from `release/identity-roles.yaml` and passed to the job | | Reconciliation | for every non-bot OpenMetadata user except `admin` and `olf-automation`: `isAdmin` for `platform-admin`, the `DataSteward` role for `data-engineer`, neither otherwise, including a user in no mapped team. Other roles are left alone. A person who has not signed in yet has no user and starts at the baseline | | Interval | every 5 minutes (`*/5 * * * *`), inside the 15 min native-service revocation bound of `identity-sessions-and-recovery.md`; removing someone from a team revokes within one interval plus the job's run. Not yet measured on a cluster: the maintainer qualification moves a member out of a mapped team and checks the demotion | | Network | one flow, F30 in `release/network-flows.yaml`: the job to `api.github.com` on 443; its calls to OpenMetadata ride F13 | | Action | In GitHub | | --- | --- | | Invite as `analyst` | add the person to the organisation and to a team mapped to `analyst` | | Change role | move them between mapped teams | | Revoke every role | remove them from every mapped team: they can still sign in to GitHub, but Dex refuses them | | Offboard | remove them from the organisation | | List who holds what | `gh api --paginate orgs//teams//members` per mapped team | ## Policy documents Four written gates bind the implementation of seam 3 and the credential-producing work. They are policy for #176, #25, #26 and #46 to implement; the perimeter part of the sessions gate is built (seam 3), the rest is not. | Gate | Decision | Document | | --- | --- | --- | | Credentials (#181) | Identity credentials are generated by an idempotent in-cluster bootstrap Job, reused on redeploy, never read by Terraform. The client secrets are created this way | [`identity-credentials.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-credentials.md) | | Sessions (#177) | Perimeter cookie 30 min idle, 10 h absolute; access token 5 min; revocation delay at most 5 min at the perimeter and 15 min in native Superset and OpenMetadata sessions; platform-wide logout; fail closed on issuer outage; cluster-administrator recovery works with the issuer down | [`identity-sessions-and-recovery.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-sessions-and-recovery.md) | | Callers (#178) | Every authentication path is human (class 1), in-cluster or automation workload (class 2), or cloud workload (class 3). Workstation and CI automation reaches services by RBAC-authorized port-forward or in-cluster execution, never through the perimeter or as a human account | [`identity-callers.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-callers.md); Trino callers: [ADR 0016](https://openlakeforge.dev/docs/adr/0016-trino-workload-authentication/) | | Service permissions (#25) | Per canonical role, what Superset and OpenMetadata allow and deny, the native roles that implement each grant, how roles reach the service, and how each meets the native session bound. Superset sign-in built (client, role mapping, 15 min bound); OpenMetadata sign-in built, role sync specified | [`identity-service-permissions.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-service-permissions.md) | ## Consequences - The `identity` binding of every v3 contract gains a required `roles` object, so a contract emitted before this change no longer parses. The AWS and Azure `implementation` strings are unchanged. The local root's moves from `identity.local_development_credentials` to `identity.oidc` (#24): the validator still accepts a legacy-implementation contract that carries `roles`, but the local root no longer emits one. - The role model is a release artifact: changing a grant changes `release/identity-roles.yaml`, and every root picks it up on the next apply. `olf` rejects a platform whose contract was rendered from a different file. - The local Dex adds one always-on pod to `olf-system` and a `dex` database in the platform PostgreSQL (input to the #171 fixed-cost budget). Its footprint has not been measured; the Keycloak figures this ADR carried (768Mi memory request, about 640 MiB resident) went with Keycloak. - The provider-binding digest recorded at activation covers `shared.identity`, so the first activation after upgrading reads as a binding change. - Platform users need a GitHub account in the mapped organisation, and the cluster needs to reach `github.com`; ADR 0018 records the trade-offs. ## History In-cluster issuer endpoints (#991): `identity.oidc` gains the optional `internal_url`; the perimeter proxy, Polaris and the platform API (`jwks_url` setting) use it instead of the public URL. The bearer-token row changes accordingly. OpenMetadata (1.13.6 has no token-URL override) and Superset (its image change waits for #1092, behind the image source-drift guard) keep the public URL through the CoreDNS rewrite and `olf-local-ca`. OpenMetadata bootstrap in `olf` (#562): the Terraform bootstrap Job is deleted; `olf` creates the admin automation bot after the platform apply. The sign-in paragraph also names the command that switches OpenMetadata to the issuer, `deploy-metadata`, where it named the Job. Fifth OIDC consumer (#536): `olf-cli` joins `identity.oidc.clients` as a public client, so the command-line client can sign a person in with Authorization Code and PKCE on a loopback redirect, with no distributable secret. The perimeter accepts the bearer tokens it issues and keeps enforcing each route's role floor. An external issuer registers it like the other consumers (`client_ids` may override the id) as a public client with loopback redirects, the `profile`, `groups` and, for refresh, `offline_access` scopes; OpenMetadata keys users on `preferred_username`, so the issuer must emit it. No `olf` command uses the client yet. Issuer-outage drill (#177, #520): the local e2e scales Dex to zero, checks sign-in fails closed, reaches Trino and Dagster through recorded break-glass sessions, restores Dex, and checks the ingresses are unchanged and sign-in works. OpenMetadata's local `admin` (#25): with SSO on, `adminPrincipals` is empty and the local `admin` user is demoted, so an issuer login named `admin` is not an admin (OM-11 closed). Authentication off on the clouds: #421 required `spec.identity` on `aws` and `azure`, but their roots publish no routes and emit no `identity.oidc`, so a cloud profile carried a placeholder `external` block nothing read. The rule is now "nothing published beyond the operator's machine": a cloud profile may omit `spec.identity` while it declares no `spec.access`, and needs it again once it asks for routes. OpenMetadata role sync (#25): a CronJob reads the mapped teams' members with the GitHub App's installation token and patches `isAdmin` and `DataSteward`. The `members_app_secret_ref` field and the `olf openmetadata sync-roles` command this ADR planned were dropped: the App's credentials are already in `oauth_app_secret_ref`. Inline GitHub connect (#428): with a missing OAuth App Secret, an interactive `olf deploy` runs the `olf github connect` flow itself instead of refusing; CI, piped runs and `--no-github-connect` keep the refusal. The flow runs before the foundation apply (#448), so the rest of the deploy is unattended; the converted App stays in memory until the Secret is written, and the end-of-deploy summary asks GitHub whether the App is installed. Bootstraps keep their class-2 workload identities. Keycloak removed (#384 slice c): `modules/identity/keycloak`, its `keycloak` database, the `keycloak` and `keycloak-config-cli` catalog pins, `spec.identity.smtp` (with its deploy-time Secret check and `OLF_SMTP_*` variables), the `email_delivery` consistency check, the Keycloak e2e (admin API, throwaway users, email delivery against the Mailpit sink) and the `e2e_mail_sink` pin are deleted. `spec.identity.issuer` accepts `github` and `external` only. **It has no default**: the old default, Keycloak, had no replacement that needs no further input, since `github` requires a `github` block, so a block without an issuer is now an error and omitting the block still means no issuer. The nightly applies `openlakeforge.conformance.yaml`, which selects `github` with `host: olf-e2e-github.olf-system.svc`; it creates a dummy `github-oauth-app` Secret (any client id and secret, since the e2e stub never checks them) after a first `olf platform apply` has created the shared namespace and stopped, then applies again (`docs/setup/github-oauth-app.md`, `local-full-e2e.yml`). The entries below that name Keycloak describe the code that existed then. Because #421 requires a profile on a cloud provider to declare `spec.identity`, the cloud profiles in the tests carry an `external` block; the AWS and Azure roots emit no `identity.oidc` yet, so the check that an external profile meets an `identity.oidc` contract applies to the local provider only. #418 made a profile without `spec.identity` the explicit "authentication off" mode: accepted only for `provider: local` with no `spec.access` or a `*.localhost` base domain. Superset then signs every visitor in as its local admin (an anonymous `Admin` role is not enough: Superset needs a real user as the owner of saved objects); OpenMetadata has no anonymous mode, so `olf status` shows its default admin login. With `spec.identity` nothing changes. #403 added the http issuer exception to `issuer_url` for `spec.access.tls: none`. New record (#175). Seam 1 is built; seams 2–4 record the direction for #24, #176, and #331, which rewrite this ADR as they land. Seam 2 contract (#24 part a): `identity.oidc` fields fixed and validated in `olf` and the schema; profile `spec.identity` added; realm-as-code decided as a `keycloak-config-cli` Job. The Keycloak adapter is #24 part b. Keycloak adapter (#24 part b): the local root deploys Keycloak, applies the realm with `keycloak-config-cli`, routes `auth.` and emits `identity.oidc`; `spec.identity.issuer: external` skips the deployment. Policy gates (#181, #177, #178): the credential inventory and bootstrap target, the session and recovery policy, and the caller inventory are recorded in `docs/architecture/`; see "Policy documents". Design only; no behaviour changed. Identity credentials (#181): the Keycloak admin password and the four OIDC client secrets are created by an in-cluster bootstrap Job only if missing, not by `random_password`, so Terraform state no longer holds them. Outbound SMTP (#24): `spec.identity.smtp`, the `email_delivery` capability, the realm `smtpServer` and the deploy-time Secret check are built. The shared namespace is created by the platform apply, so a first deploy supplies the login through `OLF_SMTP_USERNAME`/`OLF_SMTP_PASSWORD` (#331, slice 2; see "The Deployment Profile gains `spec.identity`" above) or creates the Secret by hand after a first deploy without `smtp`. Email delivery check (#24): `olf e2e run` starts a throwaway Mailpit (catalog `e2e_mail_sink`, digest-pinned; never part of the stack), creates a throwaway realm pointed at it, asks Keycloak for an `UPDATE_PASSWORD` action email for a test user and asserts it reaches the sink; a second send with SMTP pointed at a closed port must come back as HTTP 500 `Failed to send execute actions email` and leave nothing in the sink. A throwaway realm is used because replacing a realm's `smtpServer` through the admin API drops the stored password, which would break a real relay. The deployed realm is only read, to require that `resetPasswordAllowed` and `verifyEmail` equal `capabilities.email_delivery`. This proves Keycloak's mail path, not an operator's relay. Perimeter (#176): seam 3 is built for the local root. oauth2-proxy instances per role floor, Traefik file-provider middlewares, one `Ingress` per namespace and floor (ADR 0013 decision 6 rewritten accordingly), a single login callback host, `shared.access.perimeter` in the contract, realm token and SSO lifespans set, and `olf` clients port-forward to protected routes. Runtime verification and what remains (logout; the issuer-outage drill now runs in the local e2e, #520) are tracked in `docs/architecture/identity/identity-sessions-and-recovery.md`. Admin client (#331, slice 1): seam 4's contract is built. The realm gains the service-account-only `olf-users` client with `view-users` and `manage-users`, its secret is created by the credentials Job, the adapter emits `shared.identity.admin` and declares `admin_api`, and the realm records admin events without details. `olf e2e run` asserts that the client authenticates by client credentials, lists users and groups, and cannot read or write realm settings, list clients, read events or reach another realm. Dagster boundary and Polaris (#26): the Dagster paragraph in seam 3 and the "Catalog credentials" section point at `identity-callers.md` and ADR 0015. Documentation only. User commands (#331, slice 1): `olf users` roles, list, grant, revoke, disable and enable. Invitations (#331, slice 2): `olf users invite`, `resend` and `cancel`. `olf e2e run` points the deployed realm's `smtpServer` at the throwaway mail sink for the step (skipped when the realm has its own SMTP, which a realm update would corrupt), completes onboarding through the mailed link as the new member, and empties `smtpServer` again. Trino workload authentication (#26 decision gate, #983): Trino has no authentication of its own ([ADR 0016](https://openlakeforge.dev/docs/adr/0016-trino-workload-authentication/)). Every caller sends its own Polaris token as the `token` extra credential, and the Web UI signs in as the fixed user `olf-web` behind the perimeter; AWS's shared coordinator keeps claim-based rules for Glue. The Dex `trino` client, which served only the Web UI's OAuth2 sign-in, is gone, so `clients` names four consumers; no other seam here changed. Service permissions (#25 specification): the allowed and denied actions per role for Superset and OpenMetadata, the exact native roles behind `Alpha`, `Gamma`, `read-only`, `write` and `read`, and the session alignment are in `docs/architecture/identity/identity-service-permissions.md`. It records that OpenMetadata 1.13.6 cannot map the canonical claim to roles itself. Design only; no behaviour changed. Bootstrap administrators and first-deploy SMTP (#331, slice 2): `spec.identity.bootstrap_admins` is built (see seam 4). A first deploy can create the SMTP Secret from `OLF_SMTP_USERNAME`/`OLF_SMTP_PASSWORD`, which `olf` removes from its own process environment at start so no child process inherits them. GitHub as the source of people (ADR 0018): the default local issuer is decided as Dex with the GitHub connector, roles mapped to organisation teams in `spec.identity.github`. Seam 4 is removed: `olf users`, the `shared.identity.admin` contract and `capabilities.admin_api`, the Keycloak `olf-users` client and `spec.identity.bootstrap_admins` are deleted, and invitation, role assignment and offboarding are GitHub's. Keycloak stays deployed until the Dex adapter replaces it. Organisation login case (#397): the organisation is no longer lowercased. Lowercasing it (#388, from a review finding that holds for team slugs only) made Dex refuse every member of `OpenLakeForge`, because GitHub preserves the case of a login and Dex compares it exactly. Team slugs stay lowercased. Dex adapter (#384 slice b1): `modules/identity/dex` deploys a digest-pinned Dex for `spec.identity.issuer: github` (postgres storage on a `dex` database, the GitHub connector limited to the mapped teams, the four static clients with secrets from an in-cluster Job) and the root emits `identity.oidc` with `adapter: dex`. The perimeter requests `groups offline_access` for it, and `olf deploy` refuses to start the platform phase without the OAuth App Secret (an interactive run instead creates the GitHub App inline, #428; CI and `--no-github-connect` still refuse). Dex's static clients match redirect URIs exactly, so the OpenMetadata client carries the Keycloak wildcard URI until it is wired to OIDC (#25), and the Trino client carries `https://trino./oauth2/callback` (ADR 0016); the Superset client already has its callback, `https://superset-./oauth-authorized/olf`. Keycloak's removal, the stub-upstream e2e and the NetworkPolicy flow are separate slices. OpenMetadata sign-in (#25 slice b): OpenMetadata authenticates through the issuer as a confidential `custom-oidc` client with the principal taken from `preferred_username`. `olf infra openmetadata deploy-metadata` applies it through the security configuration API because 1.13.6 keeps that configuration in its database after the first boot; an admin automation bot, which `olf`'s OpenMetadata bootstrap creates after the platform apply, replaces basic login for `olf`. 1.13.6 has no claim-based admin mapping, so every signed-in person starts at the read baseline until the role sync lands. Details in `docs/architecture/identity/identity-service-permissions.md`. Data access (ADR 0019, build step 1): `release/identity-roles.yaml` gains `data_access`, rendered into `shared.identity.roles` with the rest of the file and validated by `olf`; nothing enforces it yet. Per-operation classes (#536, [ADR 0020](https://openlakeforge.dev/docs/adr/0020-infrastructure-common-and-platform-cli-surfaces/)): "every `olf` call is class 2" is replaced by a rule per operation. Commands that need cluster or cloud permissions live under `olf infra` and stay class 2; commands that need none (`init`, `check`, scaffolding) have no identity; a platform surface that signs a person in through Dex, and so is class 1, is decided and not built. `query_api` grant row: Trino's `/v1` at the `viewer` floor for `olf query`, routed at the ingress without a contract route (ADR 0019, build step 6). Data access enforced (ADR 0019, build steps 2-8): `data_access` is no longer carried only. With `spec.identity.issuer: github` on the local provider, a person's own queries (`olf query`, through the `query_api` route with an `olf-cli` token) reach what their role's row grants, enforced by Polaris catalog roles and vended storage credentials. Every workload keeps its stage principal. The boundary above records Polaris, not cloud IAM, as the place canonical roles reach data. Browser identity (#799): the browser session's ID token now reaches the platform API as a bearer, carrying the audience Trino and Polaris already require, through Dex cross-client trust (not yet run against them). `olf-cli` lists `perimeter` in `trustedPeers`, the perimeter requests `audience:server:client_id:olf-cli` and `federated:id` for Dex only, passes `--oidc-extra-audience=olf-cli` and `--set-authorization-header=true`, and only the platform API's route has a middleware that copies `Authorization` on. The tokens' audience is therefore no longer issued by the CLI alone; the services' accepted audience is unchanged. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0014-identity-and-authorization.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0014-identity-and-authorization.md). --- # ADR 0015: Polaris identity-provider evaluation — deferred > Decided: deferred for workloads. This is an evaluation (#26), not a migration; every workload keeps Polaris's own credentials. It also records the… Source: https://openlakeforge.dev/docs/adr/0015-polaris-identity-provider-evaluation/ ## Status Decided: **deferred for workloads**. This is an evaluation (#26), not a migration; every workload keeps Polaris's own credentials. It also records the catalog-side findings that the data-plane authorization assessment (#179) needs. For people's tokens the deferral has ended: with `spec.identity.issuer: github`, Polaris runs `mixed` and accepts Dex tokens issued to `olf-cli` (ADR 0019, build step 3). Scope of the evidence. The deployed Polaris is the image `apache/polaris:1.4.0` (`release/component-catalog.yaml`, `infra/helm/values/local/polaris.yaml`) installed by Helm chart `polaris/polaris` 1.4.1, whose own `appVersion` is 1.4.1 — the image tag is overridden. Findings below come from the upstream documentation and source at tag `apache-polaris-1.4.0`, the chart's `values.yaml` at `apache-polaris-1.4.1`, and the Trino 480 documentation. Nothing was run on a cluster. Statements about this repository were checked against the tree. What was not verified is marked **to verify**. ## Context Polaris has its own OAuth client-credentials model. Every writer to the Iceberg catalog holds a Polaris-minted client id and secret, and the platform's human identity work (ADR 0014) does not touch it. #26 asks whether Polaris can instead validate tokens from the `identity.oidc` issuer, what that would cost every caller, and whether it is worth doing in v0.5-alpha. ## What Polaris 1.4.0 supports | Question | Finding | | --- | --- | | Can an external issuer authenticate principals? | Yes. `polaris.authentication.type` is `internal` (default), `external` or `mixed`, globally or per realm. `external` validates bearer JWTs with Quarkus OIDC (`quarkus.oidc.*`); `mixed` tries Polaris' own token first and falls back to OIDC. Opaque (non-JWT) tokens need a custom `PrincipalMapper` | | Does the issuer create or own principals? | **No.** `DefaultAuthenticator` resolves the token to a principal that must already exist in the Polaris metastore, by numeric id when the id claim is present, otherwise by name; a miss is `NotAuthorizedException`. Its own javadoc: it "does not support federated principals that are not managed by Polaris". The issuer replaces authentication only. Principals, principal roles, catalog roles and grants stay Polaris data, written through the management API | | How do issuer roles become Polaris roles? | `quarkus.oidc.roles.role-claim-path` selects the claim; `polaris.oidc.principal-roles-mapper` filters and rewrites values by regex into `PRINCIPAL_ROLE:`. The roles active for a request are the token's roles that the principal was also granted in Polaris (or all granted roles for `PRINCIPAL_ROLE:ALL`) | | How is the principal read from the token? | `polaris.oidc.principal-mapper`: `id-claim-path` and `name-claim-path` (chart: `oidc.principalMapper.idClaimPath` / `nameClaimPath`; one of the two is required). The id is parsed as a number, so a UUID `sub` cannot be the id claim; the name claim must equal an existing Polaris principal name | | Token exchange or brokering? | Not for external tokens. Polaris' own `/api/catalog/v1/oauth/tokens` accepts `client_credentials` and `urn:ietf:params:oauth:grant-type:token-exchange`, but the exchange only re-issues a token that verifies against Polaris' own `TokenBroker` signing key (`JWTBroker.generateFromToken`). In `external` mode the token endpoint is disabled (the docs say HTTP 501; the chart says the token service is always disabled and the broker unused). No path exchanges an issuer token for a Polaris token: with an external issuer the client presents the issuer's token directly | | Chart support | Chart 1.4.1 exposes `authentication.type`, `authentication.realmOverrides` and an `oidc` block (`authServeUrl`, `client.id`, `client.secret`, `principalMapper`, `principalRolesMapper`); defaults are `internal` and an empty `oidc.authServeUrl`. Only one default OIDC tenant is supported through values | | What does this deployment set? | Without `spec.identity.issuer: github`, nothing: Polaris runs `internal`. With it, `modules/catalog/polaris/person_access.tf` sets `mixed` and the `oidc` block for people's Dex tokens (ADR 0019) | | Issuer reachability | **Verified** (ADR 0019, verification item 3). The issuer URL is `https://auth.` behind Traefik with the local CA (ADR 0014). Polaris resolves it through `in-cluster-resolution` and trusts the CA mounted from the `olf-local-ca` ConfigMap through a named Quarkus TLS configuration; it starts while the issuer is unreachable and fetches the keys on the first token | | Which claim names the principal for an issuer service-account token? | **To verify** against Dex (this row was written against Keycloak, since removed). A client-credentials token's `sub` is a UUID, which cannot be the numeric id claim. A name claim can be a protocol mapper with a fixed value, or the issuer's own name claim; which fits the existing principal names (`trino-`, `floe-`, ... in `environments/local/main.tf`) was not tested | ## How the Polaris credential is consumed today Verified in the tree. Polaris has no ingress route (`service_routes` in `infra/terraform/environments/local/contracts.tf`), so no human reaches it: every caller below is class 2 (`identity-callers.md`). | Caller | Credential | How it is used | | --- | --- | --- | | Trino, per stage catalog | The stage's processing principal, `olf--processing`; Secret `trino_credentials_secret_name`, keys `POLARIS_PROCESSING_CLIENT_ID` / `_SECRET`, in the stage namespace | `iceberg.rest-catalog.security=OAUTH2`, `oauth2.credential=:`, `oauth2.server-uri` = the contract `token_uri`, `oauth2.scope` = `PRINCIPAL_ROLE:ALL`, `vended-credentials-enabled=false` (`modules/query/trino`). Granted `CATALOG_MANAGE_CONTENT` on that stage's catalog | | Floe domain Job | The stage's processing principal; Secret `floe_credentials_secret_name` (the Secret Trino reads) in the stage namespace, referenced by each domain's Floe Job through `secretKeyRef` | The stage profile `openlakeforge_runtime/floe_profile.py` renders names the token URI, scope and the Secret's keys; Floe authenticates with those credentials against that URI. `CATALOG_MANAGE_CONTENT` | | `olf infra catalog sync-namespaces` | The stage's deployer principal; Secret `polaris-deployer-creds`, read through RBAC | `olf/infra/polaris.py` POSTs `grant_type=client_credentials` with HTTP Basic to the token path over a port-forward. `CATALOG_MANAGE_METADATA`, and `CATALOG_MANAGE_ACCESS` when people sign in (ADR 0019) | | `olf`'s Polaris bootstrap | The Polaris root client (created in-cluster by the Polaris module's credentials Job, so not in Terraform state), read by the operator's kubeconfig | Exchanges at the internal token endpoint through a port-forward after the platform apply, then creates catalogs, principals, roles and grants and writes each principal's Secret (`olf/infra/polaris_bootstrap.py`) | | dbt | **None.** Gold is written through Trino as `olf--runtime` | The bootstrap deletes the legacy `dbt` principal and `polaris-dbt-creds` Secret. #26 still lists dbt as a Polaris writer; it no longer is | | OpenMetadata | **None used.** The bootstrap still creates the `om` principal, its Secret `om_credentials_secret_name` and a `CATALOG_MANAGE_CONTENT` grant on every stage catalog | The lakehouse service crawls through Trino as `openmetadata` (OpenMetadata 1.13 removed the Iceberg connector; `technical-debt.md`). No module, `olf` command or chart reads the `om` Secret: only the Polaris bootstrap and an unused field of the OpenMetadata contract variable name it. It is a dormant credential with a write-level grant | Dagster pods receive the Polaris REST and token URIs and the scope (`POLARIS_*` in `modules/orchestration/dagster`) but no client credential of their own beyond the Floe Secret above. ## Blast radius if Polaris moved to the issuer | Writer or operation | What changes | | --- | --- | | Trino | `oauth2.server-uri` and `oauth2.credential` point at the issuer's token endpoint and a new issuer client per stage; scope semantics change (the issuer decides roles, not `PRINCIPAL_ROLE:ALL`). Trino restarts per stage catalog. Token lifetime becomes the realm's access-token lifespan (5 min, ADR 0014); **to verify** that Trino's refresh keeps unattended queries alive across it | | Floe | Its generated profile must name the issuer token URI and an issuer client. **To verify** that Floe's catalog client accepts a token endpoint that is not Polaris' and a different scope format; manifests are Floe-owned and must not be post-processed | | `olf` deployer | `olf/infra/polaris.py` assumes the Polaris token path and Basic client credentials, so it needs an issuer-aware login | | Bootstrap Job | It authenticates to the internal token endpoint as root. Under `external` that endpoint is disabled and the Job fails; `mixed` keeps it. Principal rotation (`/principals//rotate`) stops mattering for migrated callers, and their secrets are then rotated at the issuer | | Principals and grants | Unchanged and still required: every migrated caller needs a Polaris principal whose name the token's name claim matches, with the same catalog-role grants | | Availability | Today Polaris is self-contained. With an external issuer, Trino and Floe cannot obtain a catalog token while the issuer is down, which conflicts with the "recovery works with the issuer down" bound in `identity-sessions-and-recovery.md` for every pipeline and query | | Local trust | Polaris must reach and trust `https://auth.` (see above) | | AWS | None. AWS uses Glue; no Polaris is deployed | ## Decision Defer. Polaris keeps `internal` authentication in v0.5-alpha. 1. **No user-facing benefit.** No person authenticates to Polaris, and the issuer would authenticate the same non-interactive callers that a Polaris secret authenticates now. The class-2 credentials stay shared service accounts either way (`identity-callers.md`). 2. **It does not reach the goal that motivates it.** The issuer replaces authentication, not Polaris' principal and grant model. Per-user policy needs the end user's identity to arrive at Polaris (see below), which the Trino connection model decides, not Polaris' IdP support. 3. **It changes every writer together** (Trino, Floe, the deployer, the bootstrap) and puts the issuer in the catalog's availability path, for the same unattended pipelines #26 requires to keep running. 4. **Unverified dependencies** — JVM trust of the local CA, the claim that names a service principal, Floe's acceptance of a foreign token endpoint — would each need a cluster experiment. ### Follow-up scope (tracked in #367) Start only when per-user identity must reach the catalog (the #179 follow-up) or an operator needs to remove Polaris-held secrets. It is sequenced with the #179 follow-up, ahead of the v1.0 governance work (#54–#57). Plan: 1. Verify the three **to verify** items on a cluster. 2. Set `authentication.type: mixed` and `oidc.*` in the chart. Mixed is additive: the bootstrap, existing Secrets and every current caller keep working. 3. Create one issuer confidential client per workload, with a name claim equal to its existing Polaris principal; migrate Trino, then Floe, then the deployer, one at a time, with the unattended e2e as the gate. 4. Move the bootstrap last, or leave it on `internal` and stay on `mixed`. Moving to `external` is only worth it once the bootstrap no longer needs the root client. 5. Independently of any migration: remove the dormant `om` principal, its Secret and grant, and the `om_*` contract fields (or record why they stay). ## Findings for the data-plane assessment (#179) Where table-level policy would be enforced, as the tree is wired today: | Layer | Polaris (self-hosted) | Glue (AWS) | | --- | --- | --- | | Catalog authorization | Polaris RBAC on the REST catalog: securables catalog, namespace, table, view and policy; privileges such as `TABLE_READ_DATA` granted to catalog roles, assigned to principal roles, assigned to principals. Optional external decision point (`polaris.authorization.type`, OPA documented). Evaluated for the principal on the request | AWS IAM on Glue databases and tables, optionally Lake Formation grants evaluated for the calling IAM principal. Today AWS scopes each stage's Pod Identity role to `database/_*` and has **no Lake Formation** (`technical-debt.md`) | | Who the catalog sees | Trino's per-stage principal with `CATALOG_MANAGE_CONTENT`, not the end user | The stage's Pod Identity role | | Effect today | Stage isolation only: one catalog per stage, one principal per catalog | Stage isolation by name prefix and IAM | | Data files | **Workload path: not gated by Polaris.** Trino's stage catalogs read object storage with their own S3 key and `vended-credentials-enabled=false`. `TABLE_READ_DATA` is defined as receiving catalog-vended storage credentials, so a per-table grant does not restrict those reads. **Person path: gated** (ADR 0019). The stage catalogs `lakehouse_` hold no S3 key and ask for vended credentials, which SeaweedFS issues through its STS, scoped by a session policy to the table, and read-only unless the person's role writes there. New stage catalogs are created with STS available (ADR 0019, build step 2) | IAM on the S3 prefixes | | Engine-level | Trino access control (`catalog_access_rules`, `tables` rules in `modules/query/trino`) keys on a user name Trino does not authenticate (register entry "Trino has no client authentication"); #26 chooses the mechanism | Same | Implications to carry into #179's ADR: - **The two catalog mechanisms are different and not interchangeable.** Polaris RBAC and Glue IAM/Lake Formation have different securables, grant shapes and principals. A canonical role (ADR 0014) can be mapped to each, but each is a separate adapter, and they enforce at different points. Table policy written against Polaris does nothing on AWS. - **The one enforcement point the providers share is the query engine.** Trino evaluates the same access-control configuration whatever catalog backs a stage, so provider neutrality favours Trino-side table policy keyed by canonical role, with the catalog as defense in depth. This is a recommendation for #179 to decide, not a decision made here. - **Polaris policy needs the user at Polaris, which Trino's connection model decides.** Trino 480 documents `iceberg.rest-catalog.session` (`NONE` or `USER`); what identity Polaris then receives and whether it is the issuer's token **is to verify**. Nothing in this evaluation forecloses it: Polaris can validate issuer tokens (`mixed` or `external`) and map them to existing principals. - **A Polaris IdP migration is not a prerequisite for Trino-side policy** and does not by itself deliver per-user data access. ## Consequences - No code, Terraform or contract changes. Polaris keeps `internal` authentication, the Secrets in `identity-callers.md` and the bootstrap. - The class-2 inventory states that the `om` Polaris credential is unused (`identity-callers.md`). - #26's Polaris acceptance item ("decision documented in an ADR or issue comment, with explicit follow-up scope") is met by this record and the follow-up issue #367. ## History New record (#26): Polaris external identity-provider evaluation, explicit deferral, and the catalog-side findings for #179. The "Data files" row: SeaweedFS stage catalogs are now created with STS available, which ADR 0019's person path uses; the workload path is unchanged. The deferral ended for people's tokens (ADR 0019, build step 3): Polaris runs `mixed` with `issuer: github`; the reachability row was verified. Workloads are unchanged. The "Data files" row splits by path (ADR 0019, build step 8): a person's queries read with credentials Polaris vends per table, so `TABLE_READ_DATA` gates their file reads; the workload path still reads with the stage's S3 key. The bootstrap caller is `olf` after the platform apply, not a Terraform Job (#562). --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0015-polaris-identity-provider-evaluation.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0015-polaris-identity-provider-evaluation.md). --- # ADR 0016: Trino workload authentication — none; Polaris decides > Decided and built on the local root (#983). Trino has no authentication of its own, no access rules and no HTTPS listener. This record once chose… Source: https://openlakeforge.dev/docs/adr/0016-trino-workload-authentication/ ## Status **Decided and built on the local root (#983).** Trino has no authentication of its own, no access rules and no HTTPS listener. This record once chose password-file authentication over HTTPS (#26, #471); ADR 0019 section 9 (#960) removed its causes, and it was rewritten in place to say what binds now. ## Context Trino authenticated workloads because one coordinator held every stage's Polaris credential and a static S3 key, so it had to tell its callers apart itself: a password per stage principal, `principals` rules binding it to one stage user, and an HTTPS listener, because Trino authenticates only a request it considers secure (#932). ADR 0019 section 9 removed both causes on the local root: one coordinator per stage (#976) makes the stage boundary a network boundary, and the keyless catalogs (#982) leave Trino no credential with a grant and no storage key, so Polaris decides every table access from the token each caller sends. ## Decision 1. **No workload authentication.** The local root's coordinators serve plain HTTP on 8080 only. Every caller sends its own Polaris token as the `token` extra credential (dbt and Gold maintenance, `olf infra query` and `olf e2e`, `olf query` and the platform API, Superset per user, the OpenMetadata crawl). The user Trino records is a claim: it labels the query, it never changes what Polaris allows (#964). 2. **No access rules on a keyless catalog.** A Glue catalog is not keyless, so AWS's shared coordinator keeps the claim-based `catalog_access_rules` until AWS moves to Polaris (#681); nothing else renders them. 3. **The Web UI signs in as a fixed user** (`web-ui.authentication.type=fixed`) behind the perimeter, which keeps its data-engineer floor. The UI shows every query; what a query reads is still Polaris's decision. 4. **Stage isolation** is the Polaris grant of the presented token plus the NetworkPolicy of ADR 0017: a stage's coordinator is reachable from its own namespace, Traefik, OpenMetadata and the platform API only. ## Consequences | Accepted cost | Why | | --- | --- | | The user in Trino's query log is a claim | Access is decided by the token alone; Polaris logs the principal `github`, not the person (ADR 0019 section 9) | | Anyone who passes the perimeter's Web UI floor sees every query in the UI | The UI shows SQL and timings, not rows; reading data still needs a token Polaris accepts | | AWS and Azure keep one shared coordinator | Their cloud milestone moves them; AWS keeps claim-based rules for Glue until then | ## History Rewritten in place (#983): Trino authentication, its `principals` and people rules, the credential Job (`trino-credential-*`, `trino-password-file`, `trino-internal-secret`), the HTTPS listener with its certificate and Traefik's re-encrypting transport, and the Web UI's OAuth2 sign-in are removed from the local root. The record below describes what was built before. One coordinator per stage on the local root (#976): the certificate, the credential Job, the password file and the internal secret are per stage namespace, and a coordinator knows only its own stage's principal and `openmetadata`. Traefik's CA trust Secret stays in `olf-system`, where it can be mounted. New record (#26 decision gate): mechanism selected and proven; nothing built. Credential Job and the default-off switch landed (migration step 2, first half). HTTPS-only listener, certificate, `PASSWORD` authentication, `principals` rules and a Traefik re-encrypting transport added behind the switch; the HTTP listener is disabled and `process-forwarded` kept (cases k0-k4, t1, t2), and keystore reload settled by a manual renewal check. Step 3 for the pipeline callers: dbt run pods (profile, run env, CA mount) and `olf e2e` reach Trino over HTTPS at the `tls` level; Superset and OpenMetadata remain. Callers send no password until `password`, because an unauthenticated HTTPS listener refuses one (case 0c); the consumer table's "password" rows describe step 4, not step 3. Step 3 for Superset: with a TLS query contract, `olf report import` writes the database URI on the `tls_port` with `engine_params.connect_args` `http_scheme: https` and `verify` set to the `olf-local-ca` ConfigMap, which the superset module mounts in the Superset pods. This mounts the CA where the driver runs instead of storing it as `server_cert`, which step 4 may still choose. OpenMetadata ingestion was blocked: in 1.13.6 the Trino connection has no `sslConfig` or CA-content field, only a `verify` string that the ingestion passes to `requests` as a file path, and the k8s pipeline client (`K8sPipelineClientConfig`) accepts no volumes, only plain-string `extraEnvVars`. **Chosen (maintainer review):** OLF runs the Trino metadata ingestion itself as a Kubernetes Job. Rejected: an image carrying the CA (the CA is per cluster), an OpenMetadata upgrade (an unknown, larger change) and `verify: false`. Step 3 for OpenMetadata: `olf openmetadata deploy-metadata` runs the crawl once per artifacts deploy as the Job `openmetadata-trino-ingestion` in the stage namespace (#976), beside the coordinator and the `openmetadata` principal Secret: the same pinned `ingestion-base` image, `metadata ingest -c`, the bot JWT from a `secretKeyRef`, and with a TLS query contract the HTTPS port with `verify` on the mounted `olf-local-ca`. The OpenMetadata bootstrap no longer deploys or triggers that pipeline. The service it registers still has no password, so `password` stays unusable until step 4. The hourly catalog refresh is the same pod as a CronJob per governed stage (`openmetadata-trino-ingestion-`), applied by `deploy-metadata` from the same builder. The pipeline-client CronJob and the `-metadata-ingestion` pipeline registration are gone. Plain-HTTP mode (`tls: none`): the Trino Web UI uses `web-ui.authentication.type=fixed` with user `olf-web` instead of its form; `/v1` workload authentication is unchanged. Web UI sign-in through Dex behind `tls` or `password`, over HTTPS routes with the `github` issuer (#26): properties above; the `trino` Dex client's redirect URI is exact. Step 4, clients: the query contract carries `credential_secret_name` (`trino-credential`) only while `password` is on. With it, dbt run pods get `method: ldap` and `OPENLAKEFORGE_DBT_TRINO_PASSWORD` from a `secretKeyRef` on the stage Secret (the Dagster module and the activation both set them); `olf report import` reads the stage Secret and sends it in the `passwords` form field of the Superset import, so it is in neither the zip nor the URI; the OpenMetadata crawl Job reads `trino-credential-openmetadata` from the coordinator's namespace into `authType.password`; `olf e2e` and `olf query` read `trino-credential-olf--runtime` and pass it to the in-pod CLI on stdin, which exports `TRINO_PASSWORD` only when the pod mounts `password.db`. The service the OpenMetadata bootstrap registers still carries no password. The Fernet-key prerequisite is met: an in-cluster Job creates a per-deployment `openmetadata-fernet-key` Secret, which OpenMetadata reads by `secretKeyRef`. Step 4, default and gate: the local root defaults `trino_workload_authentication` to `password` when `spec.access` is present. `olf e2e` (`_isolation.py`), with Trino requiring a password, runs the DEV principal with `--session-user olf-prod-runtime` (expects `cannot become user`), the PROD user name with no password and the DEV user name with a wrong one (expect 401), beside the existing direct cross-stage query (`Access Denied`) and the pipeline runs that authenticate with their own credentials as the positive controls. `JWT` beside `PASSWORD` for people's Dex tokens, the people catalogs and their rules, and the platform S3 key under `OPENLAKEFORGE_S3_*` (ADR 0019, build step 5). Per-user identity: Trino fetches the JWT keys for people's tokens from Dex's Service rather than through the ingress. The first fresh deployment with people's access never finished: Traefik waits for Trino's route, and Trino crash-looped on an unresolvable `auth.` while fetching the keys at startup. An attempt (#932) to serve `PASSWORD` on the HTTP listener with `http-server.authentication.allow-insecure-over-http=true` was reverted: Trino then skips its authenticators on a request it does not consider secure, so a request with no credential was accepted as the `X-Trino-User` it named and one with a password was refused with `401 Password not allowed for insecure authentication` (observed in the coordinator of the full local e2e). Password authentication holds only on the HTTPS listener, or on a request Traefik marks `X-Forwarded-Proto: https`; the HTTPS-only listener above is therefore the decision, not a preference. #960: scheduled for retirement. ADR 0019 section 9 makes Polaris the authority for workloads as well as people, with one Trino per stage and no credential in Trino; this record's mechanism stays binding until #967 removes it. Spikes #961 and #964 confirmed the keyless engine, so no fallback is kept. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0016-trino-workload-authentication.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0016-trino-workload-authentication.md). --- # ADR 0017: Local default-deny NetworkPolicy, namespace RBAC and the enforcing CNI > Design for #46 (local qualification only); slice 1a (the canary gate), slice 2 (the flow file, its check, the policy module and the stage-namespace… Source: https://openlakeforge.dev/docs/adr/0017-local-network-policy-and-rbac/ ## Status Design for #46 (local qualification only); slice 1a (the canary gate), slice 2 (the flow file, its check, the policy module and the stage-namespace policies), slice 3a (default-deny on the `olf-system` data plane: Postgres, SeaweedFS, Polaris, Trino) and slice 3b (the access plane: Traefik, oauth2-proxy, the issuer, the portal, cert-manager, OpenMetadata, OpenSearch and the Jobs) are built; the cluster-side behaviour of the 3b rows is **[T]**. What binds today is the policy model, the flow table, the RBAC inventory, the conformance plan and the slice order. The CNI question is **settled: Option A, kindnet.** The canary passed on the pinned kind 0.32.0 (History), so Calico (slice 1b) is not built. Claims carry a tag. **[V]** read from this repository or rendered from the pinned charts with `helm template` (no cluster). **[D]** read in upstream documentation, not run. **[T]** to verify on a running cluster; no cluster was touched while writing this. ## Context No `NetworkPolicy` object exists in the tree [V]. Every pod reaches every Service: Postgres (per-service passwords only), Polaris, SeaweedFS, Dex's whole HTTP surface, Dagster's unauthenticated GraphQL API, and Trino (which trusts `X-Trino-User`, [ADR 0016](https://openlakeforge.dev/docs/adr/0016-trino-workload-authentication/)). The perimeter ([ADR 0014](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/)) protects ingress only, so an untrusted pod bypasses it. #178 makes the callers class 2 and #46 is the control that stops anyone else using those paths. Cluster administrators stay trusted; `kubectl port-forward` and `exec` are RBAC, not network, paths. Two facts about the tree shape the model. Traefik and cert-manager are **not** in namespaces of their own: both are Helm releases in the shared namespace `olf-system` [V: `modules/access/traefik`, `cert-manager`]. Stage namespaces (`olf-`) hold Dagster, its run pods and Floe Jobs, and Superset [V: `environments/local/main.tf`]. ## Premise check: does kindnet enforce? The request for #46 assumes kind's default CNI, kindnet, does not enforce NetworkPolicy, and the maintainer approved Calico on that basis. The kind v0.24.0 release notes say "Out-of-the-box support for network policy via sigs.k8s.io/kube-network-policies" [D], and kindnet's own documentation says it implements NetworkPolicy that way, by inspecting the first packet of a connection and programming the host dataplane [D]. The tree pins kind 0.32.0 [V: `release/component-catalog.yaml`] and its `kind-cluster.yaml` neither disables the default CNI nor pins a node image, so the CNI is whatever kindnetd that kind release ships. The upstream project calls itself a "reference implementation" [D]; its semantics for `ipBlock`, host-network sources (kubelet, the API server) and Service DNAT ordering are **[T]**. The two options, and why slice 1 is a gate (see [Decisions](#decisions)): | | A. kindnet (kind 0.32.0 default) | B. Calico (fallback) | | --- | --- | --- | | Install work | None. Slice 1 is the enforcement canary | A CNI install in the foundation, ~450 lines (below) | | Existing local clusters | Work as they are | Must be destroyed and recreated: the CNI cannot be swapped under a running kind cluster | | Cost per developer | None | Extra RAM, extra startup minutes, a second upgrade surface (Calico release, Kubernetes-version-specific CRDs [D]) | | Semantics | Reference implementation, [T] | The mature, documented implementation | | Decided by | A canary that proves a deny-all policy drops traffic | Only if the canary fails: Calico is the documented fallback | **Slice 1a, the canary on the pinned kind 0.32.0, is the gate.** If it blocks, kindnet is the dataplane, the kindnet version goes in the History and slice 1b is not built. If it does not enforce, B is built as designed below. The rest of this ADR holds under either; only the CNI section and the apiserver rows of the flow table are CNI-sensitive. ## Decision 1. **Dataplane gate.** `olf infra deploy` fails before any policy is applied unless the cluster enforces policy, and the e2e re-proves it with a canary on every run. Policy objects without enforcement never count as done (#46). 2. **Default-deny ingress and egress** in `olf-system` and every stage namespace, DNS allowed, every other flow an explicit row in one file, `release/network-flows.yaml`, read by Terraform and by `olf e2e` (the `release/identity-roles.yaml` precedent [V]). 3. **A stage namespace is one trust domain; `olf-system` is not.** Inside a stage namespace pods talk freely: run pods and Floe Jobs are launched by the `dagster` ServiceAccount with labels user code controls, so a label is not a boundary there. Between namespaces, and between `olf-system` workloads, every flow is an allow row selecting on chart-native labels. 4. **Stage-first rollout.** Pods in a namespace with no policy are not isolated. Policies go onto the stage namespaces first, whose destinations in `olf-system` are still open, then onto `olf-system`; the stack works after every slice. 5. **RBAC is inventoried, narrowed where the roles are ours, and pinned** by an e2e check that fails when a new Secret-reading binding appears. 6. `kube-system`, `calico-system`/`tigera-operator` (Option B) and the control-plane host network are **not** policy targets: a default-deny there can take the cluster down (CoreDNS, kube-proxy, the CNI itself). They are the documented exception, and the egress rows below allow only what the OLF pods need from them. ## The enforcing CNI ### Option B: Calico | Topic | Design | | --- | --- | | Cluster config | `infra/kind/local/kind-cluster.yaml` gains `networking: {disableDefaultCNI: true, podSubnet: 10.244.0.0/16, serviceSubnet: 10.96.0.0/16}` (kind's own defaults, written down so the Calico pool can name them). The control-plane node keeps the `ingress-ready` label and 80/443 mappings | | Ordering | Nodes stay `NotReady` and CoreDNS `Pending` until a CNI exists [D], and the foundation runs `kind create cluster --wait 120s` [V], which would fail. The foundation passes `--wait 0s` (`kind_wait_timeout`), then `olf` installs the CNI in `foundation_up`, then waits for nodes. Terraform keeps owning cluster creation; the CNI release is not in Terraform state, because the foundation root has no Kubernetes or Helm provider and the kubeconfig does not exist at plan time | | Pins | Chart `tigera-operator` v3.33.0 (appVersion v3.33.0; archive sha256 `efcc8633742c136708cd8de9673862c6eee3a91ed176d7f2835690ab625ad846` as downloaded from `https://docs.tigera.io/calico/charts` while writing) under `components.helm.charts` in the catalog, fetched by the existing `CatalogChart`/`prepare_chart` cache. Images under `components.images` with digests: the operator (`quay.io/tigera/operator:v1.44.0`, the chart default [V]) and `quay.io/calico/{node,cni,kube-controllers,typha}:v3.33.0` [D]. Digests are recorded by the implementing PR, not here [T]; `olf check components` enforces them. Calico's own images are pinned through an `ImageSet` named `calico-v3.33.0` [D] | | Install | `helm upgrade --install calico -n tigera-operator --create-namespace -f infra/helm/values/local/calico.yaml` with `installation.enabled: false`, `apiServer`, `goldmane` and `whisker` disabled (the chart enables all three by default [V]; none is needed for Kubernetes policy). Then `kubectl apply` of `infra/kind/local/calico-installation.yaml`: an `Installation` with one IP pool `10.244.0.0/16`, `VXLANCrossSubnet` (upstream's kind guide uses a VXLAN overlay [D]; the mode, and whether it works on WSL2, is **T**), `controlPlaneReplicas: 1`, `kubeletVolumePluginPath: None`. The CR is a separate step because the chart ships no `crds/` directory (the operator bootstraps its own CRDs at start [V]), so a CR in the same release may not map, the reason the repo already splits `local-ca` from cert-manager [V] | | Prefetch | The images load into every node with the `prefetch.py` mechanism (`docker pull`, `save`, `ctr import`) before the install, so three nodes do not each pull from quay.io (rate limits, CI time). `_prefetch_one_image` becomes public; the list is the catalog images above | | Readiness gate | `kubectl wait tigerastatus/calico --for=condition=Available`, every node `Ready`, CoreDNS available; then the canary of the next section. Runs on **every** `olf infra deploy`, not only on creation, so a cluster whose dataplane vanished cannot take policies silently | | Existing cluster | `foundation_up` finds the cluster and reuses it ("already exists. Reusing it", `foundation/local-kind/main.tf` [V]); a changed config file hash does not recreate it. `olf` therefore detects a cluster without the CNI (`kindnet` DaemonSet present or `tigerastatus` absent) and stops: `olf infra destroy --provider local`, then deploy. Local data is lost; no production deployments exist (maintainer note, pre-beta) | | Destroy | Deleting the cluster deletes the CNI. `olf infra destroy --phase platform` leaves the cluster and the CNI; the `tigera-operator` and `calico-system` namespaces carry no `openlakeforge.io/managed-by` label, so the foundation guard that refuses to delete a cluster with platform namespaces ignores them [V: `foundation_down` selects by profile label] | | Upgrade | Change the pins and recreate the cluster. In-place operator upgrades are not supported or tested: local clusters are disposable | | Cost | **Not measured [T]; measure before merging slice 1b** with `docker stats` on the node containers before and after, and record startup time of `olf infra deploy --phase foundation`. Expected from the objects: one operator pod, a `calico-node` DaemonSet pod per node (3), `calico-kube-controllers`, possibly Typha; five images pulled once per node unless prefetched. The first cost every developer sees is the forced destroy and the CI runner's longer foundation step | | What changes for developers | The first deploy after the change recreates the cluster; pods no longer reach arbitrary Services, so an ad hoc `kubectl run curl` in an OLF namespace is blocked (use `port-forward`, or `exec` into an allowed pod); `olf e2e` creates and removes its own temporary policies; `kubectl get pods -A` shows two more namespaces | Slice 1b must resolve these review findings before it is built; none is designed here, because Option B is built only if the canary fails: - **Guard before Terraform.** `triggers_replace` hashes the kind config, so the foundation apply replaces the resource and its destroy provisioner deletes the cluster; the missing-CNI check must run before that apply, or ownership of replacement must change. - **Ownership.** The Calico release and `Installation` are static foundation infrastructure; place them in Terraform state, or rewrite ADR 0002 to allow an `olf`-owned step, rather than a second unrecorded ownership model. - **CRDs.** The v3.33 operator chart may not install the Calico CRDs (the upstream kind guide installs them first, in a Kubernetes-version-specific file [D]); pin and apply the matching CRD bundle before the operator. - **Image set.** v3.33 may have consolidated `cni`, `kube-controllers` and `typha` into `calico/calico`; derive the prefetch and `ImageSet` lists from the pinned operator's `--print-images=list` output, not from the names above. ### Option A: kindnet Nothing is installed. Slice 1 is the gate and canary below, run against the cluster `olf` already creates. The destroy-and-recreate step disappears unless a developer's cluster predates kind 0.24 [D]. ### The gate and the canary `olf` creates a throwaway namespace with a deny-all policy, a server pod and a client pod, and requires every connection attempt to fail, by timeout or by refusal (the NetworkPolicy contract promises only that the connection cannot occur, not how it is signalled [D]), while an identical pair in a second, policy-free namespace connects, which also proves the server was listening. Deploy runs it once after the CNI is ready; the e2e runs it again as its first step. This is the evidence for "Local runtime demonstrably enforces default-deny network policy". ## Namespaces and the policy model | Namespace | Holds [V] | Baseline | Isolation level | | --- | --- | --- | --- | | `olf-system` | PostgreSQL, SeaweedFS (master, volume, filer, S3), Polaris, Trino, Dex, oauth2-proxy (one per role floor), portal, Traefik, cert-manager (controller, webhook, cainjector), OpenMetadata, OpenSearch, OpenMetadata ingestion Jobs, every bootstrap Job | default-deny both ways, DNS | Per-service allow rows | | `olf-` | Dagster webserver, daemon, code server, run pods and Floe Jobs; Superset (web, worker, Redis, init Job); the stage Secrets | default-deny both ways, DNS, intra-namespace | Whole namespace is one trust domain | | `kube-system` | CoreDNS (with the in-cluster-resolution Corefile), kube-proxy, kindnet if Option A | unmanaged | Exception | | `calico-system`, `tigera-operator` | the CNI (Option B) | unmanaged | Exception | Every policy selects pods by the labels the charts and modules already set, so no chart value changes in the policy slices. Jobs carry `openlakeforge.io/job=` [V: twelve Jobs and CronJobs]. Selectors per workload (`name` is `app.kubernetes.io/name`): PostgreSQL `app.kubernetes.io/name=postgresql`; SeaweedFS `app.kubernetes.io/name=seaweedfs` plus `component`; Polaris `name=polaris`; Trino `name=trino,component=coordinator`; Dex `name=dex`; Traefik `name=traefik`; cert-manager `component` in `controller|webhook|cainjector`; OpenMetadata `name=openmetadata`; OpenSearch `name=opensearch`; Superset `app=superset`, `app=superset-worker`; Dagster `name=dagster` with `component` (webserver, daemon) and `name=dagster-user-deployments` [V: `helm template` of the pinned charts]. The stage namespaces are matched by their `openlakeforge.io/stage` label and the shared one by `openlakeforge.io/scope=shared` [V: `main.tf`], not by name. ## Flow table Each row is a pair of policies: egress on the source, ingress on the destination, unless a side's namespace is unmanaged. "Source" is the row of [`identity-callers.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-callers.md) or the file the flow was read from. Ports are container ports (a policy sees the post-DNAT pod port [D]). | # | From | To | Port | Source | Tag | | --- | --- | --- | --- | --- | --- | | F1 | any (host, via the kind 80/443 mapping) | Traefik pod | 8443 (443 hostPort); 8000 (80 hostPort) only in plain-HTTP mode, `tls: none`, but the policy allows it in both | `traefik.yaml`, `kind-cluster.yaml`; the chart exposes `web` 8000 and `websecure` 8443 | V; hostPort through the CNI's portmap **T** | | F2 | Traefik | oauth2-proxy (every floor) | 4180 | forwardAuth address in `modules/access/perimeter` | V | | F3 | Traefik | Dex, portal, platform API 8080, OpenMetadata, Trino (`olf-system`); Superset 8088 and Dagster webserver 80 (stage) | per route | `service_routes` and `ingress_routes` (the platform API's `/api` path) in `contracts.tf` | V | | F4 | OpenMetadata | Traefik 8443 (8000 when `tls: none`) | 8443, 8000 | the issuer's public URL through the CoreDNS rewrite: OpenMetadata's discovery and token requests (the oauth2-proxy, Polaris and platform API calls moved to F31, #991); Superset's sign-in calls until #1092 (stage rule) | V; Superset (stage rule) is built; the Trino and OpenMetadata rows **T** | | F5 | all managed pods | CoreDNS in `kube-system` (`k8s-app=kube-dns`) | 53 UDP/TCP | every pod resolves; `*.` is rewritten to Traefik | V | | F6 | Dex, Polaris, OpenMetadata, Postgres bootstrap, Polaris metastore bootstrap; Superset and Dagster (stage) | PostgreSQL | 5432 | `postgresql_contract`; `stage_databases` namespaces | V | | F7 | Polaris | SeaweedFS S3 | 8333 | table metadata is written to the warehouse bucket; not traced in the module | **T** | | F8 | a stage's Trino coordinator, which runs in the stage namespace and so takes the stage rows F9 | Polaris 8181; SeaweedFS S3 8333 | 8181, 8333 | `catalog_contract`, `storage_contract` | V | | F9 | stage namespace (run pods, Floe Jobs) | Polaris 8181; SeaweedFS S3 8333 | 8181, 8333 | Floe/dbt rows; `AWS_ENDPOINT_URL_S3`, S3 compute-log manager in `dagster.yaml` | V (Floe runner labels **T**) | | F10 | a stage's own pods | its own Trino coordinator, in the same namespace (no row: a stage namespace is one trust domain, and no other stage's pod reaches it) | 8080 | Superset, dbt rows; Trino has no authentication of its own (ADR 0019 section 9) | V | | F11 | Traefik (the Trino UI), OpenMetadata | the stage namespaces (a stage's Trino 8080) | 8080 | OpenMetadata to Trino row | V | | F12 | stage namespace of a governed stage | OpenMetadata | 8585 | `OPENLINEAGE_URL`, ingestion-bot token | V | | F13 | the role-sync CronJob | OpenMetadata | 8585 | `pipelineServiceClientConfig` (`metadataApiEndpoint`); `openlakeforge.io/job` | V; the same Job needs it, so slice 3b selects it by `openlakeforge.io/job` | | F14 | OpenMetadata | Superset (stage) | 8088 | `superset_url` registered by `olf`'s bootstrap | V; whether ingestion runs today **T** | | F15 | OpenMetadata | OpenSearch | 9200 | `elasticsearch.host` in `openmetadata.yaml` | V | | F16 | Superset web, worker, init Job | Redis (stage) | 6379 | intra-namespace | V | | F17 | SeaweedFS pods among themselves; bucket Job | master 9333, 19333; filer 8888, 18888; volume 8080, 18080; S3 8333 | those | chart Services; `bucket` Job waits on 9333 and 8888 | V | | F19 | Polaris metastore bootstrap Job | Polaris | 8181 | `metastore-bootstrap.sh.tftpl`: its first step probes the token endpoint | V | | F20 | Jobs: `dex-credentials`, `postgresql-credentials`, `perimeter-cookie-secret`, `publish-local-ca`; Dagster daemon and run pods (Floe's runner creates Jobs); OpenMetadata server (creates ingestion Jobs); Traefik; cert-manager (three, and the `startupapicheck` post-install Job, label `component=startupapicheck`); the stage log archiver (`openlakeforge-k8s-log-archive`, `dagster` token, lists pods and reads logs [V: `log_archive.tf`, `openlakeforge_runtime/k8s_log_archive.py`]) | kube-apiserver | 443 (Service) and 6443 (the endpoint) | RBAC section | V | | F21 | API server (control-plane node) | cert-manager webhook | 10250 | admission webhook | node-sourced traffic **T** | | F23 | oauth2-proxy, the platform API | an `issuer: external` host | 443 | profile-driven, same rendering; the platform API reads the issuer's discovery document and keys | T | | F24 | kubelet (node) | any pod | probes | not a policy flow: node-to-local-pod traffic is not blocked [D] | T | | F25 | `kubectl port-forward`, `exec`, `logs` | any pod | none | the kubelet's runtime stream enters the pod's own network namespace, loopback, never crossing the policy hooks [D] | T | | F28 | Dex | any address outside the pod and Service ranges | 443 | Dex calls `github.com` and `api.github.com` at every login and refresh ([ADR 0014](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/), "Network"); NetworkPolicy has no FQDN selector, so the rule is the port on any address, on the Dex pods only | T | | F29 | Dex | the Dex e2e's stub GitHub pod (`olf-system`, label `openlakeforge.io/e2e=github-stub`, #405) | 8443 | the connector `hostName` is `olf-e2e-github.olf-system.svc`; F28 excludes pod and Service ranges, so the stub needs its own row (post-DNAT port) | T; a flow-file row keyed on the label the e2e sets | | F30 | OpenMetadata role-sync CronJob (`openlakeforge.io/job=openmetadata-role-sync`) | any address outside the pod and Service ranges | 443 | the sync reads team members from `api.github.com` ([ADR 0014](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/), "OpenMetadata role sync"); no FQDN selector, so the port on any address, on that Job's pods only. Its calls to OpenMetadata ride F13 | T | | F31 | oauth2-proxy; Polaris; the platform API; OpenMetadata | Dex (`olf-system`) | 5556 | the signing keys for people's tokens and the perimeter's code exchange, over Dex's Service (ADR 0013, decision 8). Trino no longer fetches them: it has no authentication of its own (#983) | T | | F32 | the platform API | Dagster webserver 80 (stage); OpenMetadata 8585 | 80, 8585 | its read endpoints ([ADR 0021](https://openlakeforge.dev/docs/adr/0021-platform-api/)): each stage's GraphQL URL (`dagster_graphql_urls`), and OpenMetadata with the caller's token forwarded (`openmetadata_url`), both rendered by `modules/access/platform-api` | T | | F33 | the platform API | SeaweedFS S3 8333 | 8333 | its archived-logs route ([ADR 0021](https://openlakeforge.dev/docs/adr/0021-platform-api/)), with the read-only key `openlakeforge-platform-api-logs` the SeaweedFS credentials Job mints: `Read` and `List` on each stage's `activations//logs/k8s/` and nothing else | T | | F34 | Dagster run pods (`app.kubernetes.io/component=run_worker`) of a stage whose profile declares `spec.stages..source_egress.ports` | any address outside the pod and Service ranges | the declared ports, TCP | Bronze sources that read an external API or database (#660); their host and port are stage bindings (`olf-source-` ConfigMaps) that reach the run pod only. No FQDN selector, so the ports on any address, as F28 and F30; rendered from the profile, as F23, as its own policy `olf-flows-f34` in that stage's namespace only. A stage that declares nothing gets no row | T | | F35 | the platform API | Superset 8088 (stage) | 8088 | its report routes ([ADR 0021](https://openlakeforge.dev/docs/adr/0021-platform-api/)): each stage's Superset (`superset_urls`), as the service user `olf-platform-api` whose password the platform API module's Job mints, and never as `admin` | T | | F36 | the platform API | the stage namespaces (a stage's Trino coordinator) 8080 | 8080 | a person's queries ([ADR 0021](https://openlakeforge.dev/docs/adr/0021-platform-api/)): each stage's statement URL (`query_endpoints`), carrying that person's own token for Polaris; the API holds no Trino credential. Rendered with `person_query` only | T | Not derivable from source, to settle in the slice that touches each: the labels of OpenMetadata ingestion Job pods (set by the server at runtime); the labels and egress of Floe's runner Jobs (`floe_dagster.kubernetes_runner` is in the image, not the tree); whether Polaris calls SeaweedFS (F7); the ordering of Service DNAT and policy evaluation in the chosen CNI, which decides whether F20 needs the ClusterIP, the endpoint, or both (the plan allows both); whether any chart pod needs internet egress (none is expected; images are pulled by the node, not the pod). Dagster run pods' external egress is settled by F34: the label is the one the pinned `dagster-k8s` run launcher puts on the run Job's pod template [V: `dagster_k8s/launcher.py` and `job.py` of 0.29.7, the version `images/project-code` pins], and what they reach is declared per stage in the profile, because the hosts are stage bindings no file in the tree holds. Denied by construction, and tested (negative matrix below): everything not in the table. Notably stage to stage (DEV cannot reach PROD's Dagster or Superset), stage to Dex, Postgres from outside the F6 sources, SeaweedFS master, filer and volume ports from outside, Polaris's management port 8182 from anywhere, Trino from an unlisted namespace, and any pod to Dagster except Traefik and the stage's own namespace. **Known leak the network cannot close.** Any pod allowed to reach Traefik (F4 sources) can request `https://auth.`, which routes the whole Dex service, which has no admin console ([ADR 0014](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/)). Dagster and run pods are not given F4, so user code cannot; narrowing the route is the follow-up that ADR already names. ## RBAC inventory Rows are what the tree grants after slice 4. "Done" was tightened in that slice; "exception" is recorded and pinned by the e2e check. | Subject | Grant | Used for | Verdict | | --- | --- | --- | --- | | `default` ServiceAccount, every namespace | no Role [V] | token auto-mounted into Postgres, Dex, portal, oauth2-proxy, Trino and Superset pods; only `log_archive.tf` sets `automount_service_account_token` [V] | No Role, so a mounted token authorizes nothing beyond discovery. `automount_service_account_token = false` on module-owned workloads is deferred hardening, not an RBAC grant; the e2e asserts the denials below | | `dex-credentials`, `-cookie`, `postgresql-credentials` (`olf-system` and each stage namespace holding a database Secret), `superset-credentials` (each stage namespace with Superset), `platform-api-superset-users` (`olf-system`, `get` naming each `platform-api-superset-`; and each stage namespace with Superset, `get` and `patch` naming `platform-api-superset`), `seaweedfs-credentials` (`olf-system` and each stage namespace holding an S3 key Secret, `get` naming the admin, stage and, with the platform API, `platform-api-log-reader-s3-creds` and `platform-api-audit-writer-s3-creds` Secrets; in `olf-system` it also patches `seaweedfs-s3-auth` and the S3 Deployment by name) | `create` Secrets (namespace-wide) + `get` by `resourceNames` | create-if-missing credentials | Exception E1: `create` cannot be limited by `resourceNames` [V: comment in `credentials.tf`] | | `publish-local-ca` (each trust namespace) | ConfigMaps `create/get/patch/update` (namespace-wide); `get` on the CA Secret by name | publishes `olf-local-ca` | Exception E1 (ConfigMaps only) | | `polaris-bootstrap` (`olf-system`) | Secrets `create`, namespace-wide; `get` on `polaris-token-broker` and `polaris-bootstrap-credentials` [V: `modules/catalog/polaris/rbac.tf`] | the token-key Job's create-if-missing token-broker key and root credentials | **Done**: `create` stays namespace-wide (E1), `get` is pinned by `resourceNames`. The Polaris bootstrap, which created and rotated the principal Secrets and their `-bootstrap-pending` markers in `olf-system` and the stage namespaces, runs in `olf` with the operator's kubeconfig after the apply (#562), so no Role grants those | | `openmetadata-bootstrap` (`olf-system`) | Secrets `create`, namespace-wide [V: `modules/governance/openmetadata/rbac.tf`] | the fernet-key Job's create-if-missing `openmetadata-fernet-key` | **Done**: `create` only (E1). The OpenMetadata bootstrap and the ingestion-bot replication, which read and wrote the admin, automation-bot, ingestion-bot and Superset admin Secrets, run in `olf` with the operator's kubeconfig after the apply (#562), so no Role grants those | | OpenMetadata server and `openmetadata-ingestion` (chart `k8s-pipeline-rbac.yaml`) | pods, ConfigMaps, **Secrets** `get/list/create/update/patch/delete`, Jobs/CronJobs, `omjobs`, namespace-wide in `olf-system` [V] | runs ingestion pipelines as Jobs | **E2, the widest; recorded as a named exception by slice 4.** A compromised OpenMetadata can read the PostgreSQL admin and the Polaris root Secret. Limiting Secret verbs by `resourceNames` is not enough while the same Role can create pods, Jobs or CronJobs in `olf-system`: a workload mounts any Secret in its namespace and can run as any ServiceAccount there, including Traefik's and cert-manager's [D: Kubernetes RBAC good practices]. Slice 4 therefore counts workload creation as Secret access. It sets `pipelineServiceClientConfig.k8s.rbac.enabled: false` [V: key exists] and supplies a module-owned Role only if pod and Job creation can be confined (for example to a dedicated ingestion namespace or ServiceAccount); the server also creates Secrets with generated names [T]. Slice 4 could not confine pod and Job creation, and the UI-triggered pipeline client needs the grant, so E2 is accepted with this exact exposure, asserted by the pin check; the chart-owned Role is not rewritten here | | `dagster`, `dagster-user-deployments` (stage) | Jobs and pods `create/delete/get/list/patch/update/watch`, pods `log/status`, events [V] | run launcher, Floe Jobs | Exception E3 (also in [`identity-callers.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-callers.md), Dagster run launcher): no Secret verbs, but pod creation in a namespace reads that namespace's Secrets through volumes; a stage's user code already holds them. Stage namespace = trust domain | | `traefik` ClusterRole | Secrets `get/list/watch` in **all** namespaces; Ingress status update [V] | TLS Secrets | Exception E4; narrowing to namespaces is a chart option, **T** | | cert-manager ClusterRoles | Secrets `get/list/watch/create/update/delete` cluster-wide [V] | issuing certificates | Exception E5, inherent; the controller-challenges ClusterRole also creates pods and Services for HTTP-01 solvers, and the webhook has a namespaced `dynamic-serving` Role on its CA Secret (get/list/watch/update pinned, create namespace-wide) | | `seaweedfs` ClusterRole `seaweedfs-rw-cr` | pods `get/list/watch/create/update/patch/delete` in **all** namespaces [V] | the chart's "hack for delete pod master after migration" | **Done (slice 4)**: `global.seaweedfs.createClusterRole: false` in `seaweedfs.yaml` [V: chart 4.48 template]; the slice 5 e2e asserts the ClusterRole is gone | | `tigera-operator`, `calico-node` (Option B) | cluster-wide, privileged | the CNI | Exception E6, inherent | | `olf` operator and CI | the kind kubeconfig is cluster-admin | everything | Trusted (#46). No recovery Role is provisioned: `olf infra break-glass` uses the operator's own kubeconfig (cluster-admin on kind), see [`identity-sessions-and-recovery.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-sessions-and-recovery.md) | Denied, and asserted with `kubectl auth can-i --as=system:serviceaccount::` (impersonation by the admin kubeconfig, no network involved): for the `default` ServiceAccount of `olf-system` and of every stage namespace, `get` and `list` Secrets, `create` pods, `create` rolebindings; for each Terraform module ServiceAccount, `get` any Secret outside its `resourceNames`; for every subject above, `create` ServiceAccount tokens, `escalate` or `bind` Roles, and `patch` ConfigMap `coredns` in `kube-system` (the Corefile the in-cluster-resolution module owns). A second assertion lists every Role and ClusterRole bound to a ServiceAccount in the OLF namespaces that grants a Secret verb, or create on pods, Jobs, CronJobs or workload controllers (which reads Secrets by mounting them), and compares the set with E1 to E6: a new one fails the run until this ADR names it. The comparison is by role kind, role, subject and resources, not by name prefix; bindings to the `system:serviceaccounts[:]` groups apply to every ServiceAccount in the OLF namespaces. A Secret pinned by `resourceNames` must match the pins in `E1_PINS` (`tools/olf/olf/infra/e2e/_network.py`), the one list of the documented names. ## Conformance test New `tools/olf/olf/infra/e2e/_network.py`, called from `_runner.py` before the pipeline checks, driven by `release/network-flows.yaml` (the flow rows, the denied pairs, the RBAC expectations). Probe pods use the `k8s_bootstrap` image (`curl`, `kubectl`, `python3`) the way `check_discovery_from_pod` does, with its `sleep 3` attach-race note [V]. | Check | Setup | Expectation | | --- | --- | --- | | Canary | deny-all namespace pair, above | blocked, and the control pair connects | | Negative, outside | a pod in a fresh namespace `olf-e2e-untrusted` with no OLF labels and no policies | TCP connect times out to Postgres 5432, Polaris 8181 and 8182, Trino 8080, Dagster 80 in each stage, Superset 8088, Dex 5556, SeaweedFS 8333 and 9333, OpenMetadata 8585 | | Negative, inside | a pod in a stage namespace and one in `olf-system`, both without an allowing label | blocked towards Dex, Postgres (from `olf-system` pods outside F6), the other stage, SeaweedFS master and filer | | Positive control | the same probe from the same namespace to Traefik 8443 (F1), and a pod carrying an allowed workload's labels (for example Superset's in a stage namespace) to Trino | connects, so a broken probe or DNS cannot pass the negatives vacuously | | Authorized flows | the unchanged `olf infra e2e run --env local`: pipelines, Silver and Gold through Trino, dashboards, OpenMetadata assets, artifacts | pass with every policy on. This is the "unattended pipelines still work" evidence and needs no new code | | kindnet semantics (Option A) | the canary's pairs extended with: an `ipBlock` allow and an `ipBlock` `except`; a kubelet probe and an API-server-to-webhook call into a default-deny pod (node-sourced traffic); a policy naming a pod port reached through a ClusterIP Service (DNAT order); a named port | each behaves as the flow table assumes; a failure here is a reason to build B | | Port-forward | the existing forwards (SeaweedFS, Polaris, Dex, Dagster, Superset, OpenMetadata, portal) | pass; the run fails if any falls back to another path | | RBAC | the can-i table and the Secret-verb pin above | as above | Negative probes assert a timeout, not a refusal, and run with a 5 s budget; the table's port list is generated from the flow file so a new denied pair needs one line. The probe namespace and every temporary policy are removed in a `finally`, as the GitHub stub of the identity e2e does. ## Where the code goes | What | Where | | --- | --- | | Flow rows, denied pairs, RBAC expectations | `release/network-flows.yaml`, schema in `docs/schema/`, validated by `olf check`; registered in `_structure.py` | | Policies | New module `infra/terraform/modules/security/network-policy` (`main.tf`, `variables.tf`, `outputs.tf`; `kubernetes_network_policy_v1`), instantiated once in `environments/local/main.tf` after the namespaces and given the namespace names, the `kubernetes` Service's cluster IP and the API server endpoint (a `kubernetes_endpoints_v1` data source) for F20. Local root only; AWS and Azure are out of scope. Profile-driven rows (F23, F34) are built in that root's `profile_flows`; F34 from the `stage_source_egress_ports` input `olf` renders from `spec.stages..source_egress` | | RBAC changes | the modules that own the Roles (`catalog/polaris`, `governance/openmetadata`) and Helm values (`seaweedfs.yaml`) | | CNI (Option B) | `infra/kind/local/`, `tools/olf/olf/infra/deployment/local/foundation.py` plus a small `cni.py`, catalog entries, `prefetch.py` | | Gate and canary | `foundation_up` / a deploy precondition, and `e2e/_network.py` | | Docs flipped from "not yet verified" | [`identity-callers.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-callers.md) Dagster and internal-reachability rows, ADR 0014 seam 3 paragraph, the #178 limitation line | ## Implementation plan Each slice is one pull request of at most 600 changed lines, and the stack works after every one. | Slice | Content | Risk | | --- | --- | --- | | 1a | The canary and the deploy gate, run against the existing cluster. Settles A or B | Cheap. If kindnet blocks, 1b disappears | | 1b (Option B only) | Kind config, catalog pins, `cni.py`, prefetch, install, readiness gate, forced-recreate message, tests. The footprint measured and recorded | Highest: VXLAN/BGP on WSL2, Docker Desktop and Colima **T**; Traefik `hostPort` through the CNI **T**; CI runner time | | 2 | `release/network-flows.yaml` and its check, the module, and the **stage-namespace** policies (default-deny, DNS, intra-namespace, F5, F6, F7 to F12 egress, F20) | Dynamic pods with labels not read (Floe, run pods): the stage rule is namespace-wide on purpose | | 3a | `olf-system` data plane: Postgres, SeaweedFS, Polaris, Trino ingress and egress | Postgres bootstrap Job pods carry the Postgres pod labels [V], so the Job is also "Postgres" to a selector; give it its own egress row | | 3b | `olf-system` access plane: Traefik, oauth2-proxy, Dex, portal, cert-manager, OpenMetadata, OpenSearch, all Jobs | cert-manager's webhook is called by the API server from the node (F21): a wrong rule fails `terraform apply`. The F20 cluster-IP and endpoint and F23 rendered from the profile | | 4 | RBAC: `resourceNames` for the Polaris and OpenMetadata bootstrap Roles, `createClusterRole: false`, `automount_service_account_token = false`, and the can-i and pin assertions | Removing a grant a chart quietly uses; the e2e is the check. E2 is the hard part | | 5 | The conformance e2e matrix completed, `identity-callers.md` and ADR 0014 updated to "verified", #178's "unreachable from outside" box | The slices above each add their rows; this one adds the untrusted-namespace matrix and docs | Ordering with the other v0.5 work: the Trino rows move to 8443 in the #26 cutover, and the OpenMetadata and Superset rows to Traefik (F4) when #25 lands, each as an edit to the flow file in that PR. ## Not covered by #46 - Resource requests, limits, PodDisruptionBudgets and storage sizing: #351 (v0.6). The Calico footprint above is measured, not budgeted. - Pod Security Standards, non-root conversion and `securityContext`: #352 (v0.8). Nothing here relies on a pod being unprivileged. - AWS and Azure enforcement (VPC CNI / network policy engines, security groups), and public-domain qualification. - Narrowing the Dex route, moving OpenMetadata to its own namespace, per-user data access (#179), and Trino authentication itself (#26). - Egress filtering by hostname, mTLS between pods, and any service mesh. ## Decisions 1. **Calico is a fallback, not the plan.** The approval rested on the belief that kind does not enforce NetworkPolicy; the kind release notes say it does. Slice 1a (canary, with a positive control) decides; slice 1b is built only if the canary proves kindnet does not enforce. kube-network-policies is a reference implementation, so the conformance e2e tests the semantics the flow table relies on (`ipBlock`, node-sourced traffic, DNAT order). 2. **The over-broad Roles are narrowed; E2 is accepted as a named exception.** Slice 4 pins the Polaris and OpenMetadata bootstrap Roles (`resourceNames`) and drops the SeaweedFS cluster role (`createClusterRole: false`). OpenMetadata's chart Role (E2) stays: its pod and Job creation cannot be confined without breaking the UI pipeline client, so it is recorded with its exposure and pinned by the slice 5 check. 3. **The e2e's own probe pods carry a label the flow file names** (F29) instead of getting temporary policies: both flows end or start at a default-deny workload (Traefik, Dex), so a policy removed in a `finally` would be the only thing standing between a crashed run and a broken stack. The probes stay in `olf-system`; the rows allow only the pod that sets the label, and creating pods there is already a cluster-administrator act. 4. **Stage-wide trust is accepted for local qualification.** Inside a stage namespace there are no per-pod rules, because user code launches pods with labels it controls. The limitation: anything running in a stage namespace can reach everything that namespace may reach. ## History F4, F10, F11, F20, F31 and F36 (#983): Trino has no authentication of its own and no HTTPS listener (ADR 0019 section 9), so its rows name port 8080 only, the coordinator no longer reaches Dex (F31) or the issuer's public URL (F4), and the `trino-credentials` Job and its E1 pin are gone. The OLF-owned Trino ingestion Job and its CronJob run in the stage namespace beside the coordinator (#976), which is where the `openmetadata` principal's Secret is: they reach OpenMetadata under F12 and Trino inside the namespace, so F11, F13 and F14 no longer name them. F8, F10, F11, F31 and F36 (#976): Trino runs once per stage in the stage namespace, so it is no longer a `workloads` entry of `release/network-flows.yaml`. Its egress (F8, F31) and its ingress from a stage's own pods (F10) are the stage-wide rows, F11 and F36 name the stage namespaces, and the `trino-credentials` Job is under the stage-wide F20. F31 names only the coordinator's pods (a narrowing, not isolation: stage labels are user-set), so other stage pods stay off Dex. Exception E1's pin for `trino-credentials` adds `dex-client-trino`: the Job reads it in `olf-system` and copies it beside the coordinator. F4 and F31 (#991): oauth2-proxy, Polaris and the platform API reach Dex's Service (F31) instead of the public URL through Traefik (F4); OpenMetadata fetches its keys the same way. OpenMetadata (no token-URL override in 1.13.6) and Superset (image change waits for #1092) keep F4 for their issuer calls. Polaris bootstrap moved to `olf` (#562): the `catalog-bootstrap` and `catalog-credential-replication` Jobs are deleted, with their workloads and their rows in F19 and F20 (`release/network-flows.yaml`). `olf` reaches Polaris through a port-forward, which no policy sees (F25). The `polaris-bootstrap` Roles in the stage namespaces are deleted and the one in `olf-system` keeps only what the token-key Job needs; the e2e pin for that ServiceAccount names `polaris-token-broker` and `polaris-bootstrap-credentials`. OpenMetadata bootstrap moved to `olf` (#562): the `governance-bootstrap` and `governance-credential-replication` Jobs are deleted, with their workloads and their sources in F13, F14 and F20 (`release/network-flows.yaml`, `environments/local/main.tf`). `olf` reaches OpenMetadata through a port-forward, which no policy sees (F25). The `openmetadata-bootstrap` Roles in the stage namespaces are deleted and the one in `olf-system` keeps only `create`; the e2e pin for that ServiceAccount names `openmetadata-fernet-key`. SeaweedFS chart 4.23.0 to 4.48.0: the ClusterRole is still gated by `global.seaweedfs.createClusterRole` and absent from the render. The new default Lance port on the S3 gateway is turned off (`s3.lancePort: 0`), so its ports and flows are unchanged. Keycloak removed (#384 slice c): the flow and RBAC tables name Dex where they named Keycloak, and the rows that existed only for Keycloak are deleted: F18 (realm Job to Keycloak), F22 (Keycloak to the `spec.identity.smtp` host), F26 (the issuer discovery probe pod, removed with the Keycloak e2e) and F27 (the mail-sink pod); the matching workloads and flows in `release/network-flows.yaml` and `environments/local/main.tf` go with them. The other flow ids are not renumbered. The observation near the end still names Keycloak because it records a probe run against it. New record (#46 design): premise check on kindnet, the Calico install design (fallback), the default-deny model with a derived flow table, the RBAC inventory with its exceptions, the conformance plan, the slice order and the maintainer's decisions. Nothing built. Slice 1a built: `olf deploy --provider local` runs the canary (`olf/infra/deployment/local/network_canary.py`) after the foundation and fails unless a deny-all namespace blocks a client its policy-free twin reaches. (Superseded below by the one-pair, two-direction canary.) Observed once, outside `olf`'s own cluster: on a stock kind v0.31.0 cluster (not the pinned 0.32.0) with kindnetd `v20251212-v0.29.0-alpha-105-g20ccfc88`, the gate passed, so kindnet blocked the deny-all pair. That did not settle A on its own. Option A settled (maintainer run, 2026-10-16): `olf deploy --provider local --phase foundation` on the pinned kind v0.32.0, node `kindest/node:v1.36.1`, kindnetd `v20260528-9350166c`, printed "NetworkPolicy is enforced." Slice 1b (Calico) is dropped; the kindnet-semantics rows of the conformance test still run in the policy slices. Canary reworked after review: one server and client pair is proven to connect with no policy, then an ingress-only and an egress-only deny must each block it. The maintainer's run above used the earlier two-namespace canary. The rework was then run against the same pinned cluster (kind v0.32.0, kindnetd `v20260528-9350166c`) through `require_policy_enforcement` and printed "NetworkPolicy is enforced.": kindnet blocks the pair for an ingress-only and an egress-only deny. Option A stands. Canary extended for allow rules (#622): after the two denies, an ingress deny must block, adding a rule that allows the client must connect, and removing it must block again. A reported cluster whose kindnet had been replaced with Calico blocked every deny but left an allow-rule selector set incomplete, so the deploy passed the gate and failed later as storage and DNS timeouts. The failure message no longer points at Calico, which was never built: it says a replaced CNI, or a host where kindnet does not enforce, is not supported. Not yet run against the pinned cluster. Slice 2 built: `release/network-flows.yaml` holds the stage rows of the flow table (F3 and F14 ingress, F5, F6, F9, F10, F12 and F20 egress), checked by `olf check flows` (in `olf check all`) for scope, ports, tag and that every id is a row of the table above. `modules/security/network-policy` renders, per stage namespace, a default-deny policy for both directions and one allow policy: the whole namespace may talk to itself, plus the file's rows. Additions beyond the slice list, needed so the stack keeps working: F3 (Traefik into Dagster 80 and Superset 8088, namespace-wide) and F14 (from `olf-system`, Superset 8088). F7, F8, F11 and F13 have `olf-system` sources and land in slices 3a/3b. F10 allows both 8080 and 8443; the 8080 row is dropped with the Trino HTTP listener. Still **[T]**: F9 (Floe runner and run pod labels are not read, and the SeaweedFS `component=s3` label is from the chart, not rendered here), F14, and F20 (whether the Service address, the endpoint address or both reach the policy). The policy module was planned against a stub provider, not applied. Slice 2 runtime check (maintainer, 2026-10-16, kind v0.32.0, kindnetd `v20260528-9350166c`): `olf deploy` and `olf e2e run --env local` pass with the stage policies, so the pipeline flows in the file are sufficient. From a probe pod in `olf-dev`, Trino (F10) answers and Keycloak (no flow; the issuer then, since replaced by Dex) is refused by pod IP, by ClusterIP and by name. **Observed limitation:** kindnet programs a new pod's policy asynchronously, and a probe started seconds earlier still reached Keycloak by pod IP and ClusterIP before the deny took effect. A freshly started stage pod therefore has a short window of unrestricted egress. Run pods are short-lived and start inside that window, so this is recorded as a known exposure of the kindnet dataplane, to be measured and either accepted or mitigated (for example an init-time wait) in slice 5's conformance matrix. Slice 3a built: `workloads` in `release/network-flows.yaml` names the four data-plane workloads by chart labels (`name` plus `instance`, and `component=coordinator` for Trino), and the module renders one policy per workload in `olf-system` denying both directions except the rows that name it. Only those pods are selected; every other `olf-system` pod stays unisolated until slice 3b, and there is no namespace-wide deny. Jobs share the `name` label with their workload but not `instance`, so they are unselected and their traffic is allowed at the destination by their `openlakeforge.io/job` label (bucket, Polaris bootstrap and replication, Polaris metastore bootstrap). The Postgres bootstrap Job is the exception the slice list flagged: its pod carries the Postgres labels, so it is selected and has its own egress row to Postgres (F6). Trino listens on 8080 and 8443 and both are allowed. Callers of Trino from `olf-system` are one row from every pod of the namespace (F11), **[T]**: OpenMetadata ingestion Job pod labels are set by the server at runtime and are not read, so the row narrows to OpenMetadata and Traefik in 3b once they are. Still **[T]**: F7 (Polaris to SeaweedFS), F10 Trino to itself (only needed if the CNI does not hairpin the Service address) and the new-pod window recorded above, which now also covers these pods. The module was validated and its rule sets evaluated with `terraform console`, not applied. Slice 3a runtime check (maintainer, kind, fresh cluster): `olf deploy` passes and the allow and deny probes match. One e2e run failed at the Polaris restart drill: the Trino query right after the new Polaris pod was Ready got an empty response from Polaris, and two re-runs passed. Under kindnet a restarted, policy-selected pod is briefly unreachable after Ready, the same asynchronous programming seen for new egress above, now on a destination. The drill retries its first post-restart query for up to 60 s instead of weakening the policies. Slice 5 should measure the window. Slice 3b built: `release/network-flows.yaml` gains workloads for Traefik, the oauth2-proxy floors (a constant pod label `openlakeforge.io/workload` that the perimeter module now sets, because the floors differ in name), the portal, Dex, the three cert-manager pods and the `startupapicheck` Job, OpenMetadata, OpenSearch and thirteen Jobs (selected by `openlakeforge.io/job`). The module gives every workload DNS egress itself, adds the peer scopes `node`, `apiserver` (as a source) and `any` (outside the pod and Service ranges, kind's defaults), and lets one row list several sources. F1 is `any` to Traefik 8443 and, for plain-HTTP mode (`tls: none`), 8000; F21 allows the API server and node addresses to the webhook on 10250, **[T]**: the source address kindnet shows for the API server's call is not read, and a wrong rule fails `terraform apply`. F11 is narrowed from any `olf-system` pod to Traefik, OpenMetadata and the OLF-owned ingestion Job; the Job label `openmetadata-trino-ingestion` is the label #410 gives the Job, so until that merges the OpenMetadata pipeline client's ingestion pods (labels not read) cannot reach Trino. F14 is narrowed the same way. Dex gets F28, 443 on any address, scoped to its pods. F23 (oauth2-proxy to the issuer URL's port, 443 by default, when the issuer is `external`) are rendered from the profile in `environments/local/main.tf`. Policies are rendered only for deployed workloads: the local root drops Dex and the governance workloads when the profile does not deploy them, and, following #406's switches, Traefik, the portal and the CA-publishing Job with `access_enabled`, cert-manager with its module count, and oauth2-proxy and its cookie Job with `identity_enabled`, so a quickstart or an access-without-identity profile plans no policy for an absent workload. The platform API (ADR 0021, #666) follows its module count: F3 from Traefik, F4 to Traefik for the issuer's keys, and F23 with an external issuer; it has no apiserver row and mounts no service account token. Decision 3 is amended (above): F29 is a row keyed on a label the e2e sets. Still **[T]**: OpenSearch's and OpenMetadata's pod labels (the dependencies chart is not rendered here), OpenMetadata's own Service hairpin, whether OpenMetadata calls Polaris or SeaweedFS (no row exists; the Iceberg crawl was not traced), the Job labels of the OpenMetadata pipeline client, and the new-pod window above, which now covers these pods too. Validated with `terraform validate` and by evaluating the module's rule sets with `terraform console`; not applied. Slice 4 (RBAC): `create` stays namespace-wide (E1) while every other verb of the Polaris and OpenMetadata bootstrap Roles is pinned by `resourceNames`; the SeaweedFS ClusterRole is not created; E2 is accepted as a named exception rather than narrowed, because pod and Job creation cannot be confined without breaking the UI pipeline client. Exceptions E1 to E6 are the accepted, named set, each pinned by the e2e check (slice 5); default-ServiceAccount token automounting is deferred hardening, since those accounts hold no Role. Decision 2 is amended to match. Not applied on kind. F31: the Trino coordinator reaches Dex's Service for the keys of people's tokens, because it fetches them at startup and Traefik, the F4 path, is created after Trino. Dex serves the same endpoints on 5556 to Traefik (F3), so the row adds no endpoint F4 sources could not already reach. F32 added (#668): the platform API's read endpoints reach each stage's Dagster webserver and OpenMetadata in-cluster. Dagster checks nothing, so this row and the API's permission matrix are the only controls on what reaches its GraphQL API (ADR 0021, decision 3). F33 added (#668): the platform API reads each stage's pod log archive from the SeaweedFS S3 gateway with its own identity, `openlakeforge-platform-api-logs`, granted `Read` and `List` on `activations//logs/k8s/` only. The SeaweedFS credentials Job mints its key into `olf-system`, so its Role there names the new Secret. The stage identities' ops-bucket grant now ends at `activations//*`: SeaweedFS 4.48 matches actions with a wildcard in which `*` also matches `/`, not with `filepath.Match` as the module's comment said. F34 added (#660): a stage's Dagster run pods reach the ports its profile declares in `spec.stages..source_egress.ports`, on any address outside the pod and Service ranges, and nothing else; a stage that declares none is unchanged. The declaration is in the Deployment Profile rather than in `source.yaml` or derived at activation: the policy is platform state Terraform owns, and the platform apply never reads user code (ADR 0002); the hosts and ports are stage bindings, not descriptor facts; and a code commit should not widen a stage's network. The module renders a stage row that names pods as its own policy, since the namespace-wide `olf-flows` would give the grant to every pod in the stage. The label narrows, it does not isolate (decision 4). The AWS and Azure roots render no NetworkPolicy, so the field has no effect there. The negative matrix is unchanged: no probe pod carries the run-worker label, and F34 opens no in-cluster address. The platform API's audit records (ADR 0021, decision 3) travel over F33 with a second identity, `openlakeforge-platform-api-audit`, granted `Write` on `audit/platform-api/` only; the credentials Job's Role in `olf-system` names its Secret, `platform-api-audit-writer-s3-creds`, as well. The platform API's Superset service users (ADR 0021, open item 3) add one more E1 ServiceAccount, `platform-api-superset-users` in `olf-system`. It mints each stage's password in `olf-system` and copies it into that stage's namespace, so it may `create` Secrets in both and touch only `platform-api-superset-` and `platform-api-superset` by name. One Job in the API's namespace writing out, rather than one per stage writing in, keeps `olf-system` free of Secrets another module created. F35 added (#670): the platform API reaches each stage's Superset on 8088 for the report routes, signed in as its own service user, not `admin`. The stage rule is namespace-wide, as F32's is. F36 added (#800): the platform API reaches the Trino coordinator on 8443 to run and page a person's queries with that person's token. It is a row on both sides, the API's egress and the coordinator's ingress, as F8 is. The query signing key (`platform-api-query-signing-key`) is minted in `olf-system` by one Job with its own E1 ServiceAccount, `platform-api-query-signing-key`: it may `create` Secrets there and read only that one by name. Its pods do not carry the API's name label, so the API's workload policy does not select them. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0017-local-network-policy-and-rbac.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0017-local-network-policy-and-rbac.md). --- # ADR 0018: GitHub is the forge — source, CI/CD, packaging and people > Partly binding. Binding today: OpenLakeForge's own source, CI and release run on GitHub (table below). Decided, not built: a client project's CD as a GitHub… Source: https://openlakeforge.dev/docs/adr/0018-github-is-the-forge/ ## Status Partly binding. **Binding today:** OpenLakeForge's own source, CI and release run on GitHub (table below). **Decided, not built:** a client project's CD as a GitHub Actions workflow, and GitHub organisation teams as the source of human identity and role assignment through the Dex adapter of [ADR 0014](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/). ## Context The audience is a small data team without a platform engineer. Such a team already keeps its repository, its CI runners, its container images and the list of who works there in one place: its forge. Every system OpenLakeForge adds beside that one is a second place to onboard and offboard people, to rotate a credential, and to look when something breaks. v0.5-alpha first answered "who may use the platform" with a user directory of its own: Keycloak accounts, email invitations, SMTP, setup links, and `olf users` to manage them (#331). That works, but it duplicates the membership the team already maintains in GitHub, and offboarding someone becomes two actions, one of which is easy to forget. ## Decision GitHub is the one forge OpenLakeForge targets. A client project is a GitHub repository, and OpenLakeForge reuses what that repository already has rather than standing up a parallel system. | Concern | What OpenLakeForge uses | State | | --- | --- | --- | | Source | A GitHub repository holding `openlakeforge.yaml` and `lakehouse_code/` (ADR 0009, project root) | binding | | CI of this repository | `.github/workflows/checks.yml` on every pull request and `merge_group`; `main` behind the `main_protection` ruleset and a merge queue | binding | | Release of this repository | `.github/workflows/release.yml`: PyPI through GitHub OIDC Trusted Publishing, GitHub Releases with checksums, SBOMs and provenance (ADR 0009) | binding | | Project images | GHCR. `local-full-e2e.yml` pushes the nightly `project-code-nightly` image there; `docs/guides/promote-dev-to-prod.md` documents GHCR (or Docker Hub) for promotable revisions | binding for this repository; the client's registry stays an environment setting | | Client CD | A GitHub Actions workflow running `olf infra project image`, `olf infra project build` and `olf infra project deploy` (the steps `.github/actions/build-revision` already chains) on the CD boundary of ADR 0002 | decided, not built; `olf init` scaffolds no workflow yet | | People and roles | GitHub organisation membership and teams. Dex brokers GitHub login into the `identity.oidc` contract; each canonical role maps to one or more teams | decided, not built (ADR 0014, seam 2) | | User administration | GitHub: inviting, removing and changing someone's team is done in GitHub (web, `gh`, or the client's own GitHub Terraform). `olf users` is removed | decided; removal in progress | ### Why Dex rather than GitHub OAuth in every service GitHub's user login is OAuth 2.0 without OpenID Connect: it issues no ID token and no groups claim. (GitHub's OIDC tokens exist only for Actions workloads.) Superset, OpenMetadata, the Trino UI and the perimeter consume the provider-neutral `identity.oidc` contract of ADR 0014; wiring each of them to GitHub's API directly would put a provider-specific adapter in every consumer. Dex's GitHub connector turns a GitHub login into an OIDC token whose `groups` claim lists the user's teams as `:`, so the contract and the role mapping stay unchanged. Dex keeps no user directory: only refresh tokens and signing keys, in its own database on the platform PostgreSQL. ### Boundaries | Not decided here | Where | | --- | --- | | How canonical roles map to teams, revocation latency, break-glass | ADR 0014 and `docs/architecture/identity/identity-sessions-and-recovery.md` | | Workload credentials (Trino, Polaris, object storage) | ADR 0015, ADR 0016, `identity-callers.md`; GitHub is never a workload credential inside the cluster | | GitHub Actions OIDC as the credential CI uses to reach the platform | not decided; CI keeps Kubernetes RBAC through kubeconfig (`identity-callers.md`, class 2) | | Other forges (GitLab, Bitbucket, Azure DevOps) | out of scope. `spec.identity.issuer: external` still accepts any OIDC issuer, and Dex has connectors for GitLab, Google and Microsoft, so another forge is a connector, not a new identity system | ## Consequences - Inviting, offboarding and changing a role need no OpenLakeForge command and no apply: they are GitHub team changes, under the client's existing GitHub audit log and 2FA policy. - `olf users`, the `shared.identity.admin` contract, the Keycloak `olf-users` client and `spec.identity.bootstrap_admins` are removed (#383). The first administrator is whoever is in the team mapped to `platform-admin`. - Every platform user needs a GitHub account in the mapped organisation. On a paid GitHub plan each member is a seat, which matters for dashboard viewers; a separate free organisation used only for platform access is an option. - Signing out of OpenLakeForge does not sign the person out of GitHub; on a shared browser the next sign-in reuses that GitHub account (ADR 0014, "Logout"). - The cluster must reach `github.com` and `api.github.com` for logins and refreshes, an egress flow ADR 0017 does not have yet. A GitHub outage blocks new logins; existing sessions run to their bound. - Air-gapped installations are not served by the default adapter; they use `issuer: external`. - `olf infra e2e run` cannot sign in to real GitHub unattended (accounts, 2FA). The Dex adapter's e2e needs a stub upstream in kind, and a qualification against a real organisation is a separate, manual or scheduled check. ## History New record. Collects the GitHub dependencies the repository already had (ADR 0009 publishing, the CI workflows, GHCR) and decides GitHub as the source of people and roles, replacing the self-hosted user directory of #331. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0018-github-is-the-forge.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0018-github-is-the-forge.md). --- # ADR 0019: Data-plane authorization — Dex identity, Polaris grants > Extended, not built (#960): Polaris becomes the authority for every caller, workloads included, not only people (section 9). The rest of this status… Source: https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/ ## Status **Extended, not built (#960):** Polaris becomes the authority for **every** caller, workloads included, not only people (section 9). The rest of this status describes what is built today. **Built** for the local provider with `spec.identity.issuer: github` (#674, build steps 1 to 8): this is the design for #367. A person signs in with `olf login` and runs SQL as themself with `olf query` (section 6). Trino authenticates their Dex token and hands it to the stage's catalog, `lakehouse_`; Polaris activates their canonical role, decides from its grants which stage and layer they read or write (`data_access`, section 1), and vends storage credentials scoped to the tables they reach. `olf infra query` keeps the workload path. Verification items 1 to 9 passed before the build; item 10, the per-role cases, runs in `olf e2e`. Item 3 found that Polaris activates **all** of a principal's roles when a token maps to none; section 4, step 11 corrects for it. Superset, dbt and OpenMetadata keep their shared stage principals (ADR 0016); per-user access through Superset stays deferred. AWS is to follow with Polaris instead of Glue (#681); Azure gains the path with a Dex adapter. The design is **query-engine agnostic** (section 3): canonical roles exist only as Polaris grants, and Polaris also issues the storage credentials a person's query reads with. A query engine is an adapter that forwards the person's token and uses those credentials. Trino is the first; DuckDB, run in the cluster as a server, is the planned second. Every claim below carries a mark. **V** is verified against the cited source or documentation (read, not run). **T** is to test: derived or assumed, and not run. Pins: Trino 480 and the Apache Iceberg 1.10.1 client it builds against (`dep.iceberg.version` in Trino's `pom.xml` at tag 480), Polaris 1.4.0, Dex v2.46.0, SeaweedFS 4.48 (`release/component-catalog.yaml`). Polaris sources are read at tag `apache-polaris-1.4.0`, Iceberg at `apache-iceberg-1.10.1`, SeaweedFS at `4.48`. DuckDB is not pinned yet; its claims are from the DuckDB Iceberg catalog documentation. ## Context The canonical role decides which services a person reaches (ADR 0014). It does not decide what they read once inside. Stated plainly for operators: **today a user's role narrows what they can reach through Superset** (`analyst` and `viewer` hold `schema_access` on the Gold schemas only; `platform-admin` and `data-engineer` hold all-database access, `identity-service-permissions.md`), **but nothing below Superset enforces it.** Trino sees one shared principal per stage, so anything that bypasses Superset's checks reaches everything that principal reads. Do not load data of differing sensitivity into a deployment whose users should not all see it. That stays true for Superset after this design is built. `olf infra query` today (`olf/infra/commands/query.py`, `olf/infra/trino.py`) runs the Trino CLI inside the coordinator pod with `kubectl exec`, as `olf--runtime`, the stage principal that also writes. Who may query is who holds `pods/exec` on the coordinator; the person's role plays no part, and every caller is the same Trino user. The goal is a per-person query path: a person runs `olf infra query` from a workstation with no kubeconfig, signs in through Dex, and their canonical role decides what they read and write, per stage and per medallion layer. ### Why Polaris grants, not Trino rules The previous version of this record chose Trino file-based rules keyed by canonical role, because Trino is the one enforcement point Polaris and Glue share (ADR 0015). This design reverses that for the person path: | # | Finding | Mark | Reference | | --- | --- | --- | --- | | 1 | Trino 480 cannot read groups from a token: the `jwt` and `oauth2` authenticators' property lists have no groups field, and file-based rules match `group` only through a `file` or `ldap` group provider. A role in Trino would need a group file synced from GitHub membership | V | Trino 480 docs, JWT authentication, OAuth 2.0 authentication | | 2 | Polaris reads roles from a claim: `quarkus.oidc.roles.role-claim-path` selects it, and the principal-roles mapper keeps the values matching `filter` and rewrites each through an ordered list of `regex` / `replacement` mappings | V | `DefaultPrincipalRolesMapper`, `OidcTenantConfiguration.PrincipalRolesMapper` | | 3 | The roles active on a request are the token's mapped roles that the principal was also granted in Polaris; a role the token does not carry is not active. **Except when the token maps to no role at all:** the authenticated principal then has an empty role set, and the resolver activates every role the principal was granted. Section 4, step 11 keeps the set from ever being empty | V, run (verification item 3) | `DefaultAuthenticator.resolvePrincipalRoles`; `Resolver.resolveCallerPrincipalAndPrincipalRoles` (`getRoles().isEmpty() ? resolveAllPrincipalRoles(...)`) at `apache-polaris-1.4.0` | | 4 | Polaris catalogs are already per stage (`lakehouse_`, one per stage catalog in the bootstrap), so a grant on a catalog is a grant on a stage. The stage binding needs no rewritten Trino user name, which the previous version listed as an open prerequisite | V | `tools/olf/olf/infra/polaris_bootstrap.py` | | 5 | Iceberg data files are read with Trino's own S3 key and vended credentials are off, so Polaris does not gate file reads directly. It gates the table metadata: `LOAD_TABLE` needs `TABLE_READ_PROPERTIES`, `UPDATE_TABLE` needs `TABLE_WRITE_PROPERTIES`, a direct create `TABLE_CREATE`. Without the metadata Trino has no file to read and no commit to make. Section 3 replaces that key with Polaris-issued credentials on the person path | V (operations); T (no read path in the Iceberg connector skips `loadTable`) | `PolarisAuthorizableOperation`; `modules/query/trino/main.tf` | So the role check lives where the role claim can be read without a sync, and the stage boundary is the catalog boundary that already exists. The cost is the one ADR 0015 named: table policy written against Polaris does nothing on Glue. **Accepted:** AWS gets no per-person query path from this design. AWS's `olf infra query` already refuses the provider (`commands/query.py`), and Glue with Lake Formation stays a separate adapter if it is ever wanted. ## Decision ### 1. The access matrix | Role | DEV Silver | DEV Gold | PROD Silver | PROD Gold | | --- | --- | --- | --- | --- | | `platform-admin` | read, write | read, write | read, write | read, write | | `data-engineer` | read, write | read, write | read | read | | `analyst` | — | read | — | read | | `viewer` | — | — | — | read | Bronze is not a column: it is raw files with no catalog namespace, so Polaris cannot grant it. Bronze isolation is the stage's object-store identity. "Write" is DML and DDL on tables, views and namespaces, which is Polaris `CATALOG_MANAGE_CONTENT`. It is not grant management: no role administers Polaris access through SQL, and the matrix changes only by a deploy. `platform-admin`'s "full access" is this row; administering grants stays the bootstrap's (section 5). The matrix is monotonic, as ADR 0014 requires for every grant: each role reaches everything the role below it reaches, so a person in several mapped teams holds the union, which is the highest role's row. `viewer` was asked as "read-only PROD"; it is PROD Gold only, which keeps that rule (maintainer decision while drafting this record). `uat` takes the PROD column for every role, `viewer` included: `viewer` reads `uat` Gold (maintainer decision). ### 2. Where the matrix lives It is product-level and fixed, like the service grants, so it is a section of `release/identity-roles.yaml` keyed by canonical role: the "fifth mapping keyed by canonical role" ADR 0014 reserves. ```yaml data_access: # role -> stage -> layer -> read | write; absent is none platform-admin: dev: {silver: write, gold: write} uat: {silver: write, gold: write} prod: {silver: write, gold: write} data-engineer: dev: {silver: write, gold: write} uat: {silver: read, gold: read} prod: {silver: read, gold: read} analyst: dev: {gold: read} uat: {gold: read} prod: {gold: read} viewer: uat: {gold: read} prod: {gold: read} ``` `olf` validates it with the rules it applies to `grants`: roles inside `precedence`, stages inside the stage enum, layers `silver` and `gold` (a `bronze` key is rejected, #966), and monotonic in both senses (a higher role holds at least the access of a lower one on every stage and layer). The provider contract carries it in `shared.identity.roles` like the rest of the file, and the published schema gains the section. Polaris can express only three shapes per stage catalog, so validation also rejects a row that is not one of them: all layers `write`, all layers `read`, or `gold: read` alone (section 5). A fourth shape is a new catalog role, added when a role needs it. ### 3. Engine neutrality Polaris is the only authority for a person's data access, so that a query engine can be added or replaced without moving any policy. Two rules bind every engine adapter: 1. **No engine carries roles.** Canonical roles and the access matrix exist only as Polaris grants (sections 2 and 5). An engine's own configuration may tell people apart from workloads (Trino's rules in step 6 of section 4); it never names a canonical role, a team or a layer. 2. **No engine holds a storage key for a person's query.** Polaris decides the table metadata, and today the engine reads the files with its own key (finding 5). That is safe only while one server holds the key and its SQL cannot address arbitrary paths. It does not hold as a rule for every engine, so on the person path the engine asks Polaris for **vended credentials**: short-lived storage credentials limited to the table's location, issued only when the active roles hold the data privilege. | # | Finding | Mark | Reference | | --- | --- | --- | --- | | 1 | Loading a table with read delegation needs `TABLE_READ_DATA`, with write delegation `TABLE_WRITE_DATA`. `CATALOG_MANAGE_CONTENT` implies both, `TABLE_READ_DATA` implies only the read. The grants of section 5 therefore already decide which credentials are vended | V | `PolarisAuthorizableOperation` (`LOAD_TABLE_WITH_READ_DELEGATION`, `..._WRITE_DELEGATION`); `PolarisAuthorizerImpl` super-privileges | | 2 | Polaris vends S3 credentials through STS `AssumeRole` with a session policy scoped to the table, signing the call with its own static storage key. A catalog's S3 storage configuration names the STS endpoint (`stsEndpoint`), so a non-AWS STS works. Credentials last `STORAGE_CREDENTIAL_DURATION_SECONDS` (default one hour) and are cached for `STORAGE_CREDENTIAL_CACHE_DURATION_SECONDS` (default 30 minutes). The bootstrap creates every stage catalog with `stsUnavailable: true`, so nothing is vended today | V, run (verification item 2) | `AwsCredentialsStorageIntegration`, `FeatureConfiguration` at `apache-polaris-1.4.0`; `tools/olf/olf/infra/polaris_bootstrap.py` | | 3 | SeaweedFS 4.48 implements STS `AssumeRole` and accepts a session `Policy` of at most 2048 characters, with durations from 15 minutes to 12 hours. A request signed with the issued credentials is allowed only when the role's attached policies **and** the session policy both allow it; a request without a session token keeps the legacy authorization of its static identity | V, run (verification item 1) | `weed/s3api/s3api_sts.go`, `weed/iam/integration/iam_manager.go`, `weed/s3api/auth_credentials.go` (`VerifyActionPermission`, `authorizationRoute`) at tag `4.48` | | 4 | Trino 480 asks for vended credentials per REST catalog with `iceberg.rest-catalog.vended-credentials-enabled`, which sends `X-Iceberg-Access-Delegation: vended-credentials` | V (property and header); V, run (verification item 8) | `IcebergRestCatalogConfig`, `TrinoIcebergRestCatalogFactory` | | 5 | DuckDB attaches an Iceberg REST catalog with a bearer token (`CREATE SECRET (TYPE iceberg, TOKEN ...)`) and requests vended credentials with `ACCESS_DELEGATION_MODE 'vended_credentials'`; Polaris is the documented example | V (documentation); T (against this Polaris) | DuckDB Iceberg extension, "Iceberg REST catalogs" | Vended credentials are a property of the request, not of the catalog. Workloads reach the same Polaris catalogs without asking for delegation (Trino's `lakehouse_` catalogs keep `vended-credentials-enabled=false` and dbt writes through them, Floe keeps its storage key), so pipelines are unchanged and still do not depend on STS or Dex (T: a catalog with STS available still serves a request without delegation). | Engine | Person's token to Polaris | Data files | Status | | --- | --- | --- | --- | | Trino 480 | The stage catalog, `session=USER`, extra credential `token` (section 4, steps 7-9) | Vended, `vended-credentials-enabled=true`, no static key in the catalog | This design | | DuckDB, a server in the cluster | Attached per person with their token as the Iceberg secret | Vended, `ACCESS_DELEGATION_MODE 'vended_credentials'` | Planned. DuckDB has no catalog rules or roles of its own, so it needs no policy; its adapter must authenticate the person and keep each person's attached catalog and secret in a session no other person shares. Designed when DuckDB is added | ### 4. The request path ```mermaid sequenceDiagram actor P as Person participant O as olf query participant D as Dex participant X as Perimeter (query_api) participant T as Trino participant C as Polaris participant S as SeaweedFS P->>O: olf login, then olf query --stage prod "SELECT ..." O->>D: authorization code with PKCE, client olf-cli D-->>P: GitHub sign-in in the browser D-->>O: ID token (email, groups, federated_claims), refresh token O->>X: POST /v1/statement, Bearer token, extra credential token X->>T: forwarded after token and role-floor check T->>T: JWT authenticator: user = email; no rules, no authentication of its own (#983) T->>C: loadTable on lakehouse_prod, Bearer = the person's token C->>C: mixed auth: Dex JWKS, principal github, roles from groups C->>S: STS AssumeRole, session policy = this table's location C-->>T: table metadata and vended credentials, or 403 for a role without the grant T->>S: read the data files with the vended credentials T-->>O: rows, or the Polaris denial ``` | Step | Piece | Detail | Mark | | --- | --- | --- | --- | | 1 | Dex client | A new public static client `olf-cli` with the device authorization grant. Scopes `openid email groups federated:id offline_access`: `email` names the Trino user, `groups` carries the roles, `federated:id` the connector id (step 11), `offline_access` a refresh token. Registered as a static client with `public: true` and the one redirect URI `/device/callback` | V, run (verification item 4) | | 2 | Token cache | `/auth/oidc-.json`, mode 0600, beside the existing `olf/infra/auth/state.py` provider state. Refreshed when the access token has under 60 seconds left; Dex's session policy bounds it (ADR 0014: tokens 5 min, refresh idle 30 min, absolute 10 h) | — | | 3 | Transport | `olf` speaks Trino's HTTP protocol with `requests` (already a dependency): `POST https://trino./v1/statement`, then each `nextUri`. Every request carries `Authorization: Bearer` with a token refreshed if due; the submission also carries `X-Trino-Extra-Credential: token=` and `X-Trino-Catalog` set to the stage's catalog, `lakehouse_`. Issuer and Trino URLs come from the profile's `spec.access.base_domain`, so no kubeconfig is needed. The local CA is trusted the way `olf infra access trust` already prints | T (protocol use) | | 4 | Perimeter | A route `query_api`: host `trino.`, path prefix `/v1`, behind a perimeter instance that accepts a bearer JWT for audience `olf-cli` (oauth2-proxy `--skip-jwt-bearer-tokens` with `--oidc-extra-audience=olf-cli`) at the `viewer` floor. The existing `query` route (the Web UI) keeps the `data-engineer` floor. The service passwords (ADR 0016) then cannot be used through the ingress without also holding a member's Dex token | V, run (verification item 9) | | 5 | Trino authentication | None since #983 (ADR 0016): the coordinator serves plain HTTP and checks no token; the perimeter (step 4) checks the person's Dex token for audience `olf-cli`, and Polaris decides what it reads (step 8). The Bearer header Trino receives is ignored | V (#983) | | 6 | Trino rules | None since #983: with no rules, any user may use any catalog of its stage's coordinator and view every query, and Polaris decides each table access from the `token` extra credential | V (#983) | | 7 | Stage catalog | The one Trino catalog per stage, `lakehouse_` (`lakehouse_dev`, `lakehouse_uat`, `lakehouse_prod`), on the stage's Polaris warehouse: `iceberg.rest-catalog.session=USER`, `iceberg.rest-catalog.session-timeout=0s`, `iceberg.rest-catalog.vended-credentials-enabled=true` with no static S3 key (section 3), and the OAuth2 credential of `trino-catalog-`, which holds no grant. `olf query` makes it the session default, so the name shows only in fully qualified SQL (`lakehouse_prod.order_revenue_gold.mart_order_revenue_by_day`). It was a second name for the workload catalog until #1052; `session=USER` is all-or-nothing per catalog, which is why every caller shares the keyless shape (rejected alternatives) | V (properties) | | 8 | Token to Polaris | With `session=USER` Trino passes the user's extra credentials to the Iceberg client and adds an unsigned JWT of its own as `JWT_TOKEN_TYPE`. The Iceberg client uses a `token` credential as the bearer **before** trying any token exchange. So the person's Dex token reaches Polaris; a request without it falls through to exchanging Trino's unsigned JWT, which Polaris does not accept (ADR 0015), and fails closed | V (`TrinoRestCatalog.convert`; `OAuth2Manager.maybeCreateChildSession`); V, run (verification item 5) | | 9 | Session cache | The Iceberg session is cached per `-` with `expireAfterAccess(session-timeout)`, the default one hour. A person querying more often than that would keep presenting their first, expired token, so the catalog sets the timeout to zero and builds the session from the current token each time. Wrapping a bearer token makes no network call unless its `exp` has passed: the session is then refreshed with the catalog's own credential and the person is replaced by `trino-catalog-`, so the catalog sets `oauth2.token-refresh-enabled=false` (#1011) | V (`AuthSessionCache`, `IcebergRestCatalogConfig`: `@MinDuration("0ms")`); V, run (verification item 7) | | 10 | Polaris authentication | `mixed`: Polaris's own tokens first, then Quarkus OIDC. `quarkus.oidc.auth-server-url` `https://auth.`, `discovery-enabled=false` with `jwks-path=keys` (as Trino's UI does, because Dex is served by Traefik), the local CA through a named TLS configuration (`quarkus.oidc.tls.tls-configuration-name`, `quarkus.tls..trust-store.pem.certs`), `quarkus.oidc.token.audience=olf-cli`. Principal mapper `name-claim-path: federated_claims/connector_id`; roles from `groups` and `federated_claims/connector_id` (step 11) | V, run (verification item 3) | | 11 | Polaris principal | Every Dex token from the GitHub connector names the principal `github` (the Dex module's connector id). The bootstrap creates it and grants it the four role principal roles and `olf-signed-in`, a principal role with no catalog role. The token's `groups` decide which canonical roles are active (finding 3). Its connector id is also read as a role and mapped to `olf-signed-in`, so the active set is never empty: without that, a token whose groups map to nothing, including one requested without the `groups` scope, which the person chooses in their own sign-in, would activate all four roles, platform-admin included (verification item 3). Revocation is Dex's: a person removed from a team is refused at their next refresh, within 5 minutes, with no Polaris change. The mapper's regexes match each claim literally through character classes (`acme[.]org:team`), with no backslash: the chart writes them into `application.properties`, which drops a backslash, so `\Q...\E` arrived as `Q...E`, matched nothing, and every token activated every role | V, run (verification items 3 and 4; connector id `github` in `modules/identity/dex/main.tf`) | ### 5. Polaris objects Names carry the `olf-` prefix so they never collide with the workload principals and roles the bootstrap already creates. | Object | Scope | Content | Created by, phase | | --- | --- | --- | --- | | Principal `github` | realm | Granted the four principal roles below and `olf-signed-in` | `olf`'s Polaris bootstrap, platform | | Principal role `olf-signed-in` | realm | No catalog role. Active on every person's request, so the active role set is never empty (section 4, step 11) | bootstrap, platform | | Principal roles `olf-platform-admin`, `olf-data-engineer`, `olf-analyst`, `olf-viewer` | realm | Each assigned the catalog roles its `data_access` row needs, per stage catalog | bootstrap, platform | | Catalog role `olf-write` | each `lakehouse_` | `CATALOG_MANAGE_CONTENT` on the catalog | bootstrap, platform | | Catalog role `olf-read` | each `lakehouse_` | On the catalog: `TABLE_READ_DATA`, `NAMESPACE_READ_PROPERTIES`, `VIEW_READ_PROPERTIES` | bootstrap, platform | | Catalog role `olf-gold-read` | each `lakehouse_` | `NAMESPACE_LIST` on the catalog; on **each Gold namespace**: `TABLE_READ_DATA`, `NAMESPACE_READ_PROPERTIES`, `VIEW_READ_PROPERTIES` | catalog grant: bootstrap, platform; namespace grants: `olf infra catalog sync-namespaces`, artifacts | | Principal `trino-catalog-` | realm | No catalog role. The credential of the stage Trino's catalogs (the one `lakehouse_` catalog), used for the configuration call. Replaces `trino-people-`, which the bootstrap deletes | bootstrap, platform | | Principal-roles mapper | Polaris chart values | `quarkus.oidc.roles.role-claim-path` `groups,federated_claims/connector_id`; `filter` matching every claim value in `role_mapping` and the connector id; one mapping per claim value, `^$` to `PRINCIPAL_ROLE:olf-`, plus `^github$` to `PRINCIPAL_ROLE:olf-signed-in`, rendered by the local root from `role_mapping`, so keyed by canonical role | Terraform, platform | `TABLE_READ_DATA` implies `TABLE_READ_PROPERTIES` and `TABLE_LIST` in Polaris's privilege hierarchy (V, `PolarisAuthorizerImpl` super-privileges). It is chosen over `TABLE_READ_PROPERTIES` because read delegation needs it (section 3, finding 1): a read grant yields read-only credentials, and only `CATALOG_MANAGE_CONTENT` yields write credentials. Grants on a catalog apply to everything in it, including namespaces and tables created after the grant (verification item 6). Gold namespaces come from the descriptors, not from a list in shared code: `PhysicalProductNames.gold_namespace` in the domain model, resolved by the same inventory `sync-namespaces` already uses. Granting on a namespace the artifacts phase creates keeps rule 3 of `AGENTS.md`: the platform apply never waits for user code. A pruned namespace takes its grants with it: Polaris's `dropEntity` deletes every grant record on the dropped entity (V, `AtomicOperationMetaStoreManager` at tag `apache-polaris-1.4.0`; V, run), so `sync-namespaces --prune` revokes nothing itself. Polaris on PostgreSQL answers a repeated grant with HTTP 500, so the command reads the role's grants and writes only the missing ones. A stack without `spec.identity.issuer: github` has no `olf-gold-read`; the command finds its grants answer 404 and skips them. **Accepted cost:** the stage deployer principal gains `CATALOG_MANAGE_ACCESS` on its own stage catalog to make those grants. It already holds `CATALOG_MANAGE_METADATA`, which can drop any table there; the added power is granting within that one catalog, including to itself. The bootstrap grants it only when people sign in (`person_access`), the one case where the role exists; a stack without it keeps the deployer's earlier privilege. The alternative, a nested `gold` parent namespace with one grant, means re-laying every Gold namespace and is not worth it for this. `NAMESPACE_LIST` at catalog level lets `analyst` and `viewer` see the names of Bronze and Silver namespaces in `SHOW SCHEMAS`, not their tables. Without it a Gold-only role cannot list schemas at all. Accepted. A query on `information_schema.tables` across the whole catalog fails for these roles, because Trino lists the tables of every schema and Polaris refuses Bronze and Silver; filtered to a Gold schema it works (verification item 6). `olf-read` needs no `NAMESPACE_LIST`: its grants already let it list namespaces. ### 6. `olf query` ADR 0020 places a person's own queries on the platform surface: `olf query`, which reaches Trino's `query_api` route and nothing in the cluster. `olf infra query` keeps the workload path for operators; it is what this record first called `--as-workload`. | Behaviour | Detail | | --- | --- | | Sign-in | `olf login`, the platform session (ADR 0020): Authorization Code with PKCE in a browser, a mode-0600 session under `OLF_HOME`, refreshed when the ID token is due. For the Dex adapter it also asks for `federated:id`, which Dex does not advertise. A session from before `olf query` lacks `federated_claims`, and `olf query` asks for `olf login` again. A person in no mapped team is refused in the browser; the loopback wait ends after 5 minutes | | Request | `POST https://trino./v1/statement`, then each `nextUri`, with the ID token as `Authorization: Bearer` and as `X-Trino-Extra-Credential: token=`, `X-Trino-User` the token's e-mail and `X-Trino-Catalog` the stage's `lakehouse_` catalog. Output: `table`, `csv` or `json` | | `olf infra query` | `kubectl exec` as `olf--runtime`, unchanged. It is the break-glass path when Dex is down (ADR 0014 lists Trino through its internal Service) and the one `olf e2e` uses for pipelines. Who may use it is still who holds `pods/exec`, a platform-admin in practice | | No GitHub sign-in | With no `spec.identity`, or `issuer: external`, `olf query` refuses and names `olf infra query`: there is no principal mapping for an external issuer | | Denial | Trino's message is generic ("Failed to list namespaces"); the reason is in the cause chain. `olf query` names it: a Polaris 403 ("your role does not reach it", pointing to `data_access`), an S3 `Access Denied` on a write ("your role may only read"), a catalog other than the stage catalogs, a 401 (`olf login`), or a 403 at the perimeter (no role). Run against the pinned stack: each message comes from the real error | ### 7. Limits accepted | Limit | Why it is accepted | | --- | --- | | A write that commits after the token expires fails at the commit. Polaris receives the token captured when the query was submitted; `olf` refreshes before submitting, so a statement has about 5 minutes to reach its commit (T) | `olf query` is for inspection and small changes. Loads belong to pipelines, which keep their workload credentials. A longer Dex token lifetime would loosen the ADR 0014 session bound for every client | | Polaris records the principal `github` and the active roles, not the person | Trino's query log records the person (user = e-mail). Per-person principals would need GitHub membership synced into Polaris (rejected below) | | The extra credential is the bearer: a client that holds another person's token gets that person's grants | Possession of a bearer token is the authority, as on every OIDC path. Trino keeps extra credentials out of the session it serialises into query information (V, `SessionRepresentation`), so the token is not shown in the UI or `system.runtime.queries` | | Gold-only roles see Bronze and Silver namespace names | Section 5 | | Superset users keep the shared stage principal until #983 removes it | Section 9 point 4 points the imported database at the stage catalog; the shared credential is removed with the rest of the workload credentials | | Vended credentials outlive the 5-minute Dex token: Polaris issues them for one hour by default (verification item 2), and SeaweedFS will not issue less than 15 minutes. A person removed from a team keeps reading the tables already loaded until they expire. Build step 2 sets `STORAGE_CREDENTIAL_DURATION_SECONDS` to 900 and the cache to 300, so a cached credential has at least 10 minutes left; Polaris 1.4.0 then vends 15-minute credentials (V, run) | Revocation still ends new table loads within 5 minutes; the credentials cover only tables the person could read when they were issued | | A stage catalog created before build step 2 vends nothing. Polaris accepts a role ARN only when the catalog is created: an update that adds one is refused (`Cannot modify Role ARN`, V, run against Polaris 1.4.0) | The bootstrap leaves such a catalog as it is and says so; the person path needs the stack redeployed from scratch. No migration is built | | Nothing for AWS or Azure yet | AWS uses Glue today; it is to move to Polaris, which brings this path with it, because Glue saves little as a managed catalog (#681). Azure runs Polaris but has no Dex adapter yet (ADR 0014); it gains the path when it does | ### 8. What changes in other records when this is built Each lands with the change that makes it true (`AGENTS.md`, "One change per pull request"). | Record | Change | | --- | --- | | ADR 0014 | `data_access` beside `grants`; the `query_api` service row (all four roles); `olf-cli` as a fifth Dex client | | ADR 0015 | The deferral ends for one caller: `mixed` with OIDC for people tokens. Every workload keeps Polaris's own credentials, so pipelines still do not depend on the issuer. Stage catalogs are created with STS available, and its "Data files" row changes for the person path | | ADR 0016 | `/v1` accepts Dex bearer tokens for audience `olf-cli`, which its Web UI section rejected while no caller needed it; the people catalogs and their rules | | `identity-callers.md`, `identity-classes.md` | `olf query` is a class-1 (human) caller from the workstation through the ingress; the workload path stays class 2 | | `docs/reference/roles-and-permissions.md` | The data-access matrix | ### 9. Every caller through Polaris (#960) **Decided, not built.** Sections 1 to 8 move people to Polaris. Workloads still go through a Trino that holds every stage's Polaris credential and a static S3 key (`modules/query/trino`), so Trino has to tell its callers apart itself (ADR 0016). That makes Trino a second policy point and is the only reason the platform needs workload authentication on Trino, and with it HTTPS and an internal CA: Trino authenticates only a request it considers secure, and on plain HTTP it accepted any `X-Trino-User` without checking a password (#932, reverted in #938). Section 3's rule 2, "no engine holds a storage key", is extended from the person path to every path. | Caller | Identity presented to Polaris | Polaris grants | | --- | --- | --- | | Person, `olf query` | their Dex token (built) | section 1 matrix | | Superset user, per stage | their Dex token, through Superset's per-database OAuth2 | section 1 matrix | | dbt, through the stage's Trino | `olf--processing` | `CATALOG_MANAGE_CONTENT` on its own stage catalog only | | Floe, direct to Polaris | `olf--processing` | the same | | OpenMetadata crawler | `openmetadata` | read on every stage catalog | | Superset cache warm-up, alerts, thumbnails | none: they stay disabled | none | 1. **One Trino per stage** (#965, built for the local root in #976; AWS and Azure keep one shared coordinator until their cloud milestone). Each stage's coordinator holds only its own stage's catalogs and is reachable only from its stage namespace, the OpenMetadata crawl Job and Traefik (ADR 0017). Stage isolation no longer depends on Trino rules. 2. **Processing principals** (#966, built in #978). One writer per stage, `olf--processing`, replaces the per-stage `trino` and `floe` principals; the bootstrap deletes those, their Secrets and their roles. It never manages grants and has no grant on another stage, so DEV's pipeline cannot write PROD. It is not an administrator. Its one Secret (`polaris--processing-creds`) lives in the stage namespace, where the stage's Trino and its Floe Jobs both read it. The deployer is not a data writer: it keeps `CATALOG_MANAGE_METADATA` and, with people's access, `CATALOG_MANAGE_ACCESS` to grant `olf-gold-read`. `--allow-stage-removal` deletes a removed stage's processing, deployer and people principals. 3. **Keyless engine** (#967). Every Trino catalog takes the shape of section 4 step 7: `session=USER`, vended credentials, no static S3 key, and a catalog credential with no grant. Every caller sends its own token as the `token` extra credential. Trino then carries no roles, no rules and no credential worth stealing, and needs no authentication of its own. A query engine added later (DuckDB, #888) follows the same adapter rules with nothing to configure in policy. Built so far (#980): dbt and Gold maintenance mint the processing principal's token (`openlakeforge_runtime/polaris_token.py`, once per dbt invocation, one invocation per Gold generation) and send it as the `token` extra credential; Gold models are `view_security: invoker`, enforced by `olf check dbt`. Built so far (#981): `olf infra query` and every `olf e2e` Trino call run the CLI in the coordinator, which mints the stage processing principal's token and passes it as the `token` extra credential with curl (`cli_script` in `olf/infra/trino.py`); a failed mint fails the query. The token is on no `kubectl` argument and in no log. `olf query` and the platform API already send the person's token on every call, discovery included. Built (#982) on the local root: the stage's workload catalog `lakehouse_` takes the keyless shape, and both names used the grantless `trino-catalog-` credential, so the coordinator holds no S3 key and no credential with a grant. `olf infra query` and `olf e2e` read the processing principal's credential from its Secret and send it to the in-pod mint on stdin. The pods carry no AWS or storage key in their environment and no service-account annotation (a module precondition and `modules/query/trino/tests/keyless.tftest.hcl`), and the stage's default-deny NetworkPolicy gives them no route to an instance metadata endpoint. The e2e isolation probes run the #964 cases: no token and another stage's token are refused, a location override and `register_table` into another stage's bucket fail. Until #1052 the stage also served it as ``, a second name kept while Trino's rules separated e-mail and service users (#983). An AWS stage on Glue keeps its keyed catalog until AWS moves to Polaris (#681); Azure's shared coordinator takes the keyless shape too, unverified at runtime. Built (#983) on the local root: Trino has no authentication, no rules and no HTTPS listener (ADR 0016); the Web UI signs in as a fixed user behind the perimeter. AWS's shared coordinator keeps claim-based rules for Glue. 4. **Superset per user** (#968, import and sign-in token built in #987; the shared credential is removed in #983). The imported database points at the stage catalog, `lakehouse_`, on the stage's Trino with no user and no password, `impersonate_user`, `per_user_caching` and no background queries. The sign-in token response seeds one `database_user_oauth2_tokens` row for that database (one only: Dex rotates refresh tokens), so a viewer needs no second consent, and the access token is dropped from FAB's signed session cookie. The viewer's dashboard returns what the viewer's role reaches in Polaris. Results are cached per user. The local `admin` and the platform API's service user hold no Dex token and cannot query the database: they administer, import and export only, and the import never queries Trino. Polaris denials reach a chart as Trino's generic error; Superset has no hook for a custom message, so this is a limit. AWS and Azure keep a shared coordinator with no keyless catalog, so their reports get no per-user connection until their cloud milestone. 5. **OpenMetadata governs its own users** (#969, built). OpenMetadata never queries data for the person signed in to it: it shows what its crawler collected, and its own roles, mapped from Dex groups, decide what a person sees there (ADR 0014). Its crawler presents the `openmetadata` token and may read every stage catalog (maintainer decision). A metadata-only grant was tested and rejected: on a catalog that asks for vended credentials, Polaris 1.8.0 refuses `LOAD_TABLE` to a principal without `TABLE_READ_DATA`, even for its columns (#963), so the crawler would see no table. The crawl Job mints the token from the `openmetadata` principal's Secret (copied into the stage namespace) when it starts and passes it as the `token` extra credential; the workflow enables no profiler, sampler, data-quality or usage feature that would read rows. 6. **Bronze leaves the matrix** (#966). Bronze is raw files with no catalog namespace (#950), so no Polaris grant can reach it; the `bronze` column of `data_access` is removed and Bronze isolation stays the stage's own object store identity. Four spikes were run on the pinned Trino 480, Polaris 1.8.0 and SeaweedFS 4.48 (STS on), dbt-trino 1.10.2 and the Superset 6.1.0 image: | Spike | Result | What the build must do | | --- | --- | --- | | S4, keyless unauthenticated Trino (#964) | Fails closed, run. No token: every statement fails (Trino exchanges its unsigned JWT and Polaris answers 400). A token without the grant: 403. `X-Trino-User` labels the session and never changes the decision. A location override, `register_table` (Trino refuses to start it beside vended credentials) and `add_files` cannot reach storage outside the vended table scope. An expired token falls back to the catalog's own credential, which holds no grant, so 403 | Keep the catalog credential grantless; it is what makes the fallback inert | | S1, dbt with a workload token (#961) | Works unpatched, run: profile `http_headers` carries `X-Trino-Extra-Credential: token=`. `table` and `incremental` merge write their own stage; the same token on another stage gets 403 | Mint one token per dbt invocation (it is frozen for the run, 1 hour by default, `polaris.authentication.token-broker.max-token-generation`); the runtime runs one invocation per Gold generation (#1061), so one generation must build within that hour. Set `view_security: invoker` on Gold models: a definer view is re-read without the caller's token and breaks the merge | | S2, Superset per user (#962) | Works with a `DB_CONNECTION_MUTATOR` module, run against the image with a fake Trino and Dex. The same module fixes a stock 6.1.0 bug: a refresh token Dex refuses leaves the user stuck instead of signing in again | Dex `trustedPeers` adds `superset` to `olf-cli`; no audience change in Polaris or Trino. Per-user result cache on. Alerts, reports and thumbnails stay disabled: their executors are local accounts with no Dex token | | S3, OpenMetadata crawl (#963) | The crawl needs no rows, and its token passes as `connectionArguments.extra_credential`, run. A metadata-only principal sees no table on a vended catalog (point 5) | Superseded by point 5: the crawler reads with its own token | There is no fallback: Trino keeps no credential and no authentication. Stage isolation rests on the Polaris grant of the token each caller presents, and on the NetworkPolicy of point 1. A keyless Trino catalog with no static key falls back to the AWS SDK's default credential chain (environment, IRSA, instance profile) for anything outside vended credentials (#963). The build closes that chain on the Trino pods; a coordinator with ambient cloud credentials would otherwise read storage with them. | Accepted cost | Why | | --- | --- | | Vended credentials make STS a requirement of the object-store adapter | Proven on SeaweedFS (section 3, finding 3). The provider contract names the store's `sts_endpoint` and the parser refuses a Polaris stage without one (#984). An on-premises S3-compatible store without STS (#803) cannot run the keyless engine; AWS waits for Polaris instead of Glue (#681) | | Without Trino authentication, the user in Trino's query log is a claim | Access is decided by the token alone (#964 ran it). Polaris still records the principal `github`, not the person, so per-person audit is weaker than with Trino authentication | | One coordinator per stage | About 2 Gi of memory requested per extra stage at `small`. A single-stage Slim deployment is unchanged | ## Build sequence Split along the seams `AGENTS.md` names, each with its tests: 1. Role model: `data_access` in `release/identity-roles.yaml`, the schema, `olf` validation (monotonic, three shapes). Contract only; nothing reads it. 2. Storage: an STS role in SeaweedFS for Polaris, and stage catalogs created with STS available (`stsUnavailable: false`, `roleArn`, `stsEndpoint`, `endpoint`, `pathStyleAccess`), with the credential duration of section 7. Verification items 1-2 passed. **Landed:** the role trusts the platform identity Polaris signs with and allows the stage medallion buckets; the STS signing key is minted in the cluster with the S3 keys. Catalogs that already exist keep `stsUnavailable: true` (section 7). 3. Polaris: `mixed` authentication, the rendered mapper, and the bootstrap objects of section 5 except the namespace grants, with `olf-signed-in`. Items 3 and 4 passed; settle items 5-6 first. **Landed:** the bootstrap also revokes a catalog role a narrowed `data_access` row no longer names. `trino-people-` moves to step 5, where its catalog uses it. 4. `olf infra catalog sync-namespaces` grants `olf-gold-read` on Gold namespaces; the deployer's `CATALOG_MANAGE_ACCESS`. **Landed:** the grants are made after the namespaces are reconciled, on every run, so a stack that enables people's access later gets them on its next artifacts phase. The deployer privilege is added by the bootstrap and is not removed if people's access is switched off again. 5. Trino: `PASSWORD,JWT`, the people catalogs with vended credentials, the rules of section 4, step 6. **Landed**, with `trino-people-` and its Secret from the Polaris bootstrap. Found while building: the coordinator held the platform S3 key as `AWS_*` variables, which the S3 client's default chain would have handed a people catalog without vended credentials; the key moved to `OPENLAKEFORGE_S3_*` (ADR 0016). 6. Dex `olf-cli` client and the `query_api` route and perimeter instance. **Landed:** the `olf-cli` client and the perimeter's acceptance of its bearer tokens already existed (`olf platform`); the step adds the `query_api` grant row and an ingress-only route `trino./v1` at the `viewer` floor. It is not a contract route: a contract route is one host per service, so the perimeter takes it as a path ref, outside `protected_routes`. 7. `olf infra query` person path, `--as-workload`, the token cache, and `olf e2e` cases: per role through the stub GitHub users the e2e already runs, an `analyst` denied DEV Silver, a `viewer` denied DEV Gold, a `data-engineer` writing DEV and denied writing PROD, a `platform-admin` writing PROD; with Dex scaled to zero, the person path fails closed and `--as-workload` still answers; a vended read credential cannot write, nor read another table's location. **Landed:** the person path is `olf query` (section 6). The e2e runs the cases in its perimeter check: each role, through the query route as `olf query` calls it, against its `data_access` row on every stage, telling Polaris's refusal from storage refusing a read-only vended credential. The Dex-down case is part of the issuer-outage drill. Reading another table's location cannot be expressed in SQL and stays verification item 1. 8. Docs of section 8 not already landed. **Landed:** with this, the record is built. ## Verification before building The **T** items that could change the design. Items 1-9 were run locally against the pinned images (Dex v2.46.0, Polaris 1.4.0, Trino 480, SeaweedFS 4.23 then 4.48), single processes outside a cluster; the scripts are not kept. | # | Item | Result | Decision | | --- | --- | --- | --- | | 1 | SeaweedFS limits S3 requests signed with `AssumeRole` credentials to the session policy (section 3, finding 3) | Passed. A credential carrying Polaris's per-table policy reads only its table, not a sibling whose path starts with the table's, and cannot write; without the policy the role reaches every table. Static identities keep their legacy authorization | Step 2 gives SeaweedFS its advanced IAM file (STS signing key as an in-cluster Secret, the role, its trust policy) and Polaris's identity `sts:AssumeRole`; how narrow that grant can be is open (T) | | 2 | Polaris vends credentials through SeaweedFS STS for a catalog with STS available, and still serves a request without delegation | Passed. Delegated loads return a SeaweedFS STS credential scoped to the table, read-only for `TABLE_READ_DATA`, writable for `TABLE_WRITE_DATA`, refused without `TABLE_READ_DATA`; loads without delegation are unchanged. Default lifetime one hour | Step 2 sets `STORAGE_CREDENTIAL_DURATION_SECONDS` to 900 (section 7) | | 3 | Polaris trusts the local CA for the Dex JWKS, discovery off (ADR 0015 to-verify) | Passed, through a named Quarkus TLS configuration; without the CA Polaris refuses the token (500). Wrong audience and tampered tokens get 401; Polaris's own tokens keep working with Dex down. **Found:** a token that maps to no role activates every role of the principal | `olf-signed-in` (finding 3; section 4, steps 10 and 11; section 5) | | 4 | Dex access tokens carry `email`, `groups` and `federated_claims` for step 1's scopes, `aud` equal to `olf-cli` | Passed with the GitHub connector as the module renders it, against the e2e's stub GitHub, device flow as a public client. `groups` holds mapped teams only; a refresh re-reads teams and a removed member is refused. A person in no mapped team is refused, but their device code stays pending | `olf infra query` bounds its device-flow polling (section 6). Removal takes effect from the first refresh after Dex's 3-second reuse interval | | 5 | Polaris refuses the token exchange of Trino's unsigned JWT, so a query without the person's token fails closed (step 8) | Passed. Polaris answers the exchange with 400 and the query fails; `trino-people-`, given a grant to expose a fallback, is used only for the catalog's configuration call. With a Dex token the query runs with that person's role. Trino's message is generic; the reason is in the error's cause chain | `olf infra query` reads the cause chain (section 6) | | 6 | Catalog-level grants apply to every namespace and table, and a Gold-only role can run `SHOW SCHEMAS` with `NAMESPACE_LIST` (section 5) | Passed. `olf-read` and `olf-write` reach Bronze, Silver, Gold and nested namespaces and tables created after the grant; `olf-read` cannot create. `olf-gold-read` lists every schema, nested ones included, and reads only Gold: Bronze and Silver tables, table lists and properties get 403. `olf-signed-in` cannot list. `information_schema.tables` over the whole catalog fails for a Gold-only role; filtered to a Gold schema it works. `olf-read` lists namespaces without `NAMESPACE_LIST` | Section 5 as designed; the `information_schema` limit is accepted (section 5) | | 7 | `session-timeout=0s` builds a fresh session per request with a refreshed token (step 9) | Passed. With the timeout at zero each query reaches Polaris with the token it was sent with: another token under the same Trino user and source gets that token's role, and a fresh token works after the first expired. A control catalog with Trino's default timeout kept presenting the first token: the second token was ignored, and once the first expired every query failed | Step 7 as designed; the zero timeout is required | | 8 | Trino 480's people catalog reads and commits with vended credentials and no static S3 key (section 3, finding 4) | Passed, with no S3 key in the catalog or Trino's environment. A data engineer creates, inserts, deletes and creates-as-select; an analyst reads Gold. The analyst's insert is refused by SeaweedFS with `Access Denied` on the read-only vended credential, before any commit; Bronze is refused by Polaris (403) | `olf infra query` names a role that may only read when the cause is an S3 `Access Denied` on a write (section 6) | | 9 | oauth2-proxy applies `--allowed-group` to a bearer session (step 4) | Passed on oauth2-proxy v7.15.5 with the perimeter module's arguments, as Traefik's forward-auth calls it for `/v1/statement`: a token whose groups hold a role at or above the floor gets 202; an unmapped group or a token without the `groups` scope gets 403; another client's audience, a tampered or expired token, or none gets 401. `--oidc-extra-audience=olf-cli` and `--extra-jwt-issuers==olf-cli` behave the same. A token for the perimeter's own client is also admitted | Step 4 uses `--oidc-extra-audience=olf-cli`. The perimeter's own audience passing is accepted: Trino's `required-audience=olf-cli` (step 5) refuses it. The perimeter's login now also requests the `olf-cli` audience (ADR 0014), so its session token passes both checks | Still to run: 10. A device-flow sign-in can be driven against the e2e's stub GitHub: shown locally by item 4; wiring it into `olf e2e` remains. Not covered by the local runs: the Helm deployments, `auth.` through the cluster's DNS rewrite, Polaris on PostgreSQL, and real github.com. With vended credentials, the earlier question of whether some Trino read path skips `loadTable` no longer decides access: without a table's credentials no file of it can be read. ## Superset 6.1.0: per-user propagation (carried forward) Not part of this decision; kept as the record for the Superset follow-up. | # | Claim | Mark | Reference | | --- | --- | --- | --- | | 1 | A database has an `impersonate_user` flag; the imported Trino connections set it `false` | V | `superset/models/core.py`; `lakehouse_code/dashboards/superset/*/databases/openlakeforge_trino.yaml` | | 2 | When set, the Trino engine spec puts the effective username in the driver's `user` connect argument | V | `superset/db_engine_specs/trino.py`, `impersonate_user` | | 3 | The effective user is the logged-in user's name from the request context, not client input; with no request context it falls back to the connection URL's user, the shared principal | V | `core.py`, `Database.get_effective_user` | | 4 | `IMPERSONATE_WITH_EMAIL_PREFIX` swaps the name for the part of the e-mail before `@` | V | `core.py`, `_get_sqla_engine` | | 5 | The `trino` driver sends its `user` argument as `X-Trino-User` | T | driver not read | | 6 | The Trino engine spec sets `supports_oauth2`. With a per-database OAuth2 configuration, the user's token for that database is sent as `Authorization: Bearer` alongside the user name | V | `trino.py`, `impersonate_user`; `core.py`, `get_oauth2_access_token` | | 7 | That token comes from a flow configured on the database (`oauth2_client_info`), not from the SSO session | T | `core.py` read; no deployment | | 8 | Result caching keys on the user only when the database impersonates **and** `CACHE_IMPERSONATION` is on, or `CACHE_QUERY_BY_USER` is on, or the database sets `per_user_caching`. `CACHE_IMPERSONATION` defaults to `False` | V | `superset/common/query_object.py`; `superset/config.py` | Turning on per-user access in Superset without per-user caching serves one user's cached result to another (claim 8). Cache warm-up, alerts and reports run as an executor identity (`CACHE_WARMUP_EXECUTORS`, `ALERT_REPORTS_EXECUTORS`) whose Trino identity is not established. Both must be settled by that follow-up. ## Rejected alternatives | Option | Why not | | --- | --- | | Trino file-based rules keyed by canonical role (this record's previous decision) | Trino 480 reads no groups from a token (finding 1), so roles would reach it only through a group file synced from GitHub, and a stage-scoped user name would be needed to keep DEV and PROD apart. Policy in one engine would also have to be rewritten for every other engine (section 3); DuckDB has no rules to write it in. Its one advantage, working on Glue too, is out of scope | | The engine reads the person's tables with its own storage key | Polaris would then decide only metadata, and the guarantee would depend on each engine never exposing a path to its key. Acceptable for one locked-down server, not as the rule every engine must meet (section 3) | | `session=USER` on the existing `lakehouse_` catalogs | Every workload caller would lose its catalog access: with no `token` credential the Iceberg client exchanges Trino's unsigned JWT, which Polaris does not accept (step 8) | | One Polaris principal per person | Needs a job copying GitHub team membership into Polaris principals, with revocation as late as that job runs. The token's `groups` already carry the role, and Polaris intersects them with the grants, provided the role set is never empty (finding 3, `olf-signed-in`) | | One Polaris principal per role, chosen by Trino | A Trino catalog has one catalog credential and cannot pick one per user | | Polaris `external` authentication | Disables Polaris's own token endpoint, which `olf`'s Polaris bootstrap and every workload use (ADR 0015) | | A workload principal impersonating the person (`X-Trino-User`) | The workstation would hold a service password, and Trino would trust the client's claim of who the person is | | Keep `kubectl exec`, mapping Kubernetes RBAC to roles | Kubernetes RBAC is not the role model and needs a kubeconfig per person (ADR 0014's boundary between roles and infrastructure access) | ## Consequences - No code, Terraform or contract changes in this record; the build sequence above makes them. - Once built, a person's role is enforced below Superset for `olf infra query`, on the local provider with the GitHub issuer, and nowhere else. - Adding a query engine adds an adapter (token forwarding and vended credentials), never a policy. - Human queries depend on Dex; pipelines, dashboards and the `--as-workload` path do not. - The ADR 0016 `principals` rules stay, with one rule added for e-mail principals, until section 9 removes them with Trino authentication (#967). ## History New record (#179): the deferral, the Trino 480 and Superset 6.1.0 assessments, the foreclosure review and the prerequisites. Rewritten as the design for #367. The decision to enforce per-user policy in Trino with rules keyed by canonical role is replaced by Polaris grants reached through Dex tokens, because Trino 480 reads no groups from a token and Polaris does; AWS and Glue are left out by decision. Absorbed: the Trino 480 impersonation analysis (now a rejected alternative), the foreclosure review (its accepted costs are in "Limits accepted"), and the nine prerequisites (now the build sequence and the verification list). The Superset assessment is carried forward unchanged. Engine neutrality (section 3): the design must hold for DuckDB, planned as a second engine run in the cluster as a server, which has no catalog rules or roles. Added the rule that no engine carries roles, and vended credentials on the person path so Polaris also decides file access; this adds SeaweedFS STS and two verification items. Settled the open questions: `uat` takes the PROD column for every role, `viewer` included, and the Trino people catalogs are named `` (one `lakehouse_` since #1052). Build step 1: `data_access` in `release/identity-roles.yaml`, rendered into `shared.identity.roles` by every root and validated by `olf` (vocabulary, monotonic on every stage and layer, the three catalog-role shapes); the provider-contract schema gains the section. SeaweedFS pin moved from 4.23 to 4.48 for the S3 gateway's read-buffer retention fix. Finding 3 was re-read at tag `4.48`: `AssumeRole` still takes a `Policy` through `sts.NormalizeSessionPolicy` and still allows 15 minutes to 12 hours unless an STS `MaxSessionLength` is configured, which this stack does not. Verification items 1-9 were run locally against the pinned images; their results and decisions are in "Verification before building". They verified findings 2, 3 and 4 of section 3, steps 1, 4, 8, 9, 10 and 11 of section 4 and the grants of section 5; found that Polaris vends for an hour by default (section 7) and that a token mapping to no role activates every role of the shared principal (fixed with `olf-signed-in`); added `olf query`'s bounded device-flow polling and its reading of the error cause chain, Polaris's and SeaweedFS's refusals (section 6); and accepted that a Gold-only role cannot query `information_schema.tables` across the whole catalog (section 5). Build step 2: SeaweedFS's credentials Job writes an advanced IAM file with the `polaris-vending` role and a signing key it keeps across runs; the storage contract carries the role ARN and STS endpoint; Polaris creates new stage catalogs with STS available and vends 15-minute credentials. Polaris refuses to add a role ARN to an existing catalog, so existing stacks keep vending nothing until redeployed (section 7). The STS `MaxSessionLength` is now set, to one hour. Build step 3: Polaris runs `mixed` when the local root passes `person_access` (`issuer: github`): Quarkus OIDC on Dex's keys, the roles mapper rendered from `role_mapping`, and the CA from `olf-local-ca`. The bootstrap creates principal `github`, the five principal roles and the three catalog roles, and reconciles each role's catalog role to its `data_access` row. Polaris reaches Traefik for Dex's keys (ADR 0017, F4). Checked against the pinned Polaris 1.4.0 and Dex: it starts while Dex is unreachable, and a token whose groups map to no role reaches nothing. Build step 4: `olf infra catalog sync-namespaces` grants `olf-gold-read` `TABLE_READ_DATA`, `NAMESPACE_READ_PROPERTIES` and `VIEW_READ_PROPERTIES` on each Gold namespace of the stage, from the descriptors; the deployer principal gains `CATALOG_MANAGE_ACCESS` on its stage catalog when people sign in. Polaris drops a namespace's grants with the namespace, so pruning needs no revoke. Run against Polaris 1.4.0 with `olf`'s client as the deployer: the grants land, a rerun plans nothing, a recreated namespace has no grants left, and a stack without people's access answers 404 for the role, so it is skipped. Build step 7, `olf query`: ADR 0020 puts a person's queries on the platform surface, so section 6 is `olf query`, signing in with `olf login` (PKCE, the platform session) rather than a device flow of its own, and `olf infra query` is the workload path the section called `--as-workload`. `olf login` asks Dex for `federated:id`. The client was run against the pinned stack of step 5: a data engineer writes, an analyst reads through Trino's paging, and the refusals (S3 on a write, Polaris on Bronze, a workload catalog) each produce their message. Build step 5: Trino authenticates `PASSWORD,JWT` when the local root passes `people_access` (`issuer: github`, `password` level), adds a people catalog per stage on its `trino-people-` credential, and the rules of section 4, step 6. Run against the pinned Trino 480 with the rendered `rules.json`, Polaris 1.4.0, Dex and SeaweedFS STS: a data engineer creates and writes through the people catalog, an analyst reads Gold and is refused a write by S3, a query without the person's token fails closed, a token cannot act as another user or use a workload catalog, another client's token gets 401, and a person sees only their own queries. Build step 6: the `query_api` grant row (every role) and, with `issuer: github` and Trino at `password`, an ingress route for `trino./v1` behind the `viewer` floor; the Web UI keeps the `data-engineer` floor. Its bearer path is the one verification item 9 ran. Build step 7, the `olf e2e` cases: each role's token reads one table per layer on the run's stage, lists every stage, and writes a probe table on every stage, created by a role that writes there. The decision logic was run against the pinned stack of step 5 with a writing, a reading, a Gold-only and a no-role person: every outcome matched, and a read role's write was refused by SeaweedFS rather than by Polaris. Build step 8: the records of section 8 now describe the built path. ADR 0014 records Polaris, not cloud IAM, as where canonical roles reach data; ADR 0015's "Data files" row splits into the workload and the person path; the caller inventories make `olf query` a class 1 caller; the role reference gains the data-access matrix, and the tutorial shows querying as yourself. Status set to built. Decided with it: AWS moves to Polaris instead of Glue (#681). Run on kind (the first full local e2e with people's access): the Polaris bootstrap's Role did not name the `trino-people-` Secrets, and Trino fetched the JWT keys through Traefik, which is created after it. Both stopped a fresh deployment; the Role now names the Secrets, and Trino fetches the keys from Dex's Service (section 4, step 5; ADR 0017, F31). Run on kind: the person-access e2e found a data engineer writing PROD. The role mapper's regexes were `^\Q\E$`; the Polaris chart writes them into `application.properties`, whose loader treats a backslash as an escape, so they matched nothing, every token mapped to no role, and Polaris activated every role of the principal (finding 3): every signed-in person reached platform-admin's grants. Verification item 3 had passed because its harness set the properties as system properties, which are not unescaped. The regexes now match through character classes, with no backslash, and a claim holding `[`, `]`, `\` or `^` is refused at plan time. Run against the pinned Polaris loading the chart's file, an analyst, a data engineer on PROD and a person in no mapped team are each refused again (section 4, step 11). Browser identity (#799): the audience `olf-cli` is no longer minted only for the CLI. Dex `trustedPeers` lets the perimeter's login request it, so the platform API can send a browser session's token to Trino and Polaris unchanged. Steps 4, 5 and 10 are unchanged: no accepted audience was added. Polaris bootstrap in `olf` (#562): the principals, roles and grants in section 5 are created by `olf` after the platform apply, not by the deleted Terraform Job; `olf` restarts Trino whenever a people catalog credential differs from the one its pods started with. Section 9 (#960): Polaris decides for every caller, workloads included; one Trino per stage, per-stage processing principals, a keyless engine, Superset per user, OpenMetadata governing its own users, and Bronze out of `data_access`. Spikes #961 to #964 ran on the pinned stack; the fallback is dropped and the metadata-only crawler replaced by a reading one. Built so far (#979): the `openmetadata` catalog role is read-only, with a converged stack losing `CATALOG_MANAGE_CONTENT`, and `bronze` is out of `data_access`, its validator and published schema. Per-stage processing principals (#978): one `olf--processing` replaces the Trino and Floe principals, and a stage removal revokes its principals. The rest is not built. People catalog (#1011): the Iceberg client copies the catalog's OAuth2 credential into every session it builds from a person's token and reads that token's `exp`; an expired token was exchanged for the catalog's own, which holds no grant. Step 9 records the property that stops it. Gold token lifetime (#1061): a dbt process reads the processing token once, when its profile renders, and Trino gives that token to Polaris at every commit, so a `dbt build` longer than the token's lifetime (one hour by default) failed at its first later commit. The runtime now builds the Gold models one topological generation at a time (a generation holds the models whose upstream models are all in earlier generations), each in its own dbt invocation with a freshly minted token. Generations rather than one invocation per model: a model-by-model build serialises every model, losing the stage's dbt `threads` parallelism, and pays dbt's start-up and manifest parse once per model, which is a large cost on a product of about a hundred tables. A generation keeps both, and the depth of the `ref()` graph, not the model count, sets the number of processes. The limit that remains is one generation's build, start-up included, within the token lifetime. Stage catalog (#1052): each coordinator serves one catalog per stage, `lakehouse_`. The second name ``, the former people catalog, ended with the rules that kept e-mail and service users apart (#983): the two shared every property and the grantless `trino-catalog-` credential. Section 4 steps 7 and 9 and section 9 point 4 name the one catalog. Superset's database URI, the platform API's `query_endpoints[*].catalog` and `olf query` follow. A redeploy's artifacts phase re-imports the reports, which moves their datasets to the new catalog. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0019-data-plane-authorization-deferral.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0019-data-plane-authorization-deferral.md). --- # ADR 0020: Infrastructure, common and platform CLI surfaces > Partly binding. Binding today: the olf infra group, the common top-level commands, and the hidden aliases that keep every earlier path working (#536, PR… Source: https://openlakeforge.dev/docs/adr/0020-infrastructure-common-and-platform-cli-surfaces/ ## Status Partly binding. **Binding today:** the `olf infra` group, the common top-level commands, and the hidden aliases that keep every earlier path working (#536, PR 2b), the platform session commands `olf login`, `whoami` and `logout` (PR 4), `olf query`, and the platform reads `olf jobs list`, `olf runs list|show`, `olf domain list` and `olf product list` (#669), and `olf report import|export` (#670). **Decided, not built:** the non-interactive authentication contract below. Platform commands are clients of the platform API, decided in [ADR 0021](https://openlakeforge.dev/docs/adr/0021-platform-api/) and not built either, except where a service accepts the person's token and the command calls its route directly. ## Context `olf` deployed infrastructure and offered end-user operations through one command tree, and its code did not keep them apart. Every command that reached a service did so with a kubeconfig, and the service saw a bot or a workload, never the person. [ADR 0014](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/) classified every `olf` call as class 2, which is right for deployment and leaves no safe way to hand a person, or their local agent, a CLI. ## Decision `olf` stays one executable with three surfaces. **The credential a command needs decides its surface**, not who runs it. | | Infra (`olf infra ...`) | Common (`olf ...`) | Platform (`olf ...`) | | --- | --- | --- | --- | | Needs | Cluster or cloud permissions | None | A Dex session, the same path as the UI | | Identity | Cloud IAM or SDK identity, kubeconfig and Kubernetes RBAC; workload or CI credentials | None | Human OIDC session; delegated user identity for local agents | | Reaches | Cloud and Kubernetes APIs, Terraform state, Helm, registry, object store | Local files, local Docker, public release metadata | The platform API ([ADR 0021](https://openlakeforge.dev/docs/adr/0021-platform-api/)), and directly the public route of a service that authorizes the person's token: Trino's `query_api` for data-plane reads (ADR 0021, decision 2); never Kubernetes Secrets, exec or port-forward | Being `platform-admin` in the OpenLakeForge UI grants no Kubernetes or cloud rights. A platform command cannot reach a privileged operation through an infra client, a shared service-admin token or an implicit port-forward. Code follows the same split: `olf/common` imports neither `olf/infra` nor `olf/platform`, and `tools/olf/tests/common/test_package_boundaries.py` fails on a violation. `olf/cli.py` is the only module that imports both. When `olf/platform` exists it imports nothing from `olf/infra`, and the same test gains that rule. The service operations both surfaces need live in a library the infra commands and the platform API share (ADR 0021, decision 4), not in either command package. ## Command ownership | Surface | Commands | | --- | --- | | Infra | `deploy`, `plan`, `destroy`, `doctor`, `status`, `forward`, `break-glass`, `query`, `auth *`, `platform *`, `access trust`, `github connect`, `secrets rotate`, `k8s`, `catalog`, `artifacts`, `openmetadata *`, `superset *`, `report import\|export`, `project build\|deploy\|status\|image\|revision *`, `product run`, `images load`, `contracts env`, `diagnostics collect`, `dbt parse`, `e2e`, `smoke` | | Common | `init`, `version`, `check *`, `release *`, `toolchain *`, `distribution *`, `profile validate\|resolve`, `source new`, `domain new`, `product new`, `project validate\|graph`, `report validate`, `contracts check`, `images build`, `layers enabled`, `diagnostics tree` | | Platform | `login`, `whoami`, `logout`, `query`, `jobs list`, `runs list\|show\|launch`, `logs`, `domain list`, `product list`, `report import\|export` | Groups that mix credentials exist on both sides: `olf project validate` is common and `olf infra project deploy` is infra. `project image` sits in infra although #536 lists it as common, because it builds through the cloud provider and needs cloud credentials on `aws` and `azure`. `olf infra query` is workload-scoped: it runs as the stage's shared Trino principal. `olf query` is the platform command for a person's own queries ([ADR 0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/)): it signs in with the platform session and reaches only Trino's `query_api` route. The hidden alias `olf query` → `olf infra query` ended with it, the first exception to the migration rule below. `olf report import|export` is the second. `olf infra report import|export` run as the stage's Superset admin and move every bundle a project holds, for operators. `olf report import ` and `olf report export ` move one report as the signed-in person, through the platform API: the import is zipped on the client within the API's limits and runs as the stage's non-admin service user, DEV only, and the export is unpacked into the report directory as the infra export unpacks it. Their hidden aliases to the infra commands ended. `olf check contracts` and `olf contracts check` are common, but one of their checks (`hcl_phase_two_invariants`) runs `terraform output` against applied state. It is skipped when no environment is applied; with an applied remote backend and cloud credentials in the environment it reads that state. ## Migration Every earlier path stays as a hidden alias of its new home: it runs the same callback, takes the same options, and does not appear in `--help`. `olf deploy` and `olf infra deploy` are one command; so are `olf project deploy` and `olf infra project deploy`. An alias prints one line on stderr, `this command moved to `olf infra `; the old path will be removed in a later release`, and then behaves as before: same stdout and exit code. `olf query`, `olf report import` and `olf report export` are no aliases: they are platform commands. A command that moves from infra to common keeps its `olf infra` path the same way, warning with its common path: `olf infra report validate` runs `olf report validate`. `tools/olf/tests/common/test_cli_surfaces.py` holds the list of earlier paths and fails if one stops resolving to its new home or stops warning. ## Non-interactive platform authentication CI and service agents cannot complete a browser login. When they need the platform surface, for example to publish project artifacts, the credential must: - be short-lived, valid for minutes and issued per run; - be scoped to the operation and project it serves, and carry no infra rights; - identify the workload or pipeline, not a person; - come from exchanging an identity the runner already holds, not from a secret stored in CI; - never be a human refresh token or personal access token, and never be derived from one. An infra credential is not a substitute. Infrastructure CI/CD keeps using cloud and Kubernetes permissions. The exchange is not built; it needs its own design against these requirements. Until it is, the artifacts phase imports reports and metadata with infra credentials and does not call the platform API (ADR 0021, decision 4). ## Consequences - A person or agent can be given the platform surface without a kubeconfig. - Every old script keeps working until the deprecation window opens. - `project image` stays on the infra surface (above). - The `olf infra` documentation paths land with PR 6 of #536. ## History New record (#536). Rewritten for [ADR 0021](https://openlakeforge.dev/docs/adr/0021-platform-api/): the platform surface reaches the platform API instead of each service's public route; `olf query` joins the planned platform commands, and its hidden alias to `olf infra query` ends when ADR 0019's person path is built. The platform session commands exist (#536, PR 4): `olf/platform` holds `olf login`, `olf whoami` and `olf logout`, registered at the top level. Until the platform API serves its discovery document (ADR 0021), the instance comes from the Deployment Profile: the issuer is `https://auth.` for `identity.issuer: github` and `issuer_url` for `external`, and the client is `identity.client_ids['olf-cli']` or `olf-cli`. The session is a mode-0600 file under `OLF_HOME`; the OS keyring is a follow-up. A test holds the import direction: `olf/platform` imports only `olf.common`. The hidden aliases started warning once the documentation and CI moved to `olf infra` (#536, PR 6). `report validate` moved to common (#664): the bundle validators live in `olf.common.report_bundles`, and `olf infra report validate` became a hidden alias that warns with the new path. The platform row follows ADR 0021's rewritten decision 2 (#665): a platform command may call a service's public route directly when that service authorizes the person's token, as `olf domain list` does with OpenMetadata. `olf query` is a platform command (ADR 0019, build step 7); its alias to `olf infra query` ended. The platform reads exist (#669): `olf jobs list`, `olf runs list|show`, `olf domain list` and `olf product list`, each a client of the platform API. `domain list` reads OpenMetadata through the API's `/api/v1/domains`, which forwards the person's token unchanged (ADR 0021, decision 2), instead of OpenMetadata's own route as planned: one client for the CLI and the portal, and one place for the first-time-user registration. Only `olf query` still calls a service's route directly. `domain list` and `product list` sit in the common `domain` and `product` groups beside `new`, on the platform surface. `olf report import|export` are platform commands (#670), the second exception to the migration rule: their pre-2b aliases to `olf infra report import|export` ended, and the infra commands stay for operators. The import zips only `metadata.yaml` and the YAML under `datasets/`, `charts/` and `dashboards/`, so a report's `databases/` never leaves the machine. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0020-infrastructure-common-and-platform-cli-surfaces.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0020-infrastructure-common-and-platform-cli-surfaces.md). --- # ADR 0021: The platform API — one backend for the portal, olf and agents > Decided, build step 1 done, build steps 3, 4 and 5 begun: packages/lakehouse-services holds every service client — the HTTP transport, Dagster, OpenMetadata… Source: https://openlakeforge.dev/docs/adr/0021-platform-api/ ## Status Decided, **build step 1 done, build steps 3, 4 and 5 begun**: `packages/lakehouse-services` holds every service client — the HTTP transport, Dagster, OpenMetadata and Superset — and the operations built on them: Superset report import and export (`openlakeforge_services.reports`) and OpenMetadata metadata deployment (`openlakeforge_services.governance`). `olf/infra` keeps only what resolves endpoints and credentials from a deployment. The platform API in `packages/platform-api` has token validation, the permission matrix, `/api/healthz`, `/api/v1/whoami` and the first read endpoints: Dagster jobs and runs per stage, each stage's archived pod logs, read with a read-only object-store key scoped to the stages' log prefixes, and OpenMetadata domains and data products with the caller's token forwarded. `olf jobs list`, `olf runs list|show`, `olf domain list` and `olf product list` read through it with the signed-in person's token. The local provider deploys it with `spec.identity` (`modules/access/platform-api`), from an image `olf` builds, since no release has published one to pin. Its first state-changing route launches a DEV run, audited as decision 3 says, with a write-only key the deployment mounts; `olf runs launch` calls it. What binds today is the direction: the platform surface of [ADR 0020](https://openlakeforge.dev/docs/adr/0020-infrastructure-common-and-platform-cli-surfaces/) reaches services through one backend, written in Python in this repository, and new code that would duplicate a platform operation in another language or another host follows the split below. ## Context ADR 0020 decided a platform surface: commands a person, or their local agent, runs with a Dex session and no kubeconfig. It assumed each platform command would call each service's public route itself. The operations that surface needs — read pipeline runs and jobs, read domains, data products and glossary from OpenMetadata, read and move Superset reports, read archived logs — are also what the portal ([openlakeforge-portal](https://github.com/OpenLakeForge/openlakeforge-portal)) needs to grow from a route index into a platform UI. Calling every service from the CLI would put that logic in `olf` and again in the portal. The logic already exists, in Python, under the infra surface: | Operation | Today | How it authenticates | Does the service accept the person's token? | | --- | --- | --- | --- | | Superset report import and export | `olf/infra/superset.py` | Port-forward (`superset_base_url`), the admin password from the `superset-credentials` Secret (`admin_password_for`), the stage's Trino password from its Secret | No. The REST API signs callers in with `provider: "db"` on `/api/v1/security/login` ([identity-service-permissions.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/identity/identity-service-permissions.md)); accepting an external issuer's token would need a custom security manager (#536, out of scope) | | OpenMetadata domains | `olf infra openmetadata list-domains`, `openlakeforge_services/openmetadata.py` | Port-forward, the automation bot's JWT from its Secret (`olf/infra/openmetadata/_auth.py`) | **Yes.** It trusts Dex's signing keys (`publicKeyUrls` lists `/keys`), names the caller by `preferred_username` (`jwtPrincipalClaims`), and authorizes by that user's own OpenMetadata roles, which the role sync sets ([ADR 0014](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/)); `infra/terraform/modules/governance/openmetadata/main.tf` | | Dagster runs and jobs | `openlakeforge_services/dagster.py`, used only by `olf e2e` | None: Dagster's GraphQL API is unauthenticated ([ADR 0017](https://openlakeforge.dev/docs/adr/0017-local-network-policy-and-rbac/)) | No: Dagster has no authentication or authorization of its own | | Archived logs | Written by `openlakeforge_runtime/k8s_log_archive.py` to `OPENLAKEFORGE_LOG_BASE_URI` (default `s3://openlakeforge-ops/logs`) | Object-store credentials | No: no module under `infra/terraform/modules/storage/` configures an OIDC issuer | Two facts shape the decision. The portal is a React Router application on Node, so it cannot import this code. And the services split in two: Superset, Dagster and the object store cannot take a person's token, so a call there needs a service credential and someone else must decide access; OpenMetadata takes the person's token and decides access itself, per user. The #536 spike (comment "Spike results", OpenMetadata 1.13.6 read from source, not run against a deployment) adds two facts about that OpenMetadata path: - OpenMetadata's `JwtFilter` checks a token's signature and expiry, not its `aud` or `iss`. Any token Dex signed passes it, so the perimeter's audience check is the only audience check on this path. This holds for browser tokens today too. - OpenMetadata derives the user from `preferred_username` and refuses a token without it, so a caller must request the `profile` scope (ADR 0014 already requires it of the `olf-cli` client). The spike notes Dex's GitHub connector sets the claim and its mock connectors do not, so the e2e stub path needs checking. ## Decision ### 1. One backend: the platform API A Python service, the **platform API**, serves the platform operations over a versioned HTTP API (`/api/v1`). The portal's pages, `olf`'s platform commands and agents are its clients. It is a platform-phase component ([ADR 0002](https://openlakeforge.dev/docs/adr/0002-deployment-lifecycle/)): Terraform deploys it, pinned by digest in `release/component-catalog.yaml`, and it reads no user code at startup. It lives in this repository, beside the code it reuses and the contracts it versions with: the `openlakeforge-platform-api` distribution in `packages/platform-api/`, next to the two packages it builds on, and an image defined in `images/platform-api/`, as `project-code` and `superset` are. A top-level `services/` directory would be a third layout for first-party Python. Unlike the other packages it is not published to PyPI; it ships only as the image. It keeps its own locked environment (`packages/platform-api/uv.lock`), so FastAPI and uvicorn never enter `olf`'s. It is served at `https:///api/` behind the perimeter, the same origin as the portal, so a browser session reaches it without CORS. The route is a path on the portal's host, not a `shared.access.routes` entry, and sits behind the perimeter's lowest role floor: every canonical role clears it, and the API's own permission matrix decides above that. It accepts only audience `olf-cli`, which a browser session's ID token carries through Dex cross-client trust (ADR 0014): the perimeter's proxies return it as `Authorization: Bearer` and a Traefik middleware used on this route alone copies it to the API, so no other service sees it. With an external issuer, or no `spec.identity`, there is no such token: the settings render `person_query: false` and a browser's cookie alone gets 401 from the API. The portal stays in its own repository and is a React Router (framework mode, Node SSR) app. It is still a thin same-origin client of this API: it holds no data-plane authorization, and what a person may read or run is decided by the services behind the API. ### 2. The identity a call carries follows the service **Where a service validates the person's token and authorizes by it, the call carries that token.** Service credentials are used only where the service cannot accept the person's token. Per service: | Service | Operations | Identity on the service call | Who decides access | | --- | --- | --- | --- | | Trino, through Polaris | Reading or writing table data: `olf query`, a query page in the portal | The person's Dex token, end to end ([ADR 0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/)) | Polaris grants | | OpenMetadata | Domains, data products, glossary | The person's Dex token, end to end | The perimeter's floor on the route the call entered by, then **OpenMetadata**, by the user's own OpenMetadata roles | | Superset | Report export and import | The platform API's Superset service credential | **The platform API** | | Dagster | Runs and jobs | None (Dagster checks nothing); the platform API reaches it over its own flow rows | **The platform API** | | Object store | Archived log reads | The platform API's read-only key for the log prefix | **The platform API** | A call that carries the person's token takes one of two routes. A CLI command may call the service's public route directly, as `olf query` reaches Trino's `query_api` route. Or the platform API forwards the token unchanged: `olf domain list` and `olf product list` read OpenMetadata through the API's `/api/v1/domains` and `/api/v1/data-products`, so the CLI and the portal share one client and one first-time-user remedy, and the portal's query page will reach Trino the same way. Either way the platform API holds no OpenMetadata credential to act on a person's behalf, and never reads table data with a stage principal: either would replace the service's per-user decision with its own. Two conditions bind every caller on the OpenMetadata path: - **Someone in front of OpenMetadata checks the audience.** OpenMetadata checks signature and expiry, not `aud` (see Context). On a direct call that is the perimeter: it admits a bearer token only if it was issued to `olf-cli` (an extra audience on the proxy's own verifier with Dex's `internal_url`, `--extra-jwt-issuers==olf-cli` for an external issuer; `infra/terraform/modules/access/perimeter/main.tf`) or, per the #536 spike, to the perimeter's own client, and enforces the route's role floor on it. The platform API reaches OpenMetadata over in-cluster Service DNS (decision 4), around the perimeter, so on a forwarded call its own token validation (decision 3: an audience from an explicit list) takes that place. A path with neither would accept any token Dex signed, including one issued to Superset or Trino. - **The caller requests the `profile` scope**, because OpenMetadata keys users on `preferred_username`. `tools/olf/olf/platform/session.py` requests `openid email profile groups offline_access`. A person who has never opened OpenMetadata's UI has no user there, and a bearer request from them fails. The remedy (#536) registers the caller once through `POST /v1/users`, which self-signup (`enableSelfSignup = true`) allows for exactly the caller, then retries; the role sync assigns roles on its next run. A platform API endpoint that forwards a person's token to OpenMetadata does the same. Under the classification rule in [identity-classes.md](https://openlakeforge.dev/docs/architecture/identity/identity-classes/), a person's call to the platform API is class 1. A forwarded call onward stays class 1: the service sees the person. A call onward to Superset, Dagster or the object store is class 2: a workload with a service credential, acting after it has checked a class 1 identity. ### 3. The platform API is an enforcement point for its service-credential calls On a call it forwards with the person's token, the platform API decides nothing: the service does, as it would for a direct call. It still validates the token as below — signature, issuer, expiry and audience — before forwarding it: on that hop it is the only audience check (decision 2), and it never relays a request it cannot attribute. A call to Superset, Dagster or the object store carries a service credential, so whoever reaches the platform API reaches what those credentials can do. For those calls it therefore: - **validates every token itself**: signature against the issuer's keys, issuer, expiry, and an audience from an explicit list. A header set by the perimeter is not proof of identity on its own; - **derives the canonical role** from the role claim exactly as [ADR 0014](https://openlakeforge.dev/docs/adr/0014-identity-and-authorization/) maps it, and checks each operation against a **permission matrix kept as data and tested** — an operation, the lowest role allowed, and the stages it applies to — in the monotonic-floor style of ADR 0014's perimeter; - **holds the narrowest credential each service offers**, mounted from a Secret (architectural rule 7): a Superset service user rather than `admin` wherever Superset's API allows the operation, a read-only object-store key for the log prefix, and no OpenMetadata credential; - **reaches Dagster's GraphQL API through its own rows in `release/network-flows.yaml`**, and its permission matrix is the only check on what it asks there, since Dagster checks nothing; - **writes an audit record** naming the person for every operation that changes state: who (the token's subject, email and canonical role), the operation, the stage, its target, and the outcome. Each record is one JSON line on stdout and, for an authenticated person, one object in the ops bucket under `audit/platform-api/date=/`, written with a key that may only `Write` there. The API stores an `attempted` record before it acts and answers 503 without acting if it cannot; the outcome follows, and a lost outcome is logged rather than undoing what was done. A refusal of an authenticated person is stored too; one of a caller without a valid token goes to stdout only, so no anonymous caller can fill the bucket. The request id in each record and key is the API's own. SeaweedFS's `Write` also overwrites and deletes (`weed/s3api/s3api_server.go`, 4.48), so the records are tamper-evident against everyone but the API itself, not append-only; - **is stateless** with a read-only root filesystem until a feature needs storage; saved queries or history bring the shared PostgreSQL in as their own decision; - **refuses cross-site writes** (#799) without tokens or a session store: on POST, PUT, PATCH and DELETE it refuses an `Origin` other than the configured `public_origin` (unset: any `Origin`), a `Sec-Fetch-Site` other than `same-origin` or `none`, and a body that is not JSON (`application/zip` for report import). A request with no `Origin` is a non-browser client and passes. It serves no CORS headers. ### 4. One library, two hosts The service clients and operations move out of `olf` into a library package, `packages/lakehouse-services/`, following the `packages/core` precedent. Its rule is **inject, don't fetch**: an operation takes a client and credentials and never resolves them itself — no `typer`, no `os.environ`, no `k8s.secret_value`, no port-forward. Each host supplies its own resolver: | Host | Reaches a service through | Credentials from | | --- | --- | --- | | `olf infra` (deploy, artifacts phase, e2e) | Port-forward or the applied contract's endpoint | Kubernetes Secrets with the caller's kubeconfig | | The platform API | In-cluster Service DNS | Secrets mounted into its pod, or the person's token, forwarded unchanged, for a service that authorizes it (decision 2) | `olf` stays a single-operator CLI (AGENTS.md, Non-goals). The library does not inherit that: the platform API calls it concurrently, so it holds no module-level state. **The artifacts phase keeps calling the library directly**, with infra credentials. `olf infra deploy --phase artifacts` imports reports and metadata through `olf/infra/deployment/artifact_steps.py`; routing that through the platform API would make every deployment depend on the API being up and give CI a platform credential, which ADR 0020's non-interactive authentication contract governs and which is not built. It is revisited when that exchange exists. ### 5. The contract between the API and its clients The API's OpenAPI document is committed under `docs/schema/` and checked against the code in CI, so a change to an endpoint is a reviewed change to a schema, as the descriptor and contract schemas already are. The portal generates its types from it. A breaking change is a new path version, so the two repositories do not have to merge in lockstep; if most portal changes come to need a paired backend change, moving the portal into this repository is reconsidered. The platform API also serves a discovery document: the issuer, the `olf-cli` client id, the API and `query_api` URLs, and each stage with its catalog. `olf login ` needs nothing else. The platform surface cannot read Terraform state or `OPENLAKEFORGE_QUERY_TRINO_CATALOG`, which `olf infra query` gets from the applied contract today. ### 6. What stays infra Deployment and recovery stay infra and never go through the platform API: `deploy`, `plan`, `destroy`, `doctor`, `status`, `forward`, `break-glass`, `auth`, `secrets rotate`, `k8s`, `project build|deploy|image`, `diagnostics collect`, `e2e`. The platform API has no Kubernetes or cloud permission beyond reading its own mounted Secrets, so `platform-admin` in the UI still grants no cluster rights (ADR 0020). ## Consequences - Platform logic is written once, in Python, and the portal, `olf` and agents share it through one API. - The platform API holds service credentials for Superset and the object store, and is the authorization point for them and for Dagster. Its permission matrix and token validation carry the review weight the perimeter carries today. - OpenMetadata keeps its per-user authorization on every platform path, and the platform API holds one credential fewer. The price is that the perimeter's audience check is the only one in front of OpenMetadata, and every caller on that path handles a first-time user's registration. - One more pod in `olf-system`, with `spec.identity` only, recorded in ADR 0013's table. Its memory was measured in Docker, not yet on kind. - The extraction of `packages/lakehouse-services` is a refactor with no behaviour change and can land before any of the API. - AGENTS.md's repository map gains `packages/lakehouse-services/` and the platform API's source and image directories when they exist. ## Open items Items 1 and 2 are settled (decision 1 and History); the numbering of the remaining one is kept. | # | Item | Why it is open | | --- | --- | --- | | 3 | The narrowest credential per service | Settled for Superset (#670, see History): a non-admin service user, role `olf_platform_api`, can import and export. It must co-own the report assets to overwrite them, and needs data access to export them | ## Build order Each step is one pull request within AGENTS.md's size rule. 1. Extract `packages/lakehouse-services` from `olf/common/clients`, `olf/infra/superset.py` and `olf/infra/openmetadata`; `olf infra` uses it. No behaviour change. 2. Platform API skeleton on the local provider: token validation, the permission matrix, `/healthz`, the discovery document; its Terraform module, flow rows and catalog pin. 3. Read endpoints: Dagster runs and jobs and archived logs with service credentials; OpenMetadata domains and products forwarding the person's token. 4. `olf login`, `whoami`, `logout` and the read commands as clients of the API, except where a command calls a service's route directly with the person's token, as `olf query` does Trino's (step 6). 5. State-changing endpoints — report export and import, launching a run — with audit records. 6. Platform `olf query` on ADR 0019's person path (ADR 0020, Command ownership). ## History New record. Rewrites ADR 0020's platform row: platform commands reach the platform API, not each service's public route. Build step 1, first part: the transport and the Dagster client moved to `packages/lakehouse-services`, a third published distribution (ADR 0009). Build step 1, second part: the OpenMetadata and Superset clients followed; `olf/common/clients` no longer exists. Build step 1, third part: Superset report import and export moved to `openlakeforge_services.reports`; `olf infra` keeps the stage resolution, the port-forward and the Secret reads, and passes its `log` module as the operations' progress reporter. Build step 1, last part: OpenMetadata payloads, upserts and the deploy sequence moved to `openlakeforge_services.governance`; `olf infra` keeps the contract and descriptor resolution, the port-forward, the Secrets, the ingestion Jobs, SSO and role sync. Domain listing needed no move: it was already `OpenMetadataClient.list_domains`. Build step 2, first part (#666): the service skeleton in `packages/platform-api`, which settles open item 4 (where the source and image live, decision 1). The proposed `services/platform-api/` was not used. Second and third parts: the image and its release build, then the Terraform module, flow rows and local wiring behind the perimeter. Decision 2 rewritten (#665): the identity on a service call follows the service, not a data-plane/control-plane split. OpenMetadata, which validates the person's token and authorizes by it, gets that token, directly from the CLI or forwarded by the API; service credentials remain for Superset, Dagster and the object store. Decision 3 now applies to those service-credential calls only, the OpenMetadata bot credential is dropped, and the context table records which services accept the person's token. Build step 3, first part (#668): Dagster jobs and runs under `/api/v1/stages/{stage}/`, at the Dagster route's `data-engineer` floor, with no credential; OpenMetadata domains and data products at the `viewer` floor, forwarding the caller's token unchanged. Archived logs, first-time user registration on the OpenMetadata path, and the endpoints' e2e through the perimeter remain. Second part: the local root renders each stage's Dagster GraphQL URL and OpenMetadata's URL into the API's settings, and ADR 0017's F32 lets the API reach them. Build step 4, read commands (#669): `olf jobs list`, `olf runs list|show`, `olf domain list` and `olf product list` call the platform API with the stored session's token, and the API's refusal below a floor names the role it needs. `olf domain list` reads OpenMetadata through the API rather than OpenMetadata's own route, as decision 2 had planned, so the CLI and the portal share one client and one first-time-user remedy. Build step 3, archived logs (#668): the platform API reads each stage's pod log archive with its own SeaweedFS identity, `Read` and `List` on the stages' log prefixes only, minted in-cluster and mounted from a Secret as decision 3 says, at the `data-engineer` floor. Build step 5, first part (#670): decision 3 now says where audit records go. A pod log is lost with the pod and nothing archives `olf-system`, so the durable copy is an object of its own, written before the API acts. The permission matrix marks an operation `changes_state`, and every such operation runs inside the audit; without an audit key it answers 503. No operation is marked yet: the first, launching a run, and the write-only key's deployment follow. Second part: `POST /api/v1/stages/{stage}/runs` launches a job as the signed-in person, at `data-engineer` and on DEV only, as #670 asks. Dagster checks nothing, so the row is the only control. The run is tagged with who asked for it and with the API's request id, by which a launch whose response was lost is found rather than launched twice. The job is looked up among the jobs the read endpoint lists, so an unknown name is answered at once instead of waiting on, and reloading, code locations as the e2e's launch does. A name that two code locations both define is refused with 409, naming them, rather than launching whichever is listed first (#670 follow-up). Third part: the SeaweedFS credentials Job mints the API's audit key in `olf-system`, identity `openlakeforge-platform-api-audit` with `Write` on `audit/platform-api/` only, never generated by Terraform (#400). The pod reads it under its own variable names, beside the log reader's key, and the local root sets `audit_base_uri` from the same prefix as the grant. `olf runs launch` posts the launch with the stored session's token and does not retry it. Open item 3, Superset, checked against the 6.1.0 source (#670): `ImportExportRestApi` is an Alpha view, not an Admin one (`security/manager.py`), so a role of its own can hold `can_import_` there. The import overwrites every asset with permission checks on: it needs `can_write` on each type, and an existing dataset, chart or dashboard may be overwritten only by an owner or an admin. Export filters charts by data access alone (`charts/filters.py`), so the role needs the report schemas' `schema_access`. The import form's `sparse=true` resolves databases already in Superset by uuid, so the API sends no database: the service user holds no `can_write` on databases, the API needs no Trino credential, and an uploaded report cannot replace a stage's connection. The role is created from data by Superset's init script (`fab import-roles`, which only adds permissions); the user's password is minted in `olf-system` by one Job that copies it into each stage namespace. The artifacts phase making the user a co-owner of what it imports and granting the role `schema_access`, the API's mount and its flow to Superset follow. The API reads each stage's Superset URL from its settings and that stage's service-user password from a variable mounted from the Secret in `olf-system`, and reaches Superset over ADR 0017's F35. The artifacts phase, still importing as `admin` (decision 4), now also makes the service user a co-owner of every dashboard it imports, with its charts and datasets, keeping every other owner, and grants `olf_platform_api` the report schemas in the step that grants `olf_data_access` them. An import keeps owners and adds the importer, so the user stays an owner across later imports; without the platform API there is no such user or role, and both steps do nothing. Build step 5, report routes (#670): `POST /api/v1/stages/{stage}/reports` takes a report directory zipped from its root and imports it into that stage's Superset as the service user, at `data-engineer` and on DEV only: the user co-owns every report asset, so an import elsewhere could overwrite any dashboard and bypass the repository and the artifacts phase. The upload's databases are dropped and the import is sparse, so it cannot replace a connection; a report reading a schema the report roles were not granted is refused with 409, since only the artifacts phase grants. It is audited like a launch. `GET /api/v1/stages/{stage}/reports/{dashboard}/export` returns one dashboard as a stage-neutral bundle, at `data-engineer` on every stage. The service user signs in with Superset's database provider, which the login endpoint honours whatever the AUTH_TYPE (Flask-AppBuilder 5.0.2), so OIDC sign-in does not stop it. Every import posts with a CSRF token, so the role also holds `can_read` on `SecurityRestApi` (`security/api.py`), the view behind `/api/v1/security/csrf_token/`; the e2e's first import found it missing. Build step 3, last part (#668): a caller OpenMetadata has never seen, such as a person who has only used the CLI, is registered on first use. OpenMetadata answers such a token 404 "user instance for not found"; the API then creates exactly that user with the caller's own token (`POST /api/v1/users`, which self-signup allows) and reads again, as decision 2 decided. The name is the one OpenMetadata derives: its `jwtPrincipalClaims` is `preferred_username` (`modules/governance/openmetadata`), taken before any `@` and lowercased (1.13.6, `SecurityUtil.findUserNameFromClaims`), and the API reads that claim from the validated token, never from the request. OpenMetadata itself refuses a self-signup under any other name with 403 `OTHER_USER_SIGN_UP` (`UserResource.createUser`), so a mismatch fails closed. Registration is not audited: it is the first-use side effect a browser sign-in has, not an operation the person asked for. The e2e calls every read route through the perimeter for every role, which is how the missing registration was found. Issue #799, first part: the cross-site write guard (`csrf.py`), the `public_origin` and `person_query` settings, and the dependency that derives a person's Trino identity from the validated token (`query_identity.py`). Open items 1 and 2 stay open until the identity wiring lands. Issue #799, second part: open items 1 and 2 are settled by Dex cross-client trust, with no change to any service's accepted audience. `olf-cli` lists the perimeter in `trustedPeers`; the perimeter requests the `olf-cli` audience and `federated:id`, and the middleware on `/api` passes the ID token on. The settings render `public_origin` from the portal route's scheme and host (`http` under `access.tls: none`) and `person_query` true only for Dex with the people catalogs. Not yet run: that Dex keeps the `olf-cli` audience when the proxy refreshes the session (every 4 minutes), that the proxy accepts the login token with `--oidc-extra-audience`, and that Trino and Polaris accept it. The e2e's browser-session check covers the sign-in and an API read; none waits out a refresh. Issue #801: `GET /api/v1/query-capabilities` and the per-person schema and table listings (`discovery.py`). The `query_endpoints` setting maps each stage to its Trino statement URL and catalog (`lakehouse_`). Both are in the committed OpenAPI document of decision 5 (#1063). Issue #800: `POST /api/v1/stages/{stage}/queries`, `GET` and `DELETE` on `.../queries/{id}`, and `GET .../queries/{id}/export?format=csv|json` (`queries.py`), at the `viewer` floor: Polaris decides the data. Every Trino call is the person's, as discovery's. A submit may name `schema` in its body (printable ASCII, at most 128 characters, else 400): Trino calls for that query, the read-only check and the export re-run included, carry it as `X-Trino-Schema`, so unqualified names resolve in it; without it names stay qualified, as in discovery, which never sets one. The `id` and `cursor` are HMAC-signed records of Trino's query id and continuation path, the stage, the schema if named, and the token `sub`, so any replica resumes a query, no one resumes another person's, and a value that does not verify is a 404; the key is mounted from a Secret (`OPENLAKEFORGE_QUERY_SIGNING_KEY`, 32 characters or more) and without it query execution answers 503. The MVP is read-only and Trino enforces it: a statement runs only if Trino accepts it as a table expression in `SELECT * FROM ()` (checked with `EXPLAIN (TYPE VALIDATE)`, which runs nothing), so SHOW, DESCRIBE, EXPLAIN and every write are refused with 403. Being read-only, these operations are not `changes_state`: decision 3's audit-before-action does not apply, and nothing about the SQL is logged or audited. The id also carries the statement, because Trino gives a result out once and an export therefore runs it again. A response carries at most `query_page_rows` rows and an export at most `query_export_max_rows`, else 413; CSV cells that a spreadsheet would read as formulas are prefixed with a quote. There is no per-person limit on queries in flight: it would need state shared between replicas, which this API does not have. Decision 1 rewritten: the portal is no longer Astro. It is a React Router (framework mode, Node SSR) app in its own repository (openlakeforge-portal #10 to #12), and the sentence about React islands is gone. Issue #799 and #800, deployment wiring: the platform API module renders `query_endpoints` (each stage's in-cluster Trino statement URL, on the coordinator's HTTPS port, and its people catalog) into `settings.json` only with `person_query`, so the URL never leaves the server. The same condition mounts `OPENLAKEFORGE_QUERY_SIGNING_KEY` from a Secret one Job mints in `olf-system`, kept on redeploy and never held by Terraform. ADR 0017 adds flow F36 for the API's egress to the coordinator. Not yet run: a query through the deployed API; there is no cluster in the change's environment. Issue #800 follow-up: a query may name its default schema (`schema` in the submit body, the Portal's Schema selector). This reverses the earlier rule that queries never set `X-Trino-Schema`; discovery still does not. Issue #1063: decision 5's document now exists, as `docs/schema/platform-api.openapi.json`, listing the 18 routes with Pydantic response models (`models.py`). The app still serves no `/openapi.json`; the file is rendered by `openlakeforge_platform_api.openapi`, and `tests/test_openapi.py` fails when it differs from the app, naming the regeneration command (`cd packages/platform-api && uv run --locked python -m `openlakeforge_platform_api.openapi`). Its `version` is the path version (`v1`), not the release, so a release bump does not change it. --- Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/adr/0021-platform-api.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/adr/0021-platform-api.md). --- # JSON Schema: OpenLakeForge Deployment Profile (`deployment-profile.schema.json`) ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://openlakeforge.io/schemas/deployment-profile/v1beta1", "title": "OpenLakeForge Deployment Profile", "type": "object", "additionalProperties": false, "required": ["apiVersion", "kind", "metadata", "spec"], "properties": { "apiVersion": {"const": "openlakeforge.io/v1beta1"}, "kind": {"const": "DeploymentProfile"}, "metadata": { "type": "object", "additionalProperties": false, "required": ["name"], "properties": { "name": {"type": "string", "maxLength": 51, "pattern": "^(?!xn--)[a-z]([a-z0-9-]{0,61}[a-z0-9])?$", "description": "Also the prefix of the local and Azure buckets: -- and -ops. At most 51 characters so -prod-bronze stays within the 63 an S3 or Azure bucket name allows."} } }, "spec": { "type": "object", "additionalProperties": false, "required": ["provider", "preset", "stages"], "if": {"properties": {"provider": {"properties": {"type": {"const": "local"}}}}}, "then": {"dependentRequired": {"identity": ["access"]}, "properties": {"project": {"required": ["image"]}}}, "allOf": [ { "if": {"properties": {"provider": {"properties": {"type": {"const": "aws"}}}}}, "then": {"properties": { "cluster": {"properties": {"adapter": {"const": "eks"}}}, "storage": {"properties": {"adapter": {"const": "s3"}, "size": false}}, "catalog": {"properties": {"adapter": {"const": "glue"}}}, "metadata_database": {"properties": {"adapter": {"const": "rds"}}} }} }, { "if": {"properties": {"provider": {"properties": {"type": {"const": "local"}}}}}, "then": {"properties": { "cluster": {"properties": {"adapter": {"const": "kind"}}}, "storage": {"properties": {"adapter": {"const": "seaweedfs"}}}, "catalog": {"properties": {"adapter": {"const": "polaris"}}}, "metadata_database": {"properties": {"adapter": {"const": "postgresql"}}} }} }, { "if": {"properties": {"provider": {"properties": {"type": {"const": "azure"}}}}}, "then": {"properties": { "cluster": {"properties": {"adapter": {"const": "aks"}}}, "storage": {"properties": {"adapter": {"const": "seaweedfs"}}}, "catalog": {"properties": {"adapter": {"const": "polaris"}}}, "metadata_database": {"properties": {"adapter": {"const": "postgresql"}}} }} } ], "properties": { "provider": { "type": "object", "additionalProperties": false, "required": ["type"], "properties": { "type": { "enum": ["local", "aws", "azure"], "description": "The deployment target, and the default adapter for each capability (storage, metadata database, catalog). Only `local` is covered by the v1beta1 compatibility promise; `aws` and `azure` are accepted as preview." }, "region": {"type": "string", "minLength": 1} } }, "preset": {"enum": ["slim", "full"]}, "cluster": { "type": "object", "additionalProperties": false, "description": "The provider's cluster adapter only. Existing-cluster selection waits on #802.", "properties": {"adapter": {"enum": ["kind", "eks", "aks"]}} }, "catalog": { "type": "object", "additionalProperties": false, "description": "The provider's catalog adapter only. AWS Polaris waits on #681.", "properties": {"adapter": {"enum": ["polaris", "glue"]}} }, "metadata_database": { "type": "object", "additionalProperties": false, "description": "The provider's metadata database adapter only. External PostgreSQL waits on #335.", "properties": {"adapter": {"enum": ["postgresql", "rds"]}} }, "state": { "type": "object", "additionalProperties": false, "description": "Terraform state backend. Remote backends wait on #905 and #132.", "properties": {"backend": {"const": "local", "default": "local"}} }, "query": { "type": "object", "additionalProperties": false, "description": "The default Trino size for every stage; stages..query.size overrides it. Only `small` has a tested backend; `medium` and `large` are rejected until one lands (#324).", "properties": {"size": {"enum": ["small"], "default": "small"}} }, "storage": { "type": "object", "additionalProperties": false, "description": "Object storage. Only the provider's default adapter is accepted; external S3-compatible storage waits on #803. Size applies only to self-hosted SeaweedFS, never AWS S3. Volume sizes are in release/storage-sizes.yaml.", "properties": { "adapter": {"enum": ["seaweedfs", "s3"]}, "size": {"enum": ["small", "medium", "large"], "default": "small"} } }, "project": { "type": "object", "additionalProperties": false, "minProperties": 1, "description": "The customer's project. Omit the block to use the public example image. Never a credential: the pull secret is a reference to a Kubernetes Secret.", "properties": { "repository": { "type": "string", "pattern": "^(https://[^\\s@?#/]+|ssh://([^\\s@:?#/]+@)?[^\\s@?#/]+)/[^\\s?#]*[^\\s?#/][^\\s?#]*$", "description": "Source URL, provenance only: olf builds the checked-out directory. Credentials in the URL are rejected." }, "image": { "type": "object", "additionalProperties": false, "required": ["repository"], "properties": { "repository": { "type": "string", "maxLength": 255, "pattern": "^((localhost|[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+)(:[0-9]{1,5})?|[a-z0-9]([a-z0-9-]*[a-z0-9])?:[0-9]{1,5})/[a-z0-9]+([._-][a-z0-9]+)*(/[a-z0-9]+([._-][a-z0-9]+)*)*$", "description": "Registry repository, host first, without tag or digest. Loose copy; the olf Python validator is the authority." }, "pull_secret_ref": { "type": "object", "additionalProperties": false, "required": ["name"], "description": "kubernetes.io/dockerconfigjson Secret created out-of-band, for a private image.", "properties": { "name": {"type": "string", "maxLength": 253, "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"} } } } } } }, "access": { "type": "object", "additionalProperties": false, "properties": { "base_domain": { "type": "string", "default": "olf.localhost", "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$" }, "tls": { "enum": ["none", "local-ca", "external"], "default": "none", "description": "none: plain HTTP on *.localhost (local only). local-ca: the platform CA, evaluation only. external: the customer terminates HTTPS in front of OpenLakeForge; not valid on *.localhost. `issuer` was the v1alpha1 name of this field and is rejected; `olf project migrate` renames it." }, "trusted_proxies": { "type": "array", "minItems": 1, "items": {"type": "string"}, "description": "CIDR blocks of the customer's proxy as Traefik sees it. Required with tls external and refused with any other tls: only these peers' X-Forwarded-Proto and X-Forwarded-Host are trusted. 0.0.0.0/0 and ::/0 are refused." } }, "if": {"required": ["tls"], "properties": {"tls": {"const": "external"}}}, "then": {"required": ["trusted_proxies"]}, "else": {"not": {"required": ["trusted_proxies"]}} }, "identity": { "type": "object", "additionalProperties": false, "required": ["issuer"], "properties": { "issuer": {"enum": ["external", "github"]}, "issuer_url": {"type": "string", "pattern": "^https://", "description": "Loose check; the olf Python validator (_oidc_issuer_url) is the authority."}, "role_claim": {"type": "string", "minLength": 1}, "client_ids": { "type": "object", "minProperties": 1, "propertyNames": {"enum": ["perimeter", "superset", "openmetadata", "olf-cli"]}, "additionalProperties": {"type": "string", "minLength": 1} }, "github": { "type": "object", "additionalProperties": false, "required": ["organization", "teams", "oauth_app_secret_ref"], "description": "GitHub organisation teams as the source of roles. role_claim and role_mapping are derived: groups and :.", "properties": { "organization": {"type": "string", "pattern": "^[A-Za-z0-9-]+$", "description": "The organisation login exactly as GitHub shows it, case included: Dex compares it exactly."}, "host": {"type": "string", "maxLength": 253, "pattern": "^[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$", "description": "GitHub Enterprise Server hostname; absent means github.com. Dex then trusts the platform CA (olf-local-ca) for it."}, "teams": { "type": "object", "minProperties": 1, "propertyNames": {"enum": ["platform-admin", "data-engineer", "analyst", "viewer"]}, "additionalProperties": { "type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$", "description": "The team slug from its GitHub URL; lowercased by olf."} } }, "oauth_app_secret_ref": { "type": "object", "additionalProperties": false, "required": ["name"], "description": "Secret holding the GitHub OAuth App client id and secret.", "properties": { "name": {"type": "string", "maxLength": 253, "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"}, "client_id_key": {"type": "string", "maxLength": 253, "pattern": "^[-._a-zA-Z0-9]+$", "default": "client-id"}, "client_secret_key": {"type": "string", "maxLength": 253, "pattern": "^[-._a-zA-Z0-9]+$", "default": "client-secret"} } } } }, "role_mapping": { "type": "object", "minProperties": 1, "propertyNames": {"enum": ["platform-admin", "data-engineer", "analyst", "viewer"]}, "additionalProperties": { "type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1} } } }, "allOf": [ { "if": {"properties": {"issuer": {"const": "external"}}, "required": ["issuer"]}, "then": { "required": ["issuer_url", "role_claim", "role_mapping"] }, "else": {"not": {"required": ["client_ids"]}} }, { "if": {"properties": {"issuer": {"const": "github"}}, "required": ["issuer"]}, "then": { "required": ["github"], "not": {"anyOf": [{"required": ["issuer_url"]}, {"required": ["role_claim"]}, {"required": ["role_mapping"]}, {"required": ["client_ids"]}]} }, "else": {"not": {"required": ["github"]}} } ] }, "stages": { "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "dev": {"$ref": "#/$defs/stage"}, "uat": {"$ref": "#/$defs/stage"}, "prod": {"$ref": "#/$defs/stage"} } } } } }, "$defs": { "stage": { "type": "object", "additionalProperties": false, "properties": { "enabled": {"type": "boolean"}, "query": { "description": "This stage's Trino size; overrides spec.query.size. Same values as spec.query.size.", "type": "object", "additionalProperties": false, "properties": {"size": {"enum": ["small"]}} }, "capabilities": { "type": "object", "additionalProperties": false, "properties": { "analytics": {"type": "boolean"}, "governance": {"type": "boolean"} } }, "source_egress": { "description": "External hosts this stage's Bronze sources reach. NetworkPolicy has no hostname selector, so on local the stage's Dagster run pods may open these TCP ports to any address outside the cluster's pod and Service ranges (ADR 0017 F34). Absent: no external egress.", "type": "object", "additionalProperties": false, "required": ["ports"], "properties": { "ports": { "type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "integer", "minimum": 1, "maximum": 65535} } } } } } } } ``` --- # JSON Schema: OpenLakeForge Governance (`governance.schema.json`) ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://openlakeforge.io/schemas/governance/v1beta2", "title": "OpenLakeForge Governance", "description": "Business domains and the data products nested under them. A product belongs to the domain it is declared in. Tables belong to a domain or product by schema (_silver, _gold) and are not declared here.", "type": "object", "additionalProperties": false, "required": ["apiVersion", "kind", "domains"], "properties": { "apiVersion": {"const": "openlakeforge.io/v1beta2"}, "kind": {"const": "Governance"}, "domains": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["name", "displayName"], "properties": { "name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "displayName": {"type": "string", "minLength": 1}, "description": {"type": "string"}, "status": {"type": "string", "minLength": 1}, "products": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["id", "displayName"], "properties": { "id": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "displayName": {"type": "string", "minLength": 1}, "description": {"type": "string"}, "status": {"type": "string", "minLength": 1} } } } } } } } } ``` --- # JSON Schema: OpenLakeForge Project Activation (`project-activation.schema.json`) ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://openlakeforge.io/schemas/project-activation/v1alpha1", "title": "OpenLakeForge Project Activation", "type": "object", "additionalProperties": false, "required": [ "apiVersion", "kind", "schema_version", "deployment_profile", "provider", "stage", "project_name", "project_revision", "distribution_version", "project_code_image", "provider_binding_digest", "capabilities", "activation_revision" ], "if": {"properties": {"schema_version": {"const": 1}}}, "then": {"required": ["floe_manifest_revision"]}, "else": {"not": {"required": ["floe_manifest_revision"]}}, "properties": { "apiVersion": {"const": "openlakeforge.io/v1alpha1"}, "kind": {"const": "ProjectActivation"}, "schema_version": {"enum": [1, 2]}, "deployment_profile": {"type": "string", "minLength": 1}, "provider": {"enum": ["local", "aws", "azure"]}, "stage": {"enum": ["dev", "uat", "prod"]}, "project_name": {"type": "string", "minLength": 1}, "distribution_version": {"type": "string", "minLength": 1}, "project_code_image": {"type": "string", "pattern": "@sha256:[0-9a-f]{64}$"}, "project_revision": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}, "floe_manifest_revision": { "description": "Schema 1 only: the Floe manifests published for the stage before Floe 0.8 built them in memory.", "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }, "provider_binding_digest": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}, "activation_revision": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}, "capabilities": { "type": "object", "additionalProperties": false, "properties": {"analytics": {"type": "boolean"}, "governance": {"type": "boolean"}} } } } ``` --- # JSON Schema: OpenLakeForge Project Revision (`project-revision.schema.json`) ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://openlakeforge.io/schemas/project-revision/v1alpha1", "title": "OpenLakeForge Project Revision", "type": "object", "additionalProperties": false, "required": [ "apiVersion", "kind", "schema_version", "project_name", "distribution_version", "project_code_image", "components", "revision" ], "if": {"properties": {"schema_version": {"const": 3}}}, "then": {"required": ["runtime_contract_version"]}, "else": {"not": {"required": ["runtime_contract_version"]}}, "properties": { "apiVersion": {"const": "openlakeforge.io/v1alpha1"}, "kind": {"const": "ProjectRevision"}, "schema_version": {"enum": [1, 2, 3]}, "runtime_contract_version": {"type": "integer", "minimum": 1}, "project_name": {"type": "string", "minLength": 1}, "distribution_version": {"type": "string", "minLength": 1}, "project_code_image": {"type": "string", "pattern": "@sha256:[0-9a-f]{64}$"}, "components": { "type": "array", "minItems": 1, "items": {"$ref": "#/$defs/component"} }, "revision": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"} }, "$defs": { "component": { "type": "object", "additionalProperties": false, "required": ["name", "entries"], "properties": { "name": { "enum": ["descriptors", "floe", "dbt", "dagster", "reports", "image", "distribution"] }, "entries": { "type": "object", "additionalProperties": {"type": "string", "minLength": 1} } } } } } ``` --- # JSON Schema: OpenLakeForge Provider Contracts v3 (`provider-contracts.schema.json`) ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "OpenLakeForge Provider Contracts v3", "type": "object", "additionalProperties": false, "required": ["schema_version", "deployment", "shared", "stages"], "properties": { "schema_version": {"const": "3.0.0"}, "deployment": {"$ref": "#/definitions/deployment"}, "shared": {"$ref": "#/definitions/shared"}, "stages": { "type": "object", "minProperties": 1, "additionalProperties": false, "properties": { "dev": {"$ref": "#/definitions/stage"}, "uat": {"$ref": "#/definitions/stage"}, "prod": {"$ref": "#/definitions/stage"} } } }, "definitions": { "nonEmptyString": {"type": "string", "minLength": 1}, "binding": { "type": "object", "additionalProperties": false, "required": ["ref", "implementation"], "properties": { "ref": {"$ref": "#/definitions/nonEmptyString"}, "implementation": {"$ref": "#/definitions/nonEmptyString"}, "endpoint": {"$ref": "#/definitions/nonEmptyString"}, "bucket_name": {"$ref": "#/definitions/nonEmptyString"}, "artifact_base_uri": {"$ref": "#/definitions/nonEmptyString"}, "access_mode": {"$ref": "#/definitions/nonEmptyString"}, "local_upload_access_mode": {"$ref": "#/definitions/nonEmptyString"} } }, "artifactRegistryBinding": { "type": "object", "additionalProperties": false, "required": ["ref", "implementation"], "properties": { "ref": {"$ref": "#/definitions/nonEmptyString"}, "implementation": {"$ref": "#/definitions/nonEmptyString"}, "endpoint": {"$ref": "#/definitions/nonEmptyString"}, "bucket_name": {"$ref": "#/definitions/nonEmptyString"}, "artifact_base_uri": {"$ref": "#/definitions/nonEmptyString"}, "access_mode": {"$ref": "#/definitions/nonEmptyString"}, "local_upload_access_mode": {"$ref": "#/definitions/nonEmptyString"}, "image_repository": { "type": "string", "minLength": 1, "maxLength": 255, "description": "Provider-owned fallback repository, without a tag, digest or credentials. Explicit project repositories take precedence; Python validation enforces the repository grammar." } } }, "oidcClient": { "type": "object", "additionalProperties": false, "required": ["client_id", "secret_ref"], "properties": { "client_id": {"$ref": "#/definitions/nonEmptyString"}, "secret_ref": { "type": "object", "additionalProperties": false, "required": ["name", "key"], "properties": { "name": {"type": "string", "maxLength": 253, "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"}, "key": {"type": "string", "maxLength": 253, "pattern": "^[-._a-zA-Z0-9]+$", "not": {"enum": [".", ".."]}} } } } }, "oidcPublicClient": { "type": "object", "additionalProperties": false, "required": ["client_id"], "properties": { "client_id": {"$ref": "#/definitions/nonEmptyString"} } }, "identityBinding": { "type": "object", "additionalProperties": false, "required": ["ref", "implementation", "roles"], "if": {"properties": {"implementation": {"const": "identity.oidc"}}}, "then": {"required": ["issuer_url", "role_claim", "role_mapping", "clients"]}, "else": {"not": {"anyOf": [ {"required": ["adapter"]}, {"required": ["capabilities"]}, {"required": ["issuer_url"]}, {"required": ["internal_url"]}, {"required": ["role_claim"]}, {"required": ["role_mapping"]}, {"required": ["clients"]} ]}}, "properties": { "ref": {"$ref": "#/definitions/nonEmptyString"}, "implementation": {"$ref": "#/definitions/nonEmptyString"}, "adapter": {"$ref": "#/definitions/nonEmptyString", "description": "Provenance only for consumers; the validator requires \"dex\" when the profile selects github to correlate profile and binding. External profiles do not need it."}, "capabilities": { "type": "object", "additionalProperties": false, "properties": { "email_delivery": {"type": "boolean"}, "groups_in_token": {"type": "boolean"}, "logout_endpoint": {"type": "boolean"} } }, "issuer_url": {"type": "string", "pattern": "^https?://", "description": "Loose check; the olf Python validator (_oidc_issuer_url) is the authority, and allows http only with tls_mode none."}, "internal_url": {"type": ["string", "null"], "pattern": "^https?://", "description": "Base URL of a deployed issuer's in-cluster Service. In-cluster consumers fetch keys and redeem codes here and compare the token's iss with issuer_url as a string. Absent or null for an external issuer."}, "role_claim": {"$ref": "#/definitions/nonEmptyString"}, "role_mapping": { "type": "object", "minProperties": 1, "additionalProperties": { "type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/definitions/nonEmptyString"} } }, "clients": { "type": "object", "additionalProperties": false, "required": ["perimeter", "superset", "openmetadata", "olf-cli"], "properties": { "perimeter": {"$ref": "#/definitions/oidcClient"}, "superset": {"$ref": "#/definitions/oidcClient"}, "openmetadata": {"$ref": "#/definitions/oidcClient"}, "olf-cli": {"$ref": "#/definitions/oidcPublicClient"} } }, "roles": { "type": "object", "additionalProperties": false, "required": ["precedence", "grants", "data_access"], "properties": { "precedence": { "type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/definitions/nonEmptyString"} }, "grants": { "type": "object", "propertyNames": {"enum": ["orchestration", "reporting", "governance_service", "query", "query_api"]}, "additionalProperties": { "type": "object", "minProperties": 1, "additionalProperties": {"$ref": "#/definitions/nonEmptyString"} } }, "data_access": { "type": "object", "additionalProperties": { "type": "object", "propertyNames": {"enum": ["dev", "uat", "prod"]}, "additionalProperties": { "type": "object", "minProperties": 1, "propertyNames": {"enum": ["silver", "gold"]}, "additionalProperties": {"enum": ["read", "write"]} } } } } } } }, "accessBinding": { "type": "object", "additionalProperties": false, "required": ["ref", "implementation"], "dependentRequired": { "base_domain": ["tls_mode", "routes"], "tls": ["base_domain"], "issuer": ["base_domain"], "tls_mode": ["base_domain"], "routes": ["base_domain"] }, "if": {"properties": {"implementation": {"const": "access.ingress"}}}, "then": {"required": ["base_domain", "tls_mode", "routes"], "oneOf": [{"required": ["tls"]}, {"required": ["issuer"]}]}, "properties": { "ref": {"$ref": "#/definitions/nonEmptyString"}, "implementation": {"$ref": "#/definitions/nonEmptyString"}, "base_domain": {"$ref": "#/definitions/nonEmptyString"}, "tls": {"enum": ["none", "local-ca", "external"]}, "issuer": {"$ref": "#/definitions/nonEmptyString", "description": "v1alpha1 name of `tls`, read for contracts already in state."}, "tls_mode": {"enum": ["ingress-terminated", "edge-terminated", "none"]}, "perimeter": { "type": "object", "additionalProperties": false, "required": ["implementation", "enabled", "protected_routes", "callback_url"], "properties": { "implementation": {"$ref": "#/definitions/nonEmptyString"}, "enabled": {"type": "boolean"}, "protected_routes": {"type": "array", "uniqueItems": true, "items": {"$ref": "#/definitions/nonEmptyString"}}, "callback_url": {"type": "string", "pattern": "^https?://"} } }, "routes": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "required": ["url", "enabled", "exposure"], "properties": { "url": {"type": "string", "pattern": "^https?://"}, "enabled": {"type": "boolean"}, "exposure": {"enum": ["user-facing", "internal"]} } } } } }, "deployment": { "type": "object", "additionalProperties": false, "required": ["profile_name", "provider", "region"], "properties": { "profile_name": {"$ref": "#/definitions/nonEmptyString"}, "provider": {"enum": ["local", "aws", "azure"]}, "region": {"type": ["string", "null"]} } }, "shared": { "type": "object", "additionalProperties": false, "required": [ "foundation", "kubernetes_platform", "metadata_database", "query", "artifact_registry", "ops_storage", "secrets", "identity", "access", "observability" ], "properties": { "foundation": {"$ref": "#/definitions/binding"}, "kubernetes_platform": {"$ref": "#/definitions/binding"}, "metadata_database": {"$ref": "#/definitions/binding"}, "query": {"$ref": "#/definitions/binding"}, "artifact_registry": {"$ref": "#/definitions/artifactRegistryBinding"}, "ops_storage": {"$ref": "#/definitions/binding"}, "secrets": {"$ref": "#/definitions/binding"}, "identity": {"$ref": "#/definitions/identityBinding"}, "access": {"$ref": "#/definitions/accessBinding"}, "observability": {"$ref": "#/definitions/binding"}, "catalog_service": {"$ref": "#/definitions/binding"}, "governance_service": {"$ref": "#/definitions/binding"}, "portal": {"$ref": "#/definitions/binding"} } }, "layerStorage": { "type": "object", "additionalProperties": false, "required": ["physical_id", "bucket_name", "uri"], "properties": { "physical_id": {"$ref": "#/definitions/nonEmptyString"}, "bucket_name": {"$ref": "#/definitions/nonEmptyString"}, "uri": {"type": "string"} } }, "storage": { "type": "object", "additionalProperties": false, "required": [ "provider", "implementation", "protocol", "region", "identity_ref", "bronze", "silver", "gold" ], "properties": { "provider": {"enum": ["local", "aws", "azure"]}, "implementation": {"$ref": "#/definitions/nonEmptyString"}, "protocol": {"$ref": "#/definitions/nonEmptyString"}, "region": {"$ref": "#/definitions/nonEmptyString"}, "identity_ref": {"$ref": "#/definitions/nonEmptyString"}, "endpoint": {"type": "string"}, "virtual_host_endpoint": {"type": "string"}, "path_style_access": {"type": "boolean"}, "ssl_mode": {"$ref": "#/definitions/nonEmptyString"}, "credentials_secret_name": {"type": "string"}, "access_key_id_key": {"type": "string"}, "secret_access_key_key": {"type": "string"}, "s3_service_name": {"type": "string"}, "s3_service_port": {"type": ["integer", "string"]}, "sts_endpoint": {"type": "string"}, "bronze": {"$ref": "#/definitions/layerStorage"}, "silver": {"$ref": "#/definitions/layerStorage"}, "gold": {"$ref": "#/definitions/layerStorage"} } }, "catalog": { "type": "object", "additionalProperties": false, "required": [ "logical_name", "implementation", "catalog_type", "catalog_provider", "catalog_name", "runtime_profile", "physical_id" ], "properties": { "logical_name": {"$ref": "#/definitions/nonEmptyString"}, "implementation": {"$ref": "#/definitions/nonEmptyString"}, "catalog_type": {"enum": ["rest", "glue"]}, "catalog_provider": {"enum": ["polaris", "aws-glue"]}, "catalog_name": {"$ref": "#/definitions/nonEmptyString"}, "runtime_profile": {"$ref": "#/definitions/nonEmptyString"}, "physical_id": {"$ref": "#/definitions/nonEmptyString"}, "service_ref": {"$ref": "#/definitions/nonEmptyString"}, "warehouse": {"type": "string"}, "rest_uri": {"type": "string"}, "token_uri": {"type": "string"}, "oauth_scope": {"type": "string"}, "glue_region": {"type": "string"}, "glue_catalog_id": {"type": "string"}, "glue_rest_uri": {"type": "string"}, "glue_rest_warehouse": {"type": "string"}, "glue_warehouse_prefix": {"type": "string"}, "catalog_namespace_model": {"type": "string"}, "floe_credentials_secret_name": {"type": "string"}, "floe_client_id_key": {"type": "string"}, "floe_client_secret_key": {"type": "string"}, "deployer_credentials_secret_name": {"type": "string"}, "deployer_client_id_key": {"type": "string"}, "deployer_client_secret_key": {"type": "string"} } }, "query": { "type": "object", "additionalProperties": false, "required": ["service_ref", "catalog_ref", "catalog_name", "endpoint", "runtime_identity_ref"], "properties": { "service_ref": {"$ref": "#/definitions/nonEmptyString"}, "catalog_ref": {"$ref": "#/definitions/nonEmptyString"}, "catalog_name": {"$ref": "#/definitions/nonEmptyString"}, "endpoint": {"$ref": "#/definitions/nonEmptyString"}, "runtime_identity_ref": {"$ref": "#/definitions/nonEmptyString"} } }, "serviceBinding": { "type": "object", "additionalProperties": false, "required": ["service_ref", "endpoint_ref"], "properties": { "service_ref": {"$ref": "#/definitions/nonEmptyString"}, "endpoint_ref": {"$ref": "#/definitions/nonEmptyString"} } }, "orchestrationBinding": { "type": "object", "additionalProperties": false, "required": ["service_ref", "endpoint_ref"], "properties": { "service_ref": {"$ref": "#/definitions/nonEmptyString"}, "endpoint_ref": {"$ref": "#/definitions/nonEmptyString"}, "pipeline_service_name": {"$ref": "#/definitions/nonEmptyString"}, "code_locations": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["name", "definitions_module"], "properties": { "name": {"$ref": "#/definitions/nonEmptyString"}, "definitions_module": {"$ref": "#/definitions/nonEmptyString"} } } } } }, "reportingBinding": { "type": "object", "additionalProperties": false, "required": ["service_ref", "endpoint_ref"], "properties": { "service_ref": {"$ref": "#/definitions/nonEmptyString"}, "endpoint_ref": {"$ref": "#/definitions/nonEmptyString"}, "dashboard_service_name": {"$ref": "#/definitions/nonEmptyString"} } }, "stage": { "type": "object", "additionalProperties": false, "required": [ "namespace", "storage", "catalog", "query", "orchestration", "activation", "endpoints", "runtime_identity" ], "properties": { "namespace": {"$ref": "#/definitions/nonEmptyString"}, "storage": {"$ref": "#/definitions/storage"}, "catalog": {"$ref": "#/definitions/catalog"}, "query": {"$ref": "#/definitions/query"}, "orchestration": {"$ref": "#/definitions/orchestrationBinding"}, "reporting": {"$ref": "#/definitions/reportingBinding"}, "governance": {"$ref": "#/definitions/serviceBinding"}, "activation": { "type": "object", "additionalProperties": false, "required": ["ops_storage_ref", "prefix"], "properties": { "ops_storage_ref": {"$ref": "#/definitions/nonEmptyString"}, "prefix": {"$ref": "#/definitions/nonEmptyString"} } }, "endpoints": { "type": "object", "additionalProperties": false, "required": ["catalog", "query", "orchestration"], "properties": { "catalog": {"$ref": "#/definitions/nonEmptyString"}, "query": {"$ref": "#/definitions/nonEmptyString"}, "orchestration": {"$ref": "#/definitions/nonEmptyString"}, "reporting": {"$ref": "#/definitions/nonEmptyString"}, "governance": {"$ref": "#/definitions/nonEmptyString"} } }, "runtime_identity": { "type": "object", "additionalProperties": false, "required": ["ref", "principal"], "properties": { "ref": {"$ref": "#/definitions/nonEmptyString"}, "principal": {"$ref": "#/definitions/nonEmptyString"} } } } } } } ``` --- # JSON Schema: OpenLakeForge Source (`source.schema.json`) ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://openlakeforge.io/schemas/source/v1beta1", "title": "OpenLakeForge Source", "type": "object", "additionalProperties": false, "required": ["apiVersion", "kind", "name", "displayName", "description", "status", "resources"], "properties": { "apiVersion": {"const": "openlakeforge.io/v1beta1"}, "kind": {"const": "Source"}, "name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "displayName": {"type": "string", "minLength": 1}, "description": {"type": "string"}, "status": {"type": "string", "minLength": 1}, "resources": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["name"], "properties": { "name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "description": {"type": "string"}, "load": { "description": "How a run extracts the resource. 'full' (the default) replaces the Bronze files on every run; 'incremental' appends the rows past the cursor's last value, and Silver merges them on primary_key.", "type": "object", "additionalProperties": false, "required": ["mode"], "properties": { "mode": {"enum": ["full", "incremental"]}, "cursor": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "primary_key": { "type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"} } }, "if": {"properties": {"mode": {"const": "incremental"}}}, "then": {"required": ["cursor", "primary_key"]}, "else": {"not": {"required": ["cursor"]}} } } } }, "runtime": { "description": "Names of the settings and credentials the source's loader reads. Each stage binds the values in its own ConfigMap and Secret; never put a value here.", "type": "object", "additionalProperties": false, "properties": { "config": {"type": "array", "uniqueItems": true, "items": {"type": "string", "pattern": "^[a-z][a-z0-9]*(_[a-z0-9]+)*$"}}, "secrets": {"type": "array", "uniqueItems": true, "items": {"type": "string", "pattern": "^[a-z][a-z0-9]*(_[a-z0-9]+)*$"}} } } } } ```