dask / dask/distributed

How should users configure distributed.dashboard.link?

Open
#7,736 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.7k
Forks
778
Avg merge
2h 50m
Merged PRs (30d)
3

Description

The `distributed.dashboard.link` setting is often used when using Dask from JupyterHub so that the dashboard can be served via the [Jupyter Server Proxy](https://jupyter-server-proxy.readthedocs.io/en/latest/) with no additional network configuration. https://github.com/dask/distributed/issues/7724 was triggered by a `distributed.dashboard.link` / `DASK_DISTRIBUTED__DASHBOARD__LINK` (see [docs](https://docs.dask.org/en/stable/configuration.html#distributed-dashboard)) setting that contains environment variables that are set on the host but not on the cluster.

Settings like this would trigger the issue:
```bash
export DASK_DISTRIBUTED__DASHBOARD__LINK="{JUPYTERHUB_EXTERNAL_BASE_URL}{JUPYTERHUB_SERVICE_PREFIX}proxy/{port}/status"
export DASK_DISTRIBUTED__DASHBOARD__LINK="{JUPYTERHUB_SERVICE_PREFIX}proxy/{port}/status"
```

Recommended settings did not trigger the issue:
```bash
# from https://github.com/dask/dask-labextension/issues/109#issuecomment-580151835
export DASK_DISTRIBUTED__DASHBOARD__LINK="proxy/{port}/status"
# from https://docs.dask.org/en/stable/configuration.html#environment-variables
export DASK_DISTRIBUTED__DASHBOARD__LINK="/user//proxy/8787/status"
```

However, these recommended settings are problematic.

The first, `proxy/{port}/status`, produces an incorrect link. Suppose I have a JupyterHub deployment and I access my notebook server at:

```
https://jupyterhub.example.com/user/matt.plough/my-named-server/lab
```

Using `proxy/{port}/status` results in the browser creating the following link in the output of a cell that says `client`:

```
https://jupyterhub.example.com/user/matt.plough/my-named-server/files/proxy/8787/status?_xsrf=[some token]
```

This is incorrect due to the inclusion of `/files`, something that does not occur when `JUPYTERHUB_SERVICE_PREFIX` is part of the `DASK_DISTRIBUTED__DASHBOARD__LINK` variable.

The second, `/user//proxy/8787/status`, cannot accommodate named servers and is not flexible enough to deal with standard servers and named servers on the same box. Use of the `JUPYTERHUB_SERVICE_PREFIX` environment variable eliminates all of these problems.

How should users configure the `DASK_DISTRIBUTED__DASHBOARD__LINK` variable when using a JupyterHub proxy?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.