Skip to content

Commit

Permalink
Log databricks proxy (#34088)
Browse files Browse the repository at this point in the history
This PR adds standard logging of the Databricks proxy URL for the dashboard when a ray cluster starts.

Currently the HTML link does not render until cell completion so it is difficult to access the dashboard while a ray workload is running.

Signed-off-by: Nathan Azrak <[email protected]>
Co-authored-by: Nathan Azrak <[email protected]>
  • Loading branch information
nathan-az and Nathan Azrak committed Apr 19, 2023
1 parent ec2c80d commit 1b451a0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/ray/util/spark/databricks_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ def display_databricks_driver_proxy_url(spark_context, port, title):
orgId = commandContextTags.apply("orgId")
clusterId = commandContextTags.apply("clusterId")

template = "/driver-proxy/o/{orgId}/{clusterId}/{port}/"
proxy_url = template.format(orgId=orgId, clusterId=clusterId, port=port)
proxy_link = f"/driver-proxy/o/{orgId}/{clusterId}/{port}/"
proxy_url = f"https://dbc-dp-{orgId}.cloud.databricks.com{proxy_link}"

print("To monitor and debug Ray from Databricks, view the dashboard at ")
print(f" {proxy_url}")

displayHTML(
f"""
<div style="margin-bottom: 16px">
<a href="{proxy_url}">
<a href="{proxy_link}">
Open {title} in a new tab
</a>
</div>
Expand Down

0 comments on commit 1b451a0

Please sign in to comment.