Search code examples
dockerdockerfilesudohpcsingularity-container

How to run singularity container on HPC cluster? - ERROR : Failed to create user namespace: user namespace disabled


I'm trying to launch a singularity container on a hpc cluster. I have been running the projectNetv2.sif and sandbox on my local with no issue. After exporting them to a hpc I get the following error.

(singularity) [me@hpc Project]$ ls
examples  projectnet_image_v2.tar.gz  projectnet_sandboxv2  projectNetv2.sif
(singularity) [me@hpc Project]$ singularity run projectNetv2.sif
INFO:    Converting SIF file to temporary sandbox...
FATAL:   while extracting SimNetv21.sif: root filesystem extraction failed: extract command failed: ERROR  : Failed to create user namespace: user namespace disabled
: exit status 1

##Attempting to run sandbox
(singularity) [me@hpc Project]$ singularity run projectnet_sandboxv2/
ERROR  : Failed to create user namespace: user namespace disabled

Can anyone advise on how I either enable user namespace? or alternatively run the sif without user name space since I don't have sudo privilege.


Solution

  • Short answer:

    bug your HPC admins to install Singularity

    Longer answer:

    There are two ways to install Singularity, as a privileged installation or an unprivileged / user namespace installation. The first way is the default, but requires sudo/root for certain actions (mostly singularity build). The latter removes the need for root, but has other system requirements. It's possible additional OS configuration is necessary for Singularity to function as expected.

    In addition to privileged/unprivileged installations, disk storage in clusters is usually on NFS or another networked/distributed filesystem so all nodes have access to the same data. Unfortunately, as is usually the case any time it is involved, NFS is a likely cause for your problem. Singularity relies on SUID for its core functionality, but for (quite good) security reasons SUID is disabled on NFS by default. It is unlikely the cluster admins will enable that option, so your best bet is to ask them install it locally on whichever computer/interactive nodes you need it on.