Skip to content

Commit

Permalink
fix skip autostop
Browse files Browse the repository at this point in the history
  • Loading branch information
cblmemo committed May 14, 2024
1 parent f66c73a commit 3c01902
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 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
15 changes: 1 addition & 14 deletions sky/serve/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3c01902

Please sign in to comment.