Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

DM-41350: Handle terminating and terminated status #58

Merged
merged 1 commit into from
Oct 26, 2023
Merged

Conversation

rra
Copy link
Member

@rra rra commented Oct 26, 2023

Update the lab status enum to match the current Nublado controller, including renaming starting to pending. Add support for terminated status, which will be used for labs killed by the idle culler. Update comments for the (soon to be implemented) behavior of the Nublado controller.

Treat terminating status the same as terminated: tell the hub that the lab has exited, even though it hasn't yet. We want to allow the user to start spawning a new lab, and if they kick that off before the lab deletion completes, we'll join the existing delete call now that the controller supports multiple simultaneous deletes.

@rra rra requested a review from athornton October 26, 2023 18:05
@rra rra force-pushed the tickets/DM-41350 branch from b8e4fe3 to 8f1ff80 Compare October 26, 2023 18:08
@@ -42,9 +42,10 @@ class LabStatus(str, Enum):
of the lab controller.
"""

STARTING = "starting"
PENDING = "pending"
RUNNING = "running"
Copy link
Member

Choose a reason for hiding this comment

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

This would all be so much nicer if k8s did this cleanly rather than Pending/Running/Succeeded/Failed/Unknown and then also having to parse the Reason field to figure out how it got there.

Copy link
Member

@athornton athornton left a comment

Choose a reason for hiding this comment

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

I think this is fine, although maybe a little more commentary that LabStatus doesn't actually exactly track the K8s Pod Status Phase, but represents a conceptual rollup of Phase and Reason.

Or perhaps we should just abandon the abstraction and use the K8s Phases and Reasons more directly? I don't know. I am finding pod and container lifecycle handling very frustrating.

Update the lab status enum to match the current Nublado controller,
including renaming starting to pending. Add support for terminated
status, which will be used for labs killed by the idle culler.
Update comments for the (soon to be implemented) behavior of the
Nublado controller.

Treat terminating status the same as terminated: tell the hub that
the lab has exited, even though it hasn't yet. We want to allow the
user to start spawning a new lab, and if they kick that off before
the lab deletion completes, we'll join the existing delete call now
that the controller supports multiple simultaneous deletes.
@rra rra force-pushed the tickets/DM-41350 branch from 8f1ff80 to 82adc37 Compare October 26, 2023 19:29
@rra rra enabled auto-merge October 26, 2023 19:30
@rra rra merged commit c9dec8c into main Oct 26, 2023
@rra rra deleted the tickets/DM-41350 branch October 26, 2023 19:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants