一、singularity快速使用入门-北极星
Singularity 是一个开放源码容器平台,旨在简化、快速和安全。Singularity 是针对 EPC 和 HPC 工作负载进行优化的,允许不受信任的用户以可信的方式运行不受信任的容器,就是可以在容器里面享受root权限
一、singularity容器技术在北极星集群的快速使用
这里以autodock4为例(尽量在login06会快些)
1、查询镜像,推荐使用docker比较全,singularity比较少,比如:
dockersearch autodock4
2、拉取docker镜像并存在本地
singularitybuild autodock4.sif docker://lucioric/autodock4
需要去https://hub.docker.com/搜索自己想要的版本的tag
3、执行镜像程序,跑外部的文件
先复制结构文件:
cp /gpfs1/share/singularity/plk1/ . -rf
进入目录:
cd plk1
###这一步比较关键,如果是其他程序得文件夹,如yourpath,那就cd yourpath,必须将要运行得文件放在这里。
4、本地测试
singularityrun ../autodock4.sif autodock4 -p 1tce-a.dpf
singularityrun会挂载当面目录得,singularityrun相当于:
singularity run -B $PWD:/mnt/ -H /mnt 其中-B 选项就是挂载得意思,$PWD为当前目录,mnt为挂载点为mnt
你也可以 继续挂载目录(前提是你必须有挂载点) 如:
singularityrun -B /lustre1/yourpath:/lustre1/yourpath ../autodock4.sif autodock4 -p 1tce-a.dpf
注意:../ 得指定sif文件的相对或者绝对路径
如果是singularityrun4 请加上cd:singularityrun4 ../autodock4.sif cd; autodock4 -p 1tce-a.dpf
5、提交脚本:
pkurun-cnlong 1 1 "singularityrun ../autodock4.sif autodock4 -p 1tce-a.dpf"
6、脚本运行情况如下,
ls /usr/local/bin/autodock4 是查看运行的是系统还是容器的,系统没有发现所以是容器的
7、与没有使用容器进行比较
测试结果发现用容器的快了些,估计是进行优化了
8、报错:忽略
cat 183254_16574762.err
/usr/local/bin/autodock4: creating docking log file 1tce-a.dlg
/usr/local/bin/autodock4: WARNING: Using autodock4.0 unbound extended model in autodock4.2!