Bokeh server for experiment visualization (ssh, gateway, jupyter)

Hello everybody,

for an experiment I am running a linux server to control al the devices. This computer runs a jupyter notebook server which can be accessed by ssh forwarding the port 8888 to my local machine. When I want to do plot I currently use matplotlib. I want the plots to be live updating while the notebook runs, so the backends notebook and inline are not possible. Therefore I have to use the qt5 backend. This however requires also X forwarding and therefore slows down the network connection.

Now I wonder whether there is a possibility to use bokeh for that. I want to run a bokeh server and live stream data to it from the jupyter notebook. This would give me the opportunity to show the plots a different tab than the notebook.

Does anyone know how this is possible. I looked at the bokeh.client example that can be found here (Running a Bokeh server — Bokeh 2.4.2 Documentation). When I try to open localhost:5006/ I just see an empty page. What is my mistake?

Thank you for your help!

Hi,

By default the Bokeh server network configuration is quite conservative. If you want to be able to connect from other than localhost, you will probably need to enable other origins to connect explicitly with --allow-websocket-origin described here:

  http://bokeh.pydata.org/en/latest/docs/user_guide/cli.html#network-configuration

However, additionally there is another problem. If you are using bokeh.client, then *you* are responsible for supplying the session id to connect to (since you are the one who created a single session, with bokeh.client). The URL will be more like:

  http://foo.bar:5006/?bokeh-session-id=BKCZUaDHzbqZRr0ID9jboXVeMljxh9LMnOfW8vr0gRjI

not just "http://foo.bar:5006/" You'd have to find some way to communicate that session ID back from your running notebook (which created the single session with bokeh,client). For this, and several other reasons, I'd actually heavily discourage the use of bokeh.client. It mostly exists as a testing tool, and I would not recommend it for general use.

It's possible to embed the bokeh server as a library, and that will give you a "real bokeh app" which will be much more robust and easy to use:

  Bokeh server — Bokeh 3.3.2 Documentation

Thanks,

Bryan

···

On Apr 28, 2017, at 08:09, [email protected] wrote:

Hello everybody,

for an experiment I am running a linux server to control al the devices. This computer runs a jupyter notebook server which can be accessed by ssh forwarding the port 8888 to my local machine. When I want to do plot I currently use matplotlib. I want the plots to be live updating while the notebook runs, so the backends notebook and inline are not possible. Therefore I have to use the qt5 backend. This however requires also X forwarding and therefore slows down the network connection.

Now I wonder whether there is a possibility to use bokeh for that. I want to run a bokeh server and live stream data to it from the jupyter notebook. This would give me the opportunity to show the plots a different tab than the notebook.

Does anyone know how this is possible. I looked at the bokeh.client example that can be found here (http://bokeh.pydata.org/en/latest/docs/user_guide/server.html\). When I try to open localhost:5006/ I just see an empty page. What is my mistake?

Thank you for your help!

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/5b46aa91-76a5-41a9-9bb1-69cc5c3ce21a%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.