Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Simplify hosing of Dask Scheduler Dashboard behind the proxy

Abierto
#8,957 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
kubernetes, python
Área
devops, web-dev

Línea de trabajo

Empieza reproduciendo el dashboard del scheduler con Client() o dask-scheduler --host 0.0.0.0 --dashboard-address 8787, usando el prefijo de proxy /session/{SID}/ports/{PID}/. Lee la ruta del dashboard y el manejo de las URL de assets generados; después, verifica que las redirecciones, los assets de Bokeh y sortable.js se resuelvan correctamente bajo las rutas con prefijo.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

needs triage

I'm trying to get Dask Scheduler running behind a custom reverse proxy.
The proxy does URL rewriting from /session/{SID}/ports/{PID}/* to just /*.

The dask scheduler dashboard is executed inside a Kubernetes pod.

In this setup, Dask Scheduler Dashboard doesn't really easily work out of the box.

Here is a couple of issues I have faced so far.

1. Absolute redirect to the root path

If you just try to open /session/{SID}/ports/{PID}/, the dashboard does a redirect to /status root path which omits the proxy subpath and breaks the target URL redirecting to host.com/status.

2. Bokeh assets are broken

The very next issue when you manually try to manually open the correct status URL e.g. /session/{SID}/ports/{PID}/status is all bokeh assets are broken because they are requested with absolute URL e.g. /static/js/bokeh-gl.min.js?v=ver:

Screenshot 2024-12-05 at 13 30 31

Interestingly, if you run it locally, the path will be relative e.g. static/js/bokeh-gl.min.js?v=ver.

It's possible to work this around by specifying this environment variable: export BOKEH_RESOURCES="cdn" that would effectively try to pull bokeh assets not from the current scheduler server but CDN.

3. Incorrect relative paths for sortable.js

The third problem that I have noticed is wrong relative paths for some assets on some pages. For example, when I open /session/{SID}/ports/{PID}/info/main/workers.html page, it tries to load ../../../statics/js/sortable.min.js that assumes three levels of nesting:

Screenshot 2024-12-05 at 13 39 44   Apparently, there should have been two levels navigation up e.g. `../..` instead of three to reach the root because out full path looks like:
info/main/workers.html
 2     1   we are here^

Three level navigation e.g. ../../.. works okay when you host the Dask Dashboard under the hostname e.g. host.com/info/main/workers.html because you simply cannot leave the root dir, so browser/server correctly handles this case.
However, when you host your app under subpath e.g. /session/{SID}/ports/{PID}/info/main/workers.html it ends up incorrectly navigating to /session/{SID}/ports/statics/js/sortable.min.js instead of /session/{SID}/ports/{PID}/statics/js/sortable.min.js.

Summary

Given all these issues with route building when the Dask Dashboard is hosted under the subpath, could we possibly make it less challenging and easier to get it work in this setup? 🙏

The first issue could be theoretically worked around by rewriting the response redirect header. The workaround for the second issue has been mentioned. As for the third one, there is as much as you can do because it's a part of the generated HTML and broken on the browser level. You could fix this by modifying the underlying content of the page but that's a lot do and support if the proxy is not Dask-specific.

Other Context

I'm installing Dask like this:

pip install "dask[distributed]" bokeh

Then I'm running the dashboard in one of these way:

from dask.distributed import Client

client = Client()
dask-scheduler --host 0.0.0.0 --dashboard-address 8787

The Dask version that I used for testing was 2023.11.0.

There is no Dask or Bokeh specific env vars in my environment.

Lenguaje dominante
Python
Estrellas
1.7k
Forks
778
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dask/distributed

Todos los issues de dask/distributed

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.