LoginSignup

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.

Install singularity on Mac

Posted at

はじめに

 公式ページを参考に singularity をMacにインストールします。Macのみ下記にまとめました。その他の環境は公式ページを参照してください。
 内容としては、Vagrant + virtualbox と Ubuntu を使ってMac上で Singularityをインストールし、テスト実行する方法までを示しています。
 またこのレシピはOS Xのbrewにアクセスする必要があります。

Installation

必要パッケージのインストール

もし brewを使っていなければ、下記コマンドでインストールします。

command
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Mac に vagrant (仮想開発環境構築ソフトウェア) と Virtualbox をインストールします。

command
brew cask install virtualbox
brew cask install vagrant
brew cask install vagrant-manager

singularity用仮想マシンの構築

command
mkdir singularity-vm
cd singularity-vm
command
vagrant destroy

もしはじめて起動する場合は、下記のようなメッセージがでますが無視して良いです。

response
A Vagrant environment or target machine is required to run this
command. Run `vagrant init` to create a new Vagrant environment. Or,
get an ID of a target machine from `vagrant global-status` to run
this command on. A final option is to change to a directory with a
Vagrantfile and to try again.

singularity-2.4 のセットアップと Ubuntu(仮想マシン) へのログイン

command
vagrant init singularityware/singularity-2.4 # Create Vagrantfile
vagrant up # download/setup singularity-2.4 on virtualbox
vagrant ssh

動作確認: Hello world

Checking OS

OS(ubuntu) のバージョン確認。公式ページには明示されていなかったが、16.04が入っている。

command&response
vagrant@vagrant:~$ uname -a
Linux vagrant 4.4.0-75-generic #96-Ubuntu SMP Thu Apr 20 09:56:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
command&response
vagrant@vagrant:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"

singularity command path & version

singularity コマンドのパスとバージョンの確認

command&response
vagrant@vagrant:~$ which singularity
/usr/local/bin/singularity
vagrant@vagrant:~$ singularity --version
2.4-dist

Hello world

command&response
vagrant@vagrant:~$ sudo singularity build growl-llo-world.simg shub://vsoch/hello-world
Cache folder set to /root/.singularity/shub
Progress |===================================| 100.0% 
Building from local image: /root/.singularity/shub/vsoch-hello-world-master.simg
Building Singularity image...
Singularity container built: growl-llo-world.simg
Cleaning up...
vagrant@vagrant:~$ ./growl-llo-world.simg
RaawwWWWWWRRRR!!
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