Add dashboard_link property to Client #3429
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently if you create a Dask cluster using a cluster manager object you can grab the dashboard web address using the
cluster.dashboard_link
attribute. When a client connects to that cluster you can also grab the address viaclient.cluster.dashboard_link
.We use this in the Dask Jupyter Lab Extension to auto-populate the address by grabbing the default client and then accessing the
client.cluster.dashboard_link
property. However if the cluster is created by another method, on the command line for example, theclient.cluster
property will be set toNone
and it is not possible to get the address.However when displaying the HTML repr for the client we infer the dashboard address and expose it, this works regardless of the cluster setup method.
This PR pulls that logic out of the HTML repr into a new property so that this address can be accessed at
client.dashboard_link
. I had to add a little indirection with the_get_scheduler_info()
method as we now need to auto-detect the scheduler object and scheduler information in multiple places.My plan if this is acceptable is to update the lab extension here to get the address via
client.dashboard_link
instead ofclient.cluster.dashboard_link
.