Singularity - Container for HPC, Science
Singularity 2.4 commands
see bottom of: Container in HPC
Singularity 2.6 commands
Ref:
2.6 doc at sylabs.io
sudo singularity build pgi_netcdf.img pg_netcdf.def
sudo singularity build myimg Singularity
sudo singularity build --writable metabolic.sif Singularity 2>&1 | tee singularity_build.log
# assuming Singularity is the .def file
Note that singularitypro26-runtime rpm does not support the "build" subcommand
Singularity 3.0 commands
Singularity 3.0 is a new rewrite in GO, it is not backward compatibile with 2.x.
3.0 doc at sylabs.io
# read-only image
sudo singularity build ./ansys.sif ./Singularity
# sandbox would create writable directory
# cd /tmp (or other dir that is root writable)
sudo singularity build --sandbox ./ansys.sif ./Singularity 2>&1 | tee singularity_build.log
# pull has a centralized cache, but image still be written to `pwd` multiple times
singularity pull shub://tin6150/r4eta
singularity pull --name myR shub://tin6150/r4eta # store in pwd,
singularity cache list -v
singularity exec myR
singularity exec myR bash
singularity exec myR rstudio
singularity exec shub://tin6150/r4eta rstudio
# pull docker container, from github container repository
singularity pull docker://ghcr.io/tin6150/r4eta:master
singularity shell docker://ghcr.io/tin6150/r4eta:master
singularity pull docker://ghcr.io/tin6150/r4eta:master
singularity shell docker://ghcr.io/tin6150/r4eta:master # get bash prompt
singularity run docker://ghcr.io/tin6150/r4eta:master # get R prompt
singularity exec docker://ghcr.io/tin6150/r4eta:master Rscript ./drJin.R # R script in current working dir
singularity exec docker://ghcr.io/tin6150/r4eta:master Rscript /opt/gitrepo/r4eta/drJin.R # R script inside container
running with gpu: --nv
singularity pull --name beast2.6.4-beagle.sif docker://ghcr.io/tin6150/beast2:dock264-beagle
singularity exec --nv beast2.6.4-beagle.sif /usr/bin/java -Dlauncher.wait.for.exit=true -Xms256m -Xmx8g -Duser.language=en -cp /opt/gitrepo/beast/lib/launcher.jar beast.app.beastapp.BeastLauncher -beagle_info
Singularity image format
- .simg - single file image from Singularity Hub prior to 3.0
- .sif - singularity 3.0 single file image, not directly writable
- [DIR] - 3.x --sandbox ./DIRNAME, writable
hpl on gpu linpack from nvidia container
ref: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/hpc-benchmarks
singularity pull --docker-login docker://nvcr.io/nvidia/hpc-benchmarks:21.4-hpl
export SIMG=$cacheDir/nvidia-benchmark/hpc-benchmarks_21.4-hpl.sif
export DAT=~/gs/CF_BK/greta/benchmark_gpu/HPL-a10-Ns=20k.dat
singularity exec --nv $SIMG \
mpirun --mca btl smcuda,self -x UCX_TLS=sm,cuda,cuda_copy,cuda_ipc --bind-to none -np 2 \
hpl.sh --xhpl-ai --cpu-affinity "0-7:8:15" --gpu-affinity "0:1" --cpu-cores-per-rank 8 \
--dat $DAT
## above run, seems loaded on both gpu, but load is 100% & 0% need to adjust PxQ?
hoti1
bofh1