Skip to content

Commit

Permalink
[Serve] Change back from autodown to autostop (#3535)
Browse files Browse the repository at this point in the history
* fix

* skip autostop for k8s

* comments

* fix skip autostop

* fix
  • Loading branch information
cblmemo authored May 17, 2024
1 parent 4bf71d5 commit e134a35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 4 additions & 5 deletions sky/backends/cloud_vm_ray_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -4152,11 +4152,10 @@ def set_autostop(self,
# Skip auto-stop for Kubernetes clusters.
if (isinstance(handle.launched_resources.cloud, clouds.Kubernetes)
and not down and idle_minutes_to_autostop >= 0):
# We should hit this code path only for the jobs controller on
# We should hit this code path only for the controllers on
# Kubernetes clusters.
assert (controller_utils.Controllers.from_name(
handle.cluster_name) == controller_utils.Controllers.
JOBS_CONTROLLER), handle.cluster_name
handle.cluster_name) is not None), handle.cluster_name
logger.info('Auto-stop is not supported for Kubernetes '
'clusters. Skipping.')
return
Expand Down
5 changes: 2 additions & 3 deletions sky/serve/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,13 @@ 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_autodown = constants.CONTROLLER_IDLE_MINUTES_TO_AUTOSTOP
idle_minutes_to_autostop = constants.CONTROLLER_IDLE_MINUTES_TO_AUTOSTOP
controller_job_id, controller_handle = sky.launch(
task=controller_task,
stream_logs=False,
cluster_name=controller_name,
detach_run=True,
idle_minutes_to_autostop=idle_minutes_to_autodown,
down=True,
idle_minutes_to_autostop=idle_minutes_to_autostop,
retry_until_up=True,
_disable_controller_check=True,
)
Expand Down

0 comments on commit e134a35

Please sign in to comment.