build-train: remote content-addressed build cache (R2)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- cloud, typescript
调研方向
Read contentHashStalenessOracle and recordBuilt to trace the existing local cache key and build flow, then inspect the bundle-store upload path and ADRs 0015 and 0020 for storage and scoping. Start after blockers #481 and #482 are complete; add restore verification, opt-in publishing, and fault-injection coverage. Done means remote hits are verified before reuse, successful builds publish non-fatally, and local-only behavior remains the default.
由索引模型根据 Issue 内容生成。
描述
What to build
The train's build cache (.bos/build-cache.json) is local-only — every fresh CI runner, agent session, and laptop rebuilds unchanged workspaces. Make the cache content-addressed and shareable: publish input-hash → dist bundle to the R2-backed bundle storage (ADR 0015 / ADR 0020 already provision the store and upload plumbing), restore on hit before judging staleness.
The cache key already exists: the member's input hash + build-mode env (envKey in contentHashStalenessOracle).
Behavior:
- Judgement: if the local cache is cold but a remote entry exists for the key, restore the dist into the member, run the #482 output verification against the recorded hashes, and treat it fresh on match (rebuild on any mismatch — restore is never trusted unverified).
- Publish: after a successful local build (
recordBuilt), upload the dist keyed by input hash. Upload failures are non-fatal — the cache is an optimization, never a gate (same posture as the unwritable local cache,workspace.ts:394). - Opt-in: gated behind a flag/env (e.g.
BOS_BUILD_CACHE_REMOTE=...+ existing storage credentials); default remains local-only. - Auth/scope: reuse the bundle-store upload path and scoping (ADR 0015
bundles:write/bundles:read); keys are namespaced so members can't collide across projects.
This is the Bazel remote-cache win ported onto the train — no Bazel, no rules, just the store that already exists.
Blocked by
#481 (stats fast path — restore must be cheaper than rebuild to be worth it), #482 (output verification — restored dists must be integrity-checked before being trusted).
Status
- Remote judgement: cold-local + remote-hit → restore → verify → fresh
- Post-build publish keyed on input hash + envKey; failures non-fatal
- Opt-in flag/env; local-only default preserved
- Fault-injection tests: corrupt restore, missing remote entry, upload failure mid-train, concurrent publish
- Changeset added
- 主要语言
- TypeScript
- 星标
- 5
- 派生
- 3
- 平均合并
- 11 小时 8 分钟
- 30 天内合并 PR
- 90
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NEARBuilders/everything-dev 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
NEARBuilders/everything-dev#400 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 55/100
NEARBuilders/everything-dev#507 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 5/5 一周以上 新手友好度 35/100
NEARBuilders/everything-dev#496 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
NEARBuilders/everything-dev#493 ·
维护者通常 1 天内回复
-
ready-for-human
难度 5/5 一周以上 新手友好度 15/100
NEARBuilders/everything-dev#491 ·
维护者通常 1 天内回复
查看 NEARBuilders/everything-dev 的全部 Issue
相似的 Issue
-
Area/Cloud Needs Triage Type/Bug
难度 1/5 1-3 小时 新手友好度 86/100
wso2/product-integrator#2847 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
bluesky-social/social-app#12118 ·
维护者通常 1 天内回复
-
enhancement
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
heygen-com/hyperframes#6021 ·
维护者通常 1 天内回复
-
check:passed streams:edit
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复