Repository navigation
feat(orchestrator): run the daemon in an agent-sandbox Sandbox with runtime: Sandbox - #301
Merged
Merged
Conversation
…untime: Sandbox spec.runtime: Sandbox runs the Orchestrator's daemon in an agent-sandbox Sandbox (agents.x-k8s.io/v1beta1) instead of a Deployment: a stable pod with a workspace volume at /workspace and a state volume at ~/.infer/projects that outlive a suspension. - spec.sandbox.operatingMode suspends and resumes the Sandbox. A pod that finished is cycled through Suspended, and a suspension completes before a resume, so a fresh pod reattaches the volumes. - spec.sandbox.shutdownTime deletes the Orchestrator once it passes, with the Sandbox, the volumes and everything else it owns. - spec.sandbox.storage sizes both volumes when the Sandbox is created. - The pod runs as <name>-daemon, a ServiceAccount whose Role may only get and patch its own Orchestrator, so the daemon can suspend itself. It finds the Orchestrator through INFER_DAEMON_KUBERNETES_ORCHESTRATOR and INFER_DAEMON_KUBERNETES_NAMESPACE. - status.podName names the Sandbox's pod once it is ready. - Switching the runtime replaces the workload the other runtime left. agent-sandbox stays optional. The controller detects the Sandbox CRD through the RESTMapper at startup and only watches Sandboxes when it is there. Without it the operator runs as before, and a Sandbox Orchestrator gets Ready=False with reason SandboxCRDMissing. The Sandbox is driven as an unstructured object, so the operator takes no agent-sandbox Go dependency. envtest installs the pinned v1.0.8 CRD, and task cluster:create installs agent-sandbox for the e2e suite. Closes #298
…in the Sandbox runtime A review against agent-sandbox v1.0.8's API docs, KEPs and threat model found the Sandbox runtime deviating from them. - The pod has no Kubernetes API access (automountServiceAccountToken: false), so the per-Orchestrator ServiceAccount, Role and RoleBinding are gone. The daemon idles out by exiting 0, and the operator parks the Orchestrator itself by setting spec.sandbox.operatingMode: Suspended. A daemon that leaves agents-done=true as its termination message starts the new spec.sandbox.retention. - The pod runs as uid 1000 with runAsNonRoot, no privilege escalation, no capabilities and the RuntimeDefault seccomp profile, and the new spec.sandbox.runtimeClassName runs it under gVisor or Kata. - agent-sandbox applies a new pod template only to the next pod, so a template change now cycles the running pod through Suspended. - Failed pods are left to failedPodPolicy: Recreate and its backoff. Succeeded pods stay terminal, as upstream intends. - spec.sandbox.shutdownTime is passed to the Sandbox with shutdownPolicy Retain, and the Orchestrator is deleted once the Sandbox reports SandboxExpired. Expiry is checked before the spec is validated. - Conditions only count for the Sandbox's current generation, and a Sandbox that is not ready passes on its own reason. - spec.runtime and spec.sandbox.storage are fixed at creation, because a switch would drop the Sandbox's volumes. The workload swap is gone. - A RESTMapper error other than a missing kind fails the setup instead of turning the runtime off. The controller also enabled the channels whenever spec.channels was set, even with no channel enabled, which `infer daemon` refuses. Channels now count as something to run only while a channel is enabled.
inference-gateway-releaser Bot
added a commit
that referenced
this pull request
Oct 31, 2026
## [0.28.0](v0.27.1...v0.28.0) (2026-10-31) ### ✨ Features * **orchestrator:** run the daemon in an agent-sandbox Sandbox with runtime: Sandbox ([#301](#301)) ([63386e2](63386e2)), closes [#298](#298) * **orchestrator:** run the full infer daemon with optional channels and the AG-UI binding ([#300](#300)) ([fa7d927](fa7d927)), closes [#297](#297) ### 🐛 Bug Fixes * **orchestrator:** run infer daemon instead of the removed channels-manager ([#299](#299)) ([62a6af7](62a6af7)), closes [#296](#296), references [inference-gateway/cli#1051](inference-gateway/cli#1051) ### 👷 CI * **deps:** bump actions/setup-node ([#288](#288)) ([d98dcb2](d98dcb2)) * **deps:** bump docker/login-action ([#293](#293)) ([5f0cef1](5f0cef1)) * **deps:** bump github.com/onsi/ginkgo/v2 ([#289](#289)) ([03684df](03684df)) * **deps:** bump rancher/k3s ([#283](#283)) ([d58b0db](d58b0db)) * **deps:** bump sigs.k8s.io/controller-runtime ([#284](#284)) ([4dc8bc9](4dc8bc9)) * **deps:** bump sigs.k8s.io/gateway-api ([#287](#287)) ([262ff14](262ff14)) * **deps:** bump the github-actions group with 2 updates ([#290](#290)) ([cf4c07b](cf4c07b)) * **release:** label issues and PRs shipped in an rc with rc ([#295](#295)) ([25cac50](25cac50)) ### 🔧 Miscellaneous * **deps:** bump claude-code 2.1.285 -> 2.1.289 ([#285](#285)) ([5e36bc7](5e36bc7)) * **deps:** bump claude-code 2.1.289 -> 2.1.296 ([#291](#291)) ([eb53de2](eb53de2)) * **deps:** bump claude-code 2.1.296 -> 2.1.308 ([#294](#294)) ([025a54a](025a54a)) * **deps:** bump infer CLI v0.221.1 -> v0.226.0 ([#286](#286)) ([505d489](505d489)) * **deps:** bump infer CLI v0.226.0 -> v0.231.1 ([#292](#292)) ([490b5af](490b5af))
Contributor
|
🎉 This PR is included in version 0.28.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
spec.runtime: Sandboxruns the Orchestrator's daemon in an agent-sandboxSandbox(agents.x-k8s.io/v1beta1) instead of a Deployment. The Sandbox is a stable pod with a workspace volume (/workspace) and a state volume (~/.infer/projects) that outlive a suspension. The infer CLI will create one per teleported session instead of managing Sandboxes itself.The runtime follows agent-sandbox v1.0.8's API docs, KEPs and threat model. A review against them reworked the first version (see the second commit).
Closes #298
Changes
spec.runtime: Deployment|Sandbox, defaultDeployment. It is fixed at creation, because switching away from a Sandbox would delete its volumes.spec.sandbox:storage, fixed at creationoperatingModeshutdownTimeretentionruntimeClassNamespec.sandboxwithoutruntime: Sandbox.status.podName, and aRUNTIMEprint column.internal/controller/orchestrator_sandbox.go)failedPodPolicy: Recreate.automountServiceAccountToken: false, following the threat model's rule that pods get no API access unless explicitly authorized.INFER_DAEMON_IDLE_EXIT). The operator seesFinished=Truewith reasonPodSucceeded, sets the Orchestrator'sspec.sandbox.operatingMode: Suspendeditself, and a client resumes the daemon by settingRunning. A daemon that leavesagents-done=trueas its termination message startsspec.sandbox.retention.runAsNonRoot, no privilege escalation, all capabilities dropped,RuntimeDefaultseccomp.runtimeClassNameselects gVisor or Kata.Suspended, and a resume waits for the suspension to complete.failedPodPolicy: Recreateand its backoff (KEP-729). Succeeded pods stay terminal and mean "idle".shutdownTimeand the retention deadline, withshutdownPolicy: Retain.Ready=Falsewith reasonSandboxExpired.shutdownTimethat already passed deletes it before the spec is validated.SandboxReady,SandboxNotReady(with the Sandbox's own reason, such asImagePullBackOff),SandboxSuspendedandSandboxCRDMissing.status.podNamenames the pod once it is ready.Ready=Falsewith reasonSandboxCRDMissing. A RESTMapper error other than a missing kind fails the setup instead of turning the runtime off.agents.x-k8s.iosandboxes, andgeton pods.install.yamlis regenerated.spec.channelswas set, even with no channel enabled, whichinfer daemonrefuses with exit 1. Channels now turn on, and count as something to run, only while a channel is enabled.AGENT_SANDBOX_VERSION: v1.0.8.task fetch-agent-sandbox-crdsinstalls that CRD in envtest.task agent-sandbox:install, whichtask cluster:createnow runs for the e2e cluster.Contract for the infer CLI
agents-done=trueoragents-done=falseto/dev/termination-log.spec.sandbox.operatingMode: Running.Where this differs from #298
spec.image,spec.envorspec.runtime. The daemon signals idleness by exiting instead.shutdownPolicyfield. The operator always passesRetainto the Sandbox and deletes the Orchestrator onSandboxExpired, so an expired Sandbox is never recreated with empty volumes.Test plan
task test(envtest). 23 sandbox specs cover:runtimeClassNameSuspendedSandboxExpired, and an overdueshutdownTimespec.runtimeimmutability and the CEL rulestask fmt,task vet, andtask generate manifestsleave the tree clean/workspacesurvives suspend and resumecli:0.239.0-rc.9idles out with exit 0, the operator parks the Orchestrator, and settingRunningresumes ittask test:e2e(CI)The idle e2e spec pins
cli:0.239.0-rc.9, the first CLI withINFER_DAEMON_IDLE_EXIT. It moves tocli:latestonce 0.239.0 is released.task lintreports one finding thatmainhas too: the deprecatedRequeueatinternal/controller/gpu_controller.go:109.