Skip to content

Commit

Permalink
[k8s] Autodown Serve controller on Kubernetes (#3984)
Browse files Browse the repository at this point in the history
* Add autodown for skyserve on k8s

* lint
  • Loading branch information
romilbhardwaj authored Sep 25, 2024
1 parent 800f7d6 commit e13c391
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions sky/backends/cloud_vm_ray_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -4147,11 +4147,21 @@ def set_autostop(self,
idle_minutes_to_autostop >= 0):
# We should hit this code path only for the controllers on
# Kubernetes and RunPod clusters.
assert (controller_utils.Controllers.from_name(
handle.cluster_name) is not None), handle.cluster_name
logger.info('Auto-stop is not supported for Kubernetes '
'and RunPod clusters. Skipping.')
return
controller = controller_utils.Controllers.from_name(
handle.cluster_name)
assert (controller is not None), handle.cluster_name
if (controller
== controller_utils.Controllers.SKY_SERVE_CONTROLLER and
isinstance(handle.launched_resources.cloud,
clouds.Kubernetes)):
# For SkyServe controllers on Kubernetes: override autostop
# behavior to force autodown (instead of no-op)
# to avoid dangling controllers.
down = True
else:
logger.info('Auto-stop is not supported for Kubernetes '
'and RunPod clusters. Skipping.')
return

# Check if we're stopping spot
assert (handle.launched_resources is not None and
Expand Down

0 comments on commit e13c391

Please sign in to comment.