Skip to content

ateapi, atelet: remove sandbox_assets from Run and Restore RPCs - #2879

Merged
Zoe Zhao (zoez7) merged 6 commits into
agent-substrate:mainfrom
shrutiyam-glitch:asset-cleanup
Oct 19, 2026
Merged

Zoe Zhao (zoez7) merged 6 commits into
agent-substrate:mainfrom
shrutiyam-glitch:asset-cleanup

Conversation

@shrutiyam-glitch

Copy link
Copy Markdown
Collaborator

Completes the removal of sandbox_assets from the ate-api-server -> atelet wire protocol following #2780 and #2781. Since atelet now resolves the pause image and sandbox binaries for Run and Restore directly from sandbox_runtime via its advertised-runtime index, ate-api-server no longer needs to resolve SandboxConfig or send SandboxAssets on RunRequest and RestoreRequest.

  • ateletpb & validation: Remove sandbox_assets from RunRequest and RestoreRequest, delete SandboxAssets, ArchAssets, and AssetFile, and make sandbox_runtime required on both RPCs.

  • cmd/ateapi & RBAC: Delete sandbox_assets.go, remove sandboxConfigLister and workerPoolLister from ActorWorkflow and NewRPCService, drop sandboxconfigs from ate-api-server RBAC, and require a non-nil DefaultRuntime in scheduler.Applies.

  • cmd/atelet: Read op.sandboxClass from sandbox_runtime in Restore, delete dead recordFromRequest, and replace poolConfigName with WorkerPool.ResolvedSandboxConfig().

  • Tests pass

  • Appropriate changes to documentation are included in the PR

atelet already resolves the pause image and sandbox binaries for Run and
Restore from the request's sandbox_runtime via its advertised-runtime
index, so carrying sandbox_assets on RunRequest and RestoreRequest and
resolving WorkerPool and SandboxConfig in ate-api-server is redundant.
- Remove sandbox_assets from RunRequest and RestoreRequest, delete the
  SandboxAssets, ArchAssets, and AssetFile messages from atelet.proto,
  and mark sandbox_runtime required on RunRequest and RestoreRequest.
- Delete ate-api-server's SandboxAssets resolution (sandbox_assets.go),
  drop sandboxConfigLister and workerPoolLister from ActorWorkflow and
  NewRPCService, and drop sandboxconfigs from ate-api-server's RBAC.
- Require a non-nil DefaultRuntime in scheduler.Applies so a worker
  marked active before reporting its runtime via RegisterWorker is not
  scheduled with a nil sandbox_runtime.
- Remove dead recordFromRequest, ValidateAssetHash, and poolConfigName
  helpers, using WorkerPool.ResolvedSandboxConfig() in atelet instead.
verbs: ["get", "watch", "list"]
- apiGroups: ["ate.dev"]
resources: ["workerpools"]
resources: ["workerpools", "csidriverconfigs"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it still need to watch workerpools?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ONly the Otel metric is using this to record the workercount.
But this could actually be moved to ate-controller too I think, so ateapi doesn't need to watch workerpool anymore.
Wdyt ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you file an issue to move that to ate-controller as well.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread cmd/atelet/lifecycle_test.go Resolved
@zoez7
Zoe Zhao (zoez7) added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 19, 2026
@bowei Bowei Du (bowei) added area/api-machinery area/node kind/cleanup Small fixes that are not bugs, for example a typo in a code comment labels Oct 19, 2026
@zoez7
Zoe Zhao (zoez7) added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 19, 2026
@zoez7
Zoe Zhao (zoez7) added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 19, 2026
@zoez7
Zoe Zhao (zoez7) added this pull request to the merge queue Oct 19, 2026
Merged via the queue into agent-substrate:main with commit 34bde58 Oct 19, 2026
15 checks passed
Yufan Su (yufan-su) pushed a commit to yufan-su/substrate that referenced this pull request Oct 21, 2026
Follow up after agent-substrate#2879 

Removes `sandbox_class` from the `Worker` spec (`ateapipb.Worker`) and
reads the worker's sandbox class from
`Worker.status.default_runtime.sandbox_class`.

Each worker already reports its `default_runtime` (including
`sandbox_class`) to `WorkerService.RegisterWorker` via `atelet`
alongside its capacity before it can take any actors. Carrying
`sandbox_class` on the `Worker` spec required `ate-controller` to copy
it from the `WorkerPool` on `CreateWorker` and duplicated what the
worker itself reports in `WorkerStatus`. Using
`status.default_runtime.sandbox_class` as the single source of truth
removes that duplication across `ate-controller`, `ate-api-server`,
`fake-workersync`, and `kubectl-ate`.


#### Behavior changes

- **Class is fixed by the first registration.** `RegisterWorker` records
the class from the first report and refuses a later report with a
different `default_runtime.sandbox_class` (restorable runtimes must
match it too). The pool's declared class no longer cross-checks the
worker's report: the pod's shape comes from the pool, and the report is
the pod's own authenticated statement. The proto comments on
`WorkerStatus.default_runtime` and
`RegisterWorkerRequest.default_runtime` document this.
- **Before a worker registers it has no class.** `kubectl ate get/top
workers` show an empty CLASS for it and `--sandbox-class` filters it
out;`ate.workerpool.workers` counts it under `ate.sandbox.class=unknown`
(registry note updated). The scheduler never placed on such a worker,
and still doesn't:`Applies` rejects an empty class, which also covers
the "no default runtime" guard agent-substrate#2879 added, so that guard is folded into
the class check.


- [x] Tests pass
- [x] Appropriate changes to documentation are included in the PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api-machinery area/node kind/cleanup Small fixes that are not bugs, for example a typo in a code comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants