Knowledge Base

Jupyter tool deployment styles

How do you want your Jupyter Notebook-based tool to behave when a user runs it? You have several choices, which we describe here:

  1. Tool or dashboard style--only the UI widgets are visible
  2. Notebook style--all code cells are shown
  3. Autorun style--shows and runs code cells on load

If you're working out how to develop and deploy the notebook, please refer to the other articles in this series. Continue reading to choose and set the tool display style.

Dashboard ("Tool") style

To deploy a notebook as "tool" or dashboard style, the code will be hidden, but the widgets, plots, and markdown will be displayed.

Two things must be done to deploy your tool in this style. From the Workspace tool's command line, do the following:

First, mark the tool mode on your notebook: -t notebook-name.ipynb

Then, set your notebook as trusted:

jupyter trust notebook-name.ipynb

Finally, check the code in to subversion (svn).

Note that you cannot make changes to a notebook once it's marked as a trusted tool. If you must make changes to a notebook that's deployed as a Dashboard, first follow the instructions in Notebook style below, then make your changes, and finally re-mark the notebook to use tool mode and trusted mode as above. Then you can check in the Dashboard-style tool's changes to svn!

Notebook style

To deploy a notebook as notebook style, all code in the notebook will be displayed. This is the default for Jupyter notebook based tools, so if it's a new tool, there's nothing special you must do. However, if you're switching a notebook from tool style to notebook style, you must do these things:

First, mark the tool mode to notebook: -n notebook-name.ipynb

Next, unsign your notebook: notebook-name.ipynb

Open your notebook and make a change (if no code change is needed, just add a line of whitespace). Save that.

Lastly, check the source in to subversion (svn) and continue with the tool deploy.

Note that just changing the tool mode or signing/unsigning is insufficient.
You must change the notebook itself then check it in in order to change its behavior.

Autorun style

For autorun, run with -a to autorun all cells on load of the notebook.

0 Dislike

Last updated

Comments on this entry

There are no comments on this entry.

Post a comment

Post a comment

Please keep comments relevant to this entry. Comments deemed offensive or inappropriate may be removed.