Skip to content

Commit 84f2764

Browse files
authored
cherrypick #50860 (#50867)
fix 2 serve release tests. Signed-off-by: Lonnie Liu <lonnie@anyscale.com>
1 parent ecd0709 commit 84f2764

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

release/serve_tests/workloads/anyscale_service_utils.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
logging.basicConfig(level=logging.INFO)
1616

1717

18-
def check_service_state(service_name: str, expected_state: ServiceState):
19-
state = service.status(name=service_name).state
18+
def check_service_state(
19+
service_name: str, expected_state: ServiceState, cloud: Optional[str] = None
20+
):
21+
state = service.status(name=service_name, cloud=cloud).state
2022
logger.info(
2123
f"Waiting for service {service_name} to be {expected_state}, currently {state}"
2224
)
@@ -34,6 +36,7 @@ def start_service(
3436
image_uri: Optional[str] = None,
3537
working_dir: Optional[str] = None,
3638
add_unique_suffix: bool = True,
39+
cloud: Optional[str] = None,
3740
):
3841
"""Starts an Anyscale Service with the specified configs.
3942
@@ -76,18 +79,20 @@ def start_service(
7679
expected_state="RUNNING",
7780
retry_interval_ms=10000, # 10s
7881
timeout=600,
82+
cloud=cloud,
7983
)
8084

8185
yield service_name
8286

8387
finally:
8488
logger.info(f"Terminating service {service_name}.")
85-
service.terminate(name=service_name)
89+
service.terminate(name=service_name, cloud=cloud)
8690
wait_for_condition(
8791
check_service_state,
8892
service_name=service_name,
8993
expected_state="TERMINATED",
9094
retry_interval_ms=10000, # 10s
9195
timeout=600,
96+
cloud=cloud,
9297
)
9398
logger.info(f"Service '{service_name}' terminated successfully.")

release/serve_tests/workloads/autoscaling_load_test.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232

3333
URI = "https://serve-resnet-benchmark-data.s3.us-west-1.amazonaws.com/000000000019.jpeg"
34+
CLOUD = "serve_release_tests_cloud"
3435

3536

3637
@click.command()
@@ -47,7 +48,7 @@ def main(output_path: Optional[str], image_uri: Optional[str]):
4748
],
4849
}
4950
compute_config = ComputeConfig(
50-
cloud="serve_release_tests_cloud",
51+
cloud=CLOUD,
5152
head_node=HeadNodeConfig(instance_type="m5.8xlarge"),
5253
worker_nodes=[
5354
WorkerNodeGroupConfig(
@@ -67,9 +68,10 @@ def main(output_path: Optional[str], image_uri: Optional[str]):
6768
compute_config=compute_config,
6869
applications=[resnet_application],
6970
working_dir="workloads",
71+
cloud=CLOUD,
7072
) as service_name:
7173
ray.init(address="auto")
72-
status = service.status(name=service_name)
74+
status = service.status(name=service_name, cloud=CLOUD)
7375

7476
# Start the locust workload
7577
num_locust_workers = int(ray.available_resources()["CPU"]) - 1

release/serve_tests/workloads/replica_scalability.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
DEFAULT_FULL_TEST_NUM_REPLICA = 1000
2424
DEFAULT_FULL_TEST_TRIAL_LENGTH_S = 60
25+
CLOUD = "serve_release_tests_cloud"
2526

2627

2728
@click.command()
@@ -52,7 +53,7 @@ def main(
5253
],
5354
}
5455
compute_config = ComputeConfig(
55-
cloud="serve_release_tests_cloud",
56+
cloud=CLOUD,
5657
head_node=HeadNodeConfig(instance_type="m5.8xlarge"),
5758
worker_nodes=[
5859
WorkerNodeGroupConfig(
@@ -92,9 +93,10 @@ def main(
9293
compute_config=compute_config,
9394
applications=[noop_1k_application],
9495
working_dir="workloads",
96+
cloud=CLOUD,
9597
) as service_name:
9698
ray.init("auto")
97-
status = service.status(name=service_name)
99+
status = service.status(name=service_name, cloud=CLOUD)
98100

99101
# Start the locust workload
100102
num_locust_workers = int(ray.available_resources()["CPU"]) - 1

0 commit comments

Comments
 (0)