[serve] Pin http proxy to the node that serve.init() is run on (#8436)

This commit is contained in:
Edward Oakes
2020-05-14 16:38:29 -05:00
committed by GitHub
parent 00325eb2b2
commit ef20564d8e
2 changed files with 16 additions and 7 deletions
+6 -2
View File
@@ -124,12 +124,16 @@ def init(blocking=False,
RequestMetadata.ray_serialize,
RequestMetadata.ray_deserialize)
# TODO(edoakes): for now, always start the HTTP proxy on the node that
# serve.init() was run on. We should consider making this configurable
# in the future.
http_node_id = ray.state.current_node_id()
master_actor = ServeMaster.options(
detached=True,
name=SERVE_MASTER_NAME,
max_restarts=-1,
).remote(queueing_policy.value, policy_kwargs, start_server, http_host,
http_port, metric_exporter)
).remote(queueing_policy.value, policy_kwargs, start_server, http_node_id,
http_host, http_port, metric_exporter)
if start_server and blocking:
block_until_http_ready("http://{}:{}/-/routes".format(