Dask dashboard over ssh
See original GitHub issueI 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:-
- I have made a trivial error
- This is a specific problem with the remote machine that I am trying the tunnel the dashboard from
- 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).
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
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
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
to8787
, that’s the default dashboard port so that might be messing with things. You could try instead to run