• Introduction
  • Support
  • Glossary
  • License
  • Acknowledgement
  • Git Version Control
    • Git Basics
    • Git and Atom: GitLab
    • Git and Atom: GitHub
    • Git in the Command Line
    • Git Scenarios
  • Learning Linux
    • Learning Linux Commands
    • Essential Commands
      • Script: Backup
      • Script: Seconds
    • Managing Files
      • Script: Create Files
    • File Permissions
    • Working with Processes
    • Services
    • System Configuration
    • Environment Customization
    • Communication Protocols
    • Task Manager (crontab, at)
    • Bash Scripting
    • Command Line Shortcuts
  • Using the HPC
    • Overview
      • Hardware
      • Storage
      • Software
    • Prerequisites
    • Request an Allocation
    • Access your Allocation
    • Execute a Job
      • Working with C++
      • Working with Fortran
      • Working with Python
      • Working with Makefiles
      • More Job Details
    • Managing Jobs
    • Modules
      • CVMFS Modules
    • Compilers
    • Workflows
      • Crystal Workflow
  • Xsede Resources
    • IU/TACC Atmosphere on Jetstream
    • Using Jetstream Virtual Machines
  • Data Transfer and Storage
    • Moving Data
      • Graphical Client SFTP
    • Globus Data Transfer Tool
      • Globus Endpoints
      • Globus Transfers & More
      • Globus Command Line Interface
  • Tools
    • Docker Containers
    • Singularity Containers
Powered by GitBook
On this page
  • Prerequisites
  • Singularity Installation
  • Building a Container using an Existing Container
  • Interacting with Containers
  1. Tools

Singularity Containers

PreviousDocker Containers

Last updated 6 years ago

Written for software version 2.5.2.

Singularity is a virtualization tool that allows users to containerize workflows, applications, and environments to allow for portability, customization, and reproducibility. Additionally, Singularity is integrated with the Message Passage Interface (MPI) to be used in High Performance Computing (HPC) systems as well as Virtual Machines (VMs) which enables a seamless workflow environment. Lastly, you may also utilize Docker containers with Singularity!

Note: These instructions are adapted from the .

Prerequisites

  • A command line environment in Ubuntu or CentOS.

  • Software dependencies (these may be numerous):

    • Ubuntu

        sudo apt-get update && \
        sudo apt-get install \
        python \
        dh-autoreconf \
        build-essential \
        libarchive-dev
    • CentOS

        sudo yum update && \
        sudo yum groupinstall 'Development Tools' && \
        sudo yum install \
        libarchive-devel \
        squashfs-tools

Singularity Installation

The most up-to-date version is housed in a GitHub repository. The software is installed from the source. Use Git to clone the repository and run the following commands.

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

Building a Container using an Existing Container

singularity build lolcow.simg shub://GodloveD/lolcow

Interacting with Containers

There are three primary ways to interact with a Singularity container.

  1. Run: Creates an ephemeral container that runs a predefined script

    singularity run lolcow.simg or ./lolcow.simg

  2. Shell: Supplies a command line prompt to interface with the container

    singularity shell lolcow.simg

  3. Execute: Sends a command into the container and provides output

    singularity exec lolcow.simg

Congratulations! You have successfully deployed a Singularity container!

The following command executes the build command, specifies the path and name of the container (lolcow.simg), and provides the location of the container on the (shub://GodloveD/lolcow).

As some next steps, navigate to the to learn more about the , and .

official Singularity documentation
Singularity Hub
official Singularity documentation
Singularity Hub
Docker Hub
building a container from scratch