Install and deploy Singularity container under Linux system

In the following two blogs:

Talking about Singularity Container_Boy Li's Blog-CSDN Blog

Common commands for Singularity container_ubuntu uninstall singularity_Boy Li's Blog-CSDN Blog

We have introduced the Singularity container and the common commands of the Singularity container respectively. I believe that everyone is familiar with the high-performance computing container Singularity. This time we will focus on describing how to install and deploy the Singularity container.

The installation of the Singularity container is roughly divided into the following three steps:

  • Install Go
  • Download Singularity
  • Compile the Singularity source code

1. Install Go

Singularity v3 and above are mainly written in Go language, so you need to install Go to compile the source code.

Regarding the download of Go, you can choose the appropriate version to download from the following webpage according to your needs.

All releases - The Go Programming LanguageAll releases - The Go Programming Language

 Here we choose go1.20.5.linux-amd64.tar.gz for Linux systems.

After the download is complete, extract it to the /usr/local directory, and set the corresponding environment variables.

tar -C /usr/local -xzvf go1.20.5.linux-amd64.tar.gz

Set environment variable to point to Go:PATH

echo 'export PATH=/usr/local/go/bin:$PATH' >> ~/.bashrc && \
  source ~/.bashrc

Note: If the go program has been downloaded and installed in the system before, it needs to be deleted or replaced

go rm -r /usr/local/go

2. Download Singularity

You can download Singularity from one of these versions. For a complete list, visit  the GitHub releases page . Once you have determined which version you want to install, you can run the following command to continue the installation.

 If you need to download other versions, you can scroll to the end and turn the page to download, or specify the download directly on the command line.

$ export VERSION=3.7.3 && # adjust this as necessary \
    wget https://github.com/sylabs/singularity/releases/download/v${VERSION}/singularity-${VERSION}.tar.gz && \
    tar -xzf singularity-${VERSION}.tar.gz && \
    cd singularity

3. Compile the Singularity source code

Now you are ready to build Singularity. Dependencies will be downloaded automatically. You can build Singularity with the following command:

$ ./mconfig && \
    make -C builddir && \
    sudo make -C builddir install

It should be noted that Singularity needs to be installed under the root user to run properly.

4. Installation verification

Verify that the installation was successful:

Singularity's command-line interface allows you to build and interact with containers transparently. You can run containers as if they were running on your host system. You can easily redirect IO, use pipes, pass parameters, and access files, sockets, and ports on the host system inside the container.

Singularity help command, you can view how to use singularity to interact with the Linux system.

 

5. Another way is yum installation

yum update -y 
yum install -y singularity

or:

yum installs Singularity and dependent packages.

yum install -y singularity-runtime singularity libseccomp-devel golang git socat gcc

Guess you like

Origin blog.csdn.net/lovebaby1689/article/details/131628055
Recommended