Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dashboard_link property to Client #3429

Merged
merged 2 commits into from
Jan 30, 2020

Conversation

jacobtomlinson
Copy link
Member

@jacobtomlinson jacobtomlinson commented Jan 30, 2020

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 via client.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, the client.cluster property will be set to None 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 of client.cluster.dashboard_link.

@mrocklin
Copy link
Member

Thanks @jacobtomlinson . This seems fine to me. Can I ask for a trivial test for the dashboard_link attribute?

@jacobtomlinson
Copy link
Member Author

@mrocklin done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants