Simplify hosing of Dask Scheduler Dashboard behind the proxy
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tái tạo scheduler dashboard với Client() hoặc dask-scheduler --host 0.0.0.0 --dashboard-address 8787, sử dụng tiền tố proxy /session/{SID}/ports/{PID}/. Đọc route của dashboard và cách xử lý URL của các asset được tạo, sau đó xác minh rằng các chuyển hướng, asset Bokeh và sortable.js được resolve chính xác dưới các đường dẫn có tiền tố.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 1.7k
- Fork
- 781
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dask/distributed
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dask/distributed#9366 ·
-
Scipy's spmatrix deprecation keeps the Upstream nightly red after #9351 — all 14 test_serialize_scipy_sparse cases failCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởneeds triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
dask/distributed#9353 · 1 bình luận ·
-
documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
dask/distributed#8304 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
dask/distributed#4816 · 2 bình luận ·
-
Client.scheduler_info needs better documentationCó thể đã có người làm @nil68657 đã nhận 14 ngày trước. Đang mởdocumentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
dask/distributed#2378 · 2 bình luận ·
Tất cả issue của dask/distributed
Issue tương tự
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-freeCó thể đã có người làm @Aaqibhafeezkhan đã nhận hôm nay. Đang mởbeginner documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
BistaDinesh03/critique#164 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug IO
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MrNeRF/LichtFeld-Studio#3824 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
open-webui/open-webui#33200 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Lychee link check failedĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog checkCó thể đã có người làm @ocelotl đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
open-telemetry/opentelemetry-python#5825 ·
Maintainer thường phản hồi trong vòng 2 ngày