| Description | Create your own Singularity containers | 
|---|---|
| Related-course materials | HPC Administration Module2 | 
| Authors | Ndomassi TANDO (ndomassi.tando@ird.fr) | 
| Creation Date | 24/09/2019 | 
| Last Modified Date | 24/09/2019 | 
Summary
- Install dependencies
- Install The programming language Go
- Download and install singularity from repo
- Modify Bind path in Singularity
- Links
- License
Install dependencies
$ sudo yum update -y && \
      sudo yum groupinstall -y 'Development Tools' && \
      sudo yum install -y \
      openssl-devel \
      libuuid-devel \
      libseccomp-devel \
      wget \
      squashfs-tools \
      gitInstall The programming language Go:
Go to the Download Page and choose the archive go.1.12.5.linux-amd64.tar.gz
Launch the following commands:
# Download the archive
    wget https://dl.google.com/go/go1.12.5.linux-amd64.tar.gz
    # Extract the archive into /usr/local
    sudo tar -C /usr/local -xzvf go1.12.5.linux-amd64.tar.gzSet up your environment for Go with the following commands:
# Create the GOPATH variable into .bashrc
    echo 'export GOPATH=${HOME}/go' >> ~/.bashrc
    # Set the PATH with Go
    echo 'export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin' >> ~/.bashrc
    # Resource your environment to take the modifications into account
     source ~/.bashrcFor Singularity > v3.0.0, we also need to install dep for dependency resolution
go get -u github.com/golang/dep/Download and install singularity from repo:
To ensure that the Singularity source code is downloaded to the appropriate directory use these commands.
go get -d github.com/sylabs/singularityYou will obtain a warning but it will still download Singularity source code to the appropriate directory within the $GOPATH
# move to the singularity folder
     cd ~/go/src/github.com/sylabs/singularity/ 
     # launch the mconfig command ( you can add the option --prefix=path to custom the installation directory)
     ./mconfig --prefix=/usr/local/singularity
     # Compile into the build directory
     make -C ./builddir
     # Install the binaries into /usr/local/singularity/bin by default as superuser
     sudo make -C ./builddir installType the following command to  your .bashrc file to enable completion in singularity:
. /usr/local/etc/bash_completion.d/singularity
    # resource your .bashrc
    source ~/.bashrcModify Bind path in Singularity
bind path allows to mount host partitions into the container directly at startup.
Modify the  file /usr/local/singularity/etc/singularity/singularity.conf
In BIND PATH part
Add the partitions you want to see in the container:
For example:
bind path = /opt
bind path = /scratch
bind path = /dataActivate the overlay with the line:
enable overlay = yesLinks
- Related courses : HPC Trainings
License
 
