calcoloscientifico:userguide:apptainer
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
| Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
| calcoloscientifico:userguide:apptainer [02/05/2022 17:56] – fabio.spataro | calcoloscientifico:userguide:apptainer [14/01/2025 13:00] (versione attuale) – [Apptainer] fabio.spataro | ||
|---|---|---|---|
| Linea 1: | Linea 1: | ||
| - | ==== AppTainer | + | ===== Apptainer ===== |
| - | [[https:// | + | * [[https:// |
| + | * [[https:// | ||
| - | AppTainer | + | Apptainer |
| Users are encouraged to use it on their system. | Users are encouraged to use it on their system. | ||
| - | === Install a binary package === | + | ==== Install a binary package |
| - | These instructions are intended for users who wish to install | + | These instructions are intended for users who wish to install |
| - | On a **RedHat Enterpise Linux** system | + | On a **RedHat Enterpise Linux** system |
| < | < | ||
| - | yum install https:// | + | yum install https:// |
| </ | </ | ||
| - | On a **Debian/ | + | On a **Debian/ |
| < | < | ||
| - | sudo apt install | + | wget -qc https:// |
| + | sudo dpkg -i apptainer_1.1.8_amd64.deb | ||
| </ | </ | ||
| - | === Extract NVIDIA driver === | + | ==== Extract NVIDIA driver |
| The following commands | The following commands | ||
| Linea 34: | Linea 36: | ||
| were executed on worker nodes with GPU by the administrator in a directory that contains the [[https:// | were executed on worker nodes with GPU by the administrator in a directory that contains the [[https:// | ||
| - | Users who want to install | + | Users who want to install |
| < | < | ||
| Linea 41: | Linea 43: | ||
| </ | </ | ||
| - | === AppTainer | + | ==== Apptainer |
| On the login node of the HPC cluster run the following command: | On the login node of the HPC cluster run the following command: | ||
| Linea 52: | Linea 54: | ||
| <code bash> | <code bash> | ||
| - | module load apptainer | + | module load apptainer/1.0 |
| container='/ | container='/ | ||
| Linea 63: | Linea 65: | ||
| </ | </ | ||
| - | Inside the AppTainer | + | Inside the Apptainer |
| < | < | ||
| Linea 70: | Linea 72: | ||
| </ | </ | ||
| - | Users who want to try AppTainer | + | Users who want to try Apptainer |
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | from the HPC cluster to their system and appropriately modify the value of the '' | ||
| Users who have installed a binary package do not have to load the '' | Users who have installed a binary package do not have to load the '' | ||
| - | === AppTainer | + | === Apptainer |
| On the login node of the HPC cluster run the following command: | On the login node of the HPC cluster run the following command: | ||
| Linea 85: | Linea 93: | ||
| <code bash> | <code bash> | ||
| - | module load apptainer | + | module load apptainer/1.0 |
| container='/ | container='/ | ||
| Linea 97: | Linea 105: | ||
| </ | </ | ||
| - | Inside the AppTainer | + | Inside the Apptainer |
| < | < | ||
| Linea 112: | Linea 120: | ||
| </ | </ | ||
| - | Users who want to try AppTainer | + | Users who want to try Apptainer |
| - | Users who have installed a binary package do not have to load the '' | + | < |
| - | + | /hpc/share/applications/amber/20/amber-20-gpu.sif | |
| - | ---- | + | |
| - | + | ||
| - | < | + | |
| - | The following section needs to be revised by replacing **singularity** with **apptainer** | + | |
| - | </ | + | |
| - | + | ||
| - | === CityChrone === | + | |
| - | + | ||
| - | [[http:// | + | |
| - | + | ||
| - | == CityChrone from Rocky 8.5 docker == | + | |
| - | + | ||
| - | Singularity Definition File: | + | |
| - | + | ||
| - | < | + | |
| - | BootStrap: docker | + | |
| - | From: rockylinux: | + | |
| - | + | ||
| - | %environment | + | |
| - | export PATH=/miniconda3/bin:$PATH | + | |
| - | + | ||
| - | %runscript | + | |
| - | exec vcontact " | + | |
| - | + | ||
| - | %post | + | |
| - | dnf -y update | + | |
| - | dnf -y install scl-utils | + | |
| - | dnf -y install gcc-toolset-9 | + | |
| - | scl enable gcc-toolset-9 bash | + | |
| - | dnf -y install git cmake3 zlib-devel wget | + | |
| - | + | ||
| - | # Install miniconda | + | |
| - | wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh | + | |
| - | bash Miniconda3-latest-Linux-x86_64.sh -b -f -p / | + | |
| - | rm Miniconda3-latest-Linux-x86_64.sh | + | |
| - | + | ||
| - | # pull the conda functions in . / | + | |
| - | export PATH="/ | + | |
| - | + | ||
| - | # CONDA install | + | |
| - | conda install \ | + | |
| - | --yes \ | + | |
| - | --channel conda-forge \ | + | |
| - | --strict-channel-priority \ | + | |
| - | pandas matplotlib folium gdal jupyter numba colorama geopy shapely tqdm pymongo geojson protobuf pyproj | + | |
| - | + | ||
| - | # Help conda resolving Python " | + | |
| - | conda update --all | + | |
| - | + | ||
| - | # PIP install | + | |
| - | pip install \ | + | |
| - | --no-deps \ | + | |
| - | gtfs-realtime-bindings pyspark mpire | + | |
| - | + | ||
| - | # OSRM | + | |
| - | git clone https:// | + | |
| - | cd osrm-backend | + | |
| - | mkdir -p build | + | |
| - | cd build | + | |
| - | cmake3 .. -DENABLE_MASON=ON -DCMAKE_CXX_COMPILER=/ | + | |
| - | make | + | |
| - | make install | + | |
| </ | </ | ||
| - | Singularity Build script: | + | from the HPC cluster to their system and appropriately modify the value of the '' |
| - | <code bash singularity-build-rocky-8.5.sh> | + | Users who have installed a binary package do not have to load the '' |
| - | #!/bin/bash | + | |
| - | module load singularity/ | + | ===== Apptainer containers ===== |
| - | export | + | ==== Bacterial Genomics software collection ==== |
| - | export | + | |
| - | export | + | |
| - | export SINGULARITY_LOCALCACHEDIR="/ | + | |
| - | export | + | |
| - | mkdir -p " | + | '' |
| - | mkdir -p " | + | |
| - | mkdir -p " | + | |
| - | mkdir -p " | + | |
| - | mkdir -p " | + | |
| - | singularity build --fakeroot "/ | + | <code bash slurm-bactgen.sh> |
| - | mv "/ | + | |
| - | </ | + | |
| - | + | ||
| - | Singularity Run script: | + | |
| - | + | ||
| - | <code bash singularity-run-rocky-8.5.sh> | + | |
| #!/bin/bash | #!/bin/bash | ||
| + | #SBATCH --job-name=bactgen | ||
| + | #SBATCH --output=%x.o%j | ||
| + | #SBATCH --error=%x.e%j | ||
| + | #SBATCH --nodes=1 | ||
| + | #SBATCH --ntasks-per-node=1 | ||
| + | #SBATCH --cpus-per-task=4 | ||
| + | #SBATCH --time=0-01: | ||
| + | #SBATCH --mem=8G | ||
| + | #SBATCH --partition=cpu | ||
| + | #SBATCH --qos=cpu | ||
| + | #SBATCH --account=< | ||
| - | module load singularity/ | + | module load apptainer |
| + | module load bactgen | ||
| - | singularity shell citychrone-rocky-8.5.sif | + | apptainer |
| - | </ | + | echo '─────────────────────────────────────────────────────────────────────────────────────────' |
| - | + | apptainer run "$CONTAINER" | |
| - | Interactive session: | + | echo ' |
| - | + | ||
| - | <code bash> | + | |
| - | srun --nodes=1 --ntasks-per-node=2 --partition=cpu --mem=8G --time=02: | + | |
| - | </ | + | |
| - | + | ||
| - | Launch Singularity Build script: | + | |
| - | + | ||
| - | <code bash> | + | |
| - | bash singularity-build-rocky-8.5.sh | + | |
| - | </ | + | |
| - | + | ||
| - | Launch Singularity Run script: | + | |
| - | + | ||
| - | <code bash> | + | |
| - | bash singularity-run-rocky-8.5.sh | + | |
| - | </ | + | |
| - | + | ||
| - | == CityChrone from Ubuntu Focal (20.04 LTS) docker == | + | |
| - | + | ||
| - | Singularity Definition File: | + | |
| - | + | ||
| - | <code text citychrone-ubuntu-focal.def> | + | |
| - | BootStrap: docker | + | |
| - | From: ubuntu: | + | |
| - | + | ||
| - | %environment | + | |
| - | export PATH=/ | + | |
| - | export DEBIAN_FRONTEND=noninteractive | + | |
| - | export TZ=' | + | |
| - | + | ||
| - | %runscript | + | |
| - | exec vcontact | + | |
| - | + | ||
| - | %post | + | |
| - | DEBIAN_FRONTEND=noninteractive | + | |
| - | TZ='Europe/Rome' | + | |
| - | ln -snf / | + | |
| - | apt-get update && \ | + | |
| - | apt-get install -y automake build-essential bzip2 wget git default-jre unzip \ | + | |
| - | build-essential git cmake pkg-config \ | + | |
| - | libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \ | + | |
| - | libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev | + | |
| - | + | ||
| - | # Install miniconda | + | |
| - | wget https:// | + | |
| - | bash Miniconda3-latest-Linux-x86_64.sh -b -f -p / | + | |
| - | rm Miniconda3-latest-Linux-x86_64.sh | + | |
| - | + | ||
| - | # pull the conda functions in . / | + | |
| - | export PATH="/ | + | |
| - | + | ||
| - | # CONDA install | + | |
| - | conda install \ | + | |
| - | --yes \ | + | |
| - | --channel conda-forge \ | + | |
| - | --strict-channel-priority \ | + | |
| - | pandas matplotlib folium gdal jupyter numba colorama geopy shapely tqdm pymongo geojson protobuf pyproj | + | |
| - | + | ||
| - | # Help conda resolving Python " | + | |
| - | conda update --all | + | |
| - | + | ||
| - | # PIP install | + | |
| - | pip install \ | + | |
| - | --no-deps \ | + | |
| - | gtfs-realtime-bindings pyspark mpire | + | |
| - | + | ||
| - | # OSRM | + | |
| - | git clone https:// | + | |
| - | cd osrm-backend | + | |
| - | mkdir -p build | + | |
| - | cd build | + | |
| - | cmake .. -DCMAKE_BUILD_TYPE=Release | + | |
| - | cmake --build . | + | |
| - | cmake --build . --target install | + | |
| - | </ | + | |
| - | + | ||
| - | Singularity Build script: | + | |
| - | + | ||
| - | <code bash singularity-build-ubuntu-focal.sh> | + | |
| - | # | + | |
| - | + | ||
| - | module load singularity/ | + | |
| - | + | ||
| - | export | + | |
| - | export | + | |
| - | export | + | |
| - | export SINGULARITY_LOCALCACHEDIR="/ | + | |
| - | export | + | |
| - | + | ||
| - | mkdir -p " | + | |
| - | mkdir -p " | + | |
| - | mkdir -p " | + | |
| - | mkdir -p " | + | |
| - | mkdir -p " | + | |
| - | + | ||
| - | singularity build --fakeroot "/ | + | |
| - | mv "/ | + | |
| - | </ | + | |
| - | + | ||
| - | Singularity Run script: | + | |
| - | + | ||
| - | <code bash singularity-run-ubuntu-focal.sh> | + | |
| - | # | + | |
| - | + | ||
| - | module load singularity/ | + | |
| - | + | ||
| - | singularity shell citychrone-ubuntu-focal.sif | + | |
| - | </ | + | |
| - | + | ||
| - | Interactive session: | + | |
| - | + | ||
| - | <code bash> | + | |
| - | srun --nodes=1 --ntasks-per-node=2 --partition=cpu --mem=8G --time=02: | + | |
| - | </ | + | |
| - | + | ||
| - | Launch Singularity Build script: | + | |
| - | + | ||
| - | <code bash> | + | |
| - | bash singularity-build-ubuntu-focal.sh | + | |
| </ | </ | ||
| - | Launch Singularity Run script: | + | Edit the '' |
| <code bash> | <code bash> | ||
| - | bash singularity-run-ubuntu-focal.sh | + | sbatch slurm-bactgen.sh |
| </ | </ | ||
calcoloscientifico/userguide/apptainer.1651506991.txt.gz · Ultima modifica: da fabio.spataro
