Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you want to build your own Singularity container for JupyterHub, see here: Create my own Singularity container JupyterHub

Remote Desktop (Graphical Environment via Xpra)

...

  1. Create a conda environment as described here:

    1. Python & Python Package Management

  2. conda activate <your conda env>

  3. conda install ipykernel

  4. ipykernel install --user --name <KERNELNAME> --display-name "<DISPLAY NAME>"

Loading software modules using JupyterLab

To load software modules inside JupyterLab, click on the Lmod extension tab. Then you have the possibility to search, load and unload modules.

If you are using the Classic Notebook View, click on tab "Softwares" to load software modules.

Create my own Singularity container

Installing Jupyter tools

You do not need to install the Jupyter client tools inside your Singularity container.

If the file /opt/conda/bin/jupyterhub-singleuser does not exists inside your container, the JupyterHub binds its own tools inside your container at run time.

If you want to manage your own Jupyter tools/extensions please make sure /opt/conda/bin/jupyterhub-singleuser exists inside your Singularity container.

Using Docker stacks

It is possible to build singularity containers from the official jupyter docker stacks:

https://jupyter-docker-stacks.readthedocs.io/en/latest/

Here are more information on how to build a singularity container from DockerHub:

https://sylabs.io/guides/3.7/user-guide/build_a_container.html

Container Location

...

Create my own Singularity container

Container package requirements

  • python >= 3.10

    • jupyterhub

    • optional, but useful: jupyterlab

Example Apptainer/Singularity recipe

Base recipe
Code Block
Bootstrap: docker
From: debian

%post
apt -y update
export DEBIAN_FRONTEND=noninteractive
apt -y install zsh locales
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

python3 -m pip install jupyterhub
Install custom Python kernel inside the container (python 3.12)
Code Block
mkdir /opt/python3.12
cd /opt/python3.12

apt -y install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git

wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz
tar -xf Python-3.12.0.tgz
rm Python-3.12.0.tgz
cd Python-3.12.0/
./configure --enable-optimizations
make -j 8
make altinstall

python3.12 --version
python3.12 -m pip install --upgrade pip
python3.12 -m pip install ipykernel

# finally installing ipython kernel
python3.12 -m ipykernel install --sys-prefix  --name <UNIQUE_KERNEL_NAME> --display-name "<KERNEL DISPLAY NAME>"

Container Location

Info

All containers with type .sif will be automatically detected in $HOME/.jupyter/pc2-jupyterhub/

Your new built container can only be placed in your $HOME directory: $HOME/.jupyter/pc2-jupyterhub/

Alternatively you can create a link from your $PC2PFS to your $HOME directory:

Code Block
$ ls -l /scratch/pc2-mitarbeiter/mawi/jupyter_container.sif
  -rw-r--r--. 1 mawi pc2-mitarbeiter 0 Dec 17 07:53 /scratch/pc2-mitarbeiter/mawi/jupyter_container.sif
$ ln -s /scratch/pc2-mitarbeiter/mawihpc-prf-project/jupyter_container.sif $HOME/.jupyter/pc2-jupyterhub/
Info
All containers with type .sif will be automatically detected in
$HOME/.jupyter/pc2-jupyterhub/

...

View Slurm job logs

If the path of the Slurm Job output has not been changed explicity, it can be found here by default:

...

Noctua 2: $HOME/.jupyter/last_jh_noctua2.log

“Terminals unavailable”

If you have terminado installed in your $HOME directory (pip3 install --user), please make sure that the version of terminado is at least 0.8.3.

PC² Support

If you have any other problems that won’t be solved, please contact the pc2-support@uni-paderborn.de

...