Skip to content

meta: backend-agnostic artifact serving and Cloudflare R2 migration fixes #2239

Backlog

Description

@zackees

Summary

Audit of fbuild's artifact serving, download mirror failover, and bucket publishing pipeline for migrating the 110.5 GB (29,416-object) artifact datalake from DigitalOcean Spaces (fbuild.sfo3.digitaloceanspaces.com) to Cloudflare R2 (fbuild, https://pub-7c5c27ede6434441a4ba3cd065938e8c.r2.dev) with zero-egress reads and clean multi-backend portability.

Audit Findings & Bug Fix Checklist

1. Client-side backend-agnostic mirror routing (crates/fbuild-packages-fetch)

  • 1.1 Index mirrors[] + serial rollback guard + FBUILD_ARTIFACT_MIRRORS (downloader_mirror_manifest.rs, downloader_mirrors.rs): Implemented in 480f0e67.
  • 1.2 Multi-mirror DEFAULT_MIRRORS + per-process circuit breaker (downloader_mirrors.rs): Implemented in 480f0e67 (R2 primary, DO Spaces fallback, 3-failure host circuit breaker).
  • 1.3 Fix slice downloads bypassing retries, mirror failover, and streaming (chip_slice.rs, variants.rs, downloader_mirror_manifest.rs): Implemented in 480f0e67 via shared streaming download_verified_candidates.
  • 1.4 Manifest freshness: shorter fresh TTL, conditional GET (ETag/Last-Modified -> 304), serial guard, and miss-triggered revalidation (downloader_mirror_manifest.rs): Implemented in 480f0e67.
  • 1.5 Fix prebuilt core-objects retired prebuilt/... path & wire Index.mirrors[] (prebuilt/mod.rs, prebuilt/reader.rs): Implemented in 480f0e67.

2. Publisher, mirror, and migration tooling (ci/)

  • 2.1 Shared S3-compatible artifact backend abstraction + fix R2 PutObjectAcl 501 crash (ci/artifact_backend.py + ci/gen_mirror_manifest.py, ci/publish_esp_slices.py, ci/publish_toolchain_slices.py, ci/mirror/mirror.py, ci/mirror/rotate.py): Implemented in 9679cf91.
  • 2.2 Emit and preserve mirrors[] and serial in ci/gen_mirror_manifest.py: Implemented in 9679cf91.
  • 2.3 Add datalake sync & parity verification tool (ci/sync_artifact_backend.py): Implemented in 9679cf91.

3. Datalake copy, cutover, and documentation

  • 3.1 Copy entire 110.5 GB (29,416-object) datalake from DO Spaces fbuild to Cloudflare R2 fbuild and verify 100% key+size parity plus live public HTTPS SHA-256 downloads across registry, @esp-libs, @esp-toolchain, and vendor/ prefixes.
  • 3.2 Publish mirrors[] (R2 primary, DO Spaces fallback) + serial in site/mirror/manifest.json, update docs/design/artifact-serving-decisions.md (add *.r2.dev to the host allowlist) and crates/fbuild-packages-fetch/README.md, and verify full Rust + Python test suites pass (ac4361be).

Activity

  1. zackees commented on Dec 2, 2026

    @zackees
    MemberAuthor

    All items on this meta issue are complete on branch feat/2239-r2-artifact-backend (480f0e67, 9679cf91, ac4361be).

    Datalake Migration & Parity Verification

    • Created Cloudflare R2 bucket fbuild (WNAM) with public managed domain https://pub-7c5c27ede6434441a4ba3cd065938e8c.r2.dev.
    • Migrated all 29,416 objects (110,510,876,769 bytes) cloud-to-cloud via Cloudflare R2 Super Slurper job 7d44421a33c8f4560b56d201b94acedff8d73ef3efd448ffcc275c8e221216b6 (0 failed objects).
    • Verified 100% parity with ci/sync_artifact_backend.py verify:
      • src_count: 29416, dst_count: 29416
      • src_bytes: 110510876769, dst_bytes: 110510876769
      • missing_count: 0, extra_count: 0, size_mismatch_count: 0
    • Live anonymous HTTPS verification against https://pub-7c5c27ede6434441a4ba3cd065938e8c.r2.dev succeeded across registry packages (.xyz, fastled), @esp-libs slice (SHA-256 verified), @esp-toolchain slice (106,462,349 bytes), and vendor/developer.arm.com/ (155,499,480 bytes).

    Verification Suite

    • soldr cargo test -p fbuild-packages-fetch --lib: 426 passed, 0 failed (2 network-ignored)
    • soldr cargo clippy -p fbuild-packages-fetch --all-targets -- -D warnings: 0 warnings, 0 errors
    • soldr cargo check --workspace --all-targets: 0 warnings, 0 errors across all 21 workspace crates
    • soldr cargo fmt --all -- --check: pass
    • uv run --no-project python ci/check_python_types.py: 0 errors, 0 warnings (basedpyright)
    • Python unit tests (test_artifact_backend, test_sync_artifact_backend, test_gen_mirror_manifest, test_mirror_tool, test_publish_toolchain_slices, test_artifact_serving_bench, test_gate_script_coverage): 202 passed, 0 failed
    • Repo policy guards (check_workspace_crates.py, check_usb_vidpid_literals.py, check_no_legacy_cross.py): all pass
  2. zackees commented on Dec 3, 2026

    @zackees
    MemberAuthor

    Added commit b500b37a on feat/2239-r2-artifact-backend:

    • Fixed whole-bundle candidate failover in variants.rs so PrebuiltLibsPolicy::WholeBundle also switches backends via Index.mirrors[] and fails over on error/checksum mismatch.
    • Added crates/fbuild-packages-fetch/src/backend_switch_tests.rs cementing end-to-end backend switchover purely via manifest.json mirrors[] (with immutable DO Spaces shards) across registry packages, @esp-libs slices + whole bundles, @esp-toolchain slices, prebuilt core archives, and un-sharded vendor/ tarballs.
    • soldr cargo clippy -p fbuild-packages-fetch --all-targets -- -D warnings: 0 warnings; soldr cargo test -p fbuild-packages-fetch --lib: 430 passed, 0 failed.
  3. zackees commented on Dec 3, 2026

    @zackees
    MemberAuthor

    Steward triage receipt (2026-12-03 19:1xZ, FastLED/fbuild hourly steward). Same run as the #2241 receipt: all eight cells here are [x] and implemented, but the implementing commits exist only on a local branch, and the published manifest does not yet carry the switchover. I made no code change.

    Where the work lives

    ~/dev/fbuild = feat/2239-r2-artifact-backend @ 11b8a31c, 8 commits ahead of origin/main a6c6d59c, tree clean. Not on origin: git ls-remote --heads origin | grep 2239 = no match; gh pr list --state all --search 2239 = no PR for this branch. Commits: 480f0e67 (client routing), 9679cf91 (backend abstraction + sync verifier), ac4361be (manifest mirrors[]), b500b37a (tests), 6d96c9ff / 23a405d1 / 1d56b330 / 11b8a31c (#2241 audit follow-ups).

    What I verified

    • Code (independent run, this tick) soldr cargo test -p fbuild-packages-fetch --lib → 437 passed; 0 failed; 2 ignored; python -m unittest ci.test_local_suites ci.test_artifact_backend ci.test_sync_artifact_backend ci.test_publish_esp_slices → Ran 29 tests, OK; ci/check_python_types.py → 0 errors, 0 warnings, 0 notes. Cell 3.2's Rust+Python green claim holds on this sha.
    • Cell 3.2 is NOT live. https://fastled.github.io/fbuild/mirror/manifest.json (what real clients fetch, served from main) is 200 but carries no mirrors key and no serial (serial: null, mirrors: null). The branch copy declares [{id: r2, weight 100}, {id: do-sfo3, weight 50}] with serial: 1. So until the branch lands, published clients get no mirrors[] and the R2-primary switchover has no effect.
    • Cell 3.1 (110.5 GB / 29,416-object parity) is not independently verifiable from outside. The canonical shard https://fastled.github.io/fbuild/mirror/shards/43be97c30102be98.json answers 200, 1193 B (matches the manifest's size_bytes), while the same key on https://pub-7c5c27ede6434441a4ba3cd065938e8c.r2.dev answers 404 — also 404 for the mirror/, site/mirror/, public/, fbuild/mirror/ and v1/ prefixes I tried — and DO Spaces answers 403 (bucket no longer anonymously readable). Either the R2 object keys carry a prefix I cannot derive from the public manifest, or the public mirror paths differ; nothing here disproves the copy, but nothing confirms it either. Confirming it needs the authenticated ci/sync_artifact_backend.py verify rerun (or the key layout named in the issue), which is the author's claim in the comment above.

    Remaining cell = delivery, and it is Zach's

    Every code cell is complete on the branch; the branch is Zach's own in-flight work (unpushed, in his live tree) and my standing rule is to never touch, push or duplicate it. Pushing it + opening the PR for #2239/#2241, then re-publishing site/mirror/manifest.json from main, is the owner action that makes this real.

    Re-verify trigger: --unblock-issue 2239 when a PR from feat/2239-r2-artifact-backend appears (PRs are listed independently of blocked issues), or when main's site/mirror/manifest.json carries mirrors[] — then close as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions