question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dask dashboard over ssh

See original GitHub issue

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).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rdPatmorecommented, Apr 24, 2020

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

0reactions
gforsythcommented, Apr 17, 2020

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")
Read more comments on GitHub >

github_iconTop Results From Across the Web

SSH - Dask documentation
It is easy to set up Dask on informally managed networks of machines using SSH. This can be done manually using SSH and...
Read more >
Networking and Port Forwarding - Dask-CHTC - Read the Docs
There are two ways to forward ports using ssh , depending on when you know ... If you are using Dask through Jupyter,...
Read more >
How to view Dask dashboard when running on a virtual ...
The goal is actually two-fold: Run Jupyter Notebook on remote server that contains Dask code. View Dask Dashboard from code running in Notebook....
Read more >
Set up ad-hoc Dask cluster — Urban Grammar AI | WP1
Dask has several ways of setting up a cluster, including over ssh or with orchestration tools such as Kubernetes. For a more thorough...
Read more >
Dask - Etp
Note that you might need to do ssh port forwarding to your local machine, both for the jupyter notebook and the dask dashboard...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found