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 1 commit 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
| ObjectRef default_version_on_create = 3; | ||
| // Output only. Set at creation to the tagged version's actor_template_id; | ||
| // the tag can only ever point at versions of this actor template. | ||
| string actor_template_id = 2; |
There was a problem hiding this comment.
Who will generate the id? There's no message ActorTemplate anymore
There was a problem hiding this comment.
The user will decide this. Perhaps calling it application_name would be more appropriate.
There was a problem hiding this comment.
That's a good point actually, the server would need to keep record of mapping between (name <-> id)
…nspired by ActorSnapshotTag
94adcf8 to
b376e71
Compare
| // versions across all templates. | ||
| ObjectRef actor_template = 1; | ||
| // The actor template whose versions to list. Required. | ||
| string actor_template_id = 1; |
There was a problem hiding this comment.
This field is where ate.template.name comes from, and it's a metric label today. We are also planning to leverage it in #853. Can we ensure this is globally unique?
|
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~ |
Previously, the
ActorTemplateobject expressed both a group and a pointer.ActorTemplateVersions.default_version_on_create.In this modified API, we separate out the "pointer" into
ActorTemplateVersionTag, similar toActorSnapshotTag.After this, the
ActorTemplateresource itself doesn't have any field anymore, therefore the "ActorTemplate" as a grouping concept only exists as an ID string.Julian Gutierrez Oschmann (@juli4n) Let me know what you think.
Initial API definition only, haven't run "go generate" yet.