From 73b37b159c749377550775114b171a946734ece4 Mon Sep 17 00:00:00 2001 From: kaihsun Date: Fri, 28 Apr 2023 07:13:22 +0000 Subject: [PATCH] update --- tests/config/ray-cluster.ray-ft.yaml.template | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/tests/config/ray-cluster.ray-ft.yaml.template b/tests/config/ray-cluster.ray-ft.yaml.template index 544e2f7a78..ccad180470 100644 --- a/tests/config/ray-cluster.ray-ft.yaml.template +++ b/tests/config/ray-cluster.ray-ft.yaml.template @@ -130,7 +130,7 @@ spec: path: test_detached_actor_2.py workerGroupSpecs: # the pod replicas in this group typed worker - - replicas: 2 + - replicas: 1 minReplicas: 1 maxReplicas: 2 # logical group name, for this called small-group, also can be functional @@ -179,7 +179,7 @@ data: def __call__(self): return self._msg - ray.init() + ray.init(address='ray://127.0.0.1:10001') # 2: Deploy the model. handle = serve.run(MyModelDeployment.bind(msg="Hello world!")) # 3: Query the deployment and print the result. @@ -190,7 +190,6 @@ data: test_ray_serve_2.py: | import requests import time - import json def retry_with_timeout(func, timeout=90): err = None @@ -205,31 +204,19 @@ data: raise err def send_req(): - response = requests.get('http://127.0.0.1:8000', timeout=60) + response = requests.get('http://127.0.0.1:8000', timeout=10) print('Response status code:', response.status_code) print('Response headers:', response.headers) print('Response content:', response.text) assert(response.text == "Hello world!") - def check_status(): - headers = { - 'Accept': 'application/json', - } - url = 'http://localhost:52365/api/serve/deployments/status' - response = requests.get(url, headers=headers) - status_json = json.loads(response.text) - print("Serve status:", status_json) - # Application "RUNNING": all deployments are healthy. - assert(status_json['app_status']['status'] == 'RUNNING') - - retry_with_timeout(check_status, 240) - retry_with_timeout(send_req, 5) + retry_with_timeout(send_req, 180) test_detached_actor_1.py: | import ray import sys - ray.init(namespace=sys.argv[1]) + ray.init(address='ray://127.0.0.1:10001', namespace=sys.argv[1]) @ray.remote class TestCounter: @@ -270,7 +257,7 @@ data: # Try to connect to Ray cluster. print("Try to connect to Ray cluster.") - retry_with_timeout(lambda: ray.init(namespace=sys.argv[1]), timeout = 180) + retry_with_timeout(lambda: ray.init(address='ray://127.0.0.1:10001', namespace=sys.argv[1]), timeout = 180) # Get TestCounter actor print("Get TestCounter actor.")