I want to execute a Popper workflow on a Linux HPC (High-performance computing) cluster. I don’t have admin/sudo rights. I know that I should use Singularity instead of Docker because Singularity is designed to not need sudo to run.
However, singularity build needs sudo privileges, if not executed in fakeroot/rootless mode.
This is what I have done in the HPC login node:
- I installed Spack (0.15.4) and Singularity (3.6.1):
git clone --depth=1 https://github.com/spack/spack.git
. spack/share/spack/setup-env.sh
spack install singularity
spack load singularity
- I installed Popper (2.7.0) in a virtual environment:
python3 -m venv ~/popper
~/popper/bin/pip install popper
- I created an example workflow in
~/test/wf.yml:
steps:
- uses: "docker://alpine:3.11"
args: ["echo", "Hello world!"]
- uses: "./my_image/"
args: ["Hello number two!"]
With ~/test/my_image/Dockerfile:
FROM alpine:3.11
ENTRYPOINT ["echo"]
- I tried to run the two steps of the Popper workflow in the login node:
$ cd ~/test
$ ~/popper/bin/popper run --engine singularity --file wf.yml 1
[1] singularity pull popper_1_4093d631.sif docker://alpine:3.11
[1] singularity run popper_1_4093d631.sif ['echo', 'Hello world!']
ERROR : Failed to create user namespace: user namespace disabled
ERROR: Step '1' failed ('1') !
$ ~/popper/bin/popper run --engine singularity --file wf.yml 2
[2] singularity build popper_2_4093d631.sif /home/bikfh/traylor/test/./my_image/
[sudo] password for traylor:
So both steps fail.
My questions:
- For an image from Docker Hub: How do I enable “user namespace”?
- For a custom image: How do I build an image without
sudoand run the container?
I found that the user namespace feature needs to be already enabled on the host machine. Here are instructions for checking whether it’s enabled.
In the case of the cluster computer I am using (Frankfurt Goethe HLR), user namespaces are only enabled in the computation nodes, not the login node. That’s why it didn’t work for me.
So I need to send the job with SLURM (here only the first step with a container from Docker Hub):
popper_config.ymldefines the options for SLURM’ssbatch(compare the Popper docs). They depend on your cluster computer. In my case it looks like this:Trying to apply the same procedure to step 2, which has a custom
Dockerfile, fails with this message:I tried to create the
.siffile (Singularity image) with Popper on another computer and copy it from~/.cache/popper/singularity/...over to the cluster machine. Unfortunately, Popper seems to clear that cache folder, so the.sifimage doesn’t persist.