Starting a Jupyter Notebook
The Fuzzfile below specifies starting a Jupyter Notebook.
version: v1
volumes:
jupyter-volume:
name: jupyter-volume
reference: volume://user/ephemeral
jobs:
jupyter:
image:
uri: docker://quay.io/jupyter/minimal-notebook:latest
mounts:
jupyter-volume:
location: /data
env:
- HOME=/tmp/home
command:
- /bin/sh
- '-c'
- >-
export NB_USER=$(whoami); test -d $HOME || mkdir $HOME;
/opt/conda/bin/jupyter notebook --ip=0.0.0.0 --allow-root --no-browser
--NotebookApp.token=$JUPYTER_TOKEN --notebook-dir=/data
resource:
cpu:
cores: 1
affinity: NUMA
memory:
size: 1GB
exclusive: true
You can start this workflow using either the GUI or the CLI.
If you click “Workflow Editor” and “Create New”, you will see a blank page in the workflow editor.
Now you can either click the ellipses (...
) menu in the lower right and select “Edit YAML” or
simply press e
on your keyboard. An editor with a Fuzzfile stub will appear.
You can delete the current contents and copy and paste the workflow definition of from above.
Now pressing “save” will return you to the interactive workflow editor. You will now see the
Jupyter Notebook job named jupyter
instead of a blank editor page. The Fuzzball GUI will automatically validate the yaml file for
syntax errors.
Submitting your workflow to Fuzzball with the GUI is easy. Simply press the triangular “Start Workflow” button in the lower right corner of the workflow editor. You will be prompted to provide an optional descriptive name for your workflow.
Now you can click on “Start Workflow” in the lower right corner of the dialog box and your workflow will be submitted. If you click “Go to Status” you can view the workflow status page. The screenshot below shows the status page for a printer workflow submission.
To retrieve logs produced by this workflow, select the jupyter
job within the workflow, and
click the “Logs” option on the right.
To run this workflow through the CLI you will need access to the Fuzzball CLI. You can install it using the Fuzzball CLI installation instructions.
First, you can create a Fuzzfile jupyter-notebook.fz
with the contents above using the text editor
of your choice.
You can start start this workflow using the CLI by running the following command:
$ fuzzball workflow start jupyter-notebook.fz
Workflow "aa3b04f0-f245-4032-a7b1-5cef0acfaf6c" started.
You can monitor the workflow’s status by running the following command:
$ fuzzball workflow describe <workflow UUID>
Name: jupyter-notebook.yaml
Email: bphan@ciq.co
UserId: e554e134-bd2d-455b-896e-bc24d8d9f81e
Status: STAGE_STATUS_STARTED
Created: 2024-06-18 02:42:53PM
Started: 2024-06-18 02:42:53PM
Finished: N/A
Error:
Stages:
KIND | STATUS | NAME | STARTED | FINISHED
Workflow | Started | aa3b04f0-f245-4032-a7b1-5cef0acfaf6c | 2024-06-18 02:42:53PM | N/A
Volume | Finished | jupyter-volume | 2024-06-18 02:42:54PM | 2024-06-18 02:43:14PM
Image | Finished | docker://quay.io/jupyter/minimal-notebook:... | 2024-06-18 02:42:54PM | 2024-06-18 02:46:35PM
Job | Started | jupyter | 2024-06-18 02:46:50PM | N/A
You can view outputs logged by the workflow, by executing the following command:
$ fuzzball workflow log <workflow UUID> jupyter
[W 2024-06-18 21:46:59.371 ServerApp] A `_jupyter_server_extension_points` function was not found in nbclassic. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2024-06-18 21:46:59.374 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2024-06-18 21:46:59.381 ServerApp] jupyter_server_terminals | extension was successfully linked.
[W 2024-06-18 21:46:59.383 LabApp] 'token' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2024-06-18 21:46:59.388 ServerApp] ServerApp.token config is deprecated in 2.0. Use IdentityProvider.token.
[I 2024-06-18 21:46:59.388 ServerApp] jupyterlab | extension was successfully linked.
[I 2024-06-18 21:46:59.392 ServerApp] nbclassic | extension was successfully linked.
[I 2024-06-18 21:46:59.408 ServerApp] notebook | extension was successfully linked.
[I 2024-06-18 21:46:59.410 ServerApp] Writing Jupyter server cookie secret to /home/jovyan/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2024-06-18 21:47:00.384 ServerApp] notebook_shim | extension was successfully linked.
[W 2024-06-18 21:47:00.498 ServerApp] All authentication is disabled. Anyone who can connect to this server will be able to run code.
[I 2024-06-18 21:47:00.500 ServerApp] notebook_shim | extension was successfully loaded.
[I 2024-06-18 21:47:00.510 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2024-06-18 21:47:00.515 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2024-06-18 21:47:00.519 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.11/site-packages/jupyterlab
[I 2024-06-18 21:47:00.519 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 2024-06-18 21:47:00.520 LabApp] Extension Manager is 'pypi'.
[I 2024-06-18 21:47:00.546 ServerApp] jupyterlab | extension was successfully loaded.
[I 2024-06-18 21:47:00.555 ServerApp] nbclassic | extension was successfully loaded.
[I 2024-06-18 21:47:00.563 ServerApp] notebook | extension was successfully loaded.
[I 2024-06-18 21:47:00.563 ServerApp] Serving notebooks from local directory: /data
[I 2024-06-18 21:47:00.563 ServerApp] Jupyter Server 2.14.1 is running at:
[I 2024-06-18 21:47:00.564 ServerApp] http://jupyter:8888/tree
[I 2024-06-18 21:47:00.564 ServerApp] http://127.0.0.1:8888/tree
[I 2024-06-18 21:47:00.564 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2024-06-18 21:47:01.814 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
...