From 3c0190204c549ac86ba6668dfd39b6e3607a655a Mon Sep 17 00:00:00 2001 From: cblmemo Date: Tue, 14 May 2024 10:01:04 -0700 Subject: [PATCH] fix skip autostop --- sky/backends/cloud_vm_ray_backend.py | 4 ++-- sky/serve/core.py | 15 +-------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/sky/backends/cloud_vm_ray_backend.py b/sky/backends/cloud_vm_ray_backend.py index a0f746a7098..e7a17bfe466 100644 --- a/sky/backends/cloud_vm_ray_backend.py +++ b/sky/backends/cloud_vm_ray_backend.py @@ -2011,10 +2011,10 @@ def provision_with_retries( cloud_user = to_provision.cloud.get_current_user_identity() requested_features = self._requested_features.copy() - # Skip stop feature for Kubernetes jobs controller. + # Skip stop feature for Kubernetes controllers. if (isinstance(to_provision.cloud, clouds.Kubernetes) and controller_utils.Controllers.from_name(cluster_name) - == controller_utils.Controllers.JOBS_CONTROLLER): + is not None): assert (clouds.CloudImplementationFeatures.STOP in requested_features), requested_features requested_features.remove( diff --git a/sky/serve/core.py b/sky/serve/core.py index c8bc5f31d3f..0252437d0e2 100644 --- a/sky/serve/core.py +++ b/sky/serve/core.py @@ -8,7 +8,6 @@ import sky from sky import backends from sky import exceptions -from sky import global_user_state from sky import sky_logging from sky import task as task_lib from sky.backends import backend_utils @@ -187,19 +186,7 @@ def up( # whether the service is already running. If the id is the same # with the current job id, we know the service is up and running # for the first time; otherwise it is a name conflict. - idle_minutes_to_autostop: Optional[int] = ( - constants.CONTROLLER_IDLE_MINUTES_TO_AUTOSTOP) - # Kubernetes does not support autostop. For k8s controller, we skip - # the autostop and let it running indefinitely for now. - controller_record = global_user_state.get_cluster_from_name( - controller_name) - if controller_record is not None: - current_controller_resources: sky.Resources = ( - controller_record['handle'].launched_resources) - if (current_controller_resources is not None and - current_controller_resources.cloud.is_same_cloud( - sky.Kubernetes())): - idle_minutes_to_autostop = None + idle_minutes_to_autostop = constants.CONTROLLER_IDLE_MINUTES_TO_AUTOSTOP controller_job_id, controller_handle = sky.launch( task=controller_task, stream_logs=False,