Skip to content

Dashboard doesn't show when scheduler does not listen on localhost #233

@etejedor

Description

@etejedor

I am running a JupyterHub deployment that uses JupyterLab and the Dask lab extension to create HTCondorClusters.

The JupyterHub user sessions run inside Docker containers, and so does the Dask scheduler. The Dask scheduler listens on an address of the private Docker network (not on the loopback interface), so that messages from the workers get forwarded from the host address to the Docker address.

I can create an HTCondorCluster normally via the Dask lab extension, but the dashboard buttons do not show up (see image below).

image

If I look at the requests done by the browser, I see 403 errors when getting e.g. dask/dashboard/a44f0140-dd9e-4f9b-a5c3-acd32682eb70/individual-plots.json?1652878129159. The error message is quite descriptive: Host '172.17.0.2' is not whitelisted. See https://jupyter-server-proxy.readthedocs.io/en/latest/arbitrary-ports-hosts.html for info. -- where 172.17.0.2 is the private Docker address.

So it seems that the jupyter server proxy extension does not allow to proxy to 172.17.0.2. At the link suggested by the error message, they recommend to use the option host_allowlist, to include in this case 172.17.0.2 in a whitelist.

However, if I include the c.ServerProxy.host_allowlistoption in the jupyter notebook config file, it has no effect. The reason is that DaskDashboardHandler does not load that option and it does not invoke its ProxyHandler superclass constructor with that option as an argument. Therefore, the 172.17.0.2 address is not whitelisted.

Shouldn't the DaskDashboardHandler class define a constructor that loads the host_allowlist option and passes it on to ProxyHandler?

Another thing I was trying was to set dashboard_address (in scheduler_options, when building the HTCondorCluster) to localhost:port, so that the dashboard does listen on the loopback interface, differently from the scheduler. That doesn't work either because the Dask lab extension still thinks the dashboard listens on the same address of the scheduler, since this call is resolved by this code, i.e. the dashboard link is constructed by using the address of the scheduler (which looks like a bug, since the addresses of the scheduler and the dashboard can be different as I explained above).

Any feedback would be appreciated! Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions