# 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.5.0-alpha.1`. --- # OpenLakeForge documentation > OpenLakeForge is an open-source, self-hosted lakehouse for small data teams. These pages show how to install it, build data products on it, and deploy it to… Source: https://openlakeforge.dev/docs/ OpenLakeForge is an open-source, self-hosted lakehouse for small data teams. 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/) | | 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/) | | 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.5.0-alpha.1/AGENTS.md). Maintainer material such as the [architecture decision records](https://openlakeforge.dev/docs/adr/) stays in the repository. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/README.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/README.md). --- # Introduction > OpenLakeForge is an open-source, self-hosted lakehouse for small data teams. This page says what it assembles, who it is for, and what you take on when you… Source: https://openlakeforge.dev/docs/get-started/introduction/ OpenLakeForge is an open-source, self-hosted lakehouse for small data teams. 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 A small team that wants a working batch lakehouse without first building the platform. 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 | | --- | --- | | A small team that wants a batch lakehouse without building the platform first | Streaming workloads: v1 is batch-first | | Keeping data on your own Kubernetes, storage and cloud account | Production-critical use: the project is alpha | | Moving the same project between a laptop, AWS and Azure | Teams that want a fully managed SaaS | ## 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 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 status`, `olf diagnostics collect`, `olf e2e run` | Backups, restore drills and monitoring 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.5.0-alpha.1` (`1598142`), [docs/get-started/introduction.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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)) | 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.5.0a1" --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 deploy --provider local ``` `olf 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 status --provider local ``` 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` / `admin` login, which `olf status` shows. 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 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 query "SELECT * FROM order_revenue_gold.mart_order_revenue_by_day LIMIT 10" ``` ## Tear down ```bash olf destroy --provider local ``` ## 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.5.0-alpha.1` (`1598142`), [docs/get-started/quickstart.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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/lakehouse.yaml` 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 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 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.5.0-alpha.1` (`1598142`), [docs/get-started/concepts.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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 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 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.5.0-alpha.1` (`1598142`), [docs/tutorial/01-tour-the-platform.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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//` | 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 Bronze namespace `marketing_platform_bronze`, 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. Added 'marketing_platform' to lakehouse_code/lakehouse.yaml sources. ``` 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/v1alpha3 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/lakehouse.yaml` 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.5.0-alpha.1` (`1598142`), [docs/tutorial/02-ingest-a-source.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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/lakehouse.yaml`, with the Silver table `campaigns` mapped to `marketing_platform/campaigns`, and creates: ```text lakehouse_code/silver/marketing/ ├── __init__.py ├── README.md └── contracts/ └── floe/ └── marketing.yml ``` ## 2. Read the contract `marketing.yml` is the Floe contract of the domain. Besides the storage definitions, it holds one entity per Silver table. This is the `campaigns` entity, with its columns inferred from the CSV you wrote in lesson 2: ```yaml entities: - name: "campaigns" incremental_mode: "none" source: format: "csv" path: "marketing_platform/campaigns" storage: "lakehouse_bronze" cast_mode: "strict" sink: write_mode: "overwrite" accepted: format: "iceberg" path: "marketing/campaigns" storage: "lakehouse_silver" iceberg: { catalog: "iceberg_catalog", namespace: "marketing_silver", table: "campaigns" } rejected: { format: "csv", path: "floe/rejected/marketing/campaigns", storage: "lakehouse_silver" } policy: { severity: "reject" } 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 } ``` The entity file also sets CSV read options and snake_case column normalization, omitted here. Four parts matter: - **Source and cast mode.** Floe reads the CSV that 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, and a domain has exactly one Floe contract. - **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 Floe turns this contract into a runner manifest during `olf deploy`. The manifest is generated: never edit it by hand. ::: ## Check it worked ```bash olf floe generate-manifests ``` It validates each domain's contract and generates its manifest. It prints one `Generated` line per domain, including: ```text ==> Generated .../manifests/marketing/marketing.manifest.json ``` ## What you learned - `olf domain new` declares the Silver namespace and writes its Floe contract in one step, 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.5.0-alpha.1` (`1598142`), [docs/tutorial/03-validate-into-silver.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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/lakehouse.yaml` and creates: ```text lakehouse_code/ ├── gold/campaign_performance/ │ ├── __init__.py │ └── dbt/ │ ├── dbt_project.yml │ ├── packages.yml │ └── models/ │ ├── sources.yml │ └── gold/ │ ├── mart_campaign_performance.sql │ └── schema.yml └── pipelines/dagster/campaign_performance.py ``` ## 2. Know the generated dbt project 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 renders the dbt `profiles.yml` for each environment. - `packages.yml` pulls in the shared OpenLakeForge dbt package from `libs/`. - `models/sources.yml` declares the Silver table as a dbt source, in the `marketing_silver` schema. 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 has 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/campaign_performance/dbt/models/gold/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('silver', '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: ```bash cat > lakehouse_code/gold/campaign_performance/dbt/models/gold/schema.yml <<'YAML' version: 2 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 deploy --provider local --phase artifacts ``` It reconciles the catalog namespaces, generates the Floe manifests, builds the project-code image, loads it into the cluster and restarts the Dagster code location. The namespaces `marketing_platform_bronze`, `marketing_silver` and `campaign_performance_gold` are created for you; no Terraform change is needed. ## Check it worked ```bash olf 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 query` runs SQL against the DEV stage's catalog, so a table is named `.
`: ```bash olf 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. ## What you learned - `olf product new` creates a product-owned dbt project and a Dagster module and registers the product in `lakehouse.yaml`. - `olf query` reads any Silver or Gold table of a stage from your machine. - Gold is plain SQL over declared Silver sources; tests run as part of the build. - `olf 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.5.0-alpha.1` (`1598142`), [docs/tutorial/04-model-gold-with-dbt.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 libs.product_dagster import ProductDefinitionSpec, build_product_definitions CAMPAIGN_PERFORMANCE_SILVER_INPUTS = ("campaigns",) CAMPAIGN_PERFORMANCE_GOLD_ASSETS = ("mart_campaign_performance",) defs = build_product_definitions( ProductDefinitionSpec( domain="marketing", product="campaign_performance", silver_inputs=CAMPAIGN_PERFORMANCE_SILVER_INPUTS, bronze_inputs=(("marketing_platform", "campaigns"),), gold_assets=CAMPAIGN_PERFORMANCE_GOLD_ASSETS, ) ) ``` `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 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 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.5.0-alpha.1` (`1598142`), [docs/tutorial/05-orchestrate-and-schedule.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 deploy --provider local ``` `olf 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 report export` does for the stage you authored in: ```bash SUPERSET_REPORT_SOURCE_DIR=lakehouse_code/dashboards/superset/sales_customer_health \ olf report export --stage dev ``` `SUPERSET_REPORT_SOURCE_DIR` picks the bundle; without it the command exports the first dashboard declared in `lakehouse.yaml`. 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 bundle only exists as a promotable report once `lakehouse.yaml` declares it and the products it reads: ```yaml dashboards: - name: sales_customer_health products: [customer_health] ``` One dashboard can consume several products. The next `olf deploy` (or `olf report import`) imports the bundle into Superset, and `olf 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 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 declared in `lakehouse.yaml` with the products they read. - `olf report export` pulls UI edits into git; `olf report import` and `olf 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.5.0-alpha.1` (`1598142`), [docs/tutorial/06-publish-a-dashboard.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 with the local development credentials `admin@open-metadata.org` / `admin`. ## 2. Find the domain and data product You wrote no OpenMetadata configuration. The artifacts phase of `olf deploy` reads `lakehouse_code/lakehouse.yaml` and creates: | lakehouse.yaml | 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 `lakehouse.yaml`. To change either, edit that file and run `olf 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 e2e run --env local --suite full ``` With the Full preset the suite also checks OpenMetadata: it requires every domain and data product from `lakehouse.yaml`, 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 `lakehouse.yaml`: 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.5.0-alpha.1` (`1598142`), [docs/tutorial/07-govern-and-trace-lineage.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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: issuer: 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 destroy --provider local olf 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 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 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` (`issuer: 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, declare `spec.access` without an issuer, so the platform uses its own CA: ```yaml spec: access: {} ``` Run `olf deploy --provider local` again, then trust the CA in your browser: ```bash olf access trust ``` It writes the CA certificate and prints the commands for your platform. Skip it and the browser warns on every host. Trino's workload authentication follows `spec.access`: with the block declared, as here, Superset, dbt and OpenMetadata ingestion authenticate to Trino with their own passwords (`trino_workload_authentication` defaults to `password`); without it, it defaults to `off`. The Trino UI sign-in follows the scheme: on plain HTTP the UI opens as a fixed user behind the perimeter, and on HTTPS it signs in through Dex. The GitHub App records the callback URL for the scheme it was created with. After switching scheme, run `olf 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 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 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; `spec.access: {}` with `olf 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.5.0-alpha.1` (`1598142`), [docs/tutorial/08-sign-in-with-github.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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 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 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 project deploy -f openlakeforge.yaml --stage dev --revision "$REVISION" olf e2e run --env local -f openlakeforge.yaml --stage dev --suite full ``` Only when DEV passes, activate the same revision in PROD: ```bash olf 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 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 project image`, then `olf project build`; outputs `image` and `revision` | | `OpenLakeForge/openlakeforge/.github/actions/deploy-stage` | `olf project deploy --stage --revision `, fails unless `olf project status` records exactly ``, and optionally runs `olf 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 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 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.5.0-alpha.1` (`1598142`), [docs/tutorial/09-add-prod-and-promote.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 forward`, and an `access:` block would require `identity:`. ```bash olf profile validate --project . ``` ## 2. Authenticate ```bash olf 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 deploy --provider aws --phase foundation # VPC, EKS, ECR, IAM olf deploy --provider aws --phase platform # S3, Glue, RDS, Trino, Dagster, Superset, OpenMetadata olf 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 forward --provider aws ``` ## Check it worked Stop `olf forward` first: run one `olf` command at a time. ```bash olf 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 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 forward`, and `olf 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.5.0-alpha.1` (`1598142`), [docs/tutorial/10-deploy-to-the-cloud.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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`. ### 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.5.0a1" --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.5.0a1" ``` 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 deploy --provider local ``` The first deploy takes several minutes while images download. `olf 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 deploy --provider local` 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 status --provider local ``` 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 | `http://trino.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` / `admin`. 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 `olf init` writes `spec.access.issuer: none`, which serves plain HTTP. To serve HTTPS from a local certificate authority (CA), remove the `issuer` line so it takes its default, `local-ca`, and deploy again: ```yaml spec: access: {} ``` `olf deploy` creates the CA once, in the cluster. Your browser rejects the routes until it trusts that CA. Export it and print the trust commands for your system: ```bash olf 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 forward` port-forwards every service to fixed ports on `localhost` until you press Ctrl-C: ```bash olf forward --provider local ``` | 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 e2e run`, port-forward instead of using the ingress, for example while you debug it. ## Tear down ```bash olf destroy --provider local ``` 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 deploy` rebuilds the same platform from them. With HTTPS, a rebuilt cluster has a new CA: run `olf access trust` again. | To remove | Run | | --- | --- | | Only the platform, keeping the cluster | `olf destroy --provider local --phase platform` | | Only the cluster, after the platform | `olf destroy --provider local --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 deploy --provider local --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 deploy --provider local ``` The contributor workflow and its gates are in [AGENTS.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.5.0-alpha.1/AGENTS.md). ## Check it worked ```bash olf 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.5.0-alpha.1` (`1598142`), [docs/guides/local-installation.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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//` | dbt-trino | | Dashboards | A dashboard | `lakehouse_code/dashboards/superset//` | Superset | `lakehouse_code/lakehouse.yaml` declares the sources, domains, products and dashboards; each source also has a `source.yaml`. 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 | | --- | --- | --- | | Bronze namespace `_bronze` | `marketing_platform_bronze` | Every product reading the source | | 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/`, and adds the source to `lakehouse.yaml`. 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. dlt can extract from APIs and databases, and Floe reads Parquet, JSON, Avro and other formats; scaffolding for those sources is tracked in [#110](https://github.com/OpenLakeForge/openlakeforge/issues/110). ::: ## 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 an entity in the domain's Floe contract, `silver/marketing/contracts/floe/marketing.yml`. The contract declares column types, a primary key and a rejected-rows path; every column starts as `nullable: false`, so loosen a column by hand when a value may be empty. A domain has exactly one Floe contract: never add a second one. `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 a dbt project under `gold/campaign_performance/dbt/` and a Dagster module `pipelines/dagster/campaign_performance.py`, and registers the product in `lakehouse.yaml`. Dagster loads every module in that directory by itself. The generated model `models/gold/mart_campaign_performance.sql` selects everything from the first Silver input. Replace it with your SQL, reading Silver through `{{ source('silver', '
') }}`, and describe and test it in `models/gold/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 | | --- | --- | | `lakehouse.yaml` | A `silver_tables` entry `{name: ad_groups, source: marketing_platform, resource: ad_groups}` under the domain, and `ad_groups` in the product's `silver_inputs` | | `silver/marketing/contracts/floe/marketing.yml` | An `ad_groups` entity, copied from an existing one | | `gold//dbt/models/sources.yml` | `- name: ad_groups` under the `silver` source | | `pipelines/dagster/.py` | `"ad_groups"` in the Silver inputs tuple and `("marketing_platform", "ad_groups")` in `bronze_inputs` | | `gold//dbt/models/gold/.sql` | A read of `{{ source('silver', 'ad_groups') }}` | ## Add a Gold model to an existing product 1. Add `models/gold/.sql` and describe it in `models/gold/schema.yml`. 2. Declare it under the product's `gold_tables.tables` in `lakehouse.yaml`. 3. Add its name to the Gold assets tuple in `pipelines/dagster/.py`: ```python CAMPAIGN_PERFORMANCE_GOLD_ASSETS = ( "mart_campaign_performance", "mart_campaign_daily", ) ``` ## Remove a product Delete its entry from `lakehouse.yaml`, its `gold//` directory 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, undeclared resources | | `olf check project-code` | The whole inventory loads in Dagster, including references between descriptors | | `olf check dbt` | Every product's dbt project compiles | | `olf floe generate-manifests` | Every domain's Floe contract is valid | Then deploy only the artifacts phase, which covers everything derived from `lakehouse_code/`: ```bash olf deploy --provider local --phase artifacts ``` It reconciles the catalog namespaces, generates the Floe manifests (never edit them by hand), builds the project-code image and restarts Dagster's code location. ## Check it worked Launch `campaign_performance_pipeline` in Dagster, then query the mart: ```bash olf query "SELECT * FROM campaign_performance_gold.mart_campaign_performance" ``` `olf e2e run --env local --suite full` also covers the new product, because it discovers products from `lakehouse.yaml`. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/guides/data-products.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/guides/data-products.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/, declare it in… 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/`, declare it in `lakehouse.yaml`, 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 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 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 bundle is promotable only when `lakehouse.yaml` declares it and the products it reads. One dashboard can read several products: ```yaml dashboards: - name: sales_customer_health products: [customer_health] ``` 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` and no `dashboards:` entry, so the draft is neither declared nor 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 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 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 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 declared in `lakehouse.yaml`. - 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` and `SUPERSET_ADMIN_PASSWORD` default to `admin` and `admin`. 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. Then declare the new dashboard in `lakehouse.yaml`, next to the demo ones: ```yaml dashboards: - name: campaign_summary products: [campaign_summary] ``` ## 5. Import a bundle The next `olf deploy` imports every bundle. To import without a full deploy: ```bash olf report import --stage dev ``` `olf 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` declared, it prints: ```text 4 report bundle(s) are promotable. ``` Pass a dashboard name to check only that one. Without a name, the command also fails when a bundle directory is not declared in `lakehouse.yaml`. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/guides/dashboards-as-code.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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, ECR repositories, 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 auth login --provider aws --profile ` | | IAM Identity Center (SSO) | `olf 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 auth login --provider aws` reuses the `default` profile, or asks for the start URL. Check which identity `olf` will use: ```bash olf 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 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 e2e run` and `olf 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 deploy --provider aws ``` 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, ECR repositories, 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 forward --provider aws ``` Run the end-to-end suite after you stop `olf forward`: `olf` runs one command at a time, and the suite opens its own port-forwards. ```bash olf 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 destroy --provider aws ``` 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 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 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 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 auth login --provider aws`, then `olf 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 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.5.0-alpha.1` (`1598142`), [docs/guides/cloud/deploy-to-aws.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 auth login --provider azure` reuses it when the `az` CLI is installed | | Browser sign-in | `olf 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 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 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 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 deploy --provider azure ``` 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` | Pushes the Superset image, then 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 forward --provider azure ``` Run the end-to-end suite after you stop `olf forward`: `olf` runs one command at a time, and the suite opens its own port-forwards. ```bash olf 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 destroy --provider azure ``` 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 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 destroy` finishes. ## Troubleshooting | Symptom | Fix | | --- | --- | | `Azure is not authenticated` | Run `olf auth login --provider azure`, then `olf 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.5.0-alpha.1` (`1598142`), [docs/guides/cloud/deploy-to-azure.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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: issuer: 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 deploy --provider local ``` In an interactive terminal, `olf 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 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 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 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 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 `issuer: none` | | Authorization callback URL | `https://auth.olf.localhost/callback`, or `http://auth.olf.localhost/callback` with `issuer: 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 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 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 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 deploy` stops on a missing Secret | Run `olf 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.5.0-alpha.1` (`1598142`), [docs/guides/identity/connect-github.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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.5.0-alpha.1` (`1598142`), [docs/guides/identity/map-teams-to-roles.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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.5.0-alpha.1` (`1598142`), [docs/guides/identity/manage-members.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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: issuer: 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 four OIDC clients in your issuer: `perimeter`, `superset`, `openmetadata` and `trino`, 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 four, so create all four; 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: {issuer: 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 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 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`, `openmetadata` and `trino`. ## 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, and the Trino UI's OAuth2 sign-in is not set up (it is Dex only). 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 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.5.0-alpha.1` (`1598142`), [docs/guides/identity/external-issuer.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/guides/identity/external-issuer.md). --- # Rotate secrets > How to rotate the secrets sign-in depends on with olf 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 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 secrets rotate` ```bash olf 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 | | `dex-client-trino` | Trino's Dex client secret | `deployment/dex` and `deployment/trino-coordinator` | | `github-app` | Registers a new GitHub App through `olf 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 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 deploy` first. ### The GitHub App `olf 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 bootstrap 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 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 bootstrap 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 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.5.0-alpha.1` (`1598142`), [docs/guides/identity/rotate-secrets.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 break-glass` ```bash olf 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 Trino Service, bound to `127.0.0.1`. Over HTTPS when Trino serves it (the command prints the scheme): connect to `https://localhost:`, not `127.0.0.1`, because the certificate names `localhost` and has no IP address; verify with the local CA, see `olf access trust`. It is for diagnosis (for example `/v1/info`, or a client with its own password), not a web UI: with workload authentication on, the Trino UI signs in through Dex. | | `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 deploy` | Deploy all phases, or one with `--phase foundation`, `prefetch` (local), `platform` or `artifacts`. | | `olf destroy` | Tear down the platform, then the foundation; `--phase platform` or `foundation` for one. `--force` destroys the foundation with platform resources left. | | `olf status` | Service URLs, then pods, services and PVCs per namespace. `--json` for JSON. | | `olf forward` | Port-forward every service to `localhost` until Ctrl-C. | | `olf doctor` | Check the host, tools, project and cloud authentication without changing anything. | | `olf plan` | Show the Terraform plan of the foundation or platform. | | `olf query ""` | Run SQL against a stage's catalog (`--stage`, `--format table\|csv\|json`, `--file`). Local and Azure only. | | `olf access trust` | Export the local CA and print the commands to trust it. | | `olf github connect` | Create the GitHub App for sign-in and store its credentials. | | `olf auth login\|status\|logout --provider aws\|azure` | Authenticate to a cloud through its SDK. | | `olf 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` | `lakehouse.yaml` and every `source.yaml` | | `olf check dbt` | Every product's dbt project compiles | | `olf floe generate-manifests` | Every domain's Floe contract, and writes its manifest | | `olf report validate []` | Superset bundles are promotable | | `olf 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. | ## Stages and revisions | Command | Does | | --- | --- | | `olf platform apply -f openlakeforge.yaml` | Create the cluster, shared services and every enabled stage, without your code. | | `olf project image -f openlakeforge.yaml` | Build and push the project-code image; prints a digest-pinned reference. | | `olf project build --project . --image ` | Build and publish an immutable revision; prints its id. | | `olf project deploy -f openlakeforge.yaml --stage --revision ` | Activate a revision in a stage without rebuilding. | | `olf project status -f openlakeforge.yaml` | The revision active in each stage. | | `olf project revision inspect\|verify --revision ` | Read or verify a published revision. | | `olf report export --stage dev` | Export Superset dashboards into their bundles. | | `olf report import` | Import the bundles into a stage's Superset. | ## 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 and kubeconfigs | | `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/project-code`, `local` | Where `olf project image` pushes on the local provider | | `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 smoke run` and `olf release`, are described in [AGENTS.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.5.0-alpha.1/AGENTS.md) and [tools/olf/README.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.5.0-alpha.1/tools/olf/README.md). --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/reference/cli.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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/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/v1alpha1 kind: DeploymentProfile metadata: name: openlakeforge spec: provider: type: local preset: slim stages: dev: enabled: true prod: enabled: true access: base_domain: olf.localhost issuer: 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/v1alpha1`. | | `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.5.0-alpha.1/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. | --- ## `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. | ### `spec.provider` | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `type` | `local`, `aws` or `azure` | yes | The deployment target. `local` is a kind cluster on this machine. | | `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`). | ### `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.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. | `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. ### `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. | | `issuer` | string, `^[a-z](https://github.com/OpenLakeForge/openlakeforge/tree/v0.5.0-alpha.1/docs/reference/[a-z0-9-]{0,61}[a-z0-9])?$` | `local-ca` | The certificate issuer. The local provider ships only `local-ca` (a CA the platform creates) and `none`, which serves plain HTTP. | ### `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 `trino`; 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 four client Secrets the contract names, as described in ADR 0014. --- ## 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. | | 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 forward`. | | Plain HTTP is local-only | `spec.access.issuer` is `none` and the provider is not `local`, or `base_domain` does not end in `.localhost`. | | 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 deploy` also refuses a `spec.access.issuer` other than `local-ca` or `none` before it creates the cluster. :::note `olf init` writes a profile with `access: {issuer: 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.5.0-alpha.1` (`1598142`), [docs/reference/deployment-profile.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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` | A person refused a service sees an "Access is role-restricted" page. ## 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. On plain HTTP the UI opens as a fixed user behind the perimeter; on HTTPS it signs in through Dex. The roles do not change what a query may read: Trino's catalog access is decided by the service principals, not by the person (see [CLI and automation](#cli-and-automation)). ### 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`, CI and the pods of the platform are not people and hold no role. They authenticate with Kubernetes RBAC (your kubeconfig) or with a service credential from a Secret (to Trino, a password per principal: with `spec.access` declared, Trino workload authentication defaults to `password`, and to `off` without it), 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 browsers, not cluster access. `olf 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.5.0-alpha.1` (`1598142`), [docs/reference/roles-and-permissions.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/reference/roles-and-permissions.md). --- # Descriptor reference > The fields and rules of the two descriptors that declare a project's data: lakehouse_code/lakehouse.yaml, 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/lakehouse.yaml`, 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, [`lakehouse.schema.json`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.5.0-alpha.1/docs/schema/lakehouse.schema.json) and [`source.schema.json`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.5.0-alpha.1/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/v1alpha3 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/v1alpha3` | | `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. | A resource has no schema here: its columns belong to the Floe contract of each domain that reads it. ## `lakehouse.yaml` ```yaml apiVersion: openlakeforge.io/v1alpha3 kind: Lakehouse name: openlakeforge displayName: OpenLakeForge description: Example lakehouse. status: active sources: - marketing_platform domains: - name: marketing displayName: Marketing description: Marketing analytics data products. status: active silver_tables: tables: - name: campaigns source: marketing_platform resource: campaigns description: Validated campaign data. products: - id: campaign_performance displayName: Campaign Performance description: Campaign spend and conversion performance. status: active silver_inputs: - campaigns gold_tables: tables: - name: mart_campaign_performance description: Campaign performance aggregated by channel. dashboards: [] ``` ### Top level | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `apiVersion` | string | yes | `openlakeforge.io/v1alpha3` | | `kind` | string | yes | `Lakehouse` | | `name` | identifier | yes | The lakehouse's machine name. | | `displayName`, `description`, `status` | as for a source | yes | Metadata. | | `sources` | array of identifiers, at least one, unique | yes | Must match the `bronze/*/source.yaml` files on disk exactly. | | `domains` | array, at least one | yes | At least one domain in the lakehouse must declare a product. | | `dashboards` | array, may be empty | yes | Superset dashboards. | ### `domains[]` | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `name` | identifier | yes | Unique across the lakehouse. | | `displayName`, `description`, `status` | | yes | Metadata. | | `silver_tables.tables` | array, at least one, unique | yes | The domain's Silver tables. | | `silver_tables.tables[].name` | identifier | yes | Unique within the domain. | | `silver_tables.tables[].source` | identifier | yes | A source listed in `sources`. | | `silver_tables.tables[].resource` | identifier | yes | A resource that source declares. | | `silver_tables.tables[].description` | string | no | | | `products` | array, may be empty | yes | The domain's data products. | A domain may declare Silver tables before any product reads them; they still get their namespace and Floe assets. ### `domains[].products[]` | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `id` | identifier | yes | Unique across the whole lakehouse, not only the domain. | | `displayName`, `description`, `status` | | yes | Metadata. | | `domain` | string | no | If written, must equal the enclosing domain's `name`. | | `silver_inputs` | array of identifiers, at least one, unique | yes | Silver tables of this domain the product reads. | | `gold_tables.tables` | array, at least one, unique | yes | The Gold tables the product publishes. | | `gold_tables.tables[].name` | identifier | yes | Unique within the product. | | `gold_tables.tables[].description` | string | no | | A table must not carry `fqn` or `fullyQualifiedName`, and `gold_tables` must not carry `schema`: physical names would tie the descriptor to one provider. ### `dashboards[]` | Field | Type | Required | Meaning | | --- | --- | --- | --- | | `name` | identifier | yes | Unique; also the bundle directory under `dashboards/superset/`. | | `products` | array of identifiers, at least one, unique | yes | Declared product ids the dashboard reads. | ## Implementation files Each identity selects the files that implement it: | Identity | Files | | --- | --- | | Source `name` | `lakehouse_code/bronze//` | | Domain `name` | `lakehouse_code/silver//contracts/floe/.yml`, the domain's only Floe contract | | Product `id` | `lakehouse_code/gold//dbt/` and `lakehouse_code/pipelines/dagster/.py` | | Dashboard `name` | `lakehouse_code/dashboards/superset//` | ## Derived names For a `crm` source, a `sales` domain and an `order_revenue` product: | Name | Value | | --- | --- | | Bronze namespace | `crm_bronze` | | 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 manifest key | `floe/manifests/sales/sales.manifest.json` | | 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_`. 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 | | --- | --- | | Source list does not match discovered descriptors | `sources` lists a source with no `source.yaml`, or a `source.yaml` exists that `sources` does not list. | | 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`, even in different domains. | | Silver mapping names an undeclared resource | A Silver table maps to a resource its source does not declare. | | Empty table group | `silver_tables: {tables: []}`, a product without `silver_inputs`, or one without Gold tables. | | Physical name in a descriptor | `fullyQualifiedName` or `gold_tables.schema` is set. | `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 a `lakehouse.yaml` with empty `sources` and `domains`. Only the scaffolding commands accept it; every check and deploy needs at least one product. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/reference/descriptors.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/reference/descriptors.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.4.0 | yes | AWS Glue instead | yes | | [SeaweedFS](https://github.com/seaweedfs/seaweedfs) | S3-compatible object storage for Bronze, Silver, Gold and run artifacts | 4.23 | 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 | runner 0.6.11 (`FLOE_VERSION`), `dagster-floe` 0.2.5 | | [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 | | ## 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 `issuer: 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.` | always | | 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 forward`. On AWS and Azure every service is reached with `olf forward`. Which role may open each service is in [Roles and permissions](https://openlakeforge.dev/docs/reference/roles-and-permissions/). --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/reference/components.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/reference/components.md). --- # OpenLakeForge 0.5.0-alpha.1 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.5.0-alpha.1/docs/reference/component-catalog.md) for the update process. ## Platform | Component | Required version | | --- | --- | | Terraform | >= 1.10.0 | ## 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.4.1 | | seaweedfs | 4.23.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_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.4.0@sha256:ef4947a3fd005ca5b2aec2bde98682a59996d38f21c16c4660fbb79e4c20b40c` | | polaris_admin_tool | `apache/polaris-admin-tool:1.4.0@sha256:7ef7557b528964e792caeaef3908434bd99c7d2f994caa654da1d77c6b428a80` | | portal | `ghcr.io/openlakeforge/openlakeforge-portal:0.3.0@sha256:544523333c3cd83e0e73b281529e1c9ccc93b4eb87e8c0964b82211e219beae9` | | postgres | `postgres:16-alpine@sha256:57c72fd2a128e416c7fcc499958864df5301e940bca0a56f58fddf30ffc07777` | | project_code_base | `python:3.12-slim@sha256:57cd7c3a7a273101a6485ba99423ee568157882804b1124b4dd04266317710de` | | seaweedfs | `chrislusf/seaweedfs:4.23@sha256:c6d6fb84b081f1f09bb089184ff4b45d2f163a1bfa8b354d04cf400c6e06f242` | | superset_base | `apache/superset:6.1.0@sha256:fb3464528ec7076f91195f0ff7835755aa023e281f1bb78a84782ce7a36b3705` | | superset_init | `apache/superset:dockerize@sha256:afe59523a6c8774c3b16d0f44146b2e52f327a7d26a47b4cc63b904fcdedf057` | | superset_redis | `docker.io/bitnamilegacy/redis:7.0.10-debian-11-r4@sha256:224a79826b42869bdc72a70933efd840c5a5f10a70caafca68e57be6901e36fb` | | 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) | Polaris (in-cluster) | PostgreSQL (in-cluster) | | Azure POC | AKS | SeaweedFS (in-cluster) | Polaris (in-cluster) | PostgreSQL (in-cluster) | | AWS POC | EKS | S3 | AWS Glue | RDS PostgreSQL | ## Supported upgrade paths OpenLakeForge is in the Alpha lifecycle stage (see [releasing.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.5.0-alpha.1/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`. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/reference/compatibility-matrix.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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. Namespace `_bronze`. | | 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: `lakehouse.yaml` 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 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. | | Issuer (access) | `spec.access.issuer`: the certificate issuer for the routes. `local-ca` signs with a local CA; `none` serves plain HTTP. | | Issuer (identity) | `spec.identity.issuer`: the OIDC issuer, `github` or `external`. | | Lakehouse | The whole project as `lakehouse_code/lakehouse.yaml` describes it: sources, domains, products and dashboards. | | Medallion layers | Bronze, Silver and Gold: three layers, each owned by one tool. | | Namespace (catalog) | A single-level catalog schema: `_bronze`, `_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 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 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 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.5.0-alpha.1` (`1598142`), [docs/reference/glossary.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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; 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 | `_bronze` | | 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 Silver table, it starts a Floe job, one after another. Floe writes 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 and Floe pods 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 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, Floe manifests, 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 forward` | `olf 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 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.5.0-alpha.1/docs/architecture/README.md): provider contracts, Terraform roots and identity policy, for contributors. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/architecture/overview.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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. | **20** | **1+N** | **3** | **0** | | --- | --- | --- | --- | | pods at steady state — 14 Deployments, 6 StatefulSets | nested ephemeral Kubernetes Jobs per ingestion run — one run pod, one Floe Job per entity | 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 runner per entity — both TTL-collected within the hour, so the pipeline scales > to zero between runs. *Bootstrap*: for one full stage, six Terraform > `kubernetes_job_v1` resource blocks (two Polaris, two OpenMetadata, 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 eleven 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 — verified with `helm template` against this repo's own values.* Twenty pods run at steady state: Dagster runs three (webserver, daemon, and the merged `openlakeforge-dagster` code server loading `lakehouse_code.definitions`), SeaweedFS runs four (three StatefulSets and an S3-gateway Deployment), Superset runs three, OpenMetadata runs two, and PostgreSQL, Polaris, and Trino run one each. Trino is deliberately coordinator-only. 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. The purple band underneath is everything that is *not* in that 20, split by what creates it. **Per pipeline run**: the run pod and its Floe runners, 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 (metastore bootstrap and principal bootstrap), SeaweedFS (one Job per bucket, four buckets), PostgreSQL, OpenMetadata (bootstrap and credential replication to the governed stage), Superset's Helm hook, and cert-manager's startup API check hook — eleven 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 the **Floe** runner (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.5.0-alpha.1/docs/architecture/local-stack-contracts.md) · `infra/terraform/modules/**` ## Chart 3 — Ephemeral Job Lifecycle *Launch → run pod → one Floe Job per entity → Gold via Trino → everything garbage-collected.* The differentiating behavior: the Dagster run pod is itself an ephemeral Job, and it creates **one Floe runner Job per entity** — sequentially, from an image declared in the Floe manifest, not in the Dagster deployment — so a product with five entities (e.g. `order_revenue`) runs five distinct Floe Jobs over the course of one pipeline run, never concurrently. Ingestion upgrades without rebuilding the orchestrator image; failures isolate per entity; 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 entity in sequence to validate and commit 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 entity 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.5.0-alpha.1/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 Floe runner 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/lakehouse.yaml · 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.5.0-alpha.1/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 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 deploy --provider local --phase foundation` | Terraform: the Kubernetes cluster + container registry — kind locally, EKS + ECR on AWS, AKS + ACR on Azure | | 2 — Platform | `olf 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 deploy --provider local --phase artifacts` | **the CD phase** — dynamic artifacts: the project-code image (dbt code), Floe contracts + manifests, Superset dashboards, OpenMetadata data products | Phases 1 and 2 are static infrastructure that Terraform owns; phase 3 is dynamic and code-derived. `olf 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: load contract env → compile Floe manifests → build + load `project-code` → `olf artifacts upload-manifests` → `olf report import` → `olf openmetadata deploy-metadata` → `olf k8s set-project-code-image`, which patches the run-launcher ConfigMap, every Dagster deployment, and the log-archive CronJob to the new image before waiting on each rollout — not a bare `kubectl rollout restart`. 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 | | --- | --- | --- | | trino | `polaris-trino-creds` | data-engineer / catalog-admin | | floe | `polaris-floe-creds` | data-writer / catalog-writer | | openmetadata | `polaris-om-creds` | data-reader / catalog-reader | | (root) | `polaris-bootstrap-credentials` | bootstrap Job only | dbt has **no** Polaris principal — the bootstrap deletes the old `polaris-dbt-creds`; Gold SQL runs in Trino, so Gold catalog access uses `polaris-trino-creds`. 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/ ├── floe/manifests/{domain}/{domain}.manifest.json ← olf artifacts upload-manifests ├── floe/reports/{domain}/ ← ephemeral Floe runner 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 ``` Only the dbt run-artifacts are keyed by Dagster run ID (`run-artifacts/dbt/{domain}/ {product}/{dagster_run_id}/`), so those are isolable per run after the pod is gone. Floe's `report_base_uri` (set per manifest, e.g. `floe/reports/sales`) stops at the domain — successive runs overwrite the same prefix, since the runner's `base_args` carry no `--run-id`. The archived Kubernetes pod logs are partitioned only by namespace / date / hour (`libs/k8s_log_archive.py`), so isolating a single run from raw pod logs or from prior Floe reports 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/ ├── lakehouse.yaml ← 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// ← domain-owned │ └── contracts/floe/ │ ├── .yml ← contract: Bronze→Silver schema · PK · reject policy → Floe │ └── manifests/.manifest.json compiled, checksummed runner spec (baked + published) ├── gold// ← product-owned │ └── dbt/models/gold/*.sql · sources.yml · 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 catalog sync-namespaces` derives the Bronze, Silver, and Gold namespaces from `lakehouse.yaml` plus every `bronze/*/source.yaml` 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/lakehouse.yaml` 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.5.0-alpha.1/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.5.0-alpha.1/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.5.0-alpha.1` (`1598142`), [docs/architecture/diagrams.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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.5.0-alpha.1/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` 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 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. `olf` and CI are therefore class 2, with Kubernetes RBAC as their identity. The consequence is that 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.5.0-alpha.1/docs/architecture/identity/identity-sessions-and-recovery.md)) | | Operations | [Add, change or remove a member](https://openlakeforge.dev/docs/guides/identity/manage-members/) | ## 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 deploy`, `olf 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 | Callers authenticate to Trino with a password per principal over HTTPS when `trino_workload_authentication` is `password`. The local root defaults to `password` when the profile has `spec.access`, and to `off` otherwise ([ADR 0016](https://openlakeforge.dev/docs/adr/0016-trino-workload-authentication/)) | | Rotation | `olf secrets rotate` for `dex-client-perimeter`, `dex-client-trino` 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.5.0-alpha.1/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. Every Superset query reaches Trino as the stage's runtime principal, whatever the person's role. Per-user data access is deferred in [ADR 0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/). ## 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 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.5.0-alpha.1` (`1598142`), [docs/architecture/identity/identity-classes.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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. The deploy fails if the cluster does not enforce NetworkPolicy. 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. ## 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 break-glass` uses the operator's own kubeconfig ([identity-sessions-and-recovery.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.5.0-alpha.1/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.5.0-alpha.1/docs/architecture/identity/identity-callers.md), [identity-classes.md](https://openlakeforge.dev/docs/architecture/identity/identity-classes/). --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/architecture/identity/identity-network-policy-and-rbac.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/architecture/identity/identity-network-policy-and-rbac.md). --- # Architecture Decision Records > These nineteen 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 nineteen 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 v1alpha3 descriptor model** — `lakehouse.yaml` + `source.yaml`, one shared `openlakeforge-domain-model` implementation; v1alpha1/v1alpha2 removed | | [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 in its own manifest-driven runner | | [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 v1** — 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.issuer`; 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** — password-file authentication over HTTPS for Superset, dbt, OpenMetadata and `olf e2e`; `principals` rules bind each verified credential to one stage user; proven in a standalone container, callers not yet migrated | | [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; design only, nothing built | | [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 is deferred** — v0.5-alpha has service-level authorization only; Trino 480 impersonation and Superset 6.1.0 propagation assessed (V/T marked), foreclosure review, and the prerequisites for per-user data access (#367) | ## Related - [`../technical-debt.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.5.0-alpha.1/docs/technical-debt.md) — known weaknesses, mitigations, and the fix path for each - [`../architecture/README.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.5.0-alpha.1/docs/architecture/README.md) — how the platform works, as opposed to why it was decided --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/README.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 in its own runner 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). --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0001-platform-baseline-and-component-stack.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 platform apply -f openlakeforge.yaml` runs the static prefix in order. The deprecated `olf 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 | | `artifacts` | Deprecated single-DEV compatibility path derived from `lakehouse_code/` | `olf` | `DeploymentPhase` (`tools/olf/olf/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. ### 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 platform apply -f` (and the deprecated `olf 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 project build` publishes a `ProjectRevision`; `olf 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 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 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 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. 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`. 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.5.0-alpha.1` (`1598142`), [docs/adr/0002-deployment-lifecycle.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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` retains the v2 adapter (`provider_contracts/_v2.py`) only to parse a contract from state a pre-v3 deploy already produced; no current root's Terraform still emits that shape. 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.contracts.load_provider_contracts` still returns either version unchanged, so a contract from state predating this rollout keeps parsing; `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); the v2 branch exists only for that backward-compatibility read. `tools/olf/tests/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. ## History 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.5.0-alpha.1` (`1598142`), [docs/adr/0003-provider-contracts.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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// domain-owned: Floe contracts and manifests ├── gold// product-owned: dbt project ├── dashboards/superset// consumption-owned: exported report bundles ├── pipelines/dagster/ user-maintained orchestration └── lakehouse.yaml 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 -> _bronze Domain -> _silver Product -> _gold ``` 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 through `silver_inputs` and owns only its Gold namespace. Product `id` is unique across the whole lakehouse, so `_gold` needs no domain 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 (local DEV) | Layer | Written by | | --- | --- | --- | | `lakehouse-dev-bronze` | Bronze | dlt | | `lakehouse-dev-silver` | Silver | Floe | | `lakehouse-dev-gold` | Gold | dbt-trino | | `openlakeforge-ops` | operational artifacts | the artifacts phase | 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. ### Operational artifact prefixes `openlakeforge-ops` is outside the medallion split and uses stable prefixes: ```text floe/manifests//.manifest.json floe/reports// logs/ run-artifacts/dbt/// ``` Floe manifests are keyed by domain, matching domain-owned Silver. 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//`, `lakehouse.yaml`, and one Dagster module at `lakehouse_code/pipelines/dagster/.py`; no Bronze or Silver work is duplicated. Catalog namespaces are derived from descriptors, so they are reconciled in the artifacts phase by `olf 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. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0004-medallion-layout-and-catalog-namespaces.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/adr/0004-medallion-layout-and-catalog-namespaces.md). --- # ADR 0005: The v1alpha3 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 shape itself changed when medallion ownership was corrected (ADR 0004). The old `Domain` descriptor keyed Silver on a product's `asset_prefix` and nested Bronze under a domain — assumptions the current ownership model contradicts, not details that can be migrated field by field. ## Decision ### One descriptor pair, at `openlakeforge.io/v1alpha3` | Kind | Path | Declares | | --- | --- | --- | | `Lakehouse` | `lakehouse_code/lakehouse.yaml` (one per project) | Sources, domains, the products each domain owns, and dashboards | | `Source` | `lakehouse_code/bronze//source.yaml` (one per source) | A Bronze source and the resources it exposes | `Lakehouse.domains[].silver_tables.tables[]` maps each domain table to one `{source, resource}` pair. Products select those tables through `silver_inputs`; dashboards select products through `products`. A product's `id` is its only identity and is unique across the lakehouse — there is no `name`/`asset_prefix` split. Both are validated against JSON Schema (`docs/schema/lakehouse.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. ### `openlakeforge-domain-model` is the only implementation The `packages/domain-model/` distribution, imported as `openlakeforge_domain`, owns descriptor constants, loading, validation, the provider-neutral value objects (`Source`, `Domain`, `Product`, `Table`, `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 `libs/`, 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 `Lakehouse` + `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 a `lakehouse.yaml` with empty `sources` and `domains`. 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, and the first `olf product new` is what turns it into a schema-valid project. ## 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 domain-model 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. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0005-descriptor-model.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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, dlt pipelines, the dbt projects, generated Floe manifests, the `openlakeforge-domain-model` package, and the shared `libs/`. 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, Floe revision, or code location. `olf 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. The K8sRunLauncher is given no image at all, 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 otherwise outrank every later promotion. Anything that does need project code rides the activation release instead. The compute-log archiver (`libs.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 in its own image, driven by manifests The project-code image does **not** install the Floe CLI. It carries generated Floe manifests so the Dagster code server can build the asset graph, but the actual validation work runs in the manifest-declared Floe runner image as a separate Kubernetes pod. That split forces one non-obvious requirement: the runner pod cannot read the project-code image's filesystem, so Kubernetes execution uses `floe_manifest_access_mode = "remote"` and Dagster passes `s3://` manifest URIs from the ops bucket. The artifacts phase publishes the same generated manifests it baked into the image. Local (in-container) manifest access is reserved for same-process execution. Manifests are generated by `olf floe generate-manifests` and owned by Floe. They are build outputs; editing one by hand is always wrong. ### 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 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.provider_contracts`. Neither consumer holds its own copy. ### Kubernetes run launcher Runs execute in isolated pods using the project-code image, so a run's dependencies and failures are contained. Locally the image is loaded into kind with `imagePullPolicy: Never`, which means Kubernetes never pulls a new image on pod creation. The artifacts phase therefore performs an explicit coordinated rollout (`olf k8s set-project-code-image`) after loading the image; without it, running pods keep serving the previous build. ## Consequences The v0.3 promotion loop is `olf project build` followed by `olf project deploy` for each stage. The deprecated `olf deploy --phase artifacts` remains only for single-DEV compatibility. 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. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0006-dagster-runtime-and-code-locations.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 openmetadata deploy-metadata` adds each stage's domains and descriptions under that root. Every governed stage emits its own lineage, and OpenMetadata auto-creates the entities it references (`autoCreateEntities: true`). 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. Exact resolution needs the stage's tables registered before its lineage arrives: `olf openmetadata deploy-metadata` seeds them at activation, and the crawl never deletes tables, so a crawl before the stage's first run cannot retire them (a missing table would fall back to the schema-and-table match). Pipeline entities are not created: OpenMetadata 1.13.6 fails to auto-create OpenLineage pipelines (an upstream bug), so the 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. - Floe environment profiles carry the endpoint and receive the ingestion-bot JWT only through a Kubernetes Secret reference — never through a generated manifest. - `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. - 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 manifest 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. Generated Floe manifests stay credential-free and provider-neutral; 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. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0007-governance-and-lineage.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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/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 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. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0008-olf-owns-orchestration-and-toolchain.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 ### Two published distributions `openlakeforge` owns the `olf` console command and pins `openlakeforge-domain-model` exactly. `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 either `pyproject.toml` 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, `libs/`, 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 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`. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0009-distribution.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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.5.0-alpha.1` (`1598142`), [docs/adr/0010-cloud-provider-implementations.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/adr/0010-cloud-provider-implementations.md). --- # ADR 0011: Deployment Profile v1 — 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 four 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). `--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 four 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` | | Runtime | not exposed — Trino only | not a v1 field | 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 v1 The project-root `openlakeforge.yaml` describes product intent only: ```yaml apiVersion: openlakeforge.io/v1alpha1 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/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/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`. ### 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, platform/compute/storage sizing or availability, raw namespaces, replicas, resources, Helm values, Terraform modules or backends, IAM policies, credentials, images, PVCs, buckets, catalogs, and generated endpoints. `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 deploy --provider local --profile slim|full` keeps its exact current behavior as a deprecated shorthand: `olf.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. With no `--profile`, the project-root Deployment Profile is authoritative; an explicit `--profile slim|full`, or a project that has no profile file at all, resolves the single-DEV shorthand instead. A profile file that exists but is invalid fails closed. 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.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 platform apply -f` and `olf project deploy -f --stage` take the profile file. - Local, AWS, and Azure POC shapes are representable without credentials, sizing, 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. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0011-deployment-profile-and-stages.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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`). v0.2 already publishes an immutable revision — `tools/olf/olf/revision.py`, now `olf floe revision`. That revision covers rendered Floe runtime artifacts only: configs, profiles, and generated manifests, hashed after the Floe CLI renders them from the live provider contract environment. That rendered output is stage-bound. A generated manifest embeds `report_base_uri: s3:///floe/reports/`, the Kubernetes `namespace`, catalog endpoints, and Kubernetes Secret names — see `lakehouse_code/silver/sales/contracts/floe/manifests/sales.manifest.json`. Hashing that output would put target-stage physical endpoints inside a manifest #154 requires to promote unchanged between stages, and a manifest generated for DEV cannot be replayed unmodified in PROD. The project-code image has the same problem one layer down. `images/project-code/Dockerfile` bakes `FLOE_MANIFEST_REVISION` into `OPENLAKEFORGE_FLOE_MANIFEST_REVISION_BUILT`, and `libs/product_dagster.py` resolved the remote Floe manifest URI from that baked value alone. Because the Floe revision is stage-bound, the image built against it was too — "the same project revision 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/project_revision.py`) is a second, independently addressed revision covering the complete promotable project: | Component | Source | Excluded because | | --- | --- | --- | | `descriptors` | `lakehouse_code/lakehouse.yaml`, `bronze//source.yaml` | — | | `floe` | `silver//contracts/floe/.yml` | — | | `dbt` | `gold//dbt/**` (no `target/`, `dbt_packages/`) | 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 | compatibility gate at activation | `openlakeforge.yaml` (the Deployment Profile) and every stage-rendered Floe artifact — manifests, profiles, 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_VERSION`/`FLOE_IMAGE`, defaulted in `olf/floe.py`) is a distribution-level pin, not project content — it is already covered by the `distribution` component and is not duplicated inside `floe`. ### Content address, publish, and verify reuse the v0.2 primitives Each component is a `{relative project path: sha256}` map. The aggregate revision is `revision.aggregate_revision` (`olf/revision.py`) over the flattened, `/`-namespaced entries — the same sorted `key\0digest\n` hash the Floe revision already uses, so an empty project and a tampered entry set fail the same way. Publication reuses the same immutable-write rule: an existing key with different content is a hard collision error, never a silent overwrite. `tools/olf/olf/artifact_store.py` extracts the bucket/client resolution both revisions publish through (`RevisionStore`, `S3RevisionStore` for in-cluster or direct cloud S3, `FilesystemRevisionStore` for `olf project build --output DIR`) so publishing does not require two client builders. Folding `olf/revision.py` itself onto `RevisionStore` is deliberate follow-up, not part of this record — see `docs/technical-debt.md`. ### 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 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. ### The project-code image is decoupled from the Floe revision `libs/product_dagster.py`'s manifest-URI resolution now prefers the stage-activated runtime variable (`OPENLAKEFORGE_FLOE_MANIFEST_REVISION`, already passed by the Dagster Terraform module on every deploy, default `"manual"`) over the value baked into the image at build time (`OPENLAKEFORGE_FLOE_MANIFEST_REVISION_BUILT`). The baked value remains a fallback for the current single-stage deploy paths, which do not yet wire the runtime variable — that wiring, from the platform root at activation time, is `#115`'s job. This record only removes the build-time coupling that would have blocked it: without it, one project-code image digest could never serve more than one Floe revision, no matter what `#115` wires. The resolution logic itself (`_built_manifest_revision`, `_revision_digest`) moved to `libs/floe_revision.py`, free of the Dagster/Floe imports `libs/product_dagster.py` carries, so it is unit-testable from `tools/olf` without the isolated dependency environment `olf check project-code` builds. ### CLI surface | Command | Behavior | | --- | --- | | `olf project build --project P --image REF` | Validate the project, freeze its content, resolve/require a digest-pinned image, publish | | `olf project revision inspect --revision R` | Read a published manifest without rebuilding source | | `olf project revision verify --revision R` | Re-verify manifest self-consistency, the distribution-compatibility gate, and every published object's digest | | `olf project deploy -f PROFILE --stage STAGE --revision R` | Materialize only verified published content, render stage-bound Floe output, and activate the stage | | `olf project status -f PROFILE [--stage STAGE] [--json]` | Compare immutable activation records with the observed user deployment | `olf revision` (the v0.2 Floe runtime-artifact commands) moved to `olf floe revision compute|publish|activate|verify`, freeing the top-level name for the project revision and keeping "which revision" unambiguous from the command path alone. ## Consequences - `#115` consumes `ProjectRevision.project_code_image` and per-component digests to activate a stage without ever rebuilding from source, and can render Floe manifests against the frozen `floe` component's contracts for the stage it is activating. - 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 rendered artifact are outside its content address by construction. - The v0.2 Floe runtime-artifact revision is unchanged in meaning: it still identifies one stage's rendered artifact set, and `#115` still activates it per stage. `ProjectRevision` does not replace it; it is the layer above. ## 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. 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. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0012-project-revisions-and-promotion.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/adr/0012-project-revisions-and-promotion.md). --- # ADR 0013: Service access — one ingress, configured by domain and issuer > 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` | | `issuer` | `local-ca` | an ACME (Let's Encrypt) or organisational CA issuer | The defaults need neither a purchased domain nor a public server. **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 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://`. 3. **The provider contract carries the routes.** `shared.access` gains `base_domain`, `issuer`, `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.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 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 deploy` waits for a probe certificate from it. `tls_mode` is therefore `ingress-terminated`, the only value the contract accepts. 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 same URLs.** A service that validates a token calls the issuer's public URL from inside the cluster, and `*.localhost` must not resolve to the pod's own loopback there. The local root adds 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 for pods to mount. The URL, certificate and token `iss` are then the same as in a browser. 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. **Development mode: `issuer: none`, plain HTTP on `*.localhost`.** The local provider accepts `spec.access.issuer: 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 issuer), Traefik serves the `web` entrypoint with no `tls` block and publishes no host port 443. cert-manager and the local CA stay deployed: Trino's internal certificate (ADR 0016) and the CA ConfigMap the pods mount are independent of the routes. Not for any other provider or a public domain; the validator rejects both, and public exposure (#340) must reject it too. ## Consequences - `olf` rejects a contract whose `base_domain` or `issuer` 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 `lakehouse.yaml`. - 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 | - Mapping 80/443 changed the kind cluster shape: an existing local cluster must be recreated (`olf destroy` then `olf deploy`), and those host ports must be free; `olf deploy` checks both ports and the issuer before it creates the cluster. ## History 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 (`issuer: 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.5.0-alpha.1` (`1598142`), [docs/adr/0013-service-access-and-ingress.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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`) | | --- | --- | --- | --- | --- | | `platform-admin` | Admin | Admin | full | yes | | `data-engineer` | Alpha | write | full | yes | | `analyst` | Gamma | read | — | — | | `viewer` | read-only | read | — | — | 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. ### 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. If per-user data access later binds canonical roles to cloud principals (an `analyst` mapped to an IAM role with Lake Formation grants, #179), that is a fifth mapping keyed by canonical role, added then. Nothing here forecloses it and nothing here builds it. ### 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.issuer: 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` | | `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`, `trino`, each `client_id` plus `secret_ref{name,key}` | 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` with `client_id` and `secret_ref{name,key}`; 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 four 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 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 e2e run` runs a stub GHE (`olf/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 | | 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`, `trino` as static Dex clients, secrets from the existing bootstrap Job (#181) | | 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) 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 | | 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` | 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 | | 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.5.0-alpha.1/docs/architecture/identity/identity-sessions-and-recovery.md). `olf` itself takes it for every protected route (`olf.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.5.0-alpha.1/docs/architecture/identity/identity-callers.md#dagster-boundary). `olf 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 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 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.5.0-alpha.1/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.5.0-alpha.1/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.5.0-alpha.1/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.5.0-alpha.1/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 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.issuer: 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): [ADR 0016](https://openlakeforge.dev/docs/adr/0016-trino-workload-authentication/) selects password-file authentication over HTTPS for the class-2 Trino callers. Human OAuth2 for the Trino UI stays separate; no 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`. The bootstrap Job 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 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`. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0014-identity-and-authorization.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/adr/0014-identity-and-authorization.md). --- # ADR 0015: Polaris identity-provider evaluation — deferred > Decided: deferred. This is an evaluation (#26), not a migration. Nothing in the tree changes. It also records the catalog-side findings that the data-plane… Source: https://openlakeforge.dev/docs/adr/0015-polaris-identity-provider-evaluation/ ## Status Decided: **deferred**. This is an evaluation (#26), not a migration. Nothing in the tree changes. It also records the catalog-side findings that the data-plane authorization assessment (#179) needs. 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? | Nothing: `infra/helm/values/local/polaris.yaml` has no `authentication` or `oidc` key, so Polaris runs `internal`, and `release.tf` passes only persistence and storage settings | | Issuer reachability | **To verify.** The issuer URL is `https://auth.` behind Traefik with the local CA (ADR 0014). The Polaris pod would need to resolve that host and trust the CA in its JVM trust store, as the other back-channel consumers do (`in-cluster-resolution`). Whether the 1.4.0 image honours a mounted CA bundle was not checked | | 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 Trino principal; Secret `trino_credentials_secret_name`, keys `POLARIS_TRINO_CLIENT_ID` / `_SECRET`, in the shared 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 runner | The stage's Floe principal; Secret `floe_credentials_secret_name` in the stage namespace, mounted into Dagster's user-code and run pods | The Floe profile generated by `olf floe generate-manifests` names the token URI, scope and `secret_name` (`olf/floe.py`); Floe authenticates with those credentials against that URI. `CATALOG_MANAGE_CONTENT` | | `olf catalog sync-namespaces` | The stage's deployer principal; Secret `polaris-deployer-creds`, read through RBAC | `olf/polaris.py` POSTs `grant_type=client_credentials` with HTTP Basic to the token path over a port-forward. `CATALOG_MANAGE_METADATA` | | Platform bootstrap Job | The Polaris root client (`random_password`, so in Terraform state — register entry "Terraform state holds the generated credential values") | Exchanges at the internal token endpoint, then creates catalogs, principals, roles and grants and writes each principal's Secret (`bootstrap.sh.tftpl`) | | dbt | **None.** Gold is written through Trino as `olf--runtime` | The bootstrap Job 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 Job 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/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 Job, 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 Job 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 | **Not gated by Polaris here.** Trino reads object storage with its own S3 key (`s3.aws-access-key`), `vended-credentials-enabled=false`, and the catalogs are created `stsUnavailable: true`. `TABLE_READ_DATA` is defined as receiving catalog-vended storage credentials, so a per-table grant would not restrict file reads unless Trino switched to vended credentials, which needs a storage side that issues them (**to verify** for SeaweedFS) | 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 Job. - 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. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0015-polaris-identity-provider-evaluation.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/adr/0015-polaris-identity-provider-evaluation.md). --- # ADR 0016: Trino workload authentication — password file over HTTPS > Decided, proven in isolation, and migrated on the local root: step 4 (the password default and the isolation gate) is done (#471). AWS and Azure remain… Source: https://openlakeforge.dev/docs/adr/0016-trino-workload-authentication/ ## Status Decided, proven in isolation, and **migrated on the local root**: step 4 (the `password` default and the isolation gate) is done (#471). AWS and Azure remain unauthenticated. Built: the credential Job in `modules/query/trino` creates the principal Secrets, `trino-password-file` and `trino-internal-secret` and replicates each stage's principal. The switch `trino_workload_authentication` has three levels, `off` (nothing differs from before), `tls` (the module issues the serving certificate and adds an HTTPS listener beside the HTTP one; dbt run pods, `olf e2e` and Superset use it, sending only the user name: migration steps 2-3), and `password` (the local default; the HTTP listener is replaced, `PASSWORD` authentication and the `principals` rules turn on, and Traefik gets a verified HTTPS transport to Trino: step 4). The OpenMetadata Trino crawl is an OLF-owned Job (its server-created ingestion pods cannot receive the CA) that verifies the HTTPS listener at `tls`. At `password` every caller reads its own credential from a Secret (step 4, clients: below), and the switch defaults to `password` in the local root when the profile has `spec.access`, which publishes the CA ConfigMap callers verify against; without it the default stays `off`. `olf e2e` runs the isolation probes below. What binds is the selection, the principal mapping and the migration order. The local root authenticates by default; AWS and Azure serve Trino unauthenticated, and the row in `docs/technical-debt.md` stays open for them. ## Context One Trino 480 coordinator (chart 1.42.2) in `olf-system` serves every stage's catalog (`lakehouse_`). Access is decided by file-based rules (`modules/query/trino`, `catalog_access_rules`) keyed on the **user name**, which is whatever the client sends in `X-Trino-User`; Trino accepts it unauthenticated, so any pod that reaches the Service can claim `olf-prod-runtime` (proved below, case 0a). Superset, dbt, OpenMetadata and `olf e2e` are the callers ([`identity-callers.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.5.0-alpha.1/docs/architecture/identity/identity-callers.md)). #26 requires one non-interactive mechanism for all of them, separate from the human OAuth2 login for the Trino UI. ## Decision **Trino `PASSWORD` authentication with the `file` authenticator, on an HTTPS listener, with a `principals` rule binding each verified principal to exactly its own user.** One password per principal, created in-cluster. The username is a claim; the password is the proof. ### Options Client support is read from the images this repository pins. | Caller (pinned client) | Password | JWT | Client certificate | | --- | --- | --- | --- | | Superset 6.1.0 (`trino` 0.340) | URI password or `encrypted_extra` `auth_method: basic` | `auth_method: jwt` | `auth_method: certificate` (key files in the pod) | | dbt-trino 1.10.2 (`trino` 0.338) | `method: ldap` | `method: jwt` | `method: certificate` | | OpenMetadata 1.13.6 Trino connector | `authType: BasicAuth` | `authType: JwtAuth` | **none**: only Basic, JWT, Azure, OAuth2 | | Trino CLI 480 (`olf e2e`) | `--password` (`TRINO_PASSWORD`) | `--access-token` | `--keystore-path` | | Credential to principal | the file entry **is** the principal | the `sub` of any token a trusted key signed | the subject of any certificate the CA signed | | Option | Outcome | | --- | --- | | **Password file** | **Selected.** All four clients support it. A leaked DEV password yields only DEV. Revoked by deleting a line, rotated without a restart (case e). No dependency on the issuer or a signing service at query time | | JWT | Rejected. Trino has one issuer and one key set and accepts any trusted key for any `sub`, so a per-stage signing key does not stop that key minting `olf-prod-runtime`; the binding lives in the minting job and its key is the crown jewel. Superset, dbt and OpenMetadata cannot refresh a token, so they would hold long-lived bearer tokens that cannot be revoked one by one. Short issuer tokens would make every dashboard query depend on the issuer being up | | Client certificates | Rejected. OpenMetadata's connector has no certificate option, so one caller would need a second mechanism, and Superset would need key files mounted in each pod. Otherwise attractive: cert-manager creates the keys in-cluster | | Trusted `X-Trino-User` header | Rejected by #26: a claimed name is not proof | | LDAP, Kerberos | Rejected: need a directory or KDC the platform does not run | What each option needs **on the Trino server** is from Trino's documentation and was not run; the client capabilities above and the password path were. ### Principal mapping | Principal (`password.db` user) | May become | Catalog access (rules unchanged) | Used by | | --- | --- | --- | --- | | `olf--runtime` | itself only | `all` on `lakehouse_` | that stage's Superset, dbt run pods, `olf e2e` | | `openmetadata` | itself only | `read-only` on every stage catalog | OpenMetadata service and ingestion | `principals` rules in `rules.json` list each principal with the one user it may assume and end with a deny-all rule. Trino then answers: no credential on HTTPS 401, any query on an HTTP listener 403 (the module has none, see k2), wrong password 401, valid password with an `X-Trino-User` outside the principal's list "Principal X cannot become user Y" before any catalog rule, and only then the catalog and table rules for the resulting user. Callers of one stage share its credential (the shared-service-account limitation in `identity-callers.md`). ### Secrets Created by an in-cluster Job owned by `modules/query/trino`, never by Terraform ([`identity-credentials.md`](https://github.com/OpenLakeForge/openlakeforge/blob/v0.5.0-alpha.1/docs/architecture/identity/identity-credentials.md), `modules/identity/dex/credentials.tf`); the contract fields are the migration's. | Secret | Namespace | Content | Created | | --- | --- | --- | --- | | `trino-credential-` | `olf-system` | `username`, `password` (32 random alphanumeric) | only if missing | | `trino-credential` | that principal's stage namespace only | copy of its `username`, `password` | by the Job, like the Polaris credential replication | | `trino-password-file` | `olf-system` | `password.db`, derived from the principal Secrets on every run | rebuilt; never the source of truth | | `trino-internal-secret` | `olf-system` | `internal-communication.shared-secret` | only if missing | The bootstrap image (`alpine/k8s:1.30.0`) has `python3` but no `openssl` or `htpasswd`, so the Job writes PBKDF2 entries with `hashlib.pbkdf2_hmac` (`password_line` in the proof script is the reference; Trino also accepts bcrypt). A stage namespace never receives another stage's Secret. Chart wiring: `auth.passwordAuthSecret: trino-password-file`, `server.config.authenticationType: PASSWORD`, `server.config.https.enabled`. ### TLS and trust | Piece | Decision | | --- | --- | | Certificate | cert-manager `Certificate` from the `local-ca` ClusterIssuer (ADR 0013), SANs `trino`, `trino.olf-system`, `trino.olf-system.svc`, the cluster-local FQDN and `localhost` (the in-pod CLI), PKCS8 key | | Keystore | Trino reads a PEM file of the PKCS8 key then the certificate chain. The `Certificate` asks cert-manager for `CombinedPEM` (key `tls-combined.pem`, a GA output format in the pinned v1.21.2: no feature gate); the Secret is mounted as a directory at `/etc/trino/tls`. Case k1 serves from a file in that layout. **Not followed on renewal**: with the file replaced by the symlink swap a Secret volume uses, the served certificate was unchanged 90 seconds later (run by hand, not in the script), so renewal needs a coordinator restart; the certificate lasts a year (`renewBefore` 30 days) | | Workload trust | callers use `trino.olf-system.svc.cluster.local:8443` and mount ConfigMap `olf-local-ca` (`ca.crt`, already in `olf-system` and every stage namespace, ADR 0013 decision 8) | | HTTP port | **Disabled** (`http-server.http.enabled=false`) when authentication is on, so no cleartext listener exists (k2). Without that, the HTTP port refuses a password only until a pod spoofs `X-Forwarded-Proto: https` (k0). The server then reaches itself at `https://localhost:8443` (a name in the certificate) with the CA as its internal truststore, `node.internal-address=localhost` and `internal-communication.https.required=true`; without those the node's calls to itself fail the handshake on its pod IP, which the certificate cannot name. That is single-node only, as local is (`workers: 0`) | | Probes | The image's `health-check`, which the chart runs for readiness and startup, uses HTTPS once HTTP is disabled, and `GET /v1/info` on HTTPS needs no credential (h2). The chart's **liveness** probe is hardwired to the named HTTP port and takes only timings, so with HTTP off it can only fail; the module sets it to once an hour with 1000 failures, which makes it inert. A hung coordinator is therefore pulled from service by readiness but not restarted. A chart that lets the liveness probe be replaced would restore it | | Ingress hop | Traefik re-encrypts to Trino's HTTPS port and verifies it against the local CA. `http-server.process-forwarded=true` stays, since the forwarded headers Traefik adds are otherwise refused with `406`; with no HTTP listener a spoofed `X-Forwarded-Proto` has nothing to downgrade (k0 against k2). The Trino Service carries `traefik.ingress.kubernetes.io/service.serversscheme: https` and `...service.serverstransport: trino@file`; the transport is in Traefik's file provider with `rootCAs` and `serverName` (the Service FQDN), and the CA comes from a Secret that cert-manager issues for that purpose (`trino-ca-bundle`) so that Traefik does not mount Trino's private key. Cases t1 and t2 run the pinned Traefik image with that transport against the proof server; the Kubernetes annotations that select it were not run. The Web UI sign-in is below (it is `web-ui.authentication.type`, not an addition to `PASSWORD`) | ### Web UI sign-in (human OAuth2) Trino 480 (docs: , ; the filter is `io.trino.server.ui.OAuth2WebUiAuthenticationFilter`, read at tag `480`). | Question | Finding | | --- | --- | | Coexistence with workloads | `web-ui.authentication.type=oauth2` is chosen apart from `http-server.authentication.type`: `OAuth2WebUiModule` installs the OAuth2 service itself, and Trino's own `TestOAuth2WebUiAuthenticationFilterWithJwt` sets no `http-server.authentication.type`. `/v1` stays `PASSWORD` (or none at `off`/`tls`); dbt, Superset, the ingestion Job and `olf e2e` do not touch the UI. No `PASSWORD,OAUTH2` list is needed, and none is used, because that would also let API clients present Dex bearer tokens | | Secure request | The filter redirects any request whose `isSecure()` is false to the "UI disabled" page. Behind Traefik, `isSecure()` is true when `process-forwarded` is on and the request carries `X-Forwarded-Proto: https`. So the ingress must be HTTPS (`spec.access.issuer` not `none`); the coordinator's own listener may be either. **With `issuer: none` the UI cannot sign in through Dex: it keeps its own login** (the module receives no `web_ui_oidc`) | | Redirect URI | `request.getUriInfo().getBaseUri().resolve("/oauth2/callback")`; with `process-forwarded` that is `https://trino./oauth2/callback` from `X-Forwarded-Host` and `-Proto`. The `trino` static Dex client carried `https://trino./*` (a Keycloak leftover; Dex matches exactly), now the exact callback. Not run: whether Jetty adds `:443` to the URI from `X-Forwarded-Port` | | Issuer reachability | Trino loads the issuer's metadata at startup and fails after 30 seconds, and `https://auth.` is served by Traefik, which is created after Trino (it takes Trino's backend transport). So the module turns discovery off and sets `auth-url`, `token-url`, `jwks-url` from Dex's fixed paths (`/auth`, `/token`, `/keys`): **Dex only**; an `issuer: external` issuer needs discovery and an egress flow, and is not wired. Trino reaches Dex by the public URL through the CoreDNS rewrite (flow F4) and trusts the local CA through `oauth2-jwk.http-client.trust-store-path` (the file already mounted for the internal truststore) | | Principal | `principal-field=email` with `scopes=openid,email` (Dex adds `email` to the token only when asked; Trino requires the field in the access token). The Trino user is the e-mail address, with the default user mapping | | Client secret | `TRINO_OIDC_CLIENT_SECRET` from the Secret the `identity.oidc` contract names (`dex-client-trino`), read in `config.properties` as `${ENV:...}`; never in Terraform | | When it is on | `spec.identity` with the `github` issuer, an HTTPS route, and `trino_workload_authentication` `tls` or `password`. Off otherwise, so authentication-off mode (#421) is unchanged | A signed-in person is user ``, to which the catalog rules give no catalog: the sign-in restricts who opens the UI, not what a person may query, and at `password` the final `principals` rule would also refuse that user as a query submitter. Data access for people is #179. Rendered config is tested in `tools/olf/tests/test_trino_oidc_config.py`; the browser flow is not proved. ### Consumer configuration | Caller | Change in the migration | | --- | --- | | Superset (per stage) | `olf report import` writes `trino://:XXXXXXXXXX@trino.olf-system.svc.cluster.local:8443/lakehouse_` and the CA as `server_cert`; it reads the password from `trino-credential` through RBAC and sends it only in the import request's `passwords` field. The `XXXXXXXXXX` placeholder is Superset's own: without it `set_sqlalchemy_uri` overwrites the imported password. Superset stores the password encrypted in its metadata DB; it is in neither the zip nor the URI. The connection uuid is unchanged | | dbt in Dagster run pods | `libs/dbt/profiles/*.yml`: `method: ldap`, `password: env_var('OPENLAKEFORGE_DBT_TRINO_PASSWORD')` from a `secretKeyRef` on `trino-credential`, `cert:` the mounted CA, FQDN host, port 8443. `impersonation_user` is there for #179 | | OpenMetadata | the metadata crawl is the OLF-owned Job `openmetadata-trino-ingestion` (`olf openmetadata deploy-metadata`; pinned `ingestion-base` image, `metadata ingest`), which mounts `olf-local-ca` and sets `verify`, not the OpenMetadata pipeline client, whose pods accept no volumes in 1.13.6. The Job's config carries `authType: {password}` (from `trino-credential-openmetadata`) when the query contract names a credential; the service the bootstrap registers carries no password | | `olf e2e` | the CLI in the coordinator pod: `--server https://localhost:8443 --truststore-path --user `, password in `TRINO_PASSWORD`, never on a command line. `_isolation.py` gains the direct-request cases below | ### Rotation Delete `trino-credential-` and replace the Job: it regenerates the Secret, rebuilds `password.db` and re-copies the stage Secret; Trino re-reads the file with no restart (case e). Consumers then re-sync: Superset by re-running the connection import, dbt run pods at their next launch, OpenMetadata by re-running its bootstrap; until then that principal's callers see 401. A zero-downtime overlap was not exercised. ### Migration and recovery An unauthenticated Trino refuses a password even over HTTPS (case 0c), so callers cannot be given credentials first. Order: | Step | Phase | Effect on callers | | --- | --- | --- | | 1. Contract carries the credential reference, scheme and CA | platform | none | | 2. Job creates and replicates credentials; Trino gets the certificate and HTTPS listener, authentication still off | platform | none | | 3. Callers move to HTTPS and the CA, still sending only the user name (accepted, case 0b). OpenMetadata's Trino ingestion moves by becoming an OLF-owned Job (consumer table) | platform, artifacts | none; proves trust from every caller | | 4. Cutover: enable `PASSWORD` and `principals`, ship the passwords in the same deploy | platform, then artifacts | Trino already restarts (`Recreate`); callers fail until their password lands, in-flight runs retry | | 5. `olf e2e` runs the isolation cases, an unattended pipeline and a dashboard query | e2e | none | Recovery is the inverse deploy (authentication off, callers back to the user name); a server-only toggle does not work, because an unauthenticated server refuses a caller that sends a password. Break-glass for a lockout is a platform-phase apply with authentication disabled, a setting the migration must define and exercise. A deleted principal Secret is regenerated (a rotation), a deleted `trino-password-file` rebuilt; an issuer outage changes nothing. ### Migration checklist Found in review; each was to be settled before step 4. For the local root step 4 is done (#471); the cloud-roots item below stays open for AWS and Azure. - Cloud roots: only the local root has cert-manager and `olf-local-ca` (ADR 0013 decision 8), and AWS and Azure expose Trino over HTTP; define the CA and certificate there, or a provider-neutral trust input in the contract. - `infra/helm/values/local/trino.yaml` sets `http-server.process-forwarded=true` in all three roots, which the proof server omits. **Settled for the local root**: with the HTTP listener on, a pod can send `X-Forwarded-Proto: https` to port 8080 and have a password accepted over plain HTTP (k0), so the module disables the HTTP listener and keeps `process-forwarded` for Traefik's re-encrypted requests (k2, k3, t1). `olf e2e`'s perimeter check that a role granted `query` reaches the route (`check_role_decisions`, status below 400) is met by the Web UI sign-in redirect (below), which the caller migration adds; the route itself no longer fails at the transport. - OpenMetadata stores the Trino password encrypted with its Fernet key. Done: a per-deployment `openmetadata-fernet-key` Secret, generated in-cluster and never in Terraform state, replaces the public upstream default. ### Per-user identity (#179) Not foreclosed, and exercised (g1-g3): with the DEV principal also allowed to act as `alice`, the DEV password acts as `alice` on DEV only. The client hooks are Superset's `impersonate_user` and dbt-trino's `impersonation_user`. ## Proof `python3 docs/testing/trino_workload_auth_proof.py --clients` starts the pinned image in one Docker container, no cluster, `tpch` standing in for the Polaris-backed catalogs, and removes it on exit; its file generation has a unit self-check in `tools/olf/tests/test_trino_workload_auth_proof.py`. Run on 2026-10-13 on a WSL2 Docker host (Trino 480 by the catalog digest, a throwaway `openssl` CA): exit 0, all 21 cases passing. Requests are `POST /v1/statement` for `SELECT count(*) FROM lakehouse_.tiny.nation` (25 when allowed); messages are Trino's, verbatim. | Case | Request | Result | | --- | --- | --- | | 0a | today: no authentication, `X-Trino-User: olf-prod-runtime`, PROD | accepted: 25 | | 0b | HTTPS listener, no authentication, header only | accepted: 25 | | 0c | same server, a caller sending a password | `401 Password not allowed for insecure authentication` | | a1 | DEV credential, DEV catalog | accepted: 25 | | a2 | DEV credential, PROD catalog | `Access Denied: Cannot access catalog lakehouse_prod` | | b1 | DEV credential with `X-Trino-User: olf-prod-runtime`, PROD catalog | `Access Denied: Principal olf-dev-runtime cannot become user olf-prod-runtime` | | c1 | `X-Trino-User` only, HTTPS | `HTTP 401 Unauthorized` | | c2, c4 | `X-Trino-User` only, or a valid PROD credential, on the HTTP port | `403 ... Authentication over HTTP is not enabled` | | c3 | right user, wrong password | `401 Access Denied: Invalid credentials` | | d | PROD credential, PROD catalog (the unattended PROD workload) | accepted: 25 | | h | `GET /v1/info` on the HTTP port, no credential (the chart's probe) | `200`, `"state":"ACTIVE"` | | e1, e2 | PROD password rewritten in `password.db`, no restart | old: `401 Invalid credentials`; new: accepted: 25 | | g1-g3 | DEV principal also allowed as `alice` (read-only on DEV) | as `alice`: DEV 25, PROD `Cannot access catalog lakehouse_prod`; as `bob`: `cannot become user bob` | | k0 | Control: HTTP listener on with `process-forwarded=true`, a valid PROD credential on the HTTP port with a spoofed `X-Forwarded-Proto: https` | accepted: 25 (why the listener is disabled) | | k1 | The configuration `modules/query/trino` renders: HTTPS only, CombinedPEM keystore, `internal-communication.shared-secret=${ENV:TRINO_INTERNAL_SECRET}`, `process-forwarded`, internal HTTPS truststore; DEV credential, DEV catalog | accepted: 25 | | k2 | On that server, a connection to the HTTP port | refused | | k3, k4 | Forwarded headers as Traefik sends them, over HTTPS: a valid PROD credential; `X-Trino-User` only | accepted: 25; `HTTP 401` | | h2 | The chart's `health-check` inside the container, and `GET /v1/info` on HTTPS with no credential | exit 0; `200`, `"state":"ACTIVE"` | | t1, t2 | Pinned Traefik with a file-provider transport (`rootCAs`, `serverName`) to `https://trino:8443`, `X-Forwarded-Proto: https`: DEV credential; `X-Trino-User` only | accepted: 25; `HTTP 401` | | o1, o2 | `openmetadata` credential: both stage catalogs; claiming `olf-prod-runtime` | accepted: 25 each; `Principal openmetadata cannot become user olf-prod-runtime` | k0-k4, h2, t1, t2 and o1-o2 were added on 2026-10-14 and run without `--clients`; the rules the script serves now include the `openmetadata` principal and the unconditional `tables` rule, as the module renders them. Clients, against the same secured server, each returned 25 (dbt: `Connection test: [OK connection ok]`): the `trino` 0.340 driver via a SQLAlchemy `trino://:@host:8443/...` URI with `http_scheme=https` and `verify=` in the Superset image; the OpenMetadata 1.13.6 connector with `BasicAuth` and `verify`; `dbt debug` (dbt-trino 1.10.2, `method: ldap`, `cert: `); and Trino CLI 480 with `--server https://localhost:8443 --truststore-path --user --password`. The Superset case runs the driver and URI its engine spec builds; the `encrypted_extra` code path was read, not run. **Not proved:** Polaris-backed catalogs, a kind deployment, cert-manager-issued certificates, Traefik in front, JWT or certificate authentication on the server, any caller inside the platform. ## Consequences - Stage isolation in Trino is enforced, not advisory, once the migration lands. - A stage's callers share one credential, also stored in Superset's and OpenMetadata's metadata databases (encrypted with their own keys). Anything that can read a stage's `trino-credential` can use it; containing that is RBAC and NetworkPolicy (#46), not this ADR. - PBKDF2-SHA1 is weaker than bcrypt against an offline attack on `password.db`; accepted because the passwords are 32 random characters. ## History 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 `olf-system`: 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 bootstrap Job 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 (`issuer: 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 `olf-system` 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. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0016-trino-workload-authentication.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 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 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 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 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 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.5.0-alpha.1/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, `issuer: 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, OpenMetadata, Trino (`olf-system`); Superset 8088 and Dagster webserver 80 (stage) | per route | `service_routes` in `contracts.tf` | V | | F4 | oauth2-proxy; the Trino coordinator (8443 only: its Web UI sign-in is HTTPS routes only) | Traefik 8443 (8000 when `issuer: none`) | 8443, 8000 | issuer discovery at `https://auth.` through the CoreDNS rewrite; Trino's token and key requests to the same URL | V; Superset (stage rule) is built, OpenMetadata joins when #25 lands; the Trino row **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 | Trino | 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 | stage namespace | Trino | 8080 now; 8443 at ADR 0016 step 4 | Superset, dbt rows. The 8080 allow is removed in the same change that enables `PASSWORD`; kubelet probes use 8080 from the node and are unaffected | V | | F11 | Traefik (the Trino UI), OpenMetadata, and the OLF-owned ingestion Job and its hourly CronJob pods (`openlakeforge.io/job=openmetadata-trino-ingestion`, #410) | Trino 8080, 8443 | 8080, 8443 | OpenMetadata to Trino row | V (the Job and its label exist since #410; its pods on a cluster **T**) | | F12 | stage namespace of a governed stage | OpenMetadata | 8585 | `OPENLINEAGE_URL`, ingestion-bot token | V | | F13 | OpenMetadata ingestion Jobs (the hourly refresh included), the role-sync CronJob, bootstrap Jobs | OpenMetadata | 8585 | `pipelineServiceClientConfig` (`metadataApiEndpoint`); `openlakeforge.io/job` | V; the same Job needs it, so slice 3b selects it by `openlakeforge.io/job` | | F14 | OpenMetadata ingestion Jobs, bootstrap Job | Superset (stage) | 8088 | `superset_url` registered by the 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 bootstrap, metastore bootstrap and replication Jobs | Polaris | 8181 | `bootstrap.sh.tftpl` | V | | F20 | Jobs: `dex-credentials`, `trino-credentials`, `perimeter-cookie-secret`, `publish-local-ca`, `catalog-bootstrap`, `catalog-credential-replication`, `governance-bootstrap`, `governance-credential-replication`; 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`, `libs/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 and, later, OIDC clients | an `issuer: external` host | 443 | profile-driven, same rendering | 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 | 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) and of Dagster run pods; 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). 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` | `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` and each stage namespace) | ConfigMaps and Secrets `create`, namespace-wide; `delete/get/patch/update` on named Secrets and marker ConfigMaps only [V: `rbac.tf`] | principal Secrets and their `-bootstrap-pending` markers | **Done (slice 4)**: `create` stays namespace-wide (E1); `get/update/patch/delete` are pinned by `resourceNames` to the plan-time Secret names (`*_credentials_secret_name`, `polaris-dbt-creds`) and their `-bootstrap-pending` markers (`rbac.tf`) | | `openmetadata-bootstrap` (`olf-system`, governed and revoked stage namespaces) | Secrets `create`, namespace-wide; `delete/get/patch/update` on two named Secrets only [V] | the ingestion-bot Secret | **Done (slice 4)**: `create` stays (E1); `get/update/patch/delete` by `resourceNames` on the automation and ingestion-bot Secrets | | 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.5.0-alpha.1/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.23 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 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.5.0-alpha.1/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/e2e/_network.py`), the one list of the documented names. ## Conformance test New `tools/olf/olf/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 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 | | 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/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.5.0-alpha.1/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 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/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. 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 (`issuer: 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. 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. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0017-local-network-policy-and-rbac.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/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 project image`, `olf project build` and `olf 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 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.5.0-alpha.1` (`1598142`), [docs/adr/0018-github-is-the-forge.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/adr/0018-github-is-the-forge.md). --- # ADR 0019: Data-plane authorization is deferred > Decided. Binding today: v0.5-alpha has service-level authorization only; nothing in it restricts which tables, rows or columns a signed-in user reads.… Source: https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/ ## Status Decided. **Binding today:** v0.5-alpha has service-level authorization only; nothing in it restricts which tables, rows or columns a signed-in user reads. **Assessed, not built:** the per-user path through Trino impersonation and Superset. The follow-up is #367 (v1.0), sequenced ahead of the governance work (#54-#57). Every claim below carries a mark. **V** is verified against the cited documentation or source (read, not run). **T** is to test: derived or assumed, and not exercised here. Pins are from `release/component-catalog.yaml`: Trino 480 (chart 1.42.2), Superset 6.1.0 (chart 0.15.5), Polaris 1.4.0. ## Context The canonical role decides which services a person reaches (ADR 0014). It does not decide what they read once inside. Superset connects to Trino as one shared principal per stage (ADR 0016, `identity-callers.md`), and Trino reaches the catalog and object storage with its own credentials (ADR 0015). The end user's identity never leaves Superset, so every Superset user has the data access of that one principal. Stated plainly for operators: **in v0.5-alpha 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 the catalog and storage apply no per-user restriction, and 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. ## Decision 1. **Defer.** v0.5-alpha ships service-level authorization only, and says so in the release notes (`CHANGELOG.md`) and `identity-callers.md`. 2. **Do not foreclose.** The assessment below finds no v0.5 decision that rules out per-user data access. Two are accepted costs (foreclosure review). 3. **Enforce at Trino.** When built, per-user policy is Trino file-based access control keyed by canonical role, the one point that is identical for Polaris and Glue (ADR 0015). Catalog and storage policy are defence in depth, not the first line. 4. **Superset propagates identity by impersonation**, not by one connection per user, as the first candidate (below). #367 confirms or replaces it. ## Trino 480: impersonation | # | Claim | Mark | Reference | | --- | --- | --- | --- | | 1 | The session user is the `X-Trino-User` header if sent, otherwise the authenticated user. With authentication the authenticated identity is kept as the principal and only the user is replaced | V | `HttpRequestSessionContextFactory.buildSessionIdentity`, tag 480 | | 2 | Two checks run on a request. `checkCanSetUser(principal, user)` always; `checkCanImpersonateUser(authenticated identity, user)` only when the authenticated user differs from the requested one | V | `HttpRequestSessionContextFactory.extractAuthorizedIdentity`, tag 480 | | 3 | File-based `impersonation` rules take `original_user`, `original_role`, `new_user` (required, may use captured groups) and `allow`; the first match wins and no match denies | V | Trino 480 docs, file-based access control, "Impersonation rules" | | 4 | With no `impersonation` rules but `principals` rules present, impersonation is allowed (the principal rules are assumed to govern it). With neither, it is denied | V | same page | | 5 | `principals` rules are marked **deprecated** in 480; the docs point to user mapping plus `impersonation` rules | V | same page, "Principal rules" | | 6 | Today's mechanism (ADR 0016: `principals` rules, a DEV credential acting as `alice` on DEV only, `cannot become user bob` otherwise) was run on 480 | V | ADR 0016 cases g1-g3 | | 7 | Replacing the `principals` rules with `impersonation` rules does **not** keep the stage binding once end users are allowed: after DEV's principal becomes `alice`, catalog and table rules evaluate `alice`, so denying `olf-prod-runtime` as a target does not keep `alice` out of PROD catalogs. Without impersonation targets, a request for another principal is denied and a request for its own user skips the check | T | derived from claims 1-4 and 6; not run | | 8 | Rules can match `group`; groups come from a group provider, which is `file` or `ldap`. The OAuth2 authentication page lists no option that reads groups from a token | V | Trino 480 docs, group mapping; OAuth2 authentication | | 9 | Iceberg table data is read with Trino's own S3 key and the catalog is created without vended credentials, so Trino rules are the only per-user check on data files | V | ADR 0015, `modules/query/trino/main.tf` | ### How a verified workload credential impersonates an end user 1. Superset authenticates to Trino as `olf--runtime` (password, ADR 0016), the verified principal. 2. It sends the signed-in user's name as `X-Trino-User`. Trino sees an authenticated user that differs from the requested one (claim 2). 3. An `impersonation` rule lets exactly that principal become end users: `original_user: olf--runtime`, `new_user` matching the end-user name pattern. Catalog, schema and table rules then evaluate the end user. What this means for the design: - **Trino trusts Superset's assertion.** The credential proves which service is calling, not which person. The guarantee is only as strong as Superset's own authentication and its refusal to let a client choose the name (Superset section, claim 3). - **Deny the service names first.** Rules are first-match (claim 3), so a `deny` rule for every service principal (`olf-*-runtime`, `openmetadata`) must precede the allow, or a stage credential could become another stage's principal. That alone does not keep stages apart: an end user the DEV credential may become is evaluated by the catalog rules as itself (prerequisite 6). T. - **End-user names must not collide with service names.** GitHub logins are free text (ADR 0018) and could equal a service principal. The Trino user needs a namespace or a pattern the service names cannot match. T. - **Roles reach Trino only through a group provider** (claim 8). The `groups` claim from Dex (ADR 0018) is read by the perimeter and Superset, not Trino. A Trino group provider fed from the same canonical role mapping, or user-keyed rules generated from it, is the "fifth mapping keyed by canonical role" ADR 0014 reserves. T: which of the two. ## Superset 6.1.0: per-user propagation | # | 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 (no `g.user`) it falls back to the connection URL's user, i.e. the shared principal | V | `core.py`, `Database.get_effective_user` | | 4 | The feature flag `IMPERSONATE_WITH_EMAIL_PREFIX` swaps the name for the part of the user's email 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 an `Authorization: Bearer` header alongside the user name | V | `trino.py`, `impersonate_user`; `core.py`, `get_oauth2_access_token` | | 7 | That OAuth2 token comes from a flow configured on the database (`oauth2_client_info`), not from the SSO session. Whether the SSO session token can serve is not established | T | `core.py` read; no deployment | | 8 | Using claim 6 needs Trino to accept the token: an `OAUTH2` or `JWT` authenticator beside `PASSWORD`, with the token's user name matching a Trino rule. ADR 0016 already needs `OAUTH2` for the Trino UI | T | Trino side not built | | 9 | Result caching: the cache key includes 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` | ### Cost | Area | Finding | Mark | | --- | --- | --- | | Correctness | Turning on `impersonate_user` without `CACHE_IMPERSONATION` serves one user's cached result to another. The flag is a prerequisite, not a tuning option | V (claim 9) | | Cache sharing | With the user in the key, a dashboard's cache is per person. Hit rate falls by roughly the number of distinct viewers per dashboard and Redis use rises the same way. No measurement | T | | Connection pooling | Connections are created with `NullPool` by default and the engine is built on each use, so there is no pool for impersonation to defeat. Trino's protocol is per-query HTTP | V (code); T (cost) | | Trino per query | One extra impersonation check and per-user rule evaluation. Expected negligible beside query time; not measured | T | | Background paths | Cache warm-up resolves `CACHE_WARMUP_EXECUTORS` (default: the chart owner) and runs as that account, with no username when none resolves; alerts and reports use `ALERT_REPORTS_EXECUTORS` (default: the owner). Which of these identities reaches Trino, and what it may read, is not established | V (config, `tasks/cache.py`); T (Trino identity) | | Metadata browsing | Whether SQL Lab and dataset editors list only tables the user may read, and whether metadata caches are shared across users | T | | Username source | The name is Superset's account name. Its derivation from Dex (ADR 0018) may not match the Trino rule pattern, and `IMPERSONATE_WITH_EMAIL_PREFIX` would change it again | T | ## Foreclosure review | v0.5 decision | Rules out per-user access? | Why | | --- | --- | --- | | Shared per-stage Trino principal (ADR 0016) | No (avoided) | The principal is the verified service identity that impersonation rules authorise. Cases g1-g3 show it acting as other users. Keeping it is the deferral itself | | Password-file authentication, not JWT (ADR 0016) | No | Impersonation needs only the service credential. Superset OAuth2 passthrough (claim 8) adds an authenticator beside `PASSWORD`; it does not replace it | | `principals` rules (ADR 0016) | No, but accepted debt | Deprecated in 480 (claim 5) and not the shape to extend. #367 replaces them with `impersonation` rules and re-runs the isolation cases (claim 7) | | GitHub teams and Dex (ADR 0018) | No (avoided) | Roles stay canonical (ADR 0014). Cost: the `groups` claim does not reach Trino (claim 8), so a role-to-group mapping is added, and GitHub logins need a namespace | | Keycloak replaced by Dex | No | Nothing per-user is stored in Trino, Superset or the catalog. A rename of users costs nothing before beta | | Trino reads storage with its own key (ADR 0015) | Storage-level policy: **accepted** | Vended credentials stay off, so only Trino enforces per-user policy. Anything with the bucket credentials (Floe, dbt, Dagster) is outside it by design | | Polaris `internal` authentication (ADR 0015) | No | Polaris sees the stage principal. Per-user identity at the catalog is optional defence in depth, not a prerequisite for Trino policy | | Catalogs `lakehouse_` with catalog and table rules | No | The rules file already has `tables` rules; per-user rules are added, not restructured | | OpenMetadata reads every stage catalog (ADR 0016, `read-only`) | Metadata and sample data: **accepted** | It is a service principal. What an OpenMetadata user sees is governed by #56, not by Trino policy. Not assessed here | | Imported Superset connections set `impersonate_user: false` | No | A report-import change flips it. The cache flag must flip with it (Superset claim 9) | | Local NetworkPolicy (ADR 0017) | No | Network-level only | ## Prerequisites for per-user data access (#367) 1. Trino authentication enforced (ADR 0016, migration step 4) before any impersonation: an unauthenticated Trino accepts any `X-Trino-User`. 2. `principals` rules replaced by ordered `impersonation` rules, service names denied first; isolation cases extended and run on 480 (Trino claim 7). 3. A stable, collision-free end-user name from Dex to Superset to Trino. 4. A role-to-Trino mapping keyed by canonical role: group provider or generated user rules (ADR 0014, fifth mapping), with table-level rules per role. 5. Superset: `impersonate_user` on with `CACHE_IMPERSONATION` on, a decision on `IMPERSONATE_WITH_EMAIL_PREFIX`, and an executor policy: which identity warm-up, alerts and reports use and what it may read in Trino. 6. Effective users qualified by stage: `new_user` rewritten to a stage-scoped name with catalog rules keyed by it, or another input that keeps the original stage principal, so a DEV `alice` cannot read PROD (Trino claim 7). T. 7. A measurement of the dashboard cost on kind with several users (Superset cost table). 8. A decision on the catalog layer: Polaris session identity (ADR 0015) and Glue with Lake Formation stay separate adapters. 9. `olf e2e` cases: an `analyst` denied a table a `data-engineer` reads, through Superset, and a cache check that one user's result is not served to another. ## Consequences - No code, Terraform or contract changes. - The release notes say what the platform does not do and what to avoid loading; they make no claim of data-level authorization. - The ADR 0016 `principals` choice is knowingly on a deprecated Trino feature until #367. ## History New record (#179): the deferral, the Trino 480 and Superset 6.1.0 assessments, the foreclosure review and the prerequisites. --- Synced from openlakeforge @ `v0.5.0-alpha.1` (`1598142`), [docs/adr/0019-data-plane-authorization-deferral.md](https://github.com/OpenLakeForge/openlakeforge/blob/159814290ffb4316f2456ebb94c2d31ac874eeae/docs/adr/0019-data-plane-authorization-deferral.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/v1alpha1", "title": "OpenLakeForge Deployment Profile", "type": "object", "additionalProperties": false, "required": ["apiVersion", "kind", "metadata", "spec"], "properties": { "apiVersion": {"const": "openlakeforge.io/v1alpha1"}, "kind": {"const": "DeploymentProfile"}, "metadata": { "type": "object", "additionalProperties": false, "required": ["name"], "properties": { "name": {"type": "string", "pattern": "^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$"} } }, "spec": { "type": "object", "additionalProperties": false, "required": ["provider", "preset", "stages"], "if": {"properties": {"provider": {"properties": {"type": {"const": "local"}}}}}, "then": {"dependentRequired": {"identity": ["access"]}}, "properties": { "provider": { "type": "object", "additionalProperties": false, "required": ["type"], "properties": { "type": {"enum": ["local", "aws", "azure"]}, "region": {"type": "string", "minLength": 1} } }, "preset": {"enum": ["slim", "full"]}, "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])?)+$" }, "issuer": { "type": "string", "default": "local-ca", "pattern": "^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$" } } }, "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", "trino"]}, "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"}, "capabilities": { "type": "object", "additionalProperties": false, "properties": { "analytics": {"type": "boolean"}, "governance": {"type": "boolean"} } } } } } } ``` --- # JSON Schema: OpenLakeForge Lakehouse (`lakehouse.schema.json`) ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://openlakeforge.io/schemas/lakehouse/v1alpha3", "title": "OpenLakeForge Lakehouse", "type": "object", "additionalProperties": false, "required": [ "apiVersion", "kind", "name", "displayName", "description", "status", "sources", "domains", "dashboards" ], "properties": { "apiVersion": {"const": "openlakeforge.io/v1alpha3"}, "kind": {"const": "Lakehouse"}, "name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "displayName": {"type": "string", "minLength": 1}, "description": {"type": "string"}, "status": {"type": "string", "minLength": 1}, "sources": { "type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"} }, "domains": { "type": "array", "minItems": 1, "uniqueItems": true, "contains": {"type": "object", "properties": {"products": {"type": "array", "minItems": 1}}}, "items": { "type": "object", "additionalProperties": false, "required": ["name", "displayName", "description", "status", "silver_tables", "products"], "properties": { "name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "displayName": {"type": "string", "minLength": 1}, "description": {"type": "string"}, "status": {"type": "string", "minLength": 1}, "silver_tables": {"$ref": "#/$defs/silverTableGroup"}, "products": { "type": "array", "minItems": 0, "uniqueItems": true, "items": { "type": "object", "additionalProperties": false, "required": [ "id", "displayName", "description", "status", "silver_inputs", "gold_tables" ], "properties": { "id": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "displayName": {"type": "string", "minLength": 1}, "description": {"type": "string"}, "status": {"type": "string", "minLength": 1}, "domain": {"type": "string", "minLength": 1}, "silver_inputs": { "type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"} }, "gold_tables": {"$ref": "#/$defs/tableGroup"} } } } } } }, "dashboards": { "type": "array", "uniqueItems": true, "items": { "type": "object", "additionalProperties": false, "required": ["name", "products"], "properties": { "name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "products": { "type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"} } } } } }, "$defs": { "silverTableGroup": { "type": "object", "additionalProperties": false, "required": ["tables"], "properties": { "tables": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "object", "additionalProperties": false, "required": ["name", "source", "resource"], "properties": { "name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "source": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "resource": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "description": {"type": "string"} } } } } }, "tableGroup": { "type": "object", "additionalProperties": false, "required": ["tables"], "properties": { "tables": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "object", "additionalProperties": false, "required": ["name"], "properties": { "name": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}, "description": {"type": "string"} } } } }, "not": {"required": ["schema"]} } } } ``` --- # 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", "floe_manifest_revision", "provider_binding_digest", "capabilities", "activation_revision" ], "properties": { "apiVersion": {"const": "openlakeforge.io/v1alpha1"}, "kind": {"const": "ProjectActivation"}, "schema_version": {"const": 1}, "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": {"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" ], "properties": { "apiVersion": {"const": "openlakeforge.io/v1alpha1"}, "kind": {"const": "ProjectRevision"}, "schema_version": {"const": 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"} } }, "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": [".", ".."]}} } } } }, "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": ["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."}, "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", "trino"], "properties": { "perimeter": {"$ref": "#/definitions/oidcClient"}, "superset": {"$ref": "#/definitions/oidcClient"}, "openmetadata": {"$ref": "#/definitions/oidcClient"}, "trino": {"$ref": "#/definitions/oidcClient"} } }, "roles": { "type": "object", "additionalProperties": false, "required": ["precedence", "grants"], "properties": { "precedence": { "type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/definitions/nonEmptyString"} }, "grants": { "type": "object", "propertyNames": {"enum": ["orchestration", "reporting", "governance_service", "query"]}, "additionalProperties": { "type": "object", "minProperties": 1, "additionalProperties": {"$ref": "#/definitions/nonEmptyString"} } } } } } }, "accessBinding": { "type": "object", "additionalProperties": false, "required": ["ref", "implementation"], "dependentRequired": { "base_domain": ["issuer", "tls_mode", "routes"], "issuer": ["base_domain"], "tls_mode": ["base_domain"], "routes": ["base_domain"] }, "if": {"properties": {"implementation": {"const": "access.ingress"}}}, "then": {"required": ["base_domain", "issuer", "tls_mode", "routes"]}, "properties": { "ref": {"$ref": "#/definitions/nonEmptyString"}, "implementation": {"$ref": "#/definitions/nonEmptyString"}, "base_domain": {"$ref": "#/definitions/nonEmptyString"}, "issuer": {"$ref": "#/definitions/nonEmptyString"}, "tls_mode": {"enum": ["ingress-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/binding"}, "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"]}, "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"}, "tls_port": {"$ref": "#/definitions/nonEmptyString"}, "ca_configmap_name": {"$ref": "#/definitions/nonEmptyString"}, "credential_secret_name": {"$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/v1alpha3", "title": "OpenLakeForge Source", "type": "object", "additionalProperties": false, "required": ["apiVersion", "kind", "name", "displayName", "description", "status", "resources"], "properties": { "apiVersion": {"const": "openlakeforge.io/v1alpha3"}, "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"} } } } } } ```