Repository navigation
Size Brainstore cache as a percentage of the cache volume - #108
Draft
Jeff McCollum (jeffmccollum) wants to merge 2 commits into
Draft
Jeff McCollum (jeffmccollum) wants to merge 2 commits into
Jeff McCollum (jeffmccollum) wants to merge 2 commits into
Conversation
Mirrors terraform-aws-braintrust-data-plane#420. When objectStoreCacheFileSize is unset (the new default), each Brainstore pod sets BRAINSTORE_OBJECT_STORE_CACHE_FILE_SIZE at startup to objectStoreCacheFileSizePercent of its cache volume: 90% for readers and fast readers, 75% for writers. The volume size is the filesystem at cacheDir, capped by volume.sizeLimit and volume.size when set. An explicit objectStoreCacheFileSize keeps the existing behavior: Brainstore starts directly and reads the size from its ConfigMap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On EKS the documented storage budget is ephemeralStorage.request, so the computed cache size now also respects ephemeralStorage.request and ephemeralStorage.limit. Document per-platform behavior in the README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Helm version of braintrustdata/terraform-aws-braintrust-data-plane#420. Brainstore's object store cache is now sized as a percentage of the cache volume, like the AWS Terraform module, instead of a fixed
1000Gidefault. Readers and fast readers use 90%. Writers use 75%.brainstore.<role>.objectStoreCacheFileSizePercent(90 / 90 / 75).objectStoreCacheFileSizenow defaults to"".objectStoreCacheFileSizeis empty, the container starts through/bin/sh -c. It reads the size of the filesystem atcacheDirand caps it at the smallest ofvolume.sizeLimit,volume.size,ephemeralStorage.requestandephemeralStorage.limitthat is set. It then exportsBRAINSTORE_OBJECT_STORE_CACHE_FILE_SIZE(wholeGi, rounded down) andexecsbrainstore web. The size it picks is logged at startup. Under 1Gi it exits with an error.objectStoreCacheFileSizeis set, nothing changes: samebrainstore webcommand, same ConfigMap key.helm upgrade --reuse-valuesfrom older chart versions still works.google-standardhad a1000Gicache on a200Givolume.Upgrade impact
1000Gidefault get a computed size, and their Brainstore pods restart, because the pod template changes.objectStoreCacheFileSize, or that upgrade with--reuse-values, see no change.emptyDiron a shared node disk and no size is set, the percentage applies to the whole node disk. Brainstore pods need dedicated nodes, or one of the sizes above set. This is documented in the README.Chart.yamlversion bump, per AGENTS.md.Validation
./test.shpasses: 362 unit tests, multi-cloud rendering, andhelm lint. The newbrainstore-cache-file-size_test.yamlcovers fixed vs percentage sizing, per-role defaults, every cap source, EKSephemeralStorage, Azure Container Storage, and bad input. 13 of its first 15 tests fail againstmain.public.ecr.aws/braintrust/brainstore:v2.17.0filesystem (chroot, uid 1000, 10GiB tmpfs atcacheDir, a stand-inbrainstorebinary):7Gi8GisizeLimit: 4Gi:2Givolume.size: 100Gilarger than the disk: the disk size is usedsizeLimit: 1Gi: exits 1 with an error🤖 Generated with Claude Code