singularity 使用规范
环境
- linux centos >= 7.9
- Linux ubuntu >= 17.10
依赖
- golang > = 1.14
安装
1. 环境依赖
yum update -y && \
yum groupinstall -y 'Development Tools' && \
yum install -y \
openssl-devel \
libuuid-devel \
libseccomp-devel \
wget \
squashfs-tools\
cryptsetup
2. golang 安装
2.1 下载
export VERSION=1.16.5 OS=linux ARCH=amd64 && \
wget https://studygolang.com/dl/golang/go$VERSION.$OS-$ARCH.tar.gz && \
tar -C /usr/local -xzvf go$VERSION.$OS-$ARCH.tar.gz && \
rm go$VERSION.$OS-$ARCH.tar.gz
2.2 配置
echo 'export GOPATH=${HOME}/go' >> ~/.bashrc && \
echo 'export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin' >> ~/.bashrc && \
source ~/.bashrc
singularity 安装
Linux 安装
# 3.4 版本
export VERSION=3.4.0 && # adjust this as necessary \
wget https://github.com/hpcng/singularity/releases/download/v${VERSION}/singularity-${VERSION}.tar.gz && \
tar -xzf singularity-${VERSION}.tar.gz && \
cd singularity
# 3.8 版本
export VERSION=3.8.0 && export REL=rc.2 && # adjust this as necessary \
wget https://github.com/hpcng/singularity/releases/download/v${VERSION}-${REL}/singularity-${VERSION}-${REL}.tar.gz && \
tar -xzf singularity-${VERSION}-${REL}.tar.gz && \
cd singularity
./mconfig && \
make -C ./builddir && \
make -C ./builddir install
mac 安装
http://repo.sylabs.io/desktop/singularity-desktop-0.0.1alpha.dmg
singularity 常用命令
singularity build #构建镜像
singularity run #容器内启动执行脚本
singularity exec #镜像内执行命令
singularity shell #执行一个 shell 脚本
# 详细参考
singularity --help
镜像编译
本地镜像编译
#方式 1, 从本地 docker images 编译为 simg
singularity build nginx2.simg docker-daemon://nginx:latest
#方式2,从压缩文件编译为 sif 或者 simg
singularity build nginx.sif docker-archive://nginx.tar.gz
参考
singularity 官网(V3.4):https://sylabs.io/guides/3.4/user-guide/installation.html
singularity 官网(V3.7): https://sylabs.io/guides/3.7/user-guide/installation.html
singularity 官网(V3.8): https://sylabs.io/guides/3.8/user-guide/installation.html