-
Notifications
You must be signed in to change notification settings - Fork 205
Replace termination_policy and termination_idle_time with idle_duration: int|str|off
#2167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace termination_policy and termination_idle_time with idle_duration: int|str|off
#2167
Conversation
| idle_duration: Annotated[ | ||
| Optional[Union[Literal["off"], str, int]], | ||
| Field( | ||
| description="Time to wait before terminating idle instances. Defaults to `5m` for runs and `3d` for fleets. Use `off` for unlimited duration" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if off is better than -1. For me, off is ambiguous: does it mean “no duration” (= unlim, = -1, = don't destroy) or “no idle” (= 0, = destroy immediately after use). I personally would prefer -1 for “never destroy”, 0 for “destroy immediately” and > 0 for “destroy if idle for N days (minutes, hours, …)”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I agree about -1 being potentially better than off. On the other hand:
a) We already support off with max_duration
b) -1 is a bit too technical
Perhaps, we could later support t-1 too as a synonym for off. Okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a) Ah, I see
b) Agree, but, as far as I understand, -1 is already works the same way as off, it's just not documented. We can leave it as is for now
…uration: int|str|off` (dstackai#2167)
…uration: int|str|off` (dstackai#2167)
…uration: int|str|off` (dstackai#2167)
Fixes #1154