fix external dashboard url if connecting to existing cluster (#27807)

Signed-off-by: Nikita Vemuri <nikitavemuri@gmail.com>
This commit is contained in:
Nikita Vemuri 2022-08-11 17:56:24 -07:00 committed by GitHub
parent b1cad0a112
commit 87dd078e1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View file

@ -903,7 +903,7 @@ class Node:
]
self.get_gcs_client().internal_kv_put(
b"webui:url",
self._webui_url.encode(),
self._webui_url_with_protocol.encode(),
True,
ray_constants.KV_NAMESPACE_DASHBOARD,
)

View file

@ -165,6 +165,28 @@ def test_hosted_external_dashboard_url_with_ray_client(
assert info.dashboard_url == "external_dashboard_url"
@pytest.mark.parametrize(
"call_ray_start",
["ray start --head --ray-client-server-port 25553 --port 0"],
indirect=True,
)
def test_hosted_external_dashboard_url_with_connecting_to_existing_cluster(
set_override_dashboard_url, call_ray_start
):
"""
Test setting external dashboard URL through environment variable
when connecting to existing Ray cluster
"""
info = ray.init()
assert info.dashboard_url == "external_dashboard_url"
assert info.address_info["webui_url"] == "external_dashboard_url"
assert (
ray._private.worker._global_node.webui_url_with_protocol
== "https://external_dashboard_url"
)
assert ray_address_to_api_server_url("auto") == "https://external_dashboard_url"
def test_shutdown_and_reset_global_worker(shutdown_only):
ray.init(job_config=ray.job_config.JobConfig(code_search_path=["a"]))
ray.shutdown()