Skip to content

feat(duckfleet): publish immutable dataset artifacts for remote workers - #1153

Merged
athvin merged 4 commits into
mainfrom
issue/1131-duckfleet-artifacts
Nov 21, 2026
Merged

athvin merged 4 commits into
mainfrom
issue/1131-duckfleet-artifacts

Conversation

@athvin

@athvin athvin commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Closes #1131

What

Publish accepted delivery and auxiliary files as immutable, dataset-scoped objects. Workers write exports to staging; the control plane verifies and seals them before returning an artifact reference. Add storage policies that protect sealed artifacts and preserve retryable inputs and outputs.

Why

Remote workers cannot use the control plane's local files, and DuckFleet's SQL response limit cannot carry bulk data. This reuses DeliveryPin and keeps file transfer separate from bounded typed query results.

Proof

make check, make check-e2e (real Postgres and DuckLake), cargo deny check, feature-enabled proof clippy, and the complete Terraform validation/test script passed. The schema/span invariant suite passed all 21 tests; the er-duckfleet library suite passed all 19 tests.

The restricted-worker service proof ingested/exported 60,000 rows (27,408,901 bytes each way), preserved receipts and retry identity, refused same-size changed content and unauthorized access, and left no worker sessions. Interrupted/corrupt/oversized downloads and expired-token responses are tested separately.

Risk & rollback

Operator-only foundation; no dataset enrollment or pipeline backend switch. Immutable objects deliberately have no automatic current-version expiry; reference-aware garbage collection is future work. Disable/drain any later pilot before reverting transport or storage policy, preserving artifacts needed by outstanding reads and retries.

Post-merge ledger

Closed by: Codex · session 01a1fb62-5950-78d2-982c-5ecb2cd40d30 on brians-MacBook-Pro.local · 2026-11-21T05:52:03Z

Specific to this change

Context — contract, evidence and boundaries

Implementation

  • Typed artifact manifests validate version, org/dataset scope, logical identity, format, length and SHA-256. All bucket/key/URI values derive from the admitted operator binding; credentials and signed URLs never enter SQL or manifests.
  • publish_delivery verifies the persisted DeliveryPin, source mapping and accepted bytes. publish_file requires an accepted fingerprint for model/config/dictionary/TF inputs. Private bounded spools prevent a local-file change from changing the upload snapshot.
  • Publication uses checksum-validated If-None-Match: *; a 412 retry succeeds only after verifying stored bytes. Other failures remain failures. Worker exports are downloaded, hashed and sealed by the publisher; consumers receive a file only after validation. Files are capped at 256 MiB and network transfers at 300 seconds.
  • Worker IAM explicitly denies mutations of the immutable artifact prefix while retaining staging/lake permissions. Bucket policy requires conditional publication and denies deletion. Only typed staging locations have a cleanup API; no current-version lifecycle expiry is introduced.

Measured constraints

  • Pinned upstream 398ff60c7abe973514707be3e47248a610560ec9 runs DuckDB v1.5.4 and rejects explicit S3 ?versionId= paths. Content-addressed keys plus storage immutability preserve accepted versions across retries and credential rotation.
  • RustFS 1.0.4 supports conditional writes, checksum validation and restricted-principal denies, but rejects AWS's s3:if-none-match policy condition. Terraform tests exercise the real policy-document function with every cloud resource overridden. Actual AWS policy and Pod Identity enforcement must be qualified in DuckFleet: qualify the full API workflow and decide production rollout #1134 before enrollment; the handoff is recorded in the qualification ticket.
  • The Rust service proof runs the actual worker and publisher with restricted identities, uses a present foreign object for the refusal test, and removes its own Compose resources. Evidence is committed under the DuckLake skill.

Boundaries

The input inventory and explicit local-path replacements are in .claude/skills/ducklake-lakehouse/references/duckfleet-artifacts.md. Work-order/backend adoption is #1132; resilience and live rollout qualification follow in #1133/#1134. Public durable receipts, resumable uploads and bulk exports remain #1011/#1012/#521; no parallel customer API is added.

@athvin
athvin force-pushed the issue/1131-duckfleet-artifacts branch from e25309b to aeb0d7d Compare November 21, 2026 05:14
@athvin athvin changed the title feat(duckfleet): transport immutable inputs and versioned result artifacts (#1131) feat(duckfleet): publish immutable dataset artifacts for remote workers Nov 21, 2026
@athvin
athvin marked this pull request as ready for review November 21, 2026 05:15
@github-actions

Copy link
Copy Markdown
Contributor

terraform plan

3548186 · run log and full plans

env add change destroy
state-backend (plan only) 0 0 0
core 0 0 0
dev 0 1 0
prod 0 1 0

Planned with -refresh=false, so this is the config-versus-state diff and
not out-of-band drift. That is a security choice, not a speed one: a refreshing
plan reads secret values, and the plan role is assumable from any PR branch —
which can edit the workflow it runs under. Drift is caught at apply time, which
refreshes fully.

dev — 0 to add, 1 to change
module.eks.data.aws_iam_policy_document.node_trust: Reading...
module.network.data.aws_region.current: Reading...
module.eks.data.aws_iam_policy_document.cluster_trust: Reading...
data.aws_rds_engine_version.aurora_pg: Reading...
module.eks.data.aws_iam_policy_document.node_trust: Read complete after 0s [id=2851119427]
module.network.data.aws_region.current: Read complete after 0s [id=us-east-2]
module.eks.data.aws_iam_policy_document.cluster_trust: Read complete after 0s [id=1029077455]
data.aws_caller_identity.current: Reading...
data.aws_iam_policy_document.eso_trust: Reading...
module.network.data.aws_availability_zones.available: Reading...
data.aws_iam_policy_document.efs_csi_trust: Reading...
data.aws_region.current: Reading...
data.aws_iam_policy_document.eso_trust: Read complete after 0s [id=819195744]
data.aws_region.current: Read complete after 0s [id=us-east-2]
data.aws_iam_policy_document.efs_csi_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.obs_pod_trust: Reading...
data.aws_iam_openid_connect_provider.github: Reading...
data.aws_iam_policy_document.obs_pod_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.eso: Reading...
data.aws_iam_policy_document.er_api_pod_trust: Reading...
data.aws_iam_policy_document.eso: Read complete after 0s [id=1725605485]
data.aws_iam_policy_document.er_api_pod_trust: Read complete after 0s [id=819195744]
data.aws_caller_identity.current: Read complete after 0s [id=797781631727]
module.lake.data.aws_iam_policy_document.lake_tls_only: Reading...
module.lake.data.aws_iam_policy_document.lake_tls_only: Read complete after 0s [id=3415312252]
data.aws_iam_policy_document.otel_collector: Reading...
data.aws_iam_policy_document.fluent_bit: Reading...
data.aws_iam_policy_document.fluent_bit: Read complete after 0s [id=4006586444]
data.aws_iam_policy_document.otel_collector: Read complete after 0s [id=3111493560]
data.aws_iam_policy_document.bedrock_invoke: Reading...
data.aws_iam_policy_document.bedrock_invoke: Read complete after 0s [id=3601248236]
data.aws_iam_policy_document.lake_access: Reading...
data.aws_iam_policy_document.lake_access: Read complete after 0s [id=2921565705]
data.aws_iam_openid_connect_provider.github: Read complete after 0s [id=arn:aws:iam::797781631727:oidc-provider/token.actions.githubusercontent.com]
data.aws_iam_policy_document.ci_deploy_dev_trust: Reading...
data.aws_iam_policy_document.ci_deploy_dev_trust: Read complete after 0s [id=4060172364]
module.network.data.aws_availability_zones.available: Read complete after 0s [id=us-east-2]
data.aws_rds_engine_version.aurora_pg: Read complete after 0s [id=17.9]
data.aws_iam_policy_document.ci_deploy_dev: Reading...
data.aws_iam_policy_document.ci_deploy_dev: Read complete after 0s [id=1754478413]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.lake.aws_s3_bucket_policy.lake will be updated in-place
  ~ resource "aws_s3_bucket_policy" "lake" {
        id     = "er-dev-lake-797781631727"
      ~ policy = jsonencode(
          ~ {
              ~ Statement = [
                  + {
                      + Action    = "s3:PutObject"
                      + Condition = {
                          + Null = {
                              + "s3:if-none-match" = "true"
                            }
                        }
                      + Effect    = "Deny"
                      + Principal = "*"
                      + Resource  = "arn:aws:s3:::er-dev-lake-797781631727/duckfleet/*/artifacts/immutable/*"
                      + Sid       = "RequireImmutableConditionalPublication"
                    },
                  + {
                      + Action    = [
                          + "s3:DeleteObjectVersion",
                          + "s3:DeleteObject",
                        ]
                      + Effect    = "Deny"
                      + Principal = "*"
                      + Resource  = "arn:aws:s3:::er-dev-lake-797781631727/duckfleet/*/artifacts/immutable/*"
                      + Sid       = "RetainImmutableArtifacts"
                    },
                    {
                        Action    = "s3:*"
                        Condition = {
                            Bool = {
                                "aws:SecureTransport" = "false"
                            }
                        }
                        Effect    = "Deny"
                        Principal = {
                            AWS = "*"
                        }
                        Resource  = [
                            "arn:aws:s3:::er-dev-lake-797781631727/*",
                            "arn:aws:s3:::er-dev-lake-797781631727",
                        ]
                        Sid       = "DenyInsecureTransport"
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        # (2 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
prod — 0 to add, 1 to change
module.eks.data.aws_iam_policy_document.cluster_trust: Reading...
module.network.data.aws_availability_zones.available: Reading...
module.eks.data.aws_iam_policy_document.node_trust: Reading...
module.network.data.aws_region.current: Reading...
data.aws_caller_identity.current: Reading...
module.network.data.aws_region.current: Read complete after 0s [id=us-east-2]
module.eks.data.aws_iam_policy_document.cluster_trust: Read complete after 0s [id=1029077455]
module.eks.data.aws_iam_policy_document.node_trust: Read complete after 0s [id=2851119427]
data.aws_rds_engine_version.aurora_pg: Reading...
data.aws_iam_policy_document.pod_trust: Reading...
module.ses.data.aws_region.current: Reading...
data.aws_iam_policy_document.pod_trust: Read complete after 0s [id=819195744]
module.ses.data.aws_region.current: Read complete after 0s [id=us-east-2]
data.aws_iam_openid_connect_provider.github: Reading...
data.aws_iam_policy_document.efs_csi_trust: Reading...
data.aws_iam_policy_document.efs_csi_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.eso_trust: Reading...
data.aws_iam_policy_document.eso_trust: Read complete after 0s [id=819195744]
data.aws_caller_identity.current: Read complete after 0s [id=797781631727]
data.aws_iam_policy_document.otel_collector: Reading...
module.lake.data.aws_iam_policy_document.lake_tls_only: Reading...
data.aws_iam_policy_document.fluent_bit: Reading...
data.aws_iam_policy_document.otel_collector: Read complete after 0s [id=1193716550]
module.lake.data.aws_iam_policy_document.lake_tls_only: Read complete after 0s [id=81696635]
data.aws_iam_policy_document.openobserve: Reading...
data.aws_iam_policy_document.fluent_bit: Read complete after 0s [id=2978074842]
data.aws_iam_policy_document.openobserve: Read complete after 0s [id=2652188337]
data.aws_iam_policy_document.eso: Reading...
data.aws_iam_policy_document.eso: Read complete after 0s [id=2178872705]
data.aws_iam_policy_document.lake_access: Reading...
data.aws_iam_policy_document.lake_access: Read complete after 0s [id=1033619361]
module.network.data.aws_availability_zones.available: Read complete after 0s [id=us-east-2]
module.ses.data.aws_iam_policy_document.send: Reading...
module.ses.data.aws_iam_policy_document.send: Read complete after 0s [id=3767633194]
data.aws_iam_openid_connect_provider.github: Read complete after 0s [id=arn:aws:iam::797781631727:oidc-provider/token.actions.githubusercontent.com]
data.aws_iam_policy_document.ci_deploy_prod_trust: Reading...
data.aws_rds_engine_version.aurora_pg: Read complete after 0s [id=17.9]
data.aws_iam_policy_document.ci_deploy_prod_trust: Read complete after 0s [id=4060172364]
data.aws_iam_policy_document.ci_deploy_prod: Reading...
data.aws_iam_policy_document.ci_deploy_prod: Read complete after 0s [id=2891227359]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.lake.aws_s3_bucket_policy.lake will be updated in-place
  ~ resource "aws_s3_bucket_policy" "lake" {
        id     = "er-prod-lake-797781631727"
      ~ policy = jsonencode(
          ~ {
              ~ Statement = [
                  + {
                      + Action    = "s3:PutObject"
                      + Condition = {
                          + Null = {
                              + "s3:if-none-match" = "true"
                            }
                        }
                      + Effect    = "Deny"
                      + Principal = "*"
                      + Resource  = "arn:aws:s3:::er-prod-lake-797781631727/duckfleet/*/artifacts/immutable/*"
                      + Sid       = "RequireImmutableConditionalPublication"
                    },
                  + {
                      + Action    = [
                          + "s3:DeleteObjectVersion",
                          + "s3:DeleteObject",
                        ]
                      + Effect    = "Deny"
                      + Principal = "*"
                      + Resource  = "arn:aws:s3:::er-prod-lake-797781631727/duckfleet/*/artifacts/immutable/*"
                      + Sid       = "RetainImmutableArtifacts"
                    },
                    {
                        Action    = "s3:*"
                        Condition = {
                            Bool = {
                                "aws:SecureTransport" = "false"
                            }
                        }
                        Effect    = "Deny"
                        Principal = {
                            AWS = "*"
                        }
                        Resource  = [
                            "arn:aws:s3:::er-prod-lake-797781631727/*",
                            "arn:aws:s3:::er-prod-lake-797781631727",
                        ]
                        Sid       = "DenyInsecureTransport"
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        # (2 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

@athvin
athvin merged commit 6e81a41 into main Nov 21, 2026
48 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 21, 2026 05:21 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — aeb0d7d5 Deployed Nov 21, 2026 by athvin via remove closed PR previews #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DuckFleet: make ingestion and result artifacts accessible to remote workers

2 participants