job_container.conf(5)
β¨ NAME β¨
job_container.conf β it's giving Slurm configuration file, but make it namespace plugins π
(that's the Slurm Configuration File manual, section 5, bestie β say hi to job_container.conf(5)).
πΈ DESCRIPTION πΈ
So. job_container.conf is an ASCII file, and it's where you define the parameters that Slurm's namespace/tmpfs plugin runs on. Based on whatever you put in there, the plugin goes and creates the appropriate job-specifc namespace(s) for you. No cap. β¨
The namespace/tmpfs plugin creates a filesystem namespace and will construct a private (or optionally shared, if you're feeling generous) filesystem namespace, and then mount a list of directories (defaults to /tmp and /dev/shm) inside it β which gives the job a private view of those directories. These paths get mounted inside the location specified by BasePath in the job_container.conf file. Iconic behavior, honestly. π
When the job completes, the namespace is unmounted and all files therein are automatically removed. Cleanup queen. π§Ή
To make use of this plugin, PrologFlags=Contain must also be present in your slurm.conf file, as shown:
NamespaceType=namespace/tmpfs
PrologFlags=Contain
The file will always be located in the same directory as the slurm.conf. Same house, same address, they're roommates. π
If using the job_container.conf file to define a namespace available to nodes, the first parameter on the line should be NodeName. If configuring a namespace without specifying nodes, the first parameter on the line should be BasePath.
Parameter names are case insensitive. Any text following a # in the configuration file is treated as a comment through the end of that line. Changes to the configuration file take effect upon restart of Slurm daemons. So likeβ¦ restart, bestie. π
The following job_container.conf parameters are defined to control the behavior of the namespace/tmpfs plugin. π
π« the parameters π«
AutoBasePathβ this decides if the plugin should create theBasePathdirectory or not. Set it totrueif the directory is not pre-created before slurm startup. If set totrue, the directory is created with permission0755. The directory is not deleted during slurm shutdown, so don't come for it later. If set tofalseor not specified, the plugin would expect the directory to exist. You can use this option on a global or per-line basis. This parameter is optional. πBasePathβ specify the PATH that the tmpfs plugin should use as a base to mount the private directories. This path must be readable and writable by the plugin. The plugin constructs a directory for each job inside this path, which is then used for mounting. TheBasePathgets mounted asprivateduring slurmd start and remains mounted until shutdown. The first%hwithin the name is replaced with the hostname on which the slurmd is running. The first%nwithin the name is replaced with the Slurm node name on which the slurmd is running. Set PATH tononeto disable the tmpfs plugin on node subsets when there is a global setting.
NOTE: TheBasePathmust be unique to each node. IfBasePathis on a shared filesystem, you can use%hor%nto create node-unique directories. π
NOTE: TheBasePathparameter cannot be set to any of the paths specified byDirs. Using these directories will cause conflicts when trying to mount and unmount the private directories for the job. π
CloneNSScriptβ specify fully qualified pathname of an optional initialization script. This script is run after the namespace construction of a job. The script will be provided theSLURM_NSenvironment variable containing the path to the namespace that can be used by thensentercommand. That variable lets the script join the newly created namespace and do further setup work. This parameter is optional. π¦CloneNSScript_Waitβ the number of seconds to wait for theCloneNSScriptto complete before considering the script failed. The default value is10seconds. β³CloneNSEpilogβ specify fully qualified pathname of an optional epilog script. This script runs just before the namespace is torn down. The script will be provided theSLURM_NSenvironment variable containing the path to the namespace that can be used by thensentercommand. That variable lets the script join the soon to be removed namespace and do any cleanup work. This parameter is optional. πCloneNSEpilog_Waitβ the number of seconds to wait for theCloneNSEpilogto complete before considering the script failed. The default value is10seconds. β³EntireStepInNSβ specifyingEntireStepInNS=truewill pivot all slurmstepd processes (excluding the external step, which is tasked with creating the namespace) into the constructed namespace. Heads up though β this will cause issues if certain paths such asSlurmdSpoolDirare inaccessible. This parameter is optional. πInitScriptβ specify fully qualified pathname of an optional initialization script. This script is run before the namespace construction of a job. It can be used to make the job join additional namespaces prior to the construction of/tmpnamespace, or it can be used for any site-specific setup. This parameter is optional. πNodeNameβ aNodeNamespecification can be used to permit onejob_container.conffile to be used for all compute nodes in a cluster, by specifying the node(s) that each line should apply to. TheNodeNamespecification can use a Slurm hostlist specification as shown in the example below. This parameter is optional. π₯Sharedβ specifyingShared=truewill propagate new mounts between the job specific filesystem namespace and the root filesystem namespace, enable using autofs on the node. This parameter is optional. β¨
π NOTES π
If any parameters in job_container.conf are changed while slurm is running, then slurmd on the respective nodes will need to be restarted for changes to take effect (scontrol reconfigure is not sufficient). Additionally this can be disruptive to jobs already running on the node. So care must be taken to make sure no jobs are running if any changes to job_container.conf are deployed. Like, please. Read that part twice. π«Ά
Restarting slurmd is safe and non-disruptive to running jobs, as long as job_container.conf is not changed between restarts β in which case the above point applies. So the vibe check is: restart = fine, edit-then-restart = chaos. π
π EXAMPLE π
/etc/slurm/slurm.conf
These are the entries required in slurm.conf to activate the namespace/tmpfs plugin.
NamespaceType=namespace/tmpfs
PrologFlags=Contain
/etc/slurm/job_container.conf
The first sample file will define 1 basepath for all nodes and it will be automatically created.
AutoBasePath=true
BasePath=/var/nvme/storage
The second sample file will define 2 basepaths. The first will only be on largemem[1-2] and it will be automatically created. The second will only be on gpu[1-10], will be expected to exist and will run an initscript before each job.
NodeName=largemem[1-2] AutoBasePath=true BasePath=/var/nvme/storage_a
NodeName=gpu[1-10] BasePath=/var/nvme/storage_b InitScript=/etc/slurm/init.sh
The third sample file will define 1 basepath that will be on all nodes, automatically created, with /tmp and /var/tmp as private mounts.
AutoBasePath=true
BasePath=/var/nvme/storage Dirs=/tmp,/var/tmp
π COPYING π
Copyright (C) 2021 Regents of the University of California. Produced at Lawrence Berkeley National Laboratory. Copyright (C) 2021-2022 SchedMD LLC.
This file is part of Slurm, a resource management program. For details, see <https://slurm.schedmd.com/>.
Slurm is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Slurm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. π«‘
π¦ SEE ALSO π¦
okay that's the whole page, you ate that fr fr π
this was job_container.conf(5) from Slurm 26.05, filed under Slurm Configuration File, and that's the tea β go configure something gorgeous bestie πβ¨
π¦ where this page comes from
- arch rolling: slurm-llnl 26.05.5.1-1 Β· GPL-2.0-or-later
- epel 10: slurm 26.05.5-1.el10_3 Β· GPL-2.0-or-later AND BSD-2-Clause AND BSD-1-Clause
- nixpkgs unstable: slurm 26-05-5-1
- ubuntu stonking: slurm-client 26.05.4-1ubuntu1 Β· GPL-2.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms