Requirements

This page documents the requirements and dependencies needed by Sarus. It serves both as a general reference and as preliminary step to performing installations from source.

The Spack package manager is able to build or retrieve software dependencies on its own: as such, when using Spack, the only requirements to satisfy from this page are those related to the operating system.

Operating System

  • Linux kernel >= 3.0

  • util-linux >= 2.20 (these utilities are usually bundled with the Linux distribution itself; v2.20 was released in August 2011)

  • The following kernel modules loaded:

    • loop

    • squashfs

    • overlayfs

These requirements are tracked by the CI/check_host.sh script.

System packages

The required packages for building Sarus are listed below for a selection of popular Linux distributions. Please note that, depending on the distribution, not all dependencies might be available through the system’s package manager, or some dependencies might be provided in versions not supported by Sarus. Please follow the manual installation instructions for such dependencies.

OpenSUSE Leap 15.3:

# Install packages
sudo zypper install -y gcc-c++ glibc-static wget which git gzip bzip2 tar \
    make autoconf automake squashfs cmake zlib-devel zlib-devel-static \
    runc tini-static skopeo umoci \
    libboost_filesystem1_75_0-devel \
    libboost_regex1_75_0-devel \
    libboost_program_options1_75_0-devel \
    python3 python3-pip python3-setuptools
sudo zypper clean --all

CentOS 7:

# Install packages
sudo yum install -y epel-release
sudo yum install -y centos-release-scl-rh
sudo yum install -y devtoolset-11-gcc-c++ glibc-static sudo curl wget rsync which \
    make bzip2 autoconf automake libtool git squashfs-tools cmake3 ca-certificates \
    zlib-devel zlib-static runc tini-static skopeo \
    python3 python3-pip python3-setuptools
sudo yum clean all
sudo rm -rf /var/cache/yum

# Create symlink to cmake3 to uniform commands with other distributions
sudo ln -s /usr/bin/cmake3 /usr/bin/cmake
sudo ln -s /usr/bin/ctest3 /usr/bin/ctest

# Enable devtoolset-11 to use GCC 11.2.1
source /opt/rh/devtoolset-11/enable

# The following dependencies are not provided via the system's package manager
# and should be installed manually:
# - Boost Libraries >= 1.60.0
# - Umoci

Fedora 35:

# Install packages
sudo dnf install -y gcc g++ glibc-static libstdc++-static git make cmake autoconf \
    diffutils findutils wget which procps squashfs-tools zlib-devel zlib-static \
    boost-devel skopeo tini-static \
    python3 python3-pip python3-setuptools
sudo dnf clean all
sudo rm -rf /var/cache/dnf

# The following dependencies are not provided via the system's package manager
# and should be installed manually:
# - Runc version 1.0.3
# - Umoci

Debian 11:

# Install packages
sudo apt-get update --fix-missing
sudo apt-get install -y --no-install-recommends build-essential
sudo DEBIAN_FRONTEND=noninteractive \
   apt-get install -y --no-install-recommends kmod curl git \
   autoconf automake gnupg squashfs-tools cmake wget \
   zlib1g-dev runc tini skopeo umoci \
   libboost-dev \
   libboost-program-options-dev \
   libboost-filesystem-dev \
   libboost-regex-dev \
   python3 python3-pip python3-setuptools
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*

Ubuntu 21.10:

# Install packages
sudo apt-get update --fix-missing
sudo apt-get install -y --no-install-recommends build-essential
sudo DEBIAN_FRONTEND=noninteractive \
   apt-get install -y --no-install-recommends kmod curl git \
   autoconf automake gnupg squashfs-tools cmake wget \
   zlib1g-dev tini skopeo umoci \
   libboost-dev \
   libboost-program-options-dev \
   libboost-filesystem-dev \
   libboost-regex-dev \
   python3 python3-pip python3-setuptools
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*

# The following dependencies are not provided via the system's package manager
# and should be installed manually:
# - Runc version 1.0.3

Ubuntu 20.04:

# Install packages
sudo apt-get update --fix-missing
sudo apt-get install -y --no-install-recommends build-essential
sudo DEBIAN_FRONTEND=noninteractive \
   apt-get install -y --no-install-recommends kmod curl git \
   autoconf automake gnupg squashfs-tools cmake wget \
   zlib1g-dev tini umoci \
   libboost-dev \
   libboost-program-options-dev \
   libboost-filesystem-dev \
   libboost-regex-dev \
   python3 python3-pip python3-setuptools

# Install Skopeo from the Kubic project repository
. /etc/os-release
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install skopeo

sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*

# The following dependencies are not provided via the system's package manager
# and should be installed manually:
# - Runc version 1.0.3

Manual installation

This section provides instructions to install some notable Sarus dependencies which might not be available through the system’s package manager, or might be provided in a version not supported by Sarus.

Boost libraries

Boost libraries are required to be version 1.60.x or later. The recommended version, which is used routinely for build integration and testing, is 1.77.x.

Note

The following instructions will default to /usr/local as the installation prefix. To install to a specific location, use the --prefix option of the b2 builder/installer tool.

pwd_bak=$PWD

# Install boost
cd /tmp && \
    mkdir -p boost/1_77_0 && cd boost/1_77_0 && \
    wget https://downloads.sourceforge.net/project/boost/boost/1.77.0/boost_1_77_0.tar.bz2 && \
    tar xf boost_1_77_0.tar.bz2 && \
    mv boost_1_77_0 src && cd src && \
    ./bootstrap.sh && \
    sudo ./b2 -j$(nproc) \
        --with-filesystem \
        --with-regex \
        --with-program_options \
        install && \
    cd ${pwd_bak} && \
    rm -rf /tmp/boost

Skopeo

Skopeo is used to acquire images and their metadata from a variety of sources. Versions 1.7.0 or later are recommended for improved performance when pulling or loading images.

Up-to-date instructions about building Skopeo from source are available on the project’s GitHub repository.

Umoci

Umoci is used to unpack OCI images’ filesystem contents before converting them into the SquashFS format:

pwd_bak=$PWD

# Install umoci
cd /tmp && \
    wget -O umoci https://github.com/opencontainers/umoci/releases/download/v0.4.7/umoci.amd64 && \
    chmod 755 umoci && \
    sudo mv umoci /usr/local/bin/ && \
    sudo chown root:root /usr/local/bin/umoci && \
    cd ${pwd_bak}

OCI-compliant runtime

Sarus internally relies on an OCI-compliant runtime to spawn a container.

Here we will provide some indications to install runc, the reference implementation from the Open Container Initiative. The recommended version is v1.0.3.

The simplest solution is to download a pre-built binary release from the project’s GitHub page:

pwd_bak=$PWD

# Install runc
cd /tmp && \
    wget -O runc.amd64 https://github.com/opencontainers/runc/releases/download/v1.0.3/runc.amd64 && \
    chmod 755 runc.amd64 && \
    sudo mv runc.amd64 /usr/local/bin/ && \
    sudo chown root:root /usr/local/bin/runc.amd64 && \
    cd ${pwd_bak}

Alternatively, you can follow the instructions to build from source, which allows more fine-grained control over runc’s features, including security options.

Init process

Sarus can start an init process within containers in order to reap zombie processes and allow container applications to receive signals.

Here we will provide some indications to install tini, a very lightweight init process which is also used by Docker. The recommended version is v0.19.0.

The simplest solution is to download a pre-built binary release from the project’s GitHub page:

pwd_bak=$PWD

# Install tini
cd /tmp && \
    wget -O tini-static-amd64 https://github.com/krallin/tini/releases/download/v0.19.0/tini-static-amd64 && \
    chmod 755 tini-static-amd64 && \
    sudo mv tini-static-amd64 /usr/local/bin/ && \
    sudo chown root:root /usr/local/bin/tini-static-amd64 && \
    cd ${pwd_bak}

Alternatively, you can follow the instructions to build from source.

Python packages for integration tests

The following Python 3 packages are required if you are interested to also run the integration tests:

$ pip3 install setuptools
$ pip3 install pytest gcovr pexpect