Repository navigation
Rethinking the ActorTemplate and ActorTemplateVersion relationship, inspired by ActorSnapshotTag - #905
Rethinking the ActorTemplate and ActorTemplateVersion relationship, inspired by ActorSnapshotTag#905Zoe Zhao (zoez7) wants to merge 2 commits into
Conversation
a827797 to
94adcf8
Compare
| // CreateActor calls that do not pin a version. If unset, CreateActor | ||
| // without an explicit version fails with FailedPrecondition. | ||
| ObjectRef default_version_on_create = 3; | ||
| // Output only. Set at creation to the tagged version's actor_template_id; |
There was a problem hiding this comment.
Why we need the actor_template_id here if you can extract it from actor_template_version? Is it to save one read?
There was a problem hiding this comment.
This is useful to support APIs like ListActorTemplateVersionTags(actor_template_id), so we don't have to first list all ATVs by actor_template_version
94adcf8 to
b376e71
Compare
|
Good mr!I want to add support for the E2B protocol. Building on the ActorTemplateVersion design, we should be able to implement the fork and checkpoint endpoints in ate-api-server fairly quickly~ |
b376e71 to
da89edb
Compare
|
YuanM (@mini-cookie) the slack discussion thread for this is https://cloud-native.slack.com/archives/C0B6M3E2J3D/p1786656116150749 feel free to add your thoughts. |
| string in_progress_local_snapshot_name = 12; | ||
|
|
||
|
|
||
| ActorTemplateVersion actor_template_version = 13; |
There was a problem hiding this comment.
Can this mirror ActorSnapshotSource right below?
I am thinking of two things:
-
Our lifecycle histogram reads the template from the request on
createbut from the stored Actor onresume/suspend/pause/delete. So if you resolve the tag away, onlycreatecan label with it and the rest can't, which means I can't use it at all. If it's on the Actor it's actually a better label than the ATV name. Same reason OTel setscontainer.image.tagsnext to the digest. -
We need an ATV uid too, for the same reason we have here for snapshot_uid, so names come back after a delete. We already pair
ate.actor.uidwithate.actor.namefor this in spans/logs.
Unrelated, just curious: field 13 was an ObjectRef on main and is now the whole message, so every Actor read carries a copy of the ATV's phase and golden_snapshot.
Is it intentional?
b0cfbf9 to
a2f220a
Compare
…nspired by ActorSnapshotTag
a2f220a to
22400ba
Compare
|
Closing this pull request, we agreed on:
|
Previously, the
ActorTemplateobject expressed both a group and a pointer.ActorTemplateVersionresources.default_version_on_createpoints to an ATV.In this modified API, we separate out the "pointer" concept into
ActorTemplateVersionTag, similar toActorSnapshotTag.After this, the
ActorTemplateresource itself doesn't have any field anymore, therefore theActorTemplateas a grouping concept that only needs a name and a ID.Advantages are:
default_version_on_create) only. Users can make their own decision of which Tag is considered "default".below is an illustration of the relationships. This PR doesn't contain rollout policy tag, but we can add that in the future.
The API to create an Actor then becomes:
Julian Gutierrez Oschmann (@juli4n) Let me know what you think.
I'm happy to see the amount of code I was able to delete in this PR :)