Skip to content
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

Add support for a client request prefix parameter to nbdiff-web #458

Closed
ned2 opened this issue Mar 1, 2019 · 4 comments
Closed

Add support for a client request prefix parameter to nbdiff-web #458

ned2 opened this issue Mar 1, 2019 · 4 comments

Comments

@ned2
Copy link

ned2 commented Mar 1, 2019

I'm trying to run nbdiff on AWS Sagemaker (using Jupyter Lab) but running into this blocking problem.

Inside the Sagemaker environment, running an app on a port is automatically made available through a prefix appended to the the request string. So an nbdiff instance running on http://127.0.0.1:44021/difftool would be made externally available at http://PUBLIC_HOST/proxy/44021/difftool. This breaks the app however as it assumes the JavaScript asset nbdime.js is located at /static/nbdime.js when it's actually found at /proxy/44021/static/nbdime.js. The same problem occurs within nbdime.js, where all the api requests assume the api endpoints are found at /api/.

nbdiff-web has the base-url parameter, however this changes the prefix for both URL routes and also client requests, so this doesn't work. It seems like a separate request prefix param is required for when a web host has implicitly set a requests prefix.

@minrk
Copy link
Member

minrk commented Mar 1, 2019

A couple questions for context:

  1. are you using jupyter-server-proxy (formerly known as nbserverproxy) to do this forwarding? If so, it mangles forwarded paths, but doesn't have to in the current beta release. Telling nbdime the base url and using the path-preserving proxy url should work. That would mean using e.g. http://PUBLIC_HOST/proxy/absolute/44021/difftool
  2. are you aware of the jupyterlab nbdime and nbserver extensions? I'd recommend using those if you can, since they shouldn't have to deal with this proxy stuff.

@ned2
Copy link
Author

ned2 commented Mar 1, 2019 via email

@vidartf
Copy link
Collaborator

vidartf commented Mar 9, 2020

Closing as answered.

@vidartf vidartf closed this as completed Mar 9, 2020
@michaelhoarau
Copy link

Hi,

I'm running into a similar issue, but within Dataiku. I'm running a Jupyter Lab server inside a Code Studio on this platform (which basically runs a JupyterLab server in a Kubernetes pod). Inside this environment, a diff-web instance running on http://127.0.0.1:3000/diff would be exposed externally on https://$HOST/code-studios/$PROJECT_ID/$CODE_STUDIO_ID/3000/diff. However, diff assumes the nbdime.js file is located at /static/nbdime.js.

How should I use the base-url option to point diff to the right path? If this is not possible, where in this picture would jupyter-server-proxy fit?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants