Repository navigation
atelet: resolve an actor's sandbox runtime from the request's sandbox_runtime - #2788
Merged
Dmitry Berkovich (dberkov) merged 1 commit intoOct 17, 2026
Conversation
…_runtime Run and Restore found the runtime to stage by hashing the request's sandbox_assets with the function the syncer hashes a SandboxConfig version with, a stopgap from before the request named the runtime. The request now carries sandbox_runtime, filled by ate-api-server from the worker assignment, which is a runtime the worker registered from the file this node wrote. So the lookup takes the sandbox_bundle_hash attribute from there and the hashing goes. The field is required: a request without it, or without the attribute, is InvalidArgument. Every worker ate-api-server can place an actor on has registered a default runtime, since the worker registers only once its runtimes file names one, so an assignment always has a runtime to send. A hash the index does not hold stays FailedPrecondition, and so is a hash advertised under another sandbox class than the request names, which the hash itself does not cover. sandbox_assets stays in the request for now and is not consulted; its removal from the API follows.
Dmitry Berkovich (dberkov)
force-pushed
the
run-by-sandbox-runtime
branch
from
October 17, 2026 00:36
ddf2019 to
2fa3b2c
Compare
Zoe Zhao (zoez7)
approved these changes
Oct 17, 2026
Zoe Zhao (zoez7)
approved these changes
Oct 17, 2026
Dmitry Berkovich (dberkov)
enabled auto-merge
October 17, 2026 00:45
Shrutiya Mohan (shrutiyam-glitch)
pushed a commit
to shrutiyam-glitch/substrate
that referenced
this pull request
Oct 19, 2026
…t in the metrics suite (agent-substrate#2792) > agent-substrate#2756 has merged; this is one commit on `main`. The page describes agent-substrate#2756's final design: the default runtime is linked under the worker's own directory, in a directory per default the worker's file names, made and removed by the syncer and gone with the pod, so the on-disk table, syncer section, eviction rule, and runbook follow that layout and a subsection gives its lifecycle; and with no budget set atelet starts no eviction pass. Step 6 of agent-substrate#2675, in its small form: the e2e under eviction pressure was dropped as too much machinery for what it proves, and this is what remained worth doing. **Metrics suite.** `ate_sandboxassetcache_size` joins `PlatformMetricPrefixes`, so `TestPlatformMetricsEmitted` proves on every kind lane that atelet registers the instrument, its callback walks a real cache directory without error, and the OTLP path to the collector carries it. Only size qualifies: it is an observable instrument read on every collection, so it has a series from the first export on any install. The eviction and pass counters emit only once a pass had work to do, which never happens with the default unbounded budget. **Doc.** `docs/sandbox-asset-cache.md`, for the operator or engineer who meets the cache for the first time: what lives under `/var/lib/ate` and why it must share a mount; how an actor gets its assets, from the runtime the request names through the index, the cache and the hard links, and what Run, Restore and Checkpoint each do; how the worker sandbox syncer decides which runtimes a node needs, prewarms and pins the defaults, and prunes; the eviction rules and the six flags; the three metrics and what a shortfall means; a runbook for a node over budget; and what is deliberately left out. Linked from the README's doc list, the node supervisor section of the architecture page, and the metrics paragraph of the observability guide. The page describes the request as naming the runtime the worker registered, which is agent-substrate#2788's behavior rather than this stack's. It documents the state once both land rather than the interim. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Run and Restore stop hashing the request's
sandbox_assetsto find the runtime to stage, and read thesandbox_bundle_hashattribute of the request'ssandbox_runtimeinstead. That field is what ate-api-server fills from the worker assignment: the runtime the worker registered from the file this node's atelet wrote, so the hash is in the index by construction. The stopgap hashing and its TODOs go.Required. A request without
sandbox_runtime, or without the attribute, is InvalidArgument. Every worker ate-api-server can place an actor on has registered a default runtime, becauseinternal/ateworker/registerregisters only once the runtimes file names one, so an assignment always has a runtime to send. An unknown hash stays FailedPrecondition. A hash advertised under another sandbox class than the request names is FailedPrecondition too, since the hash does not cover the class.Not yet.
sandbox_assetsstays in the request and is no longer consulted. Removing it from the protos, ate-api-server and atelet is the next PR, so this one stays a change to how atelet reads the request.Tests. The lifecycle tests' Run and Restore requests carry the runtime ate-api-server would send for an actor placed on the worker that advertises their assets. A request with assets but no runtime is InvalidArgument, and still before any on-node work: the invalid-Run test now proves the detach stays scheduled that way instead of through assets for another architecture, which the resolver no longer reads. The resolver test covers the miss, the hit, four malformed runtimes and the class mismatch.
🤖 Generated with Claude Code