Apptainer: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 41: Line 41:


=Other Items=
=Other Items=
 
==General==
* In order to use Apptainer one must '''already''' have a container image, e.g., a <code>.sif</code> file or a "sandbox" directory created previously. If you don't already have a container image/sandbox, see the section on '''[[#Building_an_Apptainer_Container/Image|building an image]]''' below.
* In order to use Apptainer one must '''already''' have a container image, e.g., a <code>.sif</code> file or a "sandbox" directory created previously. If you don't already have a container image/sandbox, see the section on '''[[#Building_an_Apptainer_Container/Image|building an image]]''' below.
* While Apptainer is installed and available for use, using Apptainer will require you to install and/or build all software you will need to make use of in your container. In many instances, '''[[Available_software|we already have such software installed on our clusters]]''' so there is often no need to create a container with the same installed in it.
* While Apptainer is installed and available for use, using Apptainer will require you to install and/or build all software you will need to make use of in your container. In many instances, '''[[Available_software|we already have such software installed on our clusters]]''' so there is often no need to create a container with the same installed in it.
==<code>sudo</code>==
Many users ask about <code>sudo</code> since documentation and web sites often discuss using <code>sudo</code>. Know the ability to use <code>sudo</code> to obtain superuser/root permissions is not available on our clusters. Should you require using <code>sudo</code>, consider the following options:
* Install Linux, Apptainer, and <code>sudo</code> in a virtual machine on a system you control so you will be able to have <code>sudo</code> access within such. Build your image(s) on that machine and upload them in order to use them on Alliance systems.
* If appropriate, [[Technical Support|submit a ticket]] asking if Alliance staff would be able to help build the image(s), etc. required needing <code>sudo</code>. (Understand that this may or may not be done/possible --but feel free to ask such in a ticket if what you wish to achieve is beyond your means. Additionally, we may respond with other ways to achieve such with may or may not involve Apptainer.)
* Apptainer version 1.1.x and newer has improved support for users using <code>--fakeroot</code> implicitly and explicitly so some things may be possible that were not with Apptainer version 1.0 and Singularity. This includes being able to build some images from <code>.def</code> definition files and building some images without needing to use <code>sudo</code>. That said, not all images will be able to be built without needing to use <code>sudo</code> or superuser/root.
==When Building Images/Overlays==
Should you need to build your own container image(s) or overlay(s), be aware of the following:
* avoid building a sandbox image using <code>--fakeroot</code> on networked filesystem(s): [https://apptainer.org/docs/admin/main/installation.html#fakeroot-with-uid-gid-mapping-on-network-filesystems link to Apptainer documentation].
* explicitly set <code>APPTAINER_CACHEDIR</code> to a non-networked filesystem location before using Apptainer: [https://apptainer.org/docs/admin/main/installation.html#apptainer-cache-atomic-rename link to Apptainer documentation].
* explicitly set <code>APPTAINER_TMPDIR</code> to a non-Lustre/GPFS filesystem location before using Apptainer: [https://apptainer.org/docs/admin/main/installation.html#lustre-gpfs link to Apptainer documentation].
* avoid using Lustre/GPFS filesystems as they don't have the feature set required to properly support building Apptainer containers (including <code>--fakeroot</code>): [https://apptainer.org/docs/admin/main/installation.html#lustre-gpfs link to Apptainer documentation].


=Loading an Apptainer Module=
=Loading an Apptainer Module=
In order to use the default version of Apptainer available run:
In order to use the default version of Apptainer available run:
<source lang="console">$ module load apptainer</source>
<source lang="console">$ module load apptainer</source>
cc_staff
156

edits

Navigation menu