Repository navigation
feat(lake): the object-store credential path — open an s3:// lake (#792) - #924
Merged
Merged
Conversation
…Rust (#792) - ObjectStoreConfig (all-optional): emits a session-scoped CREATE OR REPLACE SECRET ahead of the ATTACH when DATA_PATH is s3://. No explicit key selects PROVIDER CREDENTIAL_CHAIN (pod identity in-cluster); an explicit pair is for MinIO-class stores/CI. Half a key is an error, not a silent chain fallback. No mode flag. - ER_LAKE_S3_{ENDPOINT,REGION,URL_STYLE,USE_SSL,KEY_ID,SECRET} resolve from the process env inside attach_ducklake when the config is empty — one mechanism for every lake-open seam. Host-level only: the new credential filter in er_server::pg refuses credential-shaped keys on every org/dataset env write (422 naming the key). - aws + httpfs join BAKED_EXTENSIONS so LOAD aws works offline in-cluster. - Proving test (er-cli tests/s3_lake.rs): write+read round trip against a real S3 store through both the explicit key and the env fallback; rustfs service in the lake-e2e CI legs (MinIO is archived upstream). - The three skill references that said 'no credential path' move with the change, plus the eval and the lake-service-user retirement note.
…teral (#792) The declared-names posterity gate scans the workspace for qualified lake.main.* literals and requires each to be a declared relation; the ad-hoc round-trip table is not one. register_lake_table is the production read idiom anyway, so the test is better for using it.
pg_orgs.rs may declare only one #[tokio::test] — fresh_db keys the database on one slug per FILE, so two tests in one file race on it (pg_serial gates this). pg_env_filter.rs is its own slug; the pg_e* prefix keeps it in the a-l CI slice by construction.
athvin
marked this pull request as ready for review
November 8, 2026 22:55
merge_dataset_envs is the remaining env-write chokepoint: its three callers today only ever forward a patch that already passed the org-side filter, but a future caller passing user keys would bypass it — the same class the org-side guard exists for. Flagged in review.
Owner
Author
PR review — 0 findingsHouse-invariant diff review (pr-review pipeline: one fresh-context reviewer per routed dimension, findings would have gone to a separate verifier; none were produced to verify).
Ready to merge? Yes — pending CI green on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #792
What
Build the object-store credential path so an
s3://lake opens from Rust, per the issue's acceptance criteria (which areattach-and-tenancy.md's own "In flight" list):ObjectStoreConfigindedupe-core— every field optional; emits aCREATE OR REPLACE SECRETbefore the ATTACH whendata_pathiss3://. Absence of an explicit key selectsPROVIDER CREDENTIAL_CHAIN(the pod's own identity in-cluster — theer-dev-runner-podPod Identity role already carries the lake-bucket grants); an explicit key stays for MinIO/CI, which have no chain to consult. No mode flag — the credential's shape is the mode.ER_LAKE_S3_*convention —ER_LAKE_S3_ENDPOINT/REGION/URL_STYLE/USE_SSL/KEY_ID/SECRET, read viaer-envat the two lake-open seams (schema::open_lake_envwrite,read::open_org_lakeread). Deliberately NOT the bannedER_S3_ACCESS_KEY_IDnames: those stay banned (a credential-shaped name nothing should consume in deployed envs), sotf-static-credentials-check.shrule 2 needs no narrowing — recorded in Context.pg::merge_org_env(the single chokepoint for org-env merges) refuses credential-shaped keys (*_SECRET,*_ACCESS_KEY_ID,*_KEY_ID,*_TOKEN,*_PASSWORD) with a 422 naming the key and the reason; org-row creation paths get the same predicate. An org row is projected into job params and travels further than process env — nothing credential-shaped persists there, ever.awsjoinsBAKED_EXTENSIONS(pullshttpfswith it), soLOAD awsworks offline in-cluster exactly likeducklaketoday; the Dockerfile's install step is the gate that proves it bakes.ER_TEST_S3_ENDPOINT(+ER_TEST_S3_KEY_ID/ER_TEST_S3_SECRET, self-skip without them, theER_TEST_PG_DSNidiom): attach a lake whoseDATA_PATHiss3://…against MinIO, write a table, read it back. MinIO joins the DuckLake e2e legs inrust.ymlas a service + bucket-create step, so CI proves it too; locally a one-commanddocker run(documented in the test's header).ducklake-lakehouse/SKILL.md's "not wired up" section,attach-and-tenancy.md's "Object storage" + "In flight" sections, and the third the issue names (found in Context below) — all updated in the same PR, not before.Why
The engine's only lake today is a filesystem path (EFS in-cluster). The identity half is already deployed (Pod Identity role + bucket grants, deliberately ahead of its first consumer); what is missing is the engine half: no
aws/httpfsload, noCREATE SECRET, no credential hygiene on org rows.attach-and-tenancy.mdrecords the omission as a Python-regression, not a design decision — so this is a feature, built to the shape that reference prescribes.Proof
make checkgreen (fmt + lint + doc + entities-check + skills-check + workflow-shell + test) atefd4f55b+.make check-e2egreen — 18 suites ok, withER_TEST_PG_DSNand the rustfs-backedER_TEST_S3_*/ER_LAKE_S3_*all set, so the pg tiers AND the s3 proving tests ran for real.er-cli tests/s3_lake.rs, run against a local rustfs): ans3://lake attaches, writes two rows, and reads them back from a fresh session (data provably crossed the object store — confirmed the Parquet objects in the bucket withaws s3 ls --recursive), through BOTH the explicit-key shape and the empty-config process-env fallback.er-server tests/pg_env_filter.rs, real Postgres): org create and dataset create each 422 onER_LAKE_S3_SECRET/AWS_SECRET_ACCESS_KEY/AWS_ACCESS_KEY_ID/ER_LAKE_S3_KEY_ID, name the key, and create nothing; the pure predicate unit-tests the liveER_LAKE_*/ER_DUCKDB_*keys keep working.ObjectStoreConfigunit tests: chain-vs-static SQL emission, quote escaping, half-key refusal, env parsing incl.USE_SSL.Risk & rollback
Additive: new config struct, new env vars (all optional), a filter that only refuses. Existing filesystem lakes are untouched (the secret path fires only on an
s3://data path).git revertis the rollback.Post-merge ledger
Closed by: agent · session
01a1b892-4cde-7a53-bb3e-9ed2e764acdconMac· 2026-11-08T23:55:00Zmainis green with this change on it — merge SHA7ca3dbb4ad00909e26b04e01443dac98ebd1a2f0; therustrun ON that SHAcompleted success (full suite incl. the DuckLake e2e legs, where the
rustfs-backed s3 proving tests ran), as did
frontend,infra,devcontainer.imagesbuilt — success on7ca3dbb4; the build raner-server install-extensions, so the newaws+httpfsentries inBAKED_EXTENSIONSare proven to fetch and bake (a 404 would fail thebuild).
deployconverged — run 42536448566 (both namespaces): helmSTATUS: deployedoner-platformanddeployment "web-api-green" successfully rolled out, which is kubectl'slive read of the cluster, not the workflow conclusion.
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: deploy green (above);
driftandkind's nightly leg arescheduled runs — none fired and none failed since the merge.
Donethrough the automation rather than byhand, and the issue closed: The engine cannot open an s3:// lake — build the object-store credential path #792 is
CLOSED/COMPLETEDand the cardreads
Done.(point a lake at s3, retire the lake service user; includes the web-api
pod-identity bucket-READ item the tier review surfaced), on the board.
the three skill references moved with the change (ducklake-lakehouse
SKILL.md, attach-and-tenancy.md, iam-and-exceptions.md) plus the eval;
the MinIO-archived supply-chain fact is recorded in the rust.yml
service comment and the PR body's Discoveries.
Specific to this change
Context — plan, discoveries, measurements, files
Plan
ObjectStoreConfig(all-optional) indedupe-core::session::ducklake+secret_sql()+ purefrom_env_withresolver + 8 unit testsaws+httpfsintoBAKED_EXTENSIONS; thes3://arm inattach_ducklake(LOAD aws → CREATE OR REPLACE SECRET → ATTACH)er_server::pg(merge_org_env/upsert_org_byo/create_dataset_byo→ 422 viaenv_write_err) + predicate unit tests + the pg HTTP testmake check+make check-e2egreenDiscoveries
Measurements
cargo test -p er-cli --test main s3_lake(rustfs local): 2 passed in ~6.5s, incl. extension INSTALL.aws s3 ls --recursive s3://er-lake-e2e/after the run: Parquet objects present under both test prefixes — the fresh-session read is genuinely off the object store.make check: green.make check-e2e(ER_TEST_PG_DSN + ER_TEST_S3_* + ER_LAKE_S3_* set): 18 suites ok, 0 failures.Files
Context — plan, discoveries, measurements, files
Plan (implementation order)
dedupe-core::session::ducklake:ObjectStoreConfig(all-optional fields) + itsCREATE OR REPLACE SECRETSQL (quoting unit-tested; chain-vs-explicit unit-tested).attach_ducklake: whendata_pathstarts withs3://,LOAD awsthen create the secret, before the ATTACH.BAKED_EXTENSIONS+=aws(and confirmhttpfsrides along at image-bake time).er-env-readER_LAKE_S3_*at both lake-open seams; the resolved config rides intoDuckLakeConfig.object_store.pg::merge_org_envcredential filter + the same predicate on the org-create path; 422 naming the key. pg test for the refusal.rust.yml+ bucket create.make check,make check-e2e,make frontendgreen.Discoveries (pre-implementation recon)
dedupe-core::session::Session::attach_ducklake:LOAD ducklake→ATTACH 'ducklake:{metadata}' (DATA_PATH, METADATA_SCHEMA, READ_ONLY, AUTOMATIC_MIGRATION false). The secret hooks in before the ATTACH, afterLOAD aws.BAKED_EXTENSIONS = ["ducklake", "parquet", "json", "icu", "postgres_scanner"](session/mod.rs:77); the Dockerfile'ser-server install-extensionsbakes them and FAILS THE BUILD on a 404 — addingawsis therefore self-verifying at image time.infrastructure.mdare Python-era); the CI e2e legs already carry apostgres:16-alpineservice — aminio/minioservice is the same idiom, and GitHub runners carry the AWS CLI for the bucket create.pg::merge_org_env(pg.rs:574) is the single merge chokepoint (update_resourcesfunnels through it). Org creation (upsert_org_byo/provision) gets the same predicate.tf-static-credentials-check.shrule 2 bans the exact namesER_S3_ACCESS_KEY_ID/ER_S3_SECRET_ACCESS_KEYunderinfra/+scripts/. Choosing theER_LAKE_S3_*convention (the issue's own caution against blindly reaching forER_S3_*) keeps the rule intact — and the rule's own rationale ("a credential nothing consumes") stays true for the banned names.DesignDoc.md§S6's Python-eraER_S3_*block is treated as intent, not interface, per the issue.