Repository navigation
atelet: stage default sandbox runtime into worker directory and remove runtimePrewarmer - #3852
Draft
Shrutiya Mohan (shrutiyam-glitch) wants to merge 2 commits into
Conversation
buildFile staged the default into a scratch directory it removed again and left the link into workers/<uid>/default-runtime/<hash> to the runtime prewarmer on another queue, so an eviction pass could take the default in between once it was older than the cache's min age. A gVisor default whose runsc digest was memoized was not staged at all, so promoting an evicted version wrote a file naming a runtime the cache did not hold. Stage the default straight into its default-runtime directory with the same ensureSandboxAssets call an activation uses: a filled directory costs a stat per asset, and an evicted asset is fetched before the file names the version. After the write, remove the directories of defaults the file no longer names. Verify restorable versions once per bundle hash for both classes, keeping the runsc probe memoized per digest. Signed-off-by: Shrutiya <shrutiyam@google.com>
The syncer links each worker's default runtime into its directory as it builds the worker's file, so the prewarmer had nothing left to do. Drop it with its queue, the dirGone checks it needed because the syncer could remove its directory under it, and the stageSandboxAssets variant that existed so it would not recreate that directory. Signed-off-by: Shrutiya <shrutiyam@google.com>
This branch has not been deployed
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.
Fixes #3279
gvisorCPUFeaturesskipped staging whencpuFeaturesalready held therunscdigest. Promoting an evicted restorable gVisor version todefaultVersionwhile object storage was unreachable wrote an uncached runtime tosandbox-runtimes.jsonand unlinked the previous default.buildFilealso staged microVM defaults into a scratch directory and removed those links beforeruntimePrewarmerlinkedworkers/<uid>/default-runtime/<hash>on a second queue. Cache GC could evict the default in that window once an entry passed--sandbox-asset-cache-min-age, and every re-sync repeated the scratch links.stageDefaultnow stages the default version intoworkers/<uid>/default-runtime/<hash>viaensureSandboxAssetsduringbuildFile. A populated directory stats each asset once, and an evicted asset is fetched and linked beforewriteupdatessandbox-runtimes.jsonandpruneDefaultRuntimeDirsremoves retired defaults.stageScratchverifies restorable versions once per bundle hash inverifiedBundlesfor both gVisor and microVM, and runs therunscCPU-feature probe from a scratch link outside the worker directory.runtimePrewarmerandstageSandboxAssetshave no remaining callers and are removed.AI-assisted, I reviewed and tested it.