Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 5 years have passed since last update.

Singularity 非公式インストール方法

Last updated at Posted at 2018-01-21

公式手順の課題

Vagrant を挟んでしまうと、余分に Mac のリソースを消費するだけでなく、Mac 側からは simg ファイルはじめ、Singularity が操作するファイル群が見えにくい。
また、2.4 系と 2.3 系を同時に使うといったことも少々困難。

Docker を使った簡易インストール

(以下、少なくとも Docker for Mac では動作確認済)

PATH が通ったところに singularity スクリプトをおきます。

$ sudo sh -c 'cat << EOF > /usr/local/bin/singularity
#!/bin/sh
docker run --rm -it --privileged -e UID=\$(id -u) -e GID=\$(id -g) \\
  -v \$(pwd):/home/singularity -v /tmp:/tmp -w /home/singularity \\
  pottava/singularity:2.4 "\$@"
EOF'
$ sudo chmod +x /usr/local/bin/singularity

これだけで、以下のように singularity コマンドが使えます。

$ singularity pull --name hello.simg shub://vsoch/hello-world
$ singularity run hello.simg
$ singularity exec hello.simg ls
$ singularity shell hello.simg

root ユーザでの操作を要求する build 系コマンドも sudo で可能。

$ sudo singularity build some.simg Singularity

例えば以下を設定すれば singularity2.3 コマンドも併用可能。

$ sudo sh -c 'cat << EOF > /usr/local/bin/singularity2.3
#!/bin/sh
docker run --rm -it --privileged -e UID=\$(id -u) -e GID=\$(id -g) \\
  -v \$(pwd):/home/singularity -v /tmp:/tmp -w /home/singularity \\
  pottava/singularity:2.3 "\$@"
EOF'
$ sudo chmod +x /usr/local/bin/singularity2.3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?