From 3592dd16f0503a8118b7475ed7100062100ee17d Mon Sep 17 00:00:00 2001 From: Serguei Mokhov Date: Fri, 24 Nov 2023 10:50:58 -0500 Subject: [PATCH] [manual] editorialize Jupyter Notebooks section --- doc/scheduler-scripting.tex | 42 +++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/doc/scheduler-scripting.tex b/doc/scheduler-scripting.tex index 091926a..8439756 100644 --- a/doc/scheduler-scripting.tex +++ b/doc/scheduler-scripting.tex @@ -571,53 +571,73 @@ \subsubsection{Graphical Applications} % ------------------------------------------------------------------------------ \subsubsection{Jupyter Notebooks} +\label{sect:jupyter} + +This is an example of running Jupyter notebooks together with Singularity +(more on Singularity see \xs{sect:singularity-containers}). +Here we are using one of the OpenISS-derived containers (see \xs{sect:openiss-examples} as well). -This is an example of running Jupyter-Notebooks. \begin{enumerate} \item -Use the \option{--x11} with \tool{salloc} or \tool{srun}:as described in the above example +Use the \option{--x11} with \tool{salloc} or \tool{srun} as described in the above example + \item Load Singularity module \verb+module load singularity/3.10.4/default+ + \item -Execute this Singularity command +Execute this Singularity command on a single line. It's best to save it in a shell script +that you could call, since it's long. +\scriptsize \begin{verbatim} srun singularity exec -B $PWD\:/speed-pwd,/speed-scratch/$USER\:/my-speed-scratch,/nettemp \ --env SHELL=/bin/bash --nv /speed-scratch/nag-public/openiss-cuda-conda-jupyter.sif \ /bin/bash -c '/opt/conda/bin/jupyter notebook --no-browser --notebook-dir=/speed-pwd \ --ip="*" --port=8888 --allow-root' \end{verbatim} +\normalsize + \item -Create an ssh tunnel between your computer and the node (speed-XX) where Jupyter is running (Using speed-submit as JumpServer) (Preferably: Putty) +Create an \tool{ssh} tunnel between your computer and the node (\texttt{speed-XX}) where Jupyter is +running (Using \texttt{speed-submit} as a ``jump server'') (Preferably: PuTTY, see \xf{fig:putty1} and \xf{fig:putty2}) \begin{verbatim} ssh -L 8888:localhost:8888 speed-XX \end{verbatim} Don't close the tunnel. + \item -Open a browser, and copy your Jupyter's token +Open a browser, and copy your Jupyter's token, in the screenshot +example in \xf{fig:jupyter}; each time the token will be different, +as it printed to you in the terminal. + +\small \begin{verbatim} http://localhost:8888/?token=5a52e6c0c7dfc111008a803e5303371ed0462d3d547ac3fb \end{verbatim} +\normalsize + +\item +Work with your notebook. + \end{enumerate} \begin{figure}[htbp] \centering - \includegraphics{images/putty1.png} + \fbox{\includegraphics{images/putty1}} \caption{SSH tunnel configuration 1} \label{fig:putty1} \end{figure} - -\begin{figure} +\begin{figure}[htbp] \centering - \includegraphics{images/putty2.png} + \fbox{\includegraphics{images/putty2}} \caption{SSH tunnel configuration 2} \label{fig:putty2} \end{figure} -\begin{figure} +\begin{figure}[htbp] \centering - \includegraphics[width=1.00\textwidth]{images/jupyter.png} + \fbox{\includegraphics[width=1.00\textwidth]{images/jupyter.png}} \caption{Jupyter running on a Speed node} \label{fig:jupyter} \end{figure}