Simplify hosing of Dask Scheduler Dashboard behind the proxy
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
まず、プロキシプレフィックス /session/{SID}/ports/{PID}/ を使用して、Client() または dask-scheduler --host 0.0.0.0 --dashboard-address 8787 で scheduler dashboard を再現します。dashboard のルートと生成されたアセット URL の処理を確認し、その後、リダイレクト、Bokeh アセット、sortable.js がプレフィックス付きパスで正しく解決されることを検証します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 778
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dask/distributed のほかの issue
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dask/distributed#9366 ·
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
dask/distributed#9353 ·
-
documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
dask/distributed#8304 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
dask/distributed#4816 · コメント 2 件 ·
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
dask/distributed#2378 · コメント 2 件 ·
dask/distributed の issue をすべて見る
似ている issue
-
bug status/needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
prowler-cloud/prowler#12887 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: desktop platform: macos priority: p3 status: ready type: enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
use-agent-os/agent-os#3484 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
open-telemetry/opentelemetry-python-contrib#5113 · コメント 2 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
external
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
langchain-ai/docs#6255 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信