Requirements¶
Software¶
System packages¶
For Debian-based systems (tested on Debian 10 and Ubuntu 18.04):
sudo apt-get update --fix-missing
sudo apt-get install -y --no-install-recommends build-essential
sudo apt-get install -y --no-install-recommends \
kmod sudo rsync curl gdb git vim autoconf automake libtool \
squashfs-tools libcap-dev cmake wget zlib1g-dev libssl-dev \
libexpat1-dev ca-certificates
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo update-ca-certificates
For CentOS 7:
sudo yum install -y epel-release
sudo yum install -y centos-release-scl-rh
sudo yum install -y devtoolset-3-gcc-c++ glibc-static sudo curl wget rsync which \
make bzip2 autoconf automake libtool squashfs-tools libcap-devel cmake3 \
zlib-devel openssl-devel expat-devel
sudo yum clean all
sudo rm -rf /var/cache/yum
# Enable devtoolset-3 to use GCC 4.9.2
source /opt/rh/devtoolset-3/enable
# Create symlink to cmake3 to uniform commands with other distributions
sudo ln -s /usr/bin/cmake3 /usr/bin/cmake
Python 2.7 is required if you are interested to also run the integration tests:
# Debian/Ubuntu
$ sudo apt-get install python python-pip
# CentOS
$ sudo yum install python python2-pip
# All platforms, after installing Python + pip
$ pip install setuptools
$ pip install nose gcovr pexpect
Note
If you plan to install Sarus using the Spack package manager, you can skip the rest of this page, since the remaining dependencies will be installed by Spack itself.
Additional dependencies¶
- libarchive 3.3.1
- Boost libraries >= 1.60.x (recommended 1.65.x)
- C++ REST SDK v2.10.0
- RapidJSON commit 663f076
Important
We recommend these versions as they are the ones routinely used for build integration and testing, thus guaranteed to work.
As the specific software versions listed above may not be provided by the system package manager, we suggest to install from source:
Note
The following instructions will default to /usr/local
as the installation
prefix. To install to a specific location, use the -DCMAKE_INSTALL_PREFIX
CMake options for libarchive and C++ REST SDK and the --prefix
option for
the Boost libraries.
# Create a dedicated working directory for clarity
export sarus_deps_workdir=${HOME}/sarus-deps
mkdir -p ${sarus_deps_workdir}
cd ${sarus_deps_workdir}
# Install libarchive
mkdir -p libarchive/3.3.1 && cd libarchive/3.3.1
wget https://github.com/libarchive/libarchive/archive/v3.3.1.tar.gz
tar xvzf v3.3.1.tar.gz
mv libarchive-3.3.1 src
mkdir src/build-cmake && cd src/build-cmake
cmake ..
make -j$(nproc)
sudo make install
cd ${sarus_deps_workdir}
rm -rf libarchive/ # cleanup sources and build artifacts
# Install boost
mkdir -p boost/1_65_0 && cd boost/1_65_0
wget https://downloads.sourceforge.net/project/boost/boost/1.65.0/boost_1_65_0.tar.bz2
tar xf boost_1_65_0.tar.bz2
mv boost_1_65_0 src && cd src
./bootstrap.sh
sudo ./b2 -j$(nproc) \
--with-atomic \
--with-chrono \
--with-filesystem \
--with-random \
--with-regex \
--with-system \
--with-thread \
--with-program_options \
--with-date_time \
install
cd ${sarus_deps_workdir}
sudo rm -r boost/ # cleanup sources and build artifacts
# Install cpprestsdk
mkdir -p cpprestsdk/v2.10.0 && cd cpprestsdk/v2.10.0
wget https://github.com/Microsoft/cpprestsdk/archive/v2.10.0.tar.gz
tar xf v2.10.0.tar.gz
mv cpprestsdk-2.10.0 src && cd src/Release
mkdir build && cd build
cmake -DWERROR=FALSE ..
make -j$(nproc)
sudo make install
cd ${sarus_deps_workdir}
rm -rf cpprestsdk/ # cleanup sources and build artifacts
# Install RapidJSON
wget -O rapidjson.tar.gz https://github.com/Tencent/rapidjson/archive/663f076c7b44ce96526d1acfda3fa46971c8af31.tar.gz
tar xvzf rapidjson.tar.gz && cd rapidjson-663f076c7b44ce96526d1acfda3fa46971c8af31
sudo cp -r include/rapidjson /usr/local/include/rapidjson
cd ${sarus_deps_workdir}
rm -rf rapidjson.tar.gz rapidjson-663f076c7b44ce96526d1acfda3fa46971c8af31 #cleanup sources
Note
Should you have trouble pointing to a specific version of Boost when
building the C++ REST SDK, use the -DBOOST_ROOT
CMake option with the
prefix directory to your Boost installation.
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.0-rc9.
The simplest solution is to download a pre-built binary release from the project’s GitHub page:
wget -O runc https://github.com/opencontainers/runc/releases/download/v1.0.0-rc9/runc.amd64
chmod 755 runc # make it executable
sudo mv runc /usr/local/bin/ # add it to PATH
sudo chown root:root /usr/local/bin/runc # set root ownership for security
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.18.0.
The simplest solution is to download a pre-built binary release from the project’s GitHub page:
wget -O tini https://github.com/krallin/tini/releases/download/v0.18.0/tini-static-amd64
chmod 755 tini # make it executable
sudo mv tini /usr/local/bin/ # add it to PATH
sudo chown root:root /usr/local/bin/tini # set root ownership for security
Alternatively, you can follow the instructions to build from source.