Skip to content

Commit

Permalink
Run dashboard on Ray port and set Dashboard link
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson committed Nov 8, 2023
1 parent 3162adb commit d9b29b6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
17 changes: 17 additions & 0 deletions dask_databricks/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union

VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object

version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '0.1.dev15+g4d11272.d20231108'
__version_tuple__ = version_tuple = (0, 1, 'dev15', 'g4d11272.d20231108')
2 changes: 1 addition & 1 deletion dask_databricks/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def run():

if DB_IS_DRIVER == "TRUE":
log.info("This node is the Dask scheduler.")
subprocess.Popen(["dask", "scheduler"])
subprocess.Popen(["dask", "scheduler", "--dashboard-address", ":8265"])
else:
log.info("This node is a Dask worker.")
log.info(f"Connecting to Dask scheduler at {DB_DRIVER_IP}:8786")
Expand Down
7 changes: 7 additions & 0 deletions dask_databricks/databrickscluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ async def _start(self):
self.scheduler_comm = rpc(f"{self.spark_local_ip}:8786")
await super()._start()

def dashboard_link(self):
if spark is None:
raise RuntimeError("Unable to locate spark session. Are you running this on a Databricks driver node?")
cluster_id = spark.conf.get("spark.databricks.clusterUsageTags.clusterId")
org_id = spark.conf.get("spark.databricks.clusterUsageTags.orgId")
return f"https://dbc-dp-{org_id}.cloud.databricks.com/driver-proxy/o/{org_id}/{cluster_id}/8265/status"


def get_client():
"""Get a Dask client connected to a Databricks cluster."""
Expand Down

0 comments on commit d9b29b6

Please sign in to comment.