You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to put Dask Dashboard behind web server like reverse proxy? #2073
I am planning on putting dash dashboard behind Nginx at particular url. However the http request of dashboard is abosolute url. so i am wondering if i can i set hostname or relative url.
My application is container based. I have multiple web service like the figure below.
in prior to dask, I used luigi as workflow engine and luigi web ui was servered by using reverse proxy at /luigi.
Compare to luigi, i think dask is more easier to define computation graph
and to test. So that was the reason i tried to replace luigi to dask.
Problem is all href in 'a' tag is started with '/' .
Other pages are functioning well
Yes, I can see how removing the leading slash might be a good idea. I
honestly don't know much about what the correct behavior is here. If
you're pretty confident that we shouldn't be enforcing absolute paths and
feel like submitting a PR with a change and a test that would be welcome.
FWIW was just playing around with nbserverproxy to do something similar (which works great I might add), but ran into the same issue with paths being incorrect on the main page as it appears to be the case here. Though they were correct in the header links of the individual apps. Would be interested in fixing this to be relative paths if you can give me a pointer about where to look and what might need to be done.
I can report that with dask-scheduler --bokeh-prefix=/daskboard (and with --bokeh-prefix=daskboard - note the lack of a leading slash) the following Nginx directive works just fine and I can access all the Active Bokeh Apps links under http(s)://<nginx>/daskboard/ just fine:
Sadly the same doesn't work well for nbserverproxy as it needs to know the port the scheduler will use since this makes up the URL (e.g. it will add on /proxy/8787 assuming the default port). However we don't know the scheduler port for the dashboard unless we set it ourselves, which could still get overridden if that port is taken. Hence --bokeh-prefix is not very helpful here.
Would much prefer the links on the Dask Dashboard menu page to be relative. This should still work well for users that set --bokeh-prefix (as they would be relative) and it would work well for users unable to set --bokeh-prefix, but needing some sort of prefix. Perhaps in the long run this would make --bokeh-prefix unnecessary as the defaults could serve all users well.
Note that all links within any of the pages are relative. In practive I
resolve this by just never using the Bokeh index page, and instead point
users to the status page by default. All of Dask's pages have a navbar at
the top to help people navigate.
On Thu, Jun 28, 2018 at 2:53 AM, jakirkham ***@***.***> wrote:
Sadly the same doesn't work well for nbserverproxy as it needs to know
the port the scheduler will use since this makes up the URL (e.g. it will
add on /proxy/8787 assuming the default port). However we don't know the
scheduler port for the dashboard unless we set it ourselves, which could
still get overridden if that port is taken. Hence --bokeh-prefix is not
very helpful here.
Would much prefer the links on the Dask Dashboard menu page to be
relative. This should still work well for users that set --bokeh-prefix
(as they would be relative) and it would work well for users unable to set
--bokeh-prefix, but needing some sort of prefix. Perhaps in the long run
this would make --bokeh-prefix unnecessary as the defaults could serve
all users well.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2073 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASszApNVPpGfqrDoLq64qamqs8hQYxWks5uBH2EgaJpZM4U2Ztd>
.
Hmm...so why is it that the index listing ignores the current URL? 😕
Yeah the navbar seems to avoid this issue. Though it doesn't include all of the apps that the index page does. Would it be worth adding them in some drop down menu on the end?
Just to better elucidate what I'm seeing, opened issue ( #2081 ).
Are there pages listed in the index that you actively use that aren't in
the navbar? Many of those are more diagnostic than user facing.
Hmm...so why is it that the index listing ignores the current URL? 
I'm not sure what this means
The dask-created pages all use relative links to avoid this problem
entirely. Bokeh requires a prefix. My solution has just been to never
use the index page. I'm surprised that people are getting to it.
The work stealing page is sometimes helpful. Though I agree it is mostly useful for diagnostics.
Please see the first screen shot in issue ( #2081 ) for an example.
So this is something that would need to be improved in Bokeh? FWIW saw they closed out issue ( bokeh/bokeh#5692 ), which seemed potentially relevant, but wasn't sure if it helped us here or how to use it.
I don't know. I suspect that they would ask why the prefix keyword wasn't
sufficient. If it isn't sufficient then yes, it might be a Bokeh issue.
You could also ask them to use relative links by default.
Activity
mrocklin commentedon Jun 25, 2018
Can you say a bit more about how you would normally do this without Dask, and if there are any challenges that Dask introduces in particular?
h4nyu commentedon Jun 26, 2018
My application is container based. I have multiple web service like the figure below.
in prior to dask, I used luigi as workflow engine and luigi web ui was servered by using reverse proxy at /luigi.
Compare to luigi, i think dask is more easier to define computation graph
and to test. So that was the reason i tried to replace luigi to dask.
Problem is all href in 'a' tag is started with '/' .
Other pages are functioning well
mrocklin commentedon Jun 26, 2018
h4nyu commentedon Jun 26, 2018
mrocklin commentedon Jun 26, 2018
h4nyu commentedon Jun 26, 2018
yes, correct.
mrocklin commentedon Jun 26, 2018
h4nyu commentedon Jun 26, 2018
command is
dask-scheduler --bokeh-prefix=dask-dashboard?I got 404.
mrocklin commentedon Jun 26, 2018
h4nyu commentedon Jun 26, 2018
i used
dask-scheduler --bokeh-prefix=dask-dashboardand changed nginx.conf
location ~ ^/dask-dashboard/ { - rewrite ^/dask-dashboard(/.*)$ $1 break; proxy_pass http://dask-scheduler:8787; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }I can acess http://192.168.10.7/dask-dashboard/status !
It works!
However i found href is '/dask-dashboard/status' its start with '/'.
When multistage reverse proxy like '/foo.com/segment/..../dask-dashboard',
dask-dasboard don't know how proxy in front of exists.
distributed/distributed/bokeh/scheduler.py
Lines 1172 to 1173 in 40e27ea
this code is forced to set prefix as absolute path.
I am wondering if can i set relative path to
--bokeh-prefixlike./dash-dashboard.mrocklin commentedon Jun 26, 2018
jakirkham commentedon Jun 27, 2018
FWIW was just playing around with
nbserverproxyto do something similar (which works great I might add), but ran into the same issue with paths being incorrect on the main page as it appears to be the case here. Though they were correct in the header links of the individual apps. Would be interested in fixing this to be relative paths if you can give me a pointer about where to look and what might need to be done.vishnu2kmohan commentedon Jun 28, 2018
I can report that with
dask-scheduler --bokeh-prefix=/daskboard(and with--bokeh-prefix=daskboard- note the lack of a leading slash) the following Nginx directive works just fine and I can access all theActive Bokeh Appslinks underhttp(s)://<nginx>/daskboard/just fine:There is no need for the Nginx
rewriteclause and I don't think we ought to remove the leading slash for the prefix inscheduler.pyNote: Replace
<dask-scheduler>with the correct hostname or IP address for your Dask Schedulerjakirkham commentedon Jun 28, 2018
Sadly the same doesn't work well for
nbserverproxyas it needs to know the port the scheduler will use since this makes up the URL (e.g. it will add on/proxy/8787assuming the default port). However we don't know the scheduler port for the dashboard unless we set it ourselves, which could still get overridden if that port is taken. Hence--bokeh-prefixis not very helpful here.Would much prefer the links on the Dask Dashboard menu page to be relative. This should still work well for users that set
--bokeh-prefix(as they would be relative) and it would work well for users unable to set--bokeh-prefix, but needing some sort of prefix. Perhaps in the long run this would make--bokeh-prefixunnecessary as the defaults could serve all users well.mrocklin commentedon Jun 28, 2018
jakirkham commentedon Jun 28, 2018
Hmm...so why is it that the index listing ignores the current URL? 😕
Yeah the navbar seems to avoid this issue. Though it doesn't include all of the apps that the index page does. Would it be worth adding them in some drop down menu on the end?
Just to better elucidate what I'm seeing, opened issue ( #2081 ).
mrocklin commentedon Jun 28, 2018
jakirkham commentedon Jun 28, 2018
The work stealing page is sometimes helpful. Though I agree it is mostly useful for diagnostics.
Please see the first screen shot in issue ( #2081 ) for an example.
So this is something that would need to be improved in Bokeh? FWIW saw they closed out issue ( bokeh/bokeh#5692 ), which seemed potentially relevant, but wasn't sure if it helped us here or how to use it.
mrocklin commentedon Jun 28, 2018
h4nyu commentedon Jul 2, 2018
I found absolute link in dask-created pages.
distributed/distributed/bokeh/components.py
Line 101 in 94f076c
I have tested.
mrocklin commentedon Jul 2, 2018
mrocklin commentedon Sep 6, 2018
If recollection serves I think that this has been resolved.