Skip to content

Commit b75cb42

Browse files
pull ray dashboard url from cluster (#26)
1 parent 0eb4fc7 commit b75cb42

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/codeflare_sdk/cluster/cluster.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ def cluster_uri(self, namespace='default'):
5959
return f'ray://{self.config.name}-head-svc.{namespace}.svc:10001'
6060

6161
def cluster_dashboard_uri(self, namespace='default'):
62-
return f'http://{self.config.name}-head-svc.{namespace}.svc:8265'
62+
try:
63+
with oc.project(namespace):
64+
route = oc.invoke("get", ["route", "-o","jsonpath='{$.items[0].spec.host}'"])
65+
route = route.out().strip().strip("'")
66+
return f"http://{route}"
67+
except:
68+
return "Dashboard route not available yet. Did you run cluster.up()?"
69+
6370

6471

6572
# checks whether the ray cluster is ready

0 commit comments

Comments
 (0)