GibbsConsulting / jupyter-plotly-dash

Jupyter notebook wrapper for plotly dash applications
GNU Affero General Public License v3.0
81 stars 12 forks source link

Compatibility with JupyterHub #17

Open TiemenSch opened 6 years ago

TiemenSch commented 6 years ago

Would it be possible to get this to work with deployments using JupyterHub?

GibbsConsulting commented 6 years ago

It should certainly possible to get it to work, if it doesn't already.

Right now jupyter-plotly-dash is known to work with

What happens when you try using it inside JupyterHub?

erolosty commented 5 years ago

I suspect it's the exact same as Binder,

It tries to render an iframe with a url like:

http://jupyterhub.$domain/user/$user/files/user/$user/app/endpoints/063ff1db6867437b981cc38789d1737d?1544201235585

The user's username is repeated twice. I've tried curling on similar urls (pulling out the double usernames etc) from localhost on the user's jupyter instance, can't seem to get anything

port 8050 doesn't gives me connection refused

Could you let me know a curl that you'd expect to work from localhost if the plugin renders the text:

Open in new window for /user/$user/app/endpoints/063ff1db6867437b981cc38789d1737d/

GibbsConsulting commented 5 years ago

I get 'Open in new window' URLs like /app/endpoints/c1c51597b69d435198703c704ca51ab3/ but this is only a fragment of the full URI (jupyterlab and jupyterhub both insert an additional proxy).

On my local machine, with http://localhost:8888/lab as the root for jupyterlab, the Dash app itself is served at http://localhost:8888/files/app/endpoints/c1c51597b69d435198703c704ca51ab3/ and should work from the browser (probably the quickest way to validate that its working) or curl.

I will now try with jupyterhub. Are you using any particular version?

delsim commented 5 years ago

For me, the following steps (on a Ubuntu 16.04 machine) work:

virtualenv env -p python3.6 source env/bin/activate pip install jupyterhub jupyter-plotly-dash jupyterhub --port=9000

Then go to http://localhost:9000, login and open the JupyterDash.ipynb notebook from the repo. I find that on calculating the notebook the dash apps are rendered within the cell output windows and function as expected. I don't see a repetition of my user name in the URL.

pip freeze reports that jupyterhub version 0.9.4 is being used, along with version 0.1.1 of jupyter-plotly-dash.