[serve] Refer to serve "instances," not "clusters" (#8746)

This commit is contained in:
Edward Oakes
2020-06-02 17:16:29 -05:00
committed by GitHub
parent 2e82e05e4b
commit 0306e4d589
8 changed files with 51 additions and 52 deletions
+7 -7
View File
@@ -58,7 +58,7 @@ def accept_batch(f):
return f
def init(cluster_name=None,
def init(name=None,
http_host=DEFAULT_HTTP_HOST,
http_port=DEFAULT_HTTP_PORT,
metric_exporter=InMemoryExporter):
@@ -71,8 +71,8 @@ def init(cluster_name=None,
separately before calling `serve.init`.
Args:
cluster_name (str): A unique name for this serve cluster. This allows
multiple serve clusters to run on the same ray cluster. Must be
name (str): A unique name for this serve instance. This allows
multiple serve instances to run on the same ray cluster. Must be
specified in all subsequent serve.init() calls.
http_host (str): Host for HTTP server. Default to "0.0.0.0".
http_port (int): Port for HTTP server. Default to 8000.
@@ -81,8 +81,8 @@ def init(cluster_name=None,
services. RayServe has two options built in: InMemoryExporter and
PrometheusExporter
"""
if cluster_name is not None and not isinstance(cluster_name, str):
raise TypeError("cluster_name must be a string.")
if name is not None and not isinstance(name, str):
raise TypeError("name must be a string.")
# Initialize ray if needed.
if not ray.is_initialized():
@@ -90,7 +90,7 @@ def init(cluster_name=None,
# Try to get serve master actor if it exists
global master_actor
master_actor_name = format_actor_name(SERVE_MASTER_NAME, cluster_name)
master_actor_name = format_actor_name(SERVE_MASTER_NAME, name)
try:
master_actor = ray.get_actor(master_actor_name)
return
@@ -111,7 +111,7 @@ def init(cluster_name=None,
master_actor = ServeMaster.options(
name=master_actor_name,
max_restarts=-1,
).remote(cluster_name, http_node_id, http_host, http_port, metric_exporter)
).remote(name, http_node_id, http_host, http_port, metric_exporter)
block_until_http_ready(
"http://{}:{}/-/routes".format(http_host, http_port),