如何在不具有sudo权限的HPC上运行Popper

问题描述

我想在Linux HPC(高性能计算)集群上执行Popper工作流程。我没有管理员/ sudo权限。我知道我应该使用Singularity而不是Docker,因为奇点设计为不需要运行sudo

但是,singularity build needs sudo特权(如果未在fakeroot/rootless模式下执行)。


这是我在HPC登录节点中所做的:

  1. 我安装了Spack(0.15.4)和奇点(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
  1. 我在虚拟环境中安装了Popper(2.7.0):
python3 -m venv ~/popper
~/popper/bin/pip install popper
  1. 我在~/test/wf.yml中创建了一个示例工作流程:
steps:
  - uses: "docker://alpine:3.11"
    args: ["echo","Hello world!"]
  - uses: "./my_image/"
    args: ["Hello number two!"]

使用~/test/my_image/Dockerfile

FROM alpine:3.11
ENTRYPOINT ["echo"]
  1. 我尝试在登录节点中运行Popper工作流的两个步骤:
$ 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:

所以两个步骤都失败。


我的问题:

  • 对于来自Docker Hub的映像:如何启用“用户名称空间”?
  • 对于自定义图像:如何在没有sudo的情况下构建图像并运行容器?

解决方法

对于来自Docker Hub的映像:如何启用“用户名称空间”?

我发现需要在主机上启用用户名称空间功能。 Here是有关检查是否已启用的说明。

对于我正在使用的群集计算机(Frankfurt Goethe HLR),仅在计算节点(而不是登录节点)中启用用户名称空间。 这就是为什么它对我不起作用。

因此,我需要使用SLURM发送作业(这里只是从Docker Hub获得容器的第一步):

 ~/popper/bin/popper run --engine singularity --file wf.yml --config popper_config.yml 1

popper_config.yml为SLURM的sbatch定义了options(比较Popper docs)。它们取决于您的群集计算机。就我而言,看起来像这样:

resource_manager:
  name: slurm
  options:
    "1": # The default step ID is a number and needs quotes here.
      nodes: 1
      mem-per-cpu: 10 # MB
      ntasks: 1
      partition: test
      time: "00:01:00"

对于自定义图像:如何在不使用sudo的情况下构建图像并运行容器?

尝试对具有自定义Dockerfile的第2步应用相同的过程,失败并显示以下消息:

FATAL:   could not use fakeroot: no mapping entry found in /etc/subuid

我试图用Popper在另一台计算机上创建.sif文件(奇异性映像),并将其从~/.cache/popper/singularity/...复制到群集计算机上。 不幸的是,Popper似乎清除了该缓存文件夹,因此.sif图片不会持续存在。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...