-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for JupyterHub proxy #193
Comments
@bnouvelbmll thanks for this! It's definitely very cool. I've done some digging though and D-Tale falls over really quick with this because its using relative URLs. For example when loading JS or CSS its using the following within its jinja template: But when you use jupyter-server-proxy that URL will resolve to: The way that we got around this at the time was by having our proxy URL simply mask the base That being said, I am working on exposing the static data (JS, CSS, Flask endpoints) in a more relative way. So prefacing any endpoints with |
url_for static can return the right url if configured/implemented/patch adequately. I had a look at the code. The two main issues for me seem to be some absolute link to "/" for instance where the code create html link to "/chart" without considering the possibilty of a prefix . And possibly some confusion in some dash libraries between More precisely, setting APPLICATION_ROOT mostly is usable to move the application in the right folder, but in the browser it seems that many assets are still queried at the root or in |
More precisely, using draft code below, it seems that it we can monkey patch for most issues from the python generated content but it seems that there are still absolute link referring to '/' in html and javascript. It seems that you may need to add tests to ensure the dtale also work when APPLICATION_ROOT is changed.
|
So I've started a branch for this and I'm getting closer. Definitely needs some more cleanup on the front-end stuff. https://github.com/man-group/dtale/tree/jupyter-server-proxy-updates |
Thanks, nice. I gave it a try, but I have not managed to get it working by specifying app_root. Not sure why. When retrying with the patching, I noticed that the charts were working, but I still could not get the grid to work. |
So it the grid and the charts were working for me (I managed to get jupyterhub w/ jupyter-server-proxy running) with that branch I just needed to fix how the endpoints on calls back to the server from the React code were working. Maybe take a stab on sunday after I get this latest release out. Thanks for all your hard work on this. 🙏 |
I repulled and I managed indeed to get the grid and plots working directly with the code in the branch. Great work! It is nice to see that the most important features are already there. It is also nice that the part of the url related to the port is added automatically to the app_root. It is useful in this precise scenario where we use jupyter_proxy. Now, to cover all types of deployments its probably a good idea to keep this as a toggle so that people that don't use jupyter_server_proxy but still want to deploy to alternate root can do it. |
@bnouvelbmll sorry been away moving for the last week. Just pushed a bunch of updates to my branch. I think I'm very close if not done. Just need to do some testing around the use case where you don't specify an Also, I still need to get the jupyter notebook cell to print the correct url. |
@bnouvelbmll I believe I have put the finishing touches on my branch so that when specifying Let me know if you have any issues. I'm going to do some more testing and add some tests and if all is still good I'll release a new version with these changes. |
This functionality has been released in v1.8.13, here's the documentation on how it works. Thanks for all your help with this! |
JupyterHub has an extension that allows to proxy port for user.
https://github.com/jupyterhub/jupyter-server-proxy
It seems it would be a much more appropriate way to deploy dtale on jupyterhub on k8s.
However, it requires to change the base URL of the application so it supports the proxied URL
which looks like - this implies tweaking the flask/dash deployment, and ensuring all redirect and static resources are working correctly with it. It seems it is mostly tweak for app.py.
https://myjupyterlab.com/user/myuserlogin/proxy/40000/dtale/main/1
I had a quick look at it but I haven't managed to get it to work within that setup yet.
The text was updated successfully, but these errors were encountered: