Skip to content

feat: Add autokill - #355

Open
jedevc wants to merge 4 commits into
prod-stagingfrom
jedevc/instance-autokill
Open

feat: Add autokill#355
jedevc wants to merge 4 commits into
prod-stagingfrom
jedevc/instance-autokill

Conversation

@jedevc

@jedevc jedevc commented Jun 5, 2026

Copy link
Copy Markdown
Member

Adds --autokill everywhere the platform accepts it: instances (time + num-requests), and service groups, instance templates and checkpoints (time only — those endpoints have no request-count trigger). Create and edit both, on all four.

Templates read back from instance.template_autokill and checkpoints from instance.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 autokill on 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/UnpinImages are unused) — that is its own feature, not an autokill gap. The same proto change also added tags to checkpoint create, which is still unwired here; happy to fold that in if you would rather not have a second PR.

@jedevc
jedevc requested a review from craciunoiuc June 5, 2026 08:15

@craciunoiuc craciunoiuc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments

Comment thread cmd/unikraft/integration/instance_test.go
Comment thread internal/cmd/instances.go Outdated
Comment thread internal/cmd/instances.go Outdated
@jedevc
jedevc force-pushed the jedevc/instance-autokill branch from bf86d2b to ee13210 Compare June 5, 2026 08:31
@jedevc
jedevc requested a review from craciunoiuc June 5, 2026 08:33
Comment thread internal/cmd/instances.go
@jedevc
jedevc force-pushed the jedevc/instance-autokill branch from ee13210 to ea43dfb Compare August 24, 2026 13:29
@jedevc
jedevc requested a review from nurof3n August 24, 2026 13:30
@jedevc

jedevc commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

Checkpoint create is unblocked upstream by https://github.com/unikraft-cloud/proto/pull/343 — once that lands and the SDK regenerates, --autokill (and --tag) can be wired into instance checkpoint create here too.

@jedevc
jedevc force-pushed the jedevc/instance-autokill branch from aaae865 to 10351c1 Compare August 25, 2026 09:35
@jedevc jedevc changed the title feat: Add instance autokill feat: Add autokill Aug 25, 2026
@jedevc
jedevc force-pushed the jedevc/instance-autokill branch from 10351c1 to 3a25f5a Compare August 25, 2026 09:37
jedevc added 4 commits August 27, 2026 19:25
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>
@jedevc
jedevc force-pushed the jedevc/instance-autokill branch from 3a25f5a to 62b947e Compare August 27, 2026 18:30
@jedevc

jedevc commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

@craciunoiuc @nurof3n ready for another review, I added autokill to a lot more places!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants