BLA-4006 Route Bazel cache by request storage prefix#1
BLA-4006 Route Bazel cache by request storage prefix#1shreyas-blacksmith wants to merge 5 commits into
Conversation
Co-authored-by: Codesmith Staging <codesmith-bot@users.noreply.github.com>
|
Ready for review. Review focus:
Expected storage shapes: Important boundary: this PR provides the bazel-remote storage primitive. FA still needs to attach Validation run locally: env GOCACHE=/private/tmp/bazel-remote-go-cache go test ./... -count=1
git diff --check |
| parts := strings.Split(key, "/") | ||
| if len(parts) >= 2 { | ||
| hash = parts[1] | ||
| if len(parts) >= 4 && parts[2] == "storage_prefix" { |
There was a problem hiding this comment.
This magical string does a lot of heavy lifting but surprisingly does not appear in the PR description, commit message, or any comment I can find. Want to hoist it to the top level and refer to the identifier, and make sure that its role is discussed in BLACKSMITH.md
There was a problem hiding this comment.
Addressed in dc64b97. I removed the literal marker from the generic cache lookup key shape (ac/<hash>/<prefixID> / cas/<hash>/<prefixID> now), hoisted the remaining local disk marker to scopedStorageRootDir, and documented in BLACKSMITH.md that storage_prefix/<sha256(prefix)>/... is local-disk-only. S3/MinIO keys still use the real request-scoped prefix directly for broad repo/generation deletion.
There was a problem hiding this comment.
Killed the magical string - it was a way of delineating the changes that we had made from bazel-remote, but honestly there's no good name for it and it's tough to pick a good location. So I killed it.
|
Follow-up pushed in 8b2d34f: removed the scoped disk marker entirely instead of documenting it. Local disk scoped entries now live directly under <sha256(prefix)>/{ac.v2,cas.v2}/..., BLACKSMITH.md no longer names the removed marker, and rg finds no remaining storage_prefix/scopedStorageRootDir references. Verified with go test ./cache ./cache/disk ./cache/s3proxy -count=1 and a full go test ./... -count=1 run. |
Summary
Contract
FA should attach Bazel request context with:
WithStoragePrefixaffects Action Cache and CAS. AC still uses bazel-remote existing logicalinstance_namehash remapping, and the physical prefix adds a visible repo/generation boundary for broad deletion/cache clearing. Buck2 should not set the required-prefix marker and continues using the configured process-wide prefix.Tests
env GOCACHE=/private/tmp/bazel-remote-go-cache go test ./... -count=1git diff --checkNotes