-
Notifications
You must be signed in to change notification settings - Fork 209
Deployment Roadmap
Per the roadmap discussion we had at the Jupyter dev meeting in March:
- We have documented the current v0 layout metadata for our extension (https://github.com/jupyter-incubator/dashboards/wiki/Dashboard-Metadata-and-Rendering#spec-v0-current)
- We have drafted our proposed v1 layout metadata for future extensibility (https://github.com/jupyter-incubator/dashboards/wiki/Dashboard-Metadata-and-Rendering#spec-v1-draft)
- We have submitted a minor enhancement proposal to see if consensus will form around shared layout (or general extension) metadata (https://github.com/jupyter/enhancement-proposals/pull/15)
- We plan to complete the adoption of our v1 metadata format in mid-to-late June across the incubating dashboard projects
- We plan to submit a proposal for graduation of the 0.6.0 version of the dashboard layout extension.
- We plan to continue to work with the community about how dashboard bundling and serving graduate, and how dashboarding features materialize in Juptyer Lab.
In addition, we have opened the https://github.com/jupyter-incubator/dashboards_setup repo with docker-compose, Cloud Foundry, and tmpnb recipes for deploying the dashboard related assets for use beyond development.
We've completed most of the original roadmap as planned. At the moment we have:
- jupyter/dashboards, for arranging notebook outputs in a grid-layout (this repo)
- jupyter/dashboards_bundlers, for bundling notebooks and associated assets for deployment as dashboards
- jupyter/dashboards_server, serving notebook-defined dashboards as standalone web apps
The last piece has matured to the point where:
- Alice can write notebook using ipywidgets and lay it out as a dashboard
- Alice can one-click deploy the notebook to a pre-configured dashboard server
- Bob can login to the dashboard server and interact with Alice's notebook as a dashboard
- Bob cannot see Alice's code or send arbitrary code to a kernel powering Alice's dashboard
- Alice can update and one-click redeploy her notebook
See https://gist.github.com/parente/527cea0481afe9fabbcd for a demo setup that brings all of the above pieces together. Here's an animation created using that demo setup.
The basic building blocks of this setup appear are depicted here:
With additional detail added:
Along the way we learned more about common deployment scenarios and aligned more with the direction Jupyter is headed with respect to interactivity both inside and outside the notebook. Here's our primary focus for continuing to move the dashboard deployment work forward, subject to change based on user requirements:
- DONE as of declwidgets 0.5.0 release Improve support for interactive widgets beyond ipywidgets to support declarative widgets (https://github.com/jupyter-incubator/dashboards_server/issues/133, https://github.com/jupyter-incubator/declarativewidgets/issues/141#issuecomment-192493710) and possibly other libraries not built atop ipywidgets (e.g., matplotlib, bokeh, plot.ly: https://github.com/jupyter-incubator/dashboards_server/issues/108)
- DONE Move beyond a single user, shared auth scheme to support multiple user accounts with pluggable authentication (https://github.com/jupyter-incubator/dashboards_server/issues/123)
-
PASS for now
Take an initial pass at user authorization levels for dashboard access (https://github.com/jupyter-incubator/dashboards_server/issues/124) -
WIP Redo the threat analysis on the
0.4.00.6.0 version of the Jupyter dashboards server (https://github.com/jupyter-incubator/dashboards_server/issues/196) - IN ROADMAP https://github.com/jupyter/roadmap#dashboarding Continue to work with the rest of the Jupyter community on how to move dashboards beyond incubation (e.g., see Spring dev meeting agenda)
The latest stable jupyter_dashboards
PyPI release 0.2.0 supports:
- Dashboard layout mode for arranging notebook cell outputs in a grid-like fashion
- Dashboard view mode for interacting with an assembled dashboard within the Jupyter Notebook
- Ability to share notebooks with dashboard layout metadata in them with other Jupyter Notebook users
- Ability to nbconvert a notebook to a separate dashboard web application
This roadmap focuses on improving the security, scalability, and compatibility story of the fourth bullet: notebooks deployed as standalone dashboard applications.
- Get to a stable set of PyPI releases that implement the initial countermeasures described in the [Deployed Dashboard Threat Analysis](Deployed Dashboard Threat Analysis) in support of the user stories below on Jupyter Notebook 4.x.
- Take stock of where the Jupyter Lab (5.0+) implementation stands and synchronize future plans for dashboards with that work.
First, some lingo used throughout this document.
- Web app frontend - The HTML/CSS/JavaScript that runs in the dashboard user's web browser
- Web app backend - The web server that returns the dashboard frontend assets (e.g., a NodeJS app)
- Kernel cluster - The web service that provides an API for requesting a kernel gateway (e.g., tmpnb, binder)
- Kernel gateway - The web service that provides an API for requesting a kernel and communicating with it (e.g.,
jupyter-incubator/kernel_gateway
) - Kernel - The compute engine that executes dashboard backend code and publishes responses to listeners (e.g., ipykernel, IRkernel)
These terms represent "slots" in a solution that enables secure, standalone dashboards. The choice of components that fill these slots (e.g., tmpnb vs binder, IPython kernel vs IRkernel, NodeJS backend vs PHP backend) will vary across use cases. The choice of how to deploy these components (e.g., kernel gateway in Docker containers vs Rocket containers, tmpnb on Swarm vs single host, use of kernel cluster for cross host scaling vs single kernel gateway only) will vary as well.
Alice installs the jupyter_dashboards
, jupyter_contentmanagement
, and jupyter_dashboards_bundlers
extensions for Jupyter Notebook 4.x. She then creates a new notebook. She includes various interactive widgets based on ipywidgets in the notebook. She gives the notebook a dashboard layout. She clicks File → Deploy as → Local Dashboard in Jupyter. A new browser tab opens and redirects to a /files/local_dashboards
URL of her Jupyter server. She sees her notebook as a standalone dashboard application. She can share the URL of the dashboard with anyone that has access to her Jupyter instance. She can see and manage running instances of kernels associated with the dashboard in the Running tab on the Jupyter Notebook main page.
Alice's deployment looks like the following in the end:
Bob installs the jupyter_dashboards
, jupyter_contentmanagement
, and jupyter_dashboards_bundlers
. He then creates a new notebook. He includes various interactive widgets based on ipywidgets in the notebook. He gives the notebook a dashboard layout. He clicks File → Download as → Dashboard Node App (.zip). A new browser tab opens and a zip download commences. Bob opens the zip file and sees a README, Dockerfile, Makefile, and other assets needed to build, configure, and deploy a NodeJS dashboard backend. Bob uses any nconf supported mechanism to configure his app in the following manner:
- HTTPS on all connections from browsers
- Require shared username/password login to access the dashboard web app
- URL of the kernel cluster that will provision and scale kernel gateways for the dashboard
- API keys that allow the dashboard backend to request kernel gateways and kernels
Bob then manually deploys his app to his Docker host of choice. In the end, Bob's deployment looks like the following:
The choice of web host, notebook host, and kernel cluster provider are all left up to Bob.
Cathy works at acme.com. Her company offers cloud hosting for Jupyter Notebook server, web apps, and Jupyter kernels (i.e., kernel cluster + kernel gateway + kernels). She wants to make it easy for users of jupyter_dashboards
to deploy their notebooks as standalone dashboard web applications at acme.com. Cathy writes a new plugin for jupyter_cms
that:
- Adds a new Deploy as → Dashboard on acme.com menu item
- Handles a click on that menu by:
- Turning the notebook into a web app for deployment at acme.com
- Configuring the app with the URL for the acme.com kernel cluster, API keys to allow the app to access the kernel cluster, specifics about the kernel gateway it needs to request to support the notebook code, etc.
- Pushing the app bundle to the acme.com web host
- Returning the public URL of the deployed dashboard
Cathy's acme.com solution looks like the following in the end. Note that it provides one potential solution to Bob's web, notebook, and kernel cluster service needs in the scenario above.
The list below is roughly sequenced, with some activities happening in parallel.
- Implement a new dashboard backend based on NodeJS
-
DONE Initial implementation (https://github.com/jupyter-incubator/dashboards_nodejs_app/issues/1)
- Use jupyter-js-services, jupyter-js-output-area instead of Thebe
- Keep code hidden from the dashboard user in the app backend, not frontend
- DONE Filter all but widget comm messages from the frontend (https://github.com/jupyter-incubator/dashboards_nodejs_app/issues/6)
-
WORKING using ipywidgets master Support ipywidget based interactive elements (https://github.com/jupyter-incubator/dashboards_nodejs_app/issues/2)
- Dependency: ipywidgets 5.0+ (https://github.com/ipython/ipywidgets/pull/264)
- DONE Support HTTP or HTTPS (https://github.com/jupyter-incubator/dashboards_nodejs_app/issues/3)
- DONE Support (optionally) shared username/password login form (https://github.com/jupyter-incubator/dashboards_nodejs_app/issues/4)
-
DONE Initial implementation (https://github.com/jupyter-incubator/dashboards_nodejs_app/issues/1)
-
DONE Make notebook conversion, bundling, and deployment pluggable
-
DONE Define bundler framework in
jupyter-incubator/contentmangagement
(https://github.com/jupyter-incubator/contentmanagement/issues/13) -
DONE Port the existing Thebe-based local deployment option from
jupyter-incubator/dashboards
tojupyter-incubator/dashboards_bundlers
as PoC (https://github.com/jupyter-incubator/dashboards_bundlers/issues/1) -
DONE Port the existing Thebe-based PHP download option from
jupyter-incubator/dashboards
tojupyter-incubator/dashboards_bundlers
as PoC (https://github.com/jupyter-incubator/dashboards_bundlers/issues/5)
-
DONE Define bundler framework in
- DONE Remove old bundling code from jupyter-incubator/dashboards once all the pluggable versions are released (https://github.com/jupyter-incubator/dashboards/issues/151)
-
Implement a new bundler that packages the NodeJS app for download injupyter-incubator/dashboards_bundlers
(https://github.com/jupyter-incubator/dashboards_bundlers/issues/2)Dependency: Requires first version of NodeJS backend (above)Ensure it packages / references declarative widgets properly
-
HOLD Implement a new static HTML web app for dashboard deployment within Jupyter
- Replace the initial Thebe implementation in
jupyter-incubator/dashboards_bundlers
with one based on jupyter-js-services and jupyter-js-output-area (https://github.com/jupyter-incubator/dashboards_bundlers/issues/3)- Dependency: wait for the NodeJS backend to get it right first (above)
- Requirement: must register a session with the Notebook server to allow manual kernel cleanup later via the Running tab in the notebook
- Replace the initial Thebe implementation in
-
DONE Make tmpnb a minimally secured open source reference implementation for the kernel cluster role
- DONE Add token auth option to tmpnb (https://github.com/jupyter/tmpnb/issues/189)
-
DONE Have tmpnb generate and return a unique API key in each
/api/spawn
response (https://github.com/jupyter/tmpnb/pull/205)
- How do common JS assets get shared among dashboard layout extension, NodeJS dashboard backend, static web app for local deployment, etc. after the refactoring?
- Short term: duplication with JS in
jupyter-incubator/dashboards
serving as the master copy - Long term: move the JS bits to a common package
- Short term: duplication with JS in
- How are prerequisites like libraries, kernels, and data used by notebooks satisfied upon deployment?
- Using only the freely available, open source assets: manually.
- In a "walled garden" solution where the notebook environment, kernel compute cluster, docker registry, package manager, and data store are all known: in an automated fashion by custom bundlers.
Largely unknown, but definitely predicated on:
- Agreement with the community on what "dashboards" mean within the grander workbench context.
- Exploration of how to port relevant features from the current implementations to Phosphor plugins.