cc_staff
156
edits
Line 35: | Line 35: | ||
==Running Programs Within a Container== | ==Running Programs Within a Container== | ||
===<code>sudo</code> Access With Apptainer is NOT Available=== | ===Important Items=== | ||
====<code>sudo</code> Access With Apptainer is NOT Available==== | |||
Many users ask about this since documentation and web sites do discuss using using <code>sudo</code> with Apptainer/Singularity. A major design aspect of Apptainer is security and know that <code>sudo</code> access is '''NOT''' available on our clusters. Should you require using <code>sudo</code>, consider the following: | Many users ask about this since documentation and web sites do discuss using using <code>sudo</code> with Apptainer/Singularity. A major design aspect of Apptainer is security and know that <code>sudo</code> access is '''NOT''' available on our clusters. Should you require using <code>sudo</code>, consider the following: | ||
Line 43: | Line 44: | ||
* Apptainer version 1.1 (which has not yet been released as of this writing (August 2022)), may well allow users to use the <code>--fakeroot</code> option with various Apptainer commands. After such has been released, this web page will be updated after the feature has been explored more, tested, and installed on our clusters. | * Apptainer version 1.1 (which has not yet been released as of this writing (August 2022)), may well allow users to use the <code>--fakeroot</code> option with various Apptainer commands. After such has been released, this web page will be updated after the feature has been explored more, tested, and installed on our clusters. | ||
===Important Command Line Options=== | ====Important Command Line Options==== | ||
Containers contain software (very likely) installed with a different environment, libraries, and tools than what is installed on a given system. It is, therefore, wise to run software within containers by '''not''' importing any environment settings or software defined outside of the container. By default Apptainer will run adopting the shell environment of the host which can create issues when executing programs within a container. When running Apptainer commands that execute programs installed inside the container, e.g., <code>apptainer run</code>, <code>apptainer shell</code>, <code>apptainer exec</code>, and </code>apptainer instance</code>, do consider using one of these options (with more preference to those options listed above other options): | Containers contain software (very likely) installed with a different environment, libraries, and tools than what is installed on a given system. It is, therefore, wise to run software within containers by '''not''' importing any environment settings or software defined outside of the container. By default Apptainer will run adopting the shell environment of the host which can create issues when executing programs within a container. When running Apptainer commands that execute programs installed inside the container, e.g., <code>apptainer run</code>, <code>apptainer shell</code>, <code>apptainer exec</code>, and </code>apptainer instance</code>, do consider using one of these options (with more preference to those options listed above other options): | ||
Line 61: | Line 62: | ||
Not using any of these options will have the convenience of file systems being mounted and shell variables existing inside your container but be aware such can be the source of issues/errors when running software inside your container. | Not using any of these options will have the convenience of file systems being mounted and shell variables existing inside your container but be aware such can be the source of issues/errors when running software inside your container. | ||
===Using GPUs=== | ====Using GPUs==== | ||
When running software inside a container that requires the use of GPUs it is important to do the following: | When running software inside a container that requires the use of GPUs it is important to do the following: | ||
Line 70: | Line 71: | ||
* If using OpenCL inside the container, besides using the mentioned options use the following bind mount: <code>--bind /etc/OpenCL</code> | * If using OpenCL inside the container, besides using the mentioned options use the following bind mount: <code>--bind /etc/OpenCL</code> | ||
===Using MPI Programs=== | ====Using MPI Programs==== | ||
If you want to run MPI programs on a container see the [[#Running_MPI_Programs_Inside_an_Apptainer Container|section below]] concerning such. | If you want to run MPI programs on a container see the [[#Running_MPI_Programs_Inside_an_Apptainer Container|section below]] concerning such. |