You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issues tracks the design for how to upgrade actor's base image during the lifetime of an actor
CUJ: As an actor developer, I would like to ship new binary versions or patch CVEs of existing actor instances.
Rule (agreed upon during the summit): Actors cannot upgrade using an existing memory snapshot.
Design idea discussed during the summit:
Users should be able to create multiple versions of an ActorTemplate, once a ActorTemplateVersion is created, its actor image version is immutable.
Users should be able to define upgrade strategy, such as actor termination policy, how the upgrade is applied. For M2, the minimalist default upgrade strategy could be "on next resume, use new ActorTemplateVersion".
This requires more investigation for what the ActorTemplateVersion API should look like with different SnapshotConfigs, and what happens exactly during an upgrade.
2026-08-21 Update : Below is the updated design proposal for actor upgrade:
Objective
As an actor developer, I would like to ship new features in my container image, or patch CVEs, for existing actor instances. How to do this in Substrate?
Design decisions
For M2, start with building primitives that both an automated rollout system and substrate user can use. Substrate itself will not trigger suspend or resume of any actors, but will provide abilities to
Move the ActorTemplate (AT) CRD into Substrate without change. The new Substrate resource is immutable; shipping a new image or sandbox config means creating a new ActorTemplate. There is no separate ActorTemplateVersion resource.
Upgrade each actor by first updating its template reference (UpdateActor), then resuming it (ResumeActor), and rollback to the previous template on failure.
Get template distribution of all actors, to confirm rollout completeness.
Post M2, when we have more data of the shape of rollout policies that will be useful to customers, we can explore building rollout controllers in substrate.
Proposed API
Immutable ActorTemplate
ActorTemplate will be a Substrate resource managed through ate-api, instead of a Kubernetes custom resource (see discussion in issues/368). Substrate owns the lifecycle of each AT. The CRD schema moves over without change; the only semantic change is that the resource is immutable after creation.
Since every field is immutable within one AT, the interesting question becomes which fields may differ between two templates that actors are upgraded across. The rule I used was "anything that affects the golden snapshot requires a new template."
ActorTemplate Field
Mutable in each AT?
Can change between templates?
Why?
Existing fields
containers (images, command, args, env vars)
immutable
yes
this is the upgrade
volumes (names + sources)
immutable
immutable for M2.
ResumeActor may not work when volumes are modified. Post-M2 we'll consider supporting add / remove volumes, but not changing existing volumes.
volume mount paths
immutable
snapshotsConfig.onPause / onCommit
immutable
yes
New templates may choose to change the snapshot scope to use DurDir only, or enable full memory snapshot.
snapshotsConfig.location
immutable
yes
Post M2, we could consider only affecting new Actors created on the new template.
New fields
SandboxConfig
immutable
yes
This is upgrading the version of runsc or uvm binaries to new versions during CVE.
CPU class
immutable
yes
Golden becomes unusable with different CPU classes.
worker_selector
immutable
yes
Previously the one mutable field on the template; with full immutability, changing scheduling constraints also means a new template.
Putting it together, the ActorTemplate representation is the definition already in ateapipb/ateapi.proto:
messageActorTemplate {
// Common resource metadata: atespace, name, uid, version, timestamps.ResourceMetadatametadata=1;
// worker_selector restricts which worker pools actors from this template// may use.Selectorworker_selector=2;
repeatedContainercontainers=3;
repeatedVolumevolumes=4;
SnapshotsConfigsnapshots_config=5;
// sandbox_config selects the sandbox runtime this version's actors run on.SandboxConfigsandbox_config=6;
// Resource usage configuration.Resourcesresources=7;
ActorTemplateStatusstatus=8;
}
// SandboxConfig selects the sandbox runtime for an ActorTemplate.messageSandboxConfig {
// sandbox_class selects the sandbox runtime family.// Required; must be specified.SandboxClasssandbox_class=1;
// config_name names the cluster-scoped SandboxConfig Kubernetes object// supplying the sandbox binaries. Required; must match sandbox_class.stringconfig_name=2;
}
messageSnapshotsConfig {
// on_pause selects what is captured during pause actor.SnapshotContentScopeon_pause=1;
// on_commit selects what captures.// Must be a subset of on_pause: FULL allows FULL or DATA, DATA allows DATA.SnapshotContentScopeon_commit=2;
// on_resume selects, per snapshot situation, what supplies the guest state// at resume. Unset means the defaults documented on OnResumeConfig.OnResumeConfigon_resume=3;
// storage_location is the base object-storage URI snapshots of actors on// this version are stored under. Required.stringstorage_location=4;
}
enumActorTemplatePhase {
ACTOR_TEMPLATE_PHASE_UNSPECIFIED=0;
ACTOR_TEMPLATE_PHASE_INITIAL=1;
ACTOR_TEMPLATE_PHASE_RESUME_GOLDEN_ACTOR=2;
ACTOR_TEMPLATE_PHASE_WAIT_GOLDEN_ACTOR=3;
ACTOR_TEMPLATE_PHASE_READY=4;
ACTOR_TEMPLATE_PHASE_FAILED=5;
}
messageActorTemplateStatus {
// State machine, mirroring the ActorTemplate CRD PhaseType:// INITIAL -> RESUME_GOLDEN_ACTOR -> WAIT_GOLDEN_ACTOR -> {READY | FAILED}.// READY and FAILED are terminal; the version is only usable once READY.ActorTemplatePhasephase=1;
// message is a human-readable explanation of the current state, most// useful when the ActorTemplate is FAILED.stringmessage=2;
// golden_snapshot points at the ActorSnapshot, in the reserved ate-golden// system atespace, built for this version by ate-api. Set once state is// READY.ObjectRefgolden_snapshot=3;
// sandbox_assets is the referenced SandboxConfig's content frozen at// creation time.SandboxAssetssandbox_assets=4;
}
Note on naming: Substrate will NOT enforce a strict naming format, but will provide a guide with recommended conventions (like [base-name]-[number], e.g. templ-v1, templ-v2) to users so that templates that form an upgrade lineage remain organized. Substrate itself attaches no meaning to the names; the lineage exists only in the user's head (see "No default tag in v1" below).
Actor changes
Actor gains two template references:
template (spec, mutable via UpdateActor): the desired template. ResumeActor always resumes onto this template.
status.current_template(status, set by ate-apiserver only): the template the actor last successfully resumed with. Empty until the first successful resume.
An upgrade is therefore not a ResumeActor parameter: the caller first moves template forward with UpdateActor, then calls ResumeActor. ResumeActor itself takes no template argument.
messageActor {
...
// Desired template. Set at CreateActor; move forward with UpdateActor.ObjectReftemplate=17;
ActorSnapshotlatest_snapshot=18;
}
messageActorStatus {
...
// The template the actor last successfully resumed with.// Set by ate-apiserver after ResumeActor reaches readyz.ObjectRefcurrent_template=9;
}
Each ActorSnapshot must also contain a reference to the ActorTemplate used to create this Snapshot, since restoring snapshots with a different ActorTemplate may fail.
CreateActor(template) — the template reference is required.
There is no default template. See "No default tag in v1" below.
Upgrade Actor
The full lifecycle, with the actor's state after each step:
Create actor and first resume
CreateActor(.template = templ-v1)
.template = templ-v1; .status.current_template= ""
ResumeActor()
resumes using templ-v1
wait for readyz
set .status = STATUS_RUNNING
set .status.current_template = templ-v1
return success
.template = templ-v1; .status.current_template= templ-v1
Begin upgrade to templ-v2 — for each actor on templ-v1:
actor = GetActor()
UpdateActor(): set .template = templ-v2
ResumeActor()
resumes using templ-v2
wait for readyz
if fail: return failure
.template = templ-v2; .status.current_template = templ-v1
(the next resume will attempt templ-v2 again)
set .status = STATUS_RUNNING
set .status.current_template = templ-v2
return success
.template = templ-v2; .status.current_template = templ-v2
Run self-test on the actor
wait for success / fail
SuspendActor()
if test failed:
// If the self-test failed *and* the operator wants the actor immediately proven good on the old template (rather than lazily verified at its next natural resume), the rollback would be `UpdateActor` \+ `ResumeActor` \+ `SuspendActor`.
UpdateActor(): set .template = actor.status.current_template // i.e. templ-v1
ResumeActor()
SuspendActor()
Move on to the next actor
Ensure 100% actors are upgraded to new template
Not every upgrade needs to reach 100% of idle actors. In M2, substrate will not have any rollout policy that drives the upgrade to 100% of idle actors. I think there are 2 types of upgrades:
If users do not care about ancient suspended actors referencing old templates, this problem doesn't exist for them.
If the users do need to upgrade all actors, or prove during security auditing that suspended actors can never resume with an image that contains CVE, we need a solution for getting to 100% of actors.
After M2 launch, users are on their own to sweep all actors and upgrade by resuming them.
Use ListActorsRequest to find remaining actors whose current_template is the old template.
Call UpdateActor(template=new) then ResumeActor() to upgrade each actor (see detailed steps above).
Delete the old ActorTemplate once no Actors or ActorSnapshots reference it, so it cannot be used during resume anymore.
Explicitly out of scope for M2
No default tag
There will be no default template tag in M2. CreateActor must name its template explicitly, and there is no server-side pointer that upgrade tooling can move to redirect new creations.
pull/905 explored an ActorTemplateTag resource (analogous to ActorSnapshotTag) as the pointer concept: users could maintain named tags like my-default and move them between templates independently of CreateActor. ActorTemplateTag addresses a real usability concern, but this is a P1 — users can work around the limitation by having a "pointer to an ActorTemplate" that they maintain outside of substrate (a config value etc.) and resolve it themselves before calling CreateActor.
No ActorTemplateGroup
With ATV gone, ActorTemplate no longer plays the role of a grouping mechanism for its versions — each template stands alone, and the relationship between templ-v1 and templ-v2 is purely a naming convention on the user's side. There will be no "ActorTemplateGroup" concept for now, until a concrete use case emerges.
Activity
zoez7 commentedon Jul 29, 2026
Initial design draft https://docs.google.com/document/d/1OsHMah0M7vvl1OBtHFtYJngItHWDYcenSCQ1gxhYseU/edit?tab=t.0
microvm: API support for resume Data snapshots on the golden snapshot (…
zoez7 commentedon Aug 5, 2026
2026-08-21 Update : Below is the updated design proposal for actor upgrade:
Objective
As an actor developer, I would like to ship new features in my container image, or patch CVEs, for existing actor instances. How to do this in Substrate?
Design decisions
For M2, start with building primitives that both an automated rollout system and substrate user can use. Substrate itself will not trigger suspend or resume of any actors, but will provide abilities to
ActorTemplate(AT) CRD into Substrate without change. The new Substrate resource is immutable; shipping a new image or sandbox config means creating a newActorTemplate. There is no separateActorTemplateVersionresource.UpdateActor), then resuming it (ResumeActor), and rollback to the previous template on failure.Post M2, when we have more data of the shape of rollout policies that will be useful to customers, we can explore building rollout controllers in substrate.
Proposed API
Immutable ActorTemplate
ActorTemplatewill be a Substrate resource managed through ate-api, instead of a Kubernetes custom resource (see discussion in issues/368). Substrate owns the lifecycle of each AT. The CRD schema moves over without change; the only semantic change is that the resource is immutable after creation.Since every field is immutable within one AT, the interesting question becomes which fields may differ between two templates that actors are upgraded across. The rule I used was "anything that affects the golden snapshot requires a new template."
ActorTemplateFieldcontainers(images, command, args, env vars)volumes(names + sources)snapshotsConfig.onPause/onCommitsnapshotsConfig.locationworker_selectorPutting it together, the
ActorTemplaterepresentation is the definition already inateapipb/ateapi.proto:Note on naming: Substrate will NOT enforce a strict naming format, but will provide a guide with recommended conventions (like
[base-name]-[number], e.g.templ-v1,templ-v2) to users so that templates that form an upgrade lineage remain organized. Substrate itself attaches no meaning to the names; the lineage exists only in the user's head (see "No default tag in v1" below).Actor changes
Actorgains two template references:template(spec, mutable viaUpdateActor): the desired template.ResumeActoralways resumes onto this template.status.current_template(status, set by ate-apiserver only): the template the actor last successfully resumed with. Empty until the first successful resume.An upgrade is therefore not a
ResumeActorparameter: the caller first movestemplateforward withUpdateActor, then callsResumeActor.ResumeActoritself takes no template argument.Each
ActorSnapshotmust also contain a reference to theActorTemplateused to create this Snapshot, since restoring snapshots with a differentActorTemplatemay fail.Create Actor
CreateActor(template)— the template reference is required.Upgrade Actor
The full lifecycle, with the actor's state after each step:
Create actor and first resume
Begin upgrade to templ-v2 — for each actor on
templ-v1:Ensure 100% actors are upgraded to new template
Not every upgrade needs to reach 100% of idle actors. In M2, substrate will not have any rollout policy that drives the upgrade to 100% of idle actors. I think there are 2 types of upgrades:
After M2 launch, users are on their own to sweep all actors and upgrade by resuming them.
ListActorsRequestto find remaining actors whosecurrent_templateis the old template.UpdateActor(template=new)thenResumeActor()to upgrade each actor (see detailed steps above).ActorTemplateonce no Actors or ActorSnapshots reference it, so it cannot be used during resume anymore.Explicitly out of scope for M2
No default tag
There will be no default template tag in M2.
CreateActormust name its template explicitly, and there is no server-side pointer that upgrade tooling can move to redirect new creations.pull/905 explored an
ActorTemplateTagresource (analogous toActorSnapshotTag) as the pointer concept: users could maintain named tags likemy-defaultand move them between templates independently ofCreateActor.ActorTemplateTagaddresses a real usability concern, but this is a P1 — users can work around the limitation by having a "pointer to an ActorTemplate" that they maintain outside of substrate (a config value etc.) and resolve it themselves before callingCreateActor.No ActorTemplateGroup
With ATV gone,
ActorTemplateno longer plays the role of a grouping mechanism for its versions — each template stands alone, and the relationship betweentempl-v1andtempl-v2is purely a naming convention on the user's side. There will be no "ActorTemplateGroup" concept for now, until a concrete use case emerges.[-]Actor Image Upgrade[/-][+]Actor Image Upgrade Design[/+]Add ActorTemplate/ActorTemplateVersion Substrate resource protos
Add ActorTemplate and ActorTemplateVersion as substrate resources; Ad…
Update ActorTemplate substrate resource definition per latest discuss…
Implement ActorTemplate CRUD in the control API (#895)
Mirror systemInfo volumes into the ActorTemplate substrate resource (#…
Add controller in ate apiserver to reconcile ActorTemplate state (#1096)
docs: rewrite counter demo README around the substrate ActorTemplate …
ateapi: UpdateActor allows updating ActorTemplate. (#1365)