Compiling Singularity-CE-3.10.0 on Rocky Linux 8

The Official Documentation can be found at https://sylabs.io/guides/3.0/user-guide/installation.html

Prerequisites 1 – Go

Go to the Download Page https://go.dev/dl/ to download the Linux Version.

Extract the archive you downloaded into /usr/local, creating a Go tree in /usr/local/go.

This step below will remove a previous installation at /usr/local/go, if any, prior to extracting. Please back up any data before proceeding.

% rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz

Add /usr/local/go/bin to the PATH environment variable. You can do this by adding the following line to your $HOME/.profile or /etc/profile (for a system-wide installation):

export PATH=$PATH:/usr/local/go/bin

Verify the Installation with the command

% go version

Compiling Singularity

To download Singularity, do visit the download site. Singularity uses a build system called makeit. mconfig is called to generate Makefile and them make is used to compile and install

% git clone https://github.com/sylabs/singularity.git --recurse-submodules
% cd singularity
% ./mconfig --prefix=/usr/local/singularity-ce-3.10.0
% cd builddir
% make
% make install
.....
.....
 checking: header linux/securebits.h... yes
 checking: header linux/capability.h... yes
 checking: libseccomp+headers... yes
 checking: conmon source... no

conmon source not found

Unless you are building --without-conmon you must 'git clone --recurse-submodules'
or 'git submodule update --init'.

You may want to install glib2-devel, delete the singularity directory and make the singularity again.

% dnf install glib2-devel

Remote the cloned singularity directory and git clone again

% rm -Rv --force singularity
% git clone https://github.com/sylabs/singularity.git --recurse-submodules

Recompile with mconfig again. If successful, it should be something like

=> generating fragments ...
=> building Makefile ...
=> generating singularity-ce.spec ...
=> project singularity-ce setup with :
    - host arch: x86_64
    - host wordsize: 64-bit
    - host C compiler: cc
    - host Go compiler: /usr/local/go-1.18.3/bin/go
    - host system: unix
      ---
    - target arch: x86_64
    - target wordsize: 64-bit
    - target C compiler: cc
      ---
    - config profile: release
      ---
    - SUID install: yes
    - Network plugins: yes
    - seccomp support: yes
    - Build conmon: yes
      ---
    - verbose: no
      ---
    - cryptsetup: /usr/sbin/cryptsetup
      ---
    - version: 3.10.0+21-g1b1a05ff8
% cd builddir
% make
% make install

Testing

As long as you see a cow your installation is working properly…….

% singularity run library://godlovedc/funny/lolcow
< Exercise caution in your daily affairs. >
 -----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

References:

  1. https://sylabs.io/guides/3.0/user-guide/installation.html
  2. https://github.com/NIH-HPC/Singularity-Tutorial
  3. Compiling Singularity-CE-3.9.2 on CentOS-7

Container runtimes, container images, and other key concepts

This is Linux Container Fundamental 101. If you want more information after reading this blog entry 101 A System’s Guide to Containers by OpenSource.com

What is Linux Container?

A Linux® container is a set of 1 or more processes that are isolated from the rest of the system. All the files necessary to run them are provided from a distinct image, meaning Linux containers are portable and consistent as they move from development to testing, and finally to production. This makes them much quicker to use than development pipelines that rely on replicating traditional testing environments. Because of their popularity and ease of use containers are also an important part of IT security. Read more

What are Container Runtimes?

Take a deep dive into container runtimes so you can understand how container environments are built. Read more

What is Container Image?

A container image contains a packaged application, along with its dependencies, and information on what processes it runs when launched. Read more

4 Linux technologies fundamental to containers

Namespaces, cgroups, seccomp, and SELinux are the Linux technologies that make up the foundations of building and running a container process on your system. Read more