Apptainer: Difference between revisions

2,552 bytes removed ,  1 year ago
Line 54: Line 54:


=Running Programs Within a Container=
=Running Programs Within a Container=
==<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].


==Important Command Line Options==
==Important Command Line Options==
cc_staff
156

edits