Skip to content

purdrew/dashboards_bundlers

 
 

Repository files navigation

PyPI version Google Group

Jupyter Dashboards Bundlers

Collection of reference implementation bundlers that convert, package, and deploy notebooks as standalone dashboards.

What It Gives You

  • File → Deploy as → Local dashboard menu item to deploy the current notebook as a dashboard within the same Jupyter Notebook server instance.
  • File → Deploy as → Dashboard on Jupyter Dashboards Server menu item to deploy the current notebook as a dashboard on a preconfigured Jupyter Dashboards server. (See Use It section for config details.)
  • File → Download as → PHP Dashboard bundle (.zip) menu item to download the current notebook as a PHP dashboard web frontend that you can deploy and configure to use your own kernel provider (e.g., tmpnb + kernel gateway).

Prerequisites

  • Jupyter Notebook 4.0.x running on Python 3.x or Python 2.7.x
  • jupyter_cms>=0.4.0
  • jupyter_dashboards>=0.4.0
  • Edge, Chrome, Firefox, or Safari

Install It

# install the python package
pip install jupyter_dashboards_bundlers
# enable the extension in your ~/.jupyter config
jupyter dashboards_bundlers activate

Uninstall It

jupyter dashboards_bundlers deactivate
pip uninstall dashboards_bundlers

Use It

Currently, there are three bundlers available in this package. The first converts your notebook to a dashboard web application and deploys it to your Jupyter Notebook server for local use. To use it:

  1. Write a notebook.
  2. Define a dashboard layout using the jupyter_dashboards extension.
  3. Click File → Deploy as → Local Dashboard.
  4. Enjoy your dashboard after the redirect.

The second converts your notebook to a dashboard web application and zips it up with a Dockerfile and Cloud Foundry manifest. To use it:

  1. Write a notebook.
  2. Define a dashboard layout using the jupyter_dashboards extension.
  3. Click File → Download as → PHP Dashboard bundle (.zip).
  4. Unzip the download.
  5. Refer to the README.md in the unzipped folder for deployment requirements.

The third directly sends your notebook to a Jupyter Dashboards Server. To use it:

  1. Set the environment variables below and launch your jupyter notebook.
    • DASHBOARD_SERVER_URL - protocol, hostname, and port of the dashboard server to which to send dashboard notebooks
    • DASHBOARD_REDIRECT_URL (optional) - protocol, hostname, and port to use when redirecting the user's browser after upload if different from DASHBOARD_SERVER_URL
    • DASHBOARD_SERVER_AUTH_TOKEN (optional) - upload token is required by the dashboard server
  2. Write a notebook.
  3. Define a dashboard layout using the jupyter_dashboards extension.
  4. Click File → Deploy as → Dashboard on Jupyter Dashboard Server.
  5. Enjoy your dashboard after the redirect.

Caveats

See https://github.com/jupyter-incubator/dashboards#deploy for a full rundown on the current status of dashboard deployment.

It is important to realize that kernels launched by your deployed dashboard will not being running in the same directory or possibly even the same environment as your original notebook. You must refer to external, kernel-side resources in a portable manner (e.g., put it in an external data store, use absolute file paths if your only concern is File → Deploy as → Local Dashboard). You must also ensure your kernel environment has all the same libraries installed as your notebook authoring environment.

It is also your responsibility to associate any frontend, dashboard-side assets with your notebook before packaging it for deployment. To aid in this task, the first two bundlers take advantage of the notebook association feature provided by the jupyter_cms package. See the associations demo for the markup you can use to refer to external files that should be included in your dashboard deployment.

If you are using declarative widgets in your dashboard, you should be mindful of the following when you deploy your dashboard:

  • You must run the entire notebook successfully before deploying. This action ensures all external Polymer components are properly installed on the notebook server and can be bundled with your converted notebook.
  • You cannot use <urth-core-import> elements in custom Polymer widgets that you develop outside your notebook. See dashboards issue #78 for the discussion and current workaround.

About

Converts a notebook to a dashboard and deploys it / downloads it

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 58.8%
  • JavaScript 12.9%
  • Jupyter Notebook 10.5%
  • Smarty 8.7%
  • Makefile 5.0%
  • CSS 4.1%