Skip to content

Commit

Permalink
Fix Dashboard URI returned by cluster.status()
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianZaccaria authored and openshift-merge-robot committed Aug 30, 2023
1 parent 1677680 commit c30f747
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/codeflare_sdk/cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"],
Expand Down

0 comments on commit c30f747

Please sign in to comment.