Transparent use on JuypterHub #13402
Replies: 5 comments 1 reply
-
Hi @jaytmiller I'm not really much of a notebook user, much less JupyterHub, so I'll have to defer to your expertise regarding both the need and the best solution for that need. In broad strokes it seems fine. @philippjfr and @mattpap or other @bokeh/core may want to chime in on specifics, but it's probably simplest for everyone to collaborate around actual proposed code in a PR (especially if the changes are minimal/self-contained, which it seems like is the case?) |
Beta Was this translation helpful? Give feedback.
-
Yes, I believe based on a count of notebook_url parameters the change should be fairly minimal. I'll see if I can whip something up and PR it so we have a reference point. |
Beta Was this translation helpful? Give feedback.
-
Definitely interested to see what this proposal looks like as I currently can't quite envision it based in your description. It is worth noting that you can already achieve a fully interactive app in a notebook by wrapping it with jupyter_bokeh's BokehWidget wrapper or with panel. |
Beta Was this translation helpful? Give feedback.
-
Didn't know about the automatic conversion so I created this issue standalone: #13403 |
Beta Was this translation helpful? Give feedback.
-
Sorry that took so long, I had to learn Bokeh dev basics. I PR'ed here: I verified this works on our JupyterHub. I wrote no additional documentation and no tests, pending basic agreement/approval. |
Beta Was this translation helpful? Give feedback.
-
I'd like to propose a minor extension to the currently documented solution for
running Bokeh on JupyterHub behind a proxy:
https://docs.bokeh.org/en/latest/docs/user_guide/output/jupyter.html#jupyterhub
My use case is trying to help class instructors produce notebooks which work the
same on and off JupyterHub, whether they are authoring on their laptops or
teaching class. For their purposes, Bokeh results should be directly injected
into the notebook page as the instructors and students step along.
What I want to propose has these 2 benefits:
a. It doesn't require notebook authors or students to learn or do anything
extra for their notebooks to work on the Hub. It "just works" from their
perspective.
b. Notebooks authored in a standalone local JupyterLab session work
identically on the hub, no source changes are required.
It can be implemented like this, leveraging the prior work:
A JupyterHub admin sets an environment variable for all users as follows:
export BOKEH_JUPYTER_EXTERNAL_URL=https://our-jupyterhub.edu/
This variable acts as both a flag activating JupyterHub mode if defined, and as
a pointer to the JupyterHub public hostname required to implement the mode. It
is easy for JupyterHub admins to adopt by setting a line of configuration code.
variation of "show(notebook_url=remote_jupyter_proxy_url)" where needed,
inside show(), etc.
Bokeh behaves the same way it always did... unless BOKEH_JUPYTER_EXTERNAL_URL
is defined. We tried this same approach for the GitHub lightkurve project and
it worked well.
If this sounds like a useful/acceptable addition, I'd be happy to submit a PR
with the required code, test, and doc changes. What do you think?
Beta Was this translation helpful? Give feedback.
All reactions