Singularity: Difference between revisions

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


<!--T:78-->
<!--T:78-->
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 <b>not</b> 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 <code>instance.start</code> and <code>instance.stop</code> commands to create and destroy sessions (i.e., container instances).
By using sessions, Singularity will ensure that all programs running within the instance 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-->
To start a Singularity session instance, decide on a name for this session, e.g., <code>quadrat5run</code>, and run the '''instance.start''' command  
To start a Singularity session instance, decide on a name for this session, e.g., <code>quadrat5run</code>, and run the <code>instance.start</code> command  
specifying the image name, e.g., <code>myimage.simg</code>, and your session name:
specifying the image name, e.g., <code>myimage.simg</code>, and your session name:


Line 354: Line 354:


<!--T:81-->
<!--T:81-->
A session (and all associated programs that are running) can be stopped (i.e., destroyed/killed) by running the '''instance.stop''' command, e.g.,
A session (and all associated programs that are running) can be stopped (i.e., destroyed/killed) by running the <code>instance.stop</code> command, e.g.,


<!--T:82-->
<!--T:82-->
Line 370: Line 370:
<!--T:86-->
<!--T:86-->
With a session started, programs can be run using Singularity's <code>shell</code>, <code>exec</code>, or <code>run</code> commands by specifying
With a session started, programs can be run using Singularity's <code>shell</code>, <code>exec</code>, or <code>run</code> commands by specifying
the name of the session immediately after the image name prefixed with '''instance://''', e.g.,
the name of the session immediately after the image name prefixed with <code>instance://</code>, e.g.,


<!--T:87-->
<!--T:87-->
rsnt_translations
56,430

edits

Navigation menu