From 2e4d1e07caf4a9889eb23149cb236bc7325f810f Mon Sep 17 00:00:00 2001 From: cblmemo Date: Tue, 14 May 2024 09:32:07 -0700 Subject: [PATCH 1/2] fix --- sky/serve/autoscalers.py | 12 ++++++++++++ tests/skyserve/failures/initial_delay.yaml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sky/serve/autoscalers.py b/sky/serve/autoscalers.py index 0a6b84111c6..69671911982 100644 --- a/sky/serve/autoscalers.py +++ b/sky/serve/autoscalers.py @@ -314,7 +314,19 @@ def select_outdated_replicas_to_scale_down( self, replica_infos: List['replica_managers.ReplicaInfo']) -> List[int]: """Select outdated replicas to scale down.""" + all_replica_ids_to_scale_down = [] + for info in replica_infos: + if info.version < self.latest_version and info.is_terminal: + all_replica_ids_to_scale_down.append(info.replica_id) + all_replica_ids_to_scale_down.extend( + self._select_outdated_nonterminal_replicas_to_scale_down( + replica_infos)) + return all_replica_ids_to_scale_down + def _select_outdated_nonterminal_replicas_to_scale_down( + self, + replica_infos: List['replica_managers.ReplicaInfo']) -> List[int]: + """Select outdated nonterminal replicas to scale down.""" if self.update_mode == serve_utils.UpdateMode.ROLLING: latest_ready_replicas = [] old_nonterminal_replicas = [] diff --git a/tests/skyserve/failures/initial_delay.yaml b/tests/skyserve/failures/initial_delay.yaml index dd2749a947d..4a12b8e9c48 100644 --- a/tests/skyserve/failures/initial_delay.yaml +++ b/tests/skyserve/failures/initial_delay.yaml @@ -2,7 +2,7 @@ service: readiness_probe: path: /health initial_delay_seconds: 10 - replicas: 2 + replicas: 1 resources: cpus: 2 From eaacd0698d2c1164908c5297819885e63e7ce390 Mon Sep 17 00:00:00 2001 From: cblmemo Date: Tue, 14 May 2024 09:44:54 -0700 Subject: [PATCH 2/2] revert --- tests/skyserve/failures/initial_delay.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/skyserve/failures/initial_delay.yaml b/tests/skyserve/failures/initial_delay.yaml index 4a12b8e9c48..dd2749a947d 100644 --- a/tests/skyserve/failures/initial_delay.yaml +++ b/tests/skyserve/failures/initial_delay.yaml @@ -2,7 +2,7 @@ service: readiness_probe: path: /health initial_delay_seconds: 10 - replicas: 1 + replicas: 2 resources: cpus: 2