Singularity: Difference between revisions

no edit summary
(Fixed Singularity Hub link.)
No edit summary
Line 2: Line 2:
<translate>
<translate>
=Overview= <!--T:1-->
=Overview= <!--T:1-->
Singularity<ref>Singularity Software Web Site: https://www.sylabs.io/docs/ (old link: http://singularity.lbl.gov/)</ref> is open source software created by Berkeley Lab:
Singularity<ref>Singularity Software Web Site: https://www.sylabs.io/docs/</ref> is open source software created by Berkeley Lab:
* as a '''secure way''' to use Linux containers on Linux multi-user clusters,
* as a '''secure way''' to use Linux containers on Linux multi-user clusters,
* as a way to enable users to have '''full control of their environment,''' and,
* as a way to enable users to have '''full control of their environment,''' and,
Line 21: Line 21:


<!--T:4-->
<!--T:4-->
Singularity is similar to other container solutions such as Docker<ref>Docker Software Web Site: https://www.docker.com/</ref> except Singularity was specifically designed to enable containers to be used securely without requiring any special permissions especially on multi-user compute clusters.<ref>Singularity Security Documentation: https://www.sylabs.io/guides/2.5.1/admin-guide/security.html (old link: http://singularity.lbl.gov/docs-security)</ref>
Singularity is similar to other container solutions such as Docker<ref>Docker Software Web Site: https://www.docker.com/</ref> except Singularity was specifically designed to enable containers to be used securely without requiring any special permissions especially on multi-user compute clusters.<ref>Singularity Security Documentation: https://www.sylabs.io/guides/2.5.1/admin-guide/security.html</ref>


=Singularity Availability= <!--T:5-->
=Singularity Availability= <!--T:5-->
Line 29: Line 29:


<!--T:7-->
<!--T:7-->
Should you wish to use Singularity on your own computer systems, you will need to download and install Singularity per its documentation.<ref>Singularity Documentation: https://www.sylabs.io/docs/ (old link: http://singularity.lbl.gov/all-releases)</ref> You should be using a relatively recent version of some Linux distribution (e.g., ideally your kernel is v3.10.0 or newer).
Should you wish to use Singularity on your own computer systems, you will need to download and install Singularity per its documentation.<ref>Singularity Documentation: https://www.sylabs.io/docs/</ref> You should be using a relatively recent version of some Linux distribution (e.g., ideally your kernel is v3.10.0 or newer).


=Singularity On Compute Canada Systems= <!--T:8-->
=Singularity On Compute Canada Systems= <!--T:8-->
Line 217: Line 217:


<!--T:40-->
<!--T:40-->
Notice the difference between the two commands is whether or not <code>'''sudo'''</code> appears. The <code>sudo</code> command runs the command after it as the '''root''' user (i.e., superuser) of that system. On Compute Canada systems, no users have such access so the '''sudo''' command cannot be used there. Presumably you do have '''root''' access on your own computer so you can use '''sudo''' on it.
Notice the difference between the two commands is whether or not <code>'''sudo'''</code> appears. The <code>sudo</code> command runs the command passed to it as the root user (i.e., superuser) of that system. On Compute Canada systems, no users have such access so the '''sudo''' command cannot be used there. Presumably you do have '''root''' access on your own computer so you can use '''sudo''' on it.


<!--T:41-->
<!--T:41-->
Line 323: Line 323:
When submitting jobs that invoke commands in Singularity containers, one will either use Singularity's <code>exec</code> or <code>run</code> commands.
When submitting jobs that invoke commands in Singularity containers, one will either use Singularity's <code>exec</code> or <code>run</code> commands.
* The <code>exec</code> command does not require any configuration.
* The <code>exec</code> command does not require any configuration.
* The <code>run</code> command requires configuring an application within a Singularity recipe file and is not discussed here.
* The <code>run</code> command requires configuring an application within a Singularity recipe file and this is not discussed on this page.


<!--T:67-->
<!--T:67-->
Line 362: Line 362:
Should you need to run daemons and backgrounded processes within your container, then do '''not''' use the Singularity <code>exec</code> command!  
Should you need to run daemons and backgrounded processes within your container, then do '''not''' use the Singularity <code>exec</code> command!  
Instead you want to use Singularity's '''instance.start''' and '''instance.stop''' commands to create and destroy sessions (i.e., container instances).
Instead you want to use Singularity's '''instance.start''' and '''instance.stop''' commands to create and destroy sessions (i.e., container instances).
By using sessions, Singularity will ensure that your programs are terminated when your job ends, unexpectedly dies, is killed, etc.
By using sessions, Singularity will ensure that all programs running within the instance are terminated when your job ends, unexpectedly dies, is killed, etc.


<!--T:79-->
<!--T:79-->
Line 420: Line 420:


<!--T:92-->
<!--T:92-->
In most cases, it is not recommended to directly mount each directory you need as this can cause access issues. Instead mount the top directory for the file system as shown above.
In most cases, it is not recommended to directly mount each directory you need as this can cause access issues. Instead, mount the top directory of the filesystem as shown above.
 


==HPC Issues With Singularity== <!--T:93-->
==HPC Issues With Singularity== <!--T:93-->
rsnt_translations
56,430

edits