mirror of
https://github.com/wassname/ray.git
synced 2026-07-07 21:34:11 +08:00
Remove blocking flag from serve.init() (#8654)
This commit is contained in:
@@ -4,7 +4,7 @@ from multiprocessing import cpu_count
|
||||
|
||||
import ray
|
||||
from ray.serve.constants import (DEFAULT_HTTP_HOST, DEFAULT_HTTP_PORT,
|
||||
SERVE_MASTER_NAME)
|
||||
SERVE_MASTER_NAME, HTTP_PROXY_TIMEOUT)
|
||||
from ray.serve.master import ServeMaster
|
||||
from ray.serve.handle import RayServeHandle
|
||||
from ray.serve.utils import (block_until_http_ready, format_actor_name,
|
||||
@@ -61,7 +61,6 @@ def accept_batch(f):
|
||||
|
||||
|
||||
def init(cluster_name=None,
|
||||
blocking=False,
|
||||
http_host=DEFAULT_HTTP_HOST,
|
||||
http_port=DEFAULT_HTTP_PORT,
|
||||
ray_init_kwargs={
|
||||
@@ -81,8 +80,6 @@ def init(cluster_name=None,
|
||||
cluster_name (str): A unique name for this serve cluster. This allows
|
||||
multiple serve clusters to run on the same ray cluster. Must be
|
||||
specified in all subsequent serve.init() calls.
|
||||
blocking (bool): If true, the function will wait for the HTTP server to
|
||||
be healthy, and other components to be ready before returns.
|
||||
http_host (str): Host for HTTP server. Default to "0.0.0.0".
|
||||
http_port (int): Port for HTTP server. Default to 8000.
|
||||
ray_init_kwargs (dict): Argument passed to ray.init, if there is no ray
|
||||
@@ -125,9 +122,9 @@ def init(cluster_name=None,
|
||||
max_restarts=-1,
|
||||
).remote(cluster_name, http_node_id, http_host, http_port, metric_exporter)
|
||||
|
||||
if blocking:
|
||||
block_until_http_ready("http://{}:{}/-/routes".format(
|
||||
http_host, http_port))
|
||||
block_until_http_ready(
|
||||
"http://{}:{}/-/routes".format(http_host, http_port),
|
||||
timeout=HTTP_PROXY_TIMEOUT)
|
||||
|
||||
|
||||
@_ensure_connected
|
||||
|
||||
Reference in New Issue
Block a user