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

Dask dashboard over ssh #3724

Closed
rdPatmore opened this issue Apr 17, 2020 · 6 comments
Closed

Dask dashboard over ssh #3724

rdPatmore opened this issue Apr 17, 2020 · 6 comments

Comments

@rdPatmore
Copy link

I use Dask with Xarray and I am trying to profile my code through the Dask dashboard. My aim is to tunnel the dashboard over ssh from a remote virtual machine to my local (laptop) browser. This doesn't seem to work for me. Here's what I do.

First of all I am setting up port forwarding from the remote location to my laptop via

ssh -N -L 8000:localhost:8787 <username>@<remote hostname>

Then as a test in a separate terminal, I ssh to the remote host in the normal way

ssh -X <username>@<remote hostname>

and run the following in IPython from that terminal

from dask.distributed import LocalCluster
cluster = LocalCluster(n_workers=1)

then open a browser on my laptop with the address http://localhost:8000/ in an attempt to open the Dask dashboard. This fails and returns the following in my port forwarding terminal

​channel 2: open failed: connect failed: Connection refused

I have made small progress here by defining the scheduler_port variable. I changed my IPython code to

from dask.distributed import LocalCluster
cluster = LocalCluster(n_workers=1, scheduler_port=8787)

​​Now when I try the address http://localhost:8000/ I no longer get connection refused error above. However, the browser just hangs and does nothing as if it is waiting for data.

The way I see it there are three potential sources of my problem:-

  1. I have made a trivial error
  2. This is a specific problem with the remote machine that I am trying the tunnel the dashboard from
  3. There is a bug with Dask

I presume it is 1) or 2) but I thought I'd post here in case it is 3).

@gforsyth
Copy link
Contributor

gforsyth commented Apr 17, 2020

@funkMasterRyan -- what's the value of cluster.dashboard_url on the remote host?

if it's an empty string, you might not have bokeh installed, which would stop the dashboard from launching

@rdPatmore
Copy link
Author

cluster.dashboard_url

returns

'LocalCluster' object has no attribute 'dashboard_url'

Did I misinterpret what you mean here?

I can import bokeh just fine on the remote host, if that helps. It seems version 0.12.4. is installed.

@gforsyth
Copy link
Contributor

Ugh, sorry, cluster.daskboard_link

@rdPatmore
Copy link
Author

Ohh yeah, you are right. cluster.daskboard_link returns an empty string.

Though I can import bokeh. Is Dask not linking up with bokeh properly?

@gforsyth
Copy link
Contributor

Could be you have two separate environments -- you might want to install using conda to avoid any missing dependencies.

In terms of specifying ports, if you set scheduler_port to 8787, that's the default dashboard port so that might be messing with things. You could try instead to run

LocalCluster(n_workers=1, dashboard_address="localhost:8787")

@rdPatmore
Copy link
Author

I have got to the bottom of my problem, lack of conda was the issue.

Whilst I did have conda and did use it to install some packages, the word 'some' here was root of my problem. I had installed some packages using conda and some with pip. After reinstalling everything with conda, the dask dashboard worked just fine.

Thanks for your comments @gforsyth

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

No branches or pull requests

2 participants