It is advised to install Python packages on Supek into containers using Apptainer. The documentation of the process is in Croatian and might be annoying to sift through for beginners. This repository simplifies the process.
Note
You should be connected to the GPU cluster:
ssh username@login-gpu.hpc.srce.hrCreate a directory where you will store your containers:
mkdir -p ~/containersand put the build_container.sh script into ~/containers.
Append the following lines to ~/.bashrc:
export PATH="/lustre/home/${USER}/containers:$PATH"
export C="/lustre/home/${USER}/containers"
alias activate='singularity shell'Write a container definition file in ~/containers. E.g., the following example hea.def file installs a Python package from a GitHub repository:
Bootstrap: docker
From: condaforge/miniforge3
%post
apt update
apt -y install vim git less
git clone https://github.com/ovcarj/hea
cd hea
conda create -n hea python=3.13
. /opt/conda/bin/activate
conda activate hea
python -m pip install -e .
%environment
. /opt/conda/bin/activate
conda activate hea
The %environment section ensures that the Conda environment containing the installed packages is activated whenever the container is activated.
Build the container:
bash build_container.sh hea.sif hea.defActivate the container:
activate $C/hea.sif