After many tries I have been unable to display a bokeh app within a notebook on JupyterHub. I can embed a bokeh server in a Jupyter notebook on my local machine, and standalone bokeh content shows up on the remote machine running JupyterHub. But it’s when using bokeh servers and JupyterHub that things go awry.
I have followed all the steps described here, with nbserverproxy installed and the corresponding extension enabled. I’m using the notebook_embed proposed as an example. I modified the
remote_jupyter_proxy_url function given by @cbanek in the docs so that
base_url corresponds to the remote server domain name.
When I call
show(bkapp, notebook_url=remote_jupyter_server_url), I notice that the
remote_jupyter_proxy_url function is actually called twice. The first time
None and the second time it is randomly assigned somewhere in the 30000-40000. The
full_url finally returned is something like https://my.remote.server/user/my-username/port and when I try to access that URL in a separate tab, the window is empty (console says the resources fail to load) but the tab title is ‘Bokeh Application’, so I figured there is at least something actually working here. As for the browser in the notebook tab, itsays it "failed to load Bokeh session’ and ‘Could not open websocket’.
I have tried to do the same in another context, with a Littlest JupyterHub instance specially set up for that purpose on my local network at home, to no avail.
Since I have similar issues in these two different JupyterHub implementations, I think I must be doing something wrong in both cases or there is something broken somewhere.
I know this issue does not deal with bokeh per se but I guess this is the right community to ask for help! Many thanks in advance.
I will provide the code I have in my notebook in a separate post as I’m limited to two links per post as a new poster.