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 [04/05/2022 18:19] – 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 is already available on the HPC cluster. | Apptainer is already available on the HPC cluster. | ||
Linea 7: | Linea 8: | ||
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 Apptainer on their Linux system. | These instructions are intended for users who wish to install Apptainer on their Linux system. | ||
Linea 14: | Linea 15: | ||
< | < | ||
- | yum install https:// | + | yum install https:// |
</ | </ | ||
Linea 20: | Linea 21: | ||
< | < | ||
- | 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 41: | Linea 43: | ||
</ | </ | ||
- | === Apptainer on a worker node with CPU === | + | ==== Apptainer on a worker node with CPU ==== |
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 91: | Linea 93: | ||
<code bash> | <code bash> | ||
- | module load apptainer | + | module load apptainer/1.0 |
container='/ | container='/ | ||
Linea 128: | Linea 130: | ||
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 containers ===== |
- | < | + | ==== Bacterial Genomics software collection ==== |
- | The following section needs to be revised by replacing **singularity** with **apptainer** | + | |
- | </ | + | |
- | === CityChrone === | + | '' |
- | [[http:// | + | <code bash slurm-bactgen.sh> |
- | + | ||
- | == CityChrone from Rocky 8.5 docker == | + | |
- | + | ||
- | Singularity Definition File: | + | |
- | + | ||
- | < | + | |
- | BootStrap: docker | + | |
- | From: rockylinux: | + | |
- | + | ||
- | %environment | + | |
- | export PATH=/ | + | |
- | + | ||
- | %runscript | + | |
- | exec vcontact " | + | |
- | + | ||
- | %post | + | |
- | dnf -y update | + | |
- | dnf -y install scl-utils | + | |
- | dnf -y install gcc-toolset-9 | + | |
- | scl enable gcc-toolset-9 | + | |
- | dnf -y install git cmake3 zlib-devel wget | + | |
- | + | ||
- | # 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 | + | |
- | cmake3 .. -DENABLE_MASON=ON -DCMAKE_CXX_COMPILER=/ | + | |
- | make | + | |
- | make install | + | |
- | </ | + | |
- | + | ||
- | Singularity Build script: | + | |
- | + | ||
- | <code bash singularity-build-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 | ||
- | export | + | apptainer |
- | export | + | echo '─────────────────────────────────────────────────────────────────────────────────────────' |
- | export | + | apptainer run "$CONTAINER" |
- | export SINGULARITY_LOCALCACHEDIR="/ | + | echo ' |
- | export | + | |
- | + | ||
- | mkdir -p " | + | |
- | mkdir -p " | + | |
- | mkdir -p " | + | |
- | mkdir -p " | + | |
- | mkdir -p " | + | |
- | + | ||
- | singularity build --fakeroot "/ | + | |
- | mv "/ | + | |
- | </ | + | |
- | + | ||
- | Singularity Run script: | + | |
- | + | ||
- | <code bash singularity-run-rocky-8.5.sh> | + | |
- | # | + | |
- | + | ||
- | module load singularity/ | + | |
- | + | ||
- | singularity shell citychrone-rocky-8.5.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-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.1651681196.txt.gz · Ultima modifica: 04/05/2022 18:19 da fabio.spataro