LoginSignup
6
2

More than 5 years have passed since last update.

Singularityのインストール (v2)

Last updated at Posted at 2018-01-24

概要

Singularityのインストール方法を2種類紹介します。

  1. 最新の開発バージョンをインストールする
  2. 特定のバージョンをインストールする

なお、本稿ではLinuxにインストールする方法を説明します。詳細については、公式ページを参照ください。

準備

必要なパッケージをインストールします。

sudo yum -y update
sudo yum -y groupinstall "Development Tools"
sudo yum -y install wget
sudo yum -y install squashfs-tools
sudo yum -y install libarchive-devel

sudoの権限設定を行います。singularityをsudoで実行可能とするためです。

sudo visudo

secure-pathという部分を以下のように変更します。

secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin

以前のバージョンがインストールされている場合には、それらの実行ファイルを削除する必要があります。初めてインストールする場合には、以下のコマンドは不要です。

sudo rm -rf /usr/local/libexec/singularity

操作

最新の開発バージョンをインストールする

公式ページのインストラクションはこちらを参照ください。

git clone https://github.com/singularityware/singularity.git
cd singularity
./autogen.sh
./configure --prefix=/usr/local
make
sudo make install

特定のバージョンをインストールする

最新の安定バージョンはGithubで確認できます。
version 2.4.2のインストールを行う場合は以下のようなコマンドとなります。

VERSION=2.4.2
wget https://github.com/singularityware/singularity/releases/download/$VERSION/singularity-$VERSION.tar.gz
tar xvf singularity-$VERSION.tar.gz
cd singularity-$VERSION
./configure --prefix=/usr/local
make
sudo make install

確認

正常にsingularityコマンドが使えることを確認します。--helpオプションを使い確認してみます。

singularity --help

以下のような出力が得られます。

USAGE: singularity [global options...] <command> [command options...] ...

GLOBAL OPTIONS:
    -d|--debug    Print debugging information
    -h|--help     Display usage summary
    -s|--silent   Only print errors
    -q|--quiet    Suppress all normal output
       --version  Show application version
    -v|--verbose  Increase verbosity +1
    -x|--sh-debug Print shell wrapper debugging information

GENERAL COMMANDS:
    help       Show additional help for a command or container                  
    selftest   Run some self tests for singularity install                      

CONTAINER USAGE COMMANDS:
    exec       Execute a command within container                               
    run        Launch a runscript within container                              
    shell      Run a Bourne shell within container                              
    test       Launch a testscript within container                             

CONTAINER MANAGEMENT COMMANDS:
    apps       List available apps within a container                           
    bootstrap  *Deprecated* use build instead                                   
    build      Build a new Singularity container                                
    check      Perform container lint checks                                    
    inspect    Display container's metadata                                     
    mount      Mount a Singularity container image                              
    pull       Pull a Singularity/Docker container to $PWD                      

COMMAND GROUPS:
    image      Container image command group                                    
    instance   Persistent instance command group                                


CONTAINER USAGE OPTIONS:
    see singularity help <command>

For any additional help or support visit the Singularity
website: http://singularity.lbl.gov/
6
2
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
6
2