|
Article ID: 722
Last updated: 14 Sep, 2026
If you have an existing Apptainer image that is ready to run, you should be able to run it on any platform where Apptainer is installed. This article provides information to help you run an Apptainer container image on NAS systems. Note: A container is a runtime instance of an image. You can run multiple containers of the same image. Unpacking the Image Tar File on NAS SystemsIf you transferred your Apptainer container image to a NAS system as a compressed tar file, use the appropriate tool to uncompress and unpack the tar file. For example:
where X in nobackuppX is one of [17-19,27-29]. Use the number of the /nobackup directory you are assigned to. Accessing Apptainer at NASApptainer is installed for use on NAS systems with either x86_64 or aarch64 architecture, and with either the TOSS4 or TOSS5 operating system. You can use Apptainer after loading one of these modules:
Here are example commands for the different environments listed above:
Running the Container ImageDepending on what you want to do, you can use either the shell, exec, or run command of Apptainer. Warning: Use of the --fakeroot option is not allowed on NAS systems.
For example, if you port a sandbox lolcow container (renamed from lolcow_from_sif as described in this article) to a NAS system, you may do:
Setting Up Environment VariablesYou can modify the environment such as the $PATH within your container. For example:
Accessing Files on NAS SystemsYou can access files on NAS systems from within the container. By default, Apptainer bind-mounts your NAS $HOME (as /u/username), /tmp, and $PWD into your container at runtime. If you run the apptainer command from your /nobackuppX/$USER directory, the $PWD variable is then /nobackuppX/$USER and you can access the files and directories there. Warning: The automatic mount for $PWD may fail if the path contains symlinks that resolve to different locations on the host versus inside the container. This will happen when $PWD is /nobackup/username, which is a symlink to the actual /nobackuppX/username. If you want to rely on Apptainer bind-mounting your $PWD when $PWD is your NAS nobackup directory, access it as /nobackuppX/username instead of /nobackup/username. To avoid this confusion, use the --bind option to bind-mount your /nobackup directory, as described below.
You can specify additional directories to bind mount into your container with the --bind option. Note: You can replace --bind with -B or set the environment variable APPTAINER_BIND or APPTINER_BINDPATH on the host system. See this Apptainer page for more information. For example, if you run the apptainer command from your $HOME, and you want to be able to access files and directories under your /nobackuppX/$USER, you can do:
For read-only filesystems such as /nasa, optionally add :ro to the command as follows:
You can bind-mount multiple filesystems. For example,
Further ReadingRead this article for information on Using OpenMPI as host MPI for running containers in hybrid MPI mode on NAS systems. Read this article for information on Using Cray MPICH as host MPI for running containers in hybrid MPI mode on Athena.
Also read
|