Skip to content

Commit

Permalink
[manual] editorialize Jupyter Notebooks section
Browse files Browse the repository at this point in the history
  • Loading branch information
smokhov committed Nov 24, 2023
1 parent 21d0448 commit 3592dd1
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions doc/scheduler-scripting.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 3592dd1

Please sign in to comment.