Simplify hosing of Dask Scheduler Dashboard behind the proxy
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia riproducendo la dashboard dello scheduler con Client() o dask-scheduler --host 0.0.0.0 --dashboard-address 8787, usando il prefisso del proxy /session/{SID}/ports/{PID}/. Leggi la route della dashboard e la gestione degli URL degli asset generati, quindi verifica che i redirect, gli asset Bokeh e sortable.js vengano risolti correttamente nei percorsi con prefisso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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:
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:
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.
- Lingua principale
- Python
- Stelle
- 1.7k
- Fork
- 778
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di dask/distributed
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
dask/distributed#9366 ·
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
dask/distributed#9353 ·
-
documentation
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
dask/distributed#8304 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
dask/distributed#4816 · 2 commenti ·
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
dask/distributed#2378 · 2 commenti ·
Tutte le issue di dask/distributed
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-2 giorni Idoneità per principianti 70/100
-
FingerprintSplitter raises ZeroDivisionError when int(frac_train * len(dataset)) floors to zeroAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 7 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
lmstudio-ai/mlx-engine#376 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pyiron/bagofholding#166 ·