Skip to content

Apptainer

Description

apptainer website

THE CONTAINER SYSTEM FOR SECURE HIGH PERFORMANCE COMPUTING Apptainer/Singularity is the most widely used container system for HPC. It is designed to execute applications at bare-metal performance while being secure, portable, and 100% reproducible. Apptainer is an open-source project with a friendly community of developers and users. The user base continues to expand, with Apptainer/Singularity now used across industry and academia in many areas of work.

Environment Modules

Run module spider apptainer to find out what environment modules are available for this application.

Environment Variables

  • HPC_APPTAINER_DIR - installation directory
  • HPC_APPTAINER_BIN - executable directory

Additional Usage Information

User Documentation

Admin Documentation

HiPerGator Usage Examples

Pull a container from Docker Hub

$ apptainer pull docker://godlovedc/lolcow

The above will result in a lolcow_latest.sif container image creation. You can run the default program from that container with

$ apptainer run lolcow_latest.sif

or execute a particular binary of your choosing with

$ apptainer exec lolcow_latest.sif ls

or even create a shell in the software environment provided by the container with

$ apptainer shell lolcow_latest.sif

Run directly with Docker Hub URL

If it’s the first time you have run or pulled the container it will be downloaded and translated. If you have run or pulled the container before, it will be run from your cache.

$ apptainer run docker://godlovedc/lolcow 

Build an Apptainer Container from Docker

To run "build" instead of "run":

$ apptainer build lolcow.sif docker://godlovedc/lolcow
$ apptainer run lolcow.sif

Converting Dockerfile to sif

You can install Docker Desktop on your (Windows) computer to build a sif file from a Dockerfile.

  • Download the Dockerfile to a local folder in your desktop.
  • Open a terminal, such as CMD as administrator and run:
  > docker build --rm -t name_your_image_file C:\directory\where\Dockerifle\is\
  > docker save -o name_your_file.tar your_image_file

This will save the Docker image to a tarball file.

  • Upload the tarball to HPC using SFTP or another transfer method, then use apptainer to convert the docker tarball to an apptainer container by running:
  $ module load apptainer
  $ apptainer build the-name-you-want.sif docker-archive://the-name-you-want.tar

See User and Admin documentation for more information on how to create and use HPC containers.

Categories

workflow_automation