Repository navigation
Description
Background
Today the actor lifecycle is split across two tightly coupled components:
atelet: a node-level DaemonSet that the control plane talks toateom: the worker component inside the worker pod that actually runs, checkpoints, and restores actors
To create a single worker, the control plane today coordinates two RPCs:
one to atelet and one to ateom-gvisor. The two processes also share
state through a host bind mount at /run/ateom-gvisor so they can hand
off snapshot files.
Problem
This split presents three structural issues:
-
Two-component coordination. Every worker-lifecycle operation is a
distributed transaction acrossateletandateom. Failures and
partial states have to be reconciled by callers, and upgrades have to
keep the two binaries version-compatible. Debugging means reading two
sets of logs and reasoning about the handoff between them. -
Backend lock-in. The split assumes the gVisor model (a node agent
plus an in-sandbox helper). Adding a different worker backend
(Firecracker, for example) will be harder as we will need to build the support for it in 2 components. -
Shared host
/runmount is a blast radius. Theatelet↔ateom
handoff requires a host bind mount on/run/ateom-gvisor. A
misbehaving sandbox that fills that directory can exhaust/runon
the node and take down every other pod on it. With per-pod state
(no host mount), one bad sandbox only takes itself down.
Proposal
Remove atelet and consolidate its responsibilities into ateom
(running per-worker-pod), exposing a single control-plane-facing
interface. Concretely:
- Worker lifecycle RPCs (create / start / suspend / restore / destroy)
become a single call to the per-pod agent. - The backend (gVisor today, others later) lives behind an interface
insideateom; new backends plug in there. - Snapshot/restore state stays inside the worker pod's own filesystem —
no host mount needed. - In the future, we can potentially even standardtize the api that
ateomexposes to allow out-of-treeateoms.
Currently it is not possible due to how the ateom does networking, but once #110 is in, we can implement this proposal.
Activity
ahmedtd commentedon May 29, 2026
Benjamin Elder (@BenTheElder)
I think we are trending towards keeping atelet for a few reasons:
I don't think the current division of work between atelet and ateom is particularly gVisor specific. atelet downloads everything (including the virtualization binaries), and ateom executes them. Firecracker or cloud hypervisor will have to be structured very similarly, because they have the same problem of snapshots not being guaranteed to be portable forwards and backwards across hypervisor versions.
It's very possible that we may change the division of work between atelet and ateom. However, even in a world where ateom does the image pulls, some sort of host volume is going to be needed in order to share the image pull cache among different ateoms (although, different flavors of ateoms might use different host volumes).
BenTheElder commentedon May 29, 2026
Agreed with all of #128 (comment)
This is addressable without removing atelet, and we definitely expect atelet to evolve.
thockin commentedon May 31, 2026
You say this as if it is solved - is it? Last I heard this was still a problem. As I understood it, please tell me if I am getting it wrong:
In order to "talk to" the ateom over IP, it needs to consume a socket to listen() on. That socket is then unavailable for the actor itself (gvisor or uVM or whatever) to listen on. Best case it would get an "in use" error. Worst case it would appear to succeed in the sandbox, but in-bound traffic would not actually reach the sandbox (stopping at ateom).
Is that right? If so, is there a reasonable solution? Atelet is the proverbial "another level of indirection" here.
I suppose it would be OK to claim a single port, but that sort of intrusion into the actor's space is something I would prefer to avoid.
Another possible option would be to have multiple IPs per pod (no standard k8s API for that).
Or we could intercept traffic and look at L7 (e.g. host headers) toi decide if ateom should eat the packet or forward it.
Or... ?
ahmedtd commentedon May 31, 2026
I think we are much closer to a solution with the veth PR (#110). Right now, it just unconditionally forwards port 80 into the workload, but I think we should have a list of listening ports declared in the ActorTemplate. We will then be free to claim some likely-unused port (1, 2, etc) for ateom to run a server.
This also opens the door to running more than one workload per ateom --- it could work Borg-style, where each workload just says that it needs N ports, and ateom doles out free inbound ports to each workload.
Even if we retain the UDS for inbound ateom communication, so that ateom doesn't consume a listening port, having ateom able to make outbound connections without stepping on the workload is a significant quality-of-life improvement
thockin commentedon May 31, 2026
IMO declaring ports is problematic - agents are very general, so they may not know what ports they use. OTOH we need to do wakeups on SOME port.
Oh please no. The ip-per-port model was born as a reaction to that mess.
Outbound is less of an issue because they are usually ephemeral ports, but they CAN be explicitly chosen by a client.
One of the things we can do (slow path) is feed requests back to kubernetes on what we need to make this stuff work better. Perhaps there needs to be a way to request multiple pod IPs.
yuval-k commentedon Jun 1, 2026
These reasons still doesn't mean the logic should be split. The daemonset can be a point of aggregation, and all the logic can be in the worker pod. I.e. the proposal above does not contradict these goals.
What's the advantage of the
ateletpulling the OCI images vs something like OCI volumes?There's a lot that goes into image management - and it would be nice to re-leverage kubelet for this, so all the image lifecycle (pulling, pull-secrets, caching, GC) is handled for us.
yuval-k commentedon Jun 2, 2026
Example from today:
We are trying to debug an issue where an actor doesn't start.
I wanted to create a binary that starts the actor directly on my laptop (without k8s) so I can debug it without k8s layers getting in the way.
Today it's hard to do as the logic is split across these 2 components.
bowei commentedon Jun 2, 2026
Can we not have Ateom have a leg in the outer network namespace? We can have atelet send it an FD for a socket that is outside and not have to mix the Actor networking with the ateom stuff.
BenTheElder commentedon Jun 2, 2026
I'm going to come back to this in more detail soon, but quickly pointing out:
OCI volumes are defined when creating the pod, we re-use pods for performance reasons.
You cannot dynamically leverage kubelet's OCI volumes (or any other volumes) unless you create new pods.
Yes, I'd love to reinvent as little as possible, but those things are not insurmountable, and unfortunately using them requires putting the Kubernetes API back into the hot path (in which case, I suggest taking a look at agent sandbox).
yuval-k commentedon Jun 3, 2026
yes, I know - Doing what i'm suggesting this would mean different worker pools for different base images.
I don't think we will have k8s api in the hot path in the common case - we can still cycle actors that share the same base image in and out of the same worker, using something like overlay-fs to re-use the same mounted OCI image.
A trade-off here is that we will end up with potentially more worker pool pods; something that we can mitigate with a smarter controller that can scale idle ones to zero.
happy to hear your thoughts!
thockin commentedon Jun 3, 2026
IMO this path is DOA. This is one of the inefficiencies we need to get past. What we need is fungibility.
I wanted to drop a quick note here, because I know this is a HOT topic that we really need to pin down urgently. Several people for the Google team dreamed up a fairly different model for how we might be able to be even better behaved WRT IO, but it's different enough that we need to try to model it and see if it's worth pursuing.
If we were to pursue that model, and decisions we make around the ateom/atelet relationship might be invalidated. I am trying to not waste anyone's time if I can avoid it.
Hopefully we will have some preliminary indicators with a couple of days -- I would ask everyone to hang tight for just a little longer.
I will emphasize a few things:
yuval-k commentedon Jun 12, 2026
To clarify, my suggestion above is one idea. we can achieve this same goal with more minimal changes.
The main goal that's relevant here, is having one component to debug/operate (this ideally will also mean that running locally will be easier).
Another proposal that can work:
I'm not fully sure if above plan will work - just trying to illustrate the boarder point - the idea is to make it easier to debug and operate (bonus points if can also run it locally)
Merge pull request agent-substrate#128 from kagent-dev/sync/upstream-…