From 41fdba91f3c9e17963b9446edcaec382a710e69c Mon Sep 17 00:00:00 2001 From: ChristianZaccaria Date: Mon, 21 Aug 2023 15:38:34 +0100 Subject: [PATCH] Fix Dashboard URI returned by cluster.status() --- src/codeflare_sdk/cluster/cluster.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/codeflare_sdk/cluster/cluster.py b/src/codeflare_sdk/cluster/cluster.py index b0bff0883..7b3d5d667 100644 --- a/src/codeflare_sdk/cluster/cluster.py +++ b/src/codeflare_sdk/cluster/cluster.py @@ -310,7 +310,8 @@ def cluster_dashboard_uri(self) -> str: for route in routes["items"]: if route["metadata"]["name"] == f"ray-dashboard-{self.config.name}": - return f"http://{route['spec']['host']}" + protocol = "https" if route["spec"].get("tls") else "http" + return f"{protocol}://{route['spec']['host']}" return "Dashboard route not available yet, have you run cluster.up()?" def list_jobs(self) -> List: @@ -585,7 +586,8 @@ def _map_to_ray_cluster(rc) -> Optional[RayCluster]: ray_route = None for route in routes["items"]: if route["metadata"]["name"] == f"ray-dashboard-{rc['metadata']['name']}": - ray_route = route["spec"]["host"] + protocol = "https" if route["spec"].get("tls") else "http" + ray_route = f"{protocol}://{route['spec']['host']}" return RayCluster( name=rc["metadata"]["name"],