There are many kernels available for Jupyter, allowing the user to write notebooks in their desired language.
Since jupyter_o2
runs Jupyter on an interactive node,
bash notebooks can be used to document your session on O2, including
commands and outputs, without using SLURM to submit additional jobs.
%%bash
can be used to run a bash
command in kernels that support it,
but it does not remember your working directory or other variables from previous cells.
Just be sure that your node has sufficient memory for the desired tasks, or you could find your notebook server shutting down unexpectedly. SLURM jobs can also be submitted and monitored from within a notebook to avoid this issue.
jupyter contrib nbextensions adds a useful nbextensions configuration tab to the main jupyter site. It also includes many useful extensions.
Set the autosave time to 2 minutes to reduce the risk of losing changes due to a lost connection or closure of the interactive node (if it runs out of time, for example).
While JupyterLab is currently an alpha preview, it is a more complete environment than jupyter notebook. With notebook and terminal tabs, a text editor, and a file browser, you could run everything you need on O2 from a single browser window.
If jupyter hangs when opening notebooks for the first time in any session, and the console shows error messages such as:
The signatures database cannot be opened; maybe it is corrupted or encrypted.
Failed commiting signatures database to disk.
Disabling the signatures database may be the best option, since there is no non-networked file system shared between all the interactive compute nodes.
- enter an interactive session and generate a notebook config using
jupyter notebook --generate-config
- in
~/.jupyter/jupyter_notebook_config.py
setc.NotebookNotary.db_file = ':memory:'
If you see srun: error: x11: no local DISPLAY defined
,
try logging in to the server with ssh -X
and check your DISPLAY using echo $DISPLAY
.
There should be a string printed in response.
If $DISPLAY
is empty, try reinstalling XQuartz,
or run jupyter_o2 with the -Y
argument to enable trusted X11 forwarding.