Deploying Bokeh apps easily on JupyterHub

When you have built your Bokeh app and it works perfectly on your local machine, the next challenge is how to share it reliably and securely with your colleagues or clients.

My open source JupyterHub extension allows you to automatically deploy visualizations based on any open source frameworks, immediately accessible to any authenticated JupyterHub user. This means you can make use of your existing JupyterHub infrastructure, and authenticate users based on corporate email etc.

The latest version of ContainDS Dashboards (0.0.20) includes some enhancements specifically for Bokeh, including reliability enhancements for apps that take a while to start up, and covering different scenarios e.g. notebooks or direct Python scripts.

I would like to thank the Bokeh (and Panel) communities for their help in highlighting the challenges they face in deploying different styles of app and helping me address these in the dashboards software.

It’s all free to use - please let me know if you have any questions or feedback at all!

3 Likes

@danlester

I scanned the documentation, and this looks like a very nice, feature rich extension.

I have a development bokeh server app which I currently embed in a flask app running under gunicorn.

The authentication that your software provides implements for free all of the logic I had to manually write using Flask extensions (login, bcrypt, etc.). This makes me think I could possibly use ContainDS Dashboards with little additional work to provide an alternative mechanism to deploy my software in the future.

The one thing I do not see in a quick scan of the docs is a way to work with user-provided data in a scientific software visualization app rather than having it work with data only available in the server.

At present, I use a flask upload form to transfer user-selected data from their local machine to the server, convert the stream to JSON, and pass it to the bokeh server at the start of a session. Is there a similar mechanism available through this JupyterHub extension? (Apologies if this is a naive question, as I don’t currently use Jupyter.)

1 Like

@_jm Thank you for taking a look, and for your thoughts.

Yes, if you are running a JupyterHub and are happy with the auth on that, then ContainDS Dashboards will mean you don’t need to implement auth separately in Flask (or Bokeh).

Things would be simpler of course if there was a data upload widget available directly in Bokeh (or maybe Panel), but as far as I’m aware there isn’t one.

But in any case, there is no reason why you can’t run a Flask app through ContainDS Dashboards. It would be best if I create a standard wrapper, as I have for Plotly Dash apps (which are just Flask apps anyway). In fact, a very small adjustment to that Dash wrapper would allow it to look for regular Flask objects instead. I’ll be very happy to work with you when you get to that point, if I haven’t already added in a direct Flask option.

I hope this explains the possibilities. I guess the most important consideration is whether you would like to run a JupyterHub or not! It’s easy enough, and there is a lot of support available.