Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the dashboard address from the Dask scheduler

When starting a dask distributed local cluster, you can set a random port or address for the dashboard_address.

If you later get the scheduler object. Is there a way to extract the address of the dashboard.

I have this:

cluster = dask.distributed.LocalCluster(scheduler_port=0,
                                        dashboard_address='localhost:0')
scheduler = dask.distributed.Client(cluster, set_as_default=False)
scheduler_info = scheduler.scheduler_info()
logger.info('Scheduler: %s', scheduler_info['address'])
logger.info('Status Port: %s', scheduler_info['services']['dashboard'])

But that only gets the port of the dashboard, not the IP of the dashboard. If I were to put the dashboard address on a separate IP other than the scheduler, seems like it would be difficult to know what IP it was bound to.

like image 775
CMCDragonkai Avatar asked Jan 27 '26 01:01

CMCDragonkai


2 Answers

If you defined a dashboard_address you can get that info with the following:

In [1]: from dask.distributed import LocalCluster, Client

In [2]: cluster = LocalCluster(dashboard_address='172.22.1.26:8782')

In [3]: cluster.scheduler.services['dashboard'].server.address
Out[3]: '172.22.1.26'

In [4]: cluster.scheduler.services['dashboard'].server.port
Out[4]: 8782

Note: When a dashboard_address is not defined, the dashboard will be at the scheduler address -- often 127.0.0.1

like image 59
quasiben Avatar answered Jan 29 '26 16:01

quasiben


# if you have the cluster object
cluster.dashboard_link

# or if you have a client
client.dashboard_link
like image 39
kuropan Avatar answered Jan 29 '26 17:01

kuropan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!