Repository navigation
profile, substrate: add Profile template resolution and snapshot Tag client support - #586
Conversation
| // to use directly instead of generating an AX-managed template. Mutually | ||
| // exclusive with image and resources. |
There was a problem hiding this comment.
iiuc, "use directly" means that the template skips what BuildActorTemplate adds right? Can we keep the seed semantics, or document what the template must provide?
My concern is that it won't get the trust bundle mount from #581,
There was a problem hiding this comment.
No it is not seed semantics. template and image are mutually exclusive. updated comment. ref #491
| return | ||
| } | ||
|
|
||
| dst.AteActorTemplate = "" |
There was a problem hiding this comment.
Does it mean a Task that overrides only cpu/memory on a Workspace using ateActorTemplate silently drops the template and runs the default image? Should this be an error instead?
I think it is also related to https://github.com/google/ax/pull/586/changes#r4566046898
There was a problem hiding this comment.
right, updated the profile.go with different scenarios. Reject overriding resources alone when base(workspace) uses ate_actor_template.
4dbf09e to
f3fa1bd
Compare
mayawang
left a comment
There was a problem hiding this comment.
Nice groundwork. One thing to keep in mind when this gets wired in: the ax- templates are shared across tasks, so task deletion must never sweep them (same trap yongruilin caught on #552), and they'll need their own GC eventually. Today's per-task sweep doesn't match them, so fine for now.
…client support Part of google#563 - pkg/apis/v1alpha1, internal/apivalidation, docs: enforce that Profile.ate_actor_template references an existing ActorTemplate directly and is mutually exclusive with image and resources. - internal/controller: add MergeProfile, ResolveProfileTemplate (deterministic ax-<hash> ActorTemplate resolution incorporating runnerImage and SNAPSHOT_FIDELITY_ROOTFS), and WorkspaceTagName (ws-<prefix>-<wsHash>-<tagHash>). - internal/substrate: add EnsureActorTemplate, EnsureActorFromTag, and CreateTag / GetTag / ListTags / DeleteTag, unify RPC retries on callWithRetry, and add substratetest Tag support.
…ument sandbox contract
f3fa1bd to
239b862
Compare
Part of #563
Prepares the Profile resolution layer and Substrate snapshot Tag client primitives for Workspace pre-warming (will wire Workspace controller change in the next PR):
Profile API Semantics & Validation (
pkg/apis/v1alpha1,internal/apivalidation,docs/manifests.md)Profile.ate_actor_templatereferences an existingActorTemplatedirectly and is mutually exclusive withimageandresources.Profile Merging, Template Resolution & Tag Naming (
internal/controller)MergeProfile: overlays Task-levelProfileoverrides onto a Workspace defaultProfilewhile respectingate_actor_templatemutual exclusivity.ResolveProfileTemplate: resolves an effectiveProfileinto either the user-suppliedate_actor_templatename or a deterministicax-<hash>ActorTemplatespec (incorporating default image/resources,runnerImage, andSNAPSHOT_FIDELITY_ROOTFS).WorkspaceTagName: generates deterministic, collision-freews-<prefix>-<wsHash>-<tagHash>snapshotTagnames per(workspace, template)pair.Substrate Snapshot Tag & Actor Client (
internal/substrate)EnsureActorTemplate,EnsureActorFromTag(provisioning anActorseeded fromsource_tag), andCreateTag/GetTag/ListTags/DeleteTag.callWithRetry(codes.Unavailable+codes.Abortedon lease-contended mutations).substratetestwith in-memoryTaglifecycle andsource_tagchecks for unit tests.