| <!--#include virtual="header.txt"--> | 
 |  | 
 | <h1>job_container/tmpfs</h1> | 
 |  | 
 | <h2 id="overview">Overview<a class="slurm_link" href="#overview"></a></h2> | 
 | <p>job_container/tmpfs is an optional plugin that provides job-specific, private | 
 | temporary file system space.</p> | 
 |  | 
 | <p>When enabled on the cluster, a filesystem namespace will be created for each | 
 | job with a unique, private instance of /tmp and /dev/shm for the job to use. | 
 | These directories can be changed with the <b>Dirs=</b> option in | 
 | job_container.conf. The contents of these directories will be removed at job | 
 | termination.</p> | 
 |  | 
 | <h2 id="installation">Installation | 
 | <a class="slurm_link" href="#installation"></a> | 
 | </h2> | 
 | <p>This plugin is built and installed as part of the default build, no extra | 
 | installation steps are required.</p> | 
 |  | 
 | <h2 id="setup">Setup<a class="slurm_link" href="#setup"></a></h2> | 
 | <p>Slurm must be configured to load the job container plugin by adding | 
 | <b>JobContainerType=job_container/tmpfs</b> and <b>PrologFlags=contain</b> in | 
 | slurm.conf. Additional configuration must be done in the job_container.conf | 
 | file, which should be placed in the same directory as slurm.conf.</p> | 
 |  | 
 | <p>Job containers can be configured for all nodes, or for a subset of nodes. | 
 | As an example, if all nodes will be configured the same way, you would put the | 
 | following in your job_container.conf:</p> | 
 |  | 
 | <pre> | 
 | AutoBasePath=true | 
 | BasePath=/var/nvme/storage | 
 | </pre> | 
 |  | 
 | <p>A full description of the parameters available in the job_container.conf | 
 | file can be found <a href="job_container.conf.html">here</a>.</p> | 
 |  | 
 | <h2 id="initial_testing">Initial Testing | 
 | <a class="slurm_link" href="#initial_testing"></a> | 
 | </h2> | 
 | <p>An easy way to verify that the container is working is to run a job and | 
 | ensure that the /tmp directory is empty (since it normally has some other | 
 | files) and that "." is owned by the user that submitted the job.</p> | 
 | <pre> | 
 | tim@slurm-ctld:~$ srun ls -al /tmp | 
 | total 8 | 
 | drwx------  2 tim    root 4096 Feb 10 17:14 . | 
 | drwxr-xr-x 21 root   root 4096 Nov 15 08:46 .. | 
 | </pre> | 
 |  | 
 | <p>While a job is running, root should be able to confirm that | 
 | <code>/$BasePath/$JobID/_tmp</code> exists and is empty. This directory is bind | 
 | mounted into the job. <code>/$BasePath/$JobID</code> should be owned by root, | 
 | and is not intended to be accessible to the user.</p> | 
 |  | 
 | <h2 id="spank">SPANK<a class="slurm_link" href="#spank"></a></h2> | 
 | <p>This plugin interfaces with the SPANK api, and automatically joins the job's | 
 | container in the following functions:</p> | 
 | <ul> | 
 | <li>spank_task_init_privileged()</li> | 
 | <li>spank_task_init()</li> | 
 | </ul> | 
 |  | 
 | <p>In addition to the job itself, the TaskProlog will also be executed inside | 
 | the container.</p> | 
 |  | 
 | <p style="text-align:center;">Last modified 29 November 2023</p> | 
 |  | 
 | <!--#include virtual="footer.txt"--> |