From ed8683cc2036a9a9f184101797eb6771d7609a74 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Wed, 8 May 2024 01:54:25 -0700 Subject: [PATCH] [k8s] Allow autodown for k8s (#3524) Allow autodown for k8s --- sky/backends/cloud_vm_ray_backend.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sky/backends/cloud_vm_ray_backend.py b/sky/backends/cloud_vm_ray_backend.py index e17845f4989..a550a4f0e36 100644 --- a/sky/backends/cloud_vm_ray_backend.py +++ b/sky/backends/cloud_vm_ray_backend.py @@ -1994,10 +1994,9 @@ def provision_with_retries( requested_features = self._requested_features.copy() # Skip stop feature for Kubernetes jobs controller. - if isinstance(to_provision.cloud, clouds.Kubernetes - ) and controller_utils.Controllers.from_name( - cluster_name - ) == controller_utils.Controllers.JOBS_CONTROLLER: + if (isinstance(to_provision.cloud, clouds.Kubernetes) and + controller_utils.Controllers.from_name(cluster_name) + == controller_utils.Controllers.JOBS_CONTROLLER): assert (clouds.CloudImplementationFeatures.STOP in requested_features), requested_features requested_features.remove( @@ -4066,7 +4065,8 @@ def set_autostop(self, # cloud and resources support requested autostop. if idle_minutes_to_autostop is not None: # Skip auto-stop for Kubernetes clusters. - if isinstance(handle.launched_resources.cloud, clouds.Kubernetes): + if (isinstance(handle.launched_resources.cloud, clouds.Kubernetes) + and not down): # We should hit this code path only for the jobs controller on # Kubernetes clusters. assert (controller_utils.Controllers.from_name(