Skip to content

Commit

Permalink
Add KubeCluster.jupyter_link property
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson committed Aug 14, 2023
1 parent d0c6e9a commit 31785b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 1 addition & 3 deletions dask_kubernetes/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ def port_forward(cluster):
console.print(f"Scheduler at: [magenta][not bold]{kcluster.scheduler_address}")
console.print(f"Dashboard at: [cyan][not bold]{kcluster.dashboard_link}")
if kcluster.jupyter:
console.print(
f"Jupyter at: [orange3][not bold]{kcluster.dashboard_link.replace('/status', '/jupyter/lab')}"
)
console.print(f"Jupyter at: [orange3][not bold]{kcluster.jupyter_link}")
console.print("Press ctrl+c to exit", style="bright_black")
while True:
time.sleep(0.1)
Expand Down
6 changes: 6 additions & 0 deletions dask_kubernetes/operator/kubecluster/kubecluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,12 @@ def from_name(cls, name, **kwargs):
**kwargs,
)

@property
def jupyter_link(self):
if self.jupyter:
return self.dashboard_link.replace("/status", "/jupyter/lab")
raise RuntimeError("KubeCluster not started with jupyter enabled")


def make_cluster_spec(
name,
Expand Down

0 comments on commit 31785b7

Please sign in to comment.