When scaling remote build execution, coalesce identical Action Digests and mount inputs lazily over FUSE.
TL;DR30-second simplified summary▾
Cuts input bandwidth 88% and achieves >92% cache hit rates.
Singleflight Coalescing & Lazy FUSE Mounting.
Why this matters: Eliminate duplicate CI work and 88% wasted input downloads.
Scheduler coalesces concurrent requests for the same ActionDigest; workers mount virtual Merkle trees via FUSE and pull only read() pages from local NVMe CAS.
| Choice | What it buys | What it costs |
|---|---|---|
| Eager Full Tree Download | Simple worker | Downloads 500 MB when only 60 MB is read |
| Lazy FUSE + NVMe CAS | Sub-second start; 88% bandwidth saved | Requires FUSE daemon on worker |
class SingleflightScheduler:
def __init__(self):
self.inflight = {}
def submit(self, action_digest: str, dispatch_fn):
if action_digest in self.inflight:
return self.inflight[action_digest] # Coalesce duplicate CI action
fut = dispatch_fn(action_digest)
self.inflight[action_digest] = fut
return fut
Zstd ByteStream & Hermetic Execution Trace.
Why this matters: Stream compressed artifacts deterministically.
Outputs are compressed with Zstd-3 (2.8x ratio) and streamed via multiplexed gRPC ByteStream.
- Problem
- How to mount 500 MB input Merkle trees onto thousands of ephemeral MicroVM workers without saturating cluster NICs.
- Naive Solution
- Eagerly download and extract every file in the input Merkle tree onto worker disk before starting the compiler.
- Why It Fails
- Compilers typically read only ~12% of declared header/dependency trees; eager downloads waste 88% of NIC bandwidth and add 5–15s cold-start delay.
- Alternatives
- Eager full-tree download, shared NFS mount (no hermetic isolation), or Lazy FUSE + node-local NVMe CAS.
- Engineering Decision
- Mount the input Merkle tree via Lazy FUSE backed by a shared node-local NVMe CAS cache, fetching missing blobs on first read().
- Trade-Offs
- Adds minor FUSE syscall overhead on first file open, but cuts network transfer 88% and starts workers in <200 ms.
50 CI jobs simultaneously trigger the exact same uncached test action with a 500 MB input tree. How do you minimize both compute and network load?
public boolean canCoalesce(boolean isHermetic, String digest) {
return isHermetic && digest != null && !digest.isEmpty();
}
Practice: Make the trade-off yourself.
Why does Lazy FUSE cut remote worker network transfer by ~88%?