Requirements
- Contact us in order to deploy your ssh key for this service.
- Do not forget to run and add your ssh agent when connecting to hpc-login.u-strasbg.fr.
- Load the singularity module :
module load singularity/singularity
Create a singularity image
- Create a directory and move to it.
- Create a image definition file
<project_name>.def
(e.g. exemple.def) - Generate the singularity image with the following script:
hpc_login_gen.sh <project_name>
- When successful, the image is generated as
<project_name>.sif
Test a singularity image (run on your PC or hpc-login)
singularity run <project_name>.sif
Submit a singularity image (run on cluster nodes)
This is a simple sbatch script example:
#!/bin/bash
#SBATCH -n 8 # Request 8 cores
module load singularity/singularity
singularity run <project_name>.sif
Submit the sbatch script:
sbatch my_script
Singularity with intel18
Create image
- Create a image definition with the following example: jacobi.def
- Generate the singularity image with the following script:
hpc_login_gen.sh <project_name>
- When successful, run the image with the specific bind:
singularity run --bind /opt/intel/compilers_and_libraries_2018.1.163:/opt/intel/compilers_and_libraries_2018.1.163 <project_name>.sif
Singularity with GPU
Create image
- Create a image definition with the following example: gpu.def
- Generate the singularity image with the following script:
hpc_login_gen.sh <project_name>
- When successful, run the image with the specific option:
singularity run --nv <project_name>.sif
Singularity with MPI
Create image
- Create a image definition with the following example: bandwidth.def
- Generate the singularity image with the following script:
hpc_login_gen.sh <project_name>
- When successful, run the image with the specific option:
singularity run --bind /usr/local/openmpi/openmpi-3.1.3-i18:/usr/local/openmpi/openmpi-3.1.3-i18 --bind /opt/intel/compilers_and_libraries_2018.1.163:/opt/intel/compilers_and_libraries_2018.1.163 <project_name>.sif
Transform a docker image to singularity (without MPI)
From the docker hub
From a docker image available on docker hub, create your <project_name>.def
file with:
Bootstrap: docker
From: <my_image>:<my_tag>
From a docker local image
- Get an archive from your docker image
docker image save -o my_image.tar image_name:version
-
Write the corresponding singularity .def file
From a docker local image, create your
<project_name>.def
file with:
Bootstrap: docker
From: hpc-singularity.di.unistra.fr:5000/<my_image>
- Generate the singularity image with the following script:
hpc_login_docker.sh <project_name>
- When successful, the image is generated as
<my_image>.sif