feat: Add autokill - #355
Conversation
bf86d2b to
ee13210
Compare
ee13210 to
ea43dfb
Compare
|
Checkpoint create is unblocked upstream by https://github.com/unikraft-cloud/proto/pull/343 — once that lands and the SDK regenerates, |
aaae865 to
10351c1
Compare
10351c1 to
3a25f5a
Compare
3a25f5a to
62b947e
Compare
|
@craciunoiuc @nurof3n ready for another review, I added autokill to a lot more places! |
| // instance templates, whose endpoints have no request-count trigger. | ||
| type Autokill struct { | ||
| TimeMs types.DurationMS `name:"time" json:"time,omitempty" mirror:"time_ms" field:"time,long"` | ||
| } |
There was a problem hiding this comment.
Why keep 2 structures instead of a single one? The fields have omitempty so if they are not set they will just not be there
Do you think maybe they will diverge in the future with more options?
There was a problem hiding this comment.
They're not the same shape — only the instance endpoint has num_requests:
CreateInstanceRequestAutokill—time_ms+num_requestsCreateServiceGroupRequestAutokill—time_msonlyItemAutokill(templates) —time_msonlyItemCheckpointAutokill(checkpoints) —time_msonly
Autokill is already shared by all three of those, so it's two CLI types covering four SDK ones.
62b947e to
c5f80b4
Compare
Signed-off-by: Justin Chadwell <justin@unikraft.com>
Service groups take the same autokill config as instances, minus the request-count trigger — /v1/services only accepts time_ms. Rather than reuse InstanceAutokill and silently drop num-requests, this adds a time-only Autokill type and wires it through create, edit, and the patch spec. Signed-off-by: Justin Chadwell <justin@unikraft.com>
Templates measure autokill from the last clone rather than from stop time, and the endpoint only accepts time_ms, so this reuses the time-only Autokill type added for service groups. The read side mirrors instance.template_autokill, not instance.autokill — the platform keeps the two separate and documents each as unused for the other kind of instance. Signed-off-by: Justin Chadwell <justin@unikraft.com>
Checkpoints are template-state VMs carrying UKP_VM_FLAGS_CHECKPOINT, so they share the template autokill timer and its last-clone semantics — here, time without a restore. The read side mirrors instance.checkpoint_autokill, which is what the platform emits for a checkpoint in place of template_autokill. Signed-off-by: Justin Chadwell <justin@unikraft.com>
c5f80b4 to
e0af3d9
Compare
craciunoiuc
left a comment
There was a problem hiding this comment.
All good here. Thanks!
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.com>
Approved-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.com>
Adds
--autokilleverywhere the platform accepts it: instances (time+num-requests), and service groups, instance templates and checkpoints (timeonly — those endpoints have no request-count trigger). Create and edit both, on all four.Templates read back from
instance.template_autokilland checkpoints frominstance.checkpoint_autokill— the platform stores one timer but emits it under different names depending on the kind of instance.Checkpoint create needed https://github.com/unikraft-cloud/proto/pull/343 first, since the spec never described
autokillon that endpoint; the SDK bump here picks it up.The one remaining autokill surface is image pin, which the CLI has no command for at all (
PinImages/UnpinImagesare unused) — that is its own feature, not an autokill gap. The same proto change also addedtagsto checkpoint create, which is still unwired here; happy to fold that in if you would rather not have a second PR.