Voila Dashboards

How to turn a notebook into a web application using Voila

What is Voila

Voila is the fasted way to turn a Jupyter notebook that leverages widgets into a web application. I recommend working with Voila in Jupyter Lab first (by running it in the terminal) before attempting to deploy it.

Jupyter Proxy

In Saturn, we setup Jupyter behind JupyterHub, and we setup the proxy, which means that you can access arbitrary ports via certain URLs. To start Voila with the appropriate parameters, execute the following

export SERVICE_PREFIX=/user/${SATURN_USERNAME}/${SATURN_PROJECT_NAME}
voila --Voila.ip=0.0.0.0 --server_url=/ --base_url=${SERVICE_PREFIX}/proxy/8866/ --Voila.custom_display_url=https://${SATURN_JUPYTER_BASE_DOMAIN}${SERVICE_PREFIX}/proxy/8866 .

This will expose voila on your jupyter lab url, except replace lab with proxy/8866/

Deployment

After you’re happy with this, it’s very easy to enable a production deployment. For a production deployment, we no longer need the url commands, but we DO need to expose the proper port.

voila --Voila.ip=0.0.0.0 --port=8000 .