namespace.yaml(5)
π namespace.yaml β the config file that runs the namespace/linux plugin π
So this is the manual page for namespace.yaml(5) from the Slurm Configuration File section, and honestly? It's a whole vibe once you get it. Sit with me, bestie π«Ά
πΈ NAME πΈ
namespace.yaml β literally the Slurm configuration file for the namespace/linux plugin. That's it, that's the name, iconic.
β¨ DESCRIPTION β¨
namespace.yaml is a YAML-formatted config file, and it defines the parameters that Slurm's namespace/linux plugin uses. Based on those parameters, the plugin creates the appropriate job-specific namespace(s) for you. No cap. π
Here's what it can actually do: the namespace/linux plugin can create a filesystem namespace, and it'll construct a private (or, if you want, shared) filesystem namespace and mount a list of directories inside it β defaults to /tmp and /dev/shm β which gives the job a private view of those directories. Those paths get mounted inside the location specified by base_path in the namespace.yaml file. And on top of all that, it can also create new User and PID namespaces for the job. Like, it's doing the most and we love it for that. π
When the job completes, the namespace is unmounted and every file inside it is automatically removed. Cleanup queen behavior, honestly. π§Ήβ¨
Now β to actually make use of these plugins, PrologFlags=Contain must also be present in your slurm.conf file, like so:
NamespaceType=namespace/linux
PrologFlags=Contain
Bestie, do not skip that part. No PrologFlags=Contain, no containment. It's giving mandatory. π
The file will always live in the same directory as the slurm.conf.
Also, to say it twice because it matters: the file must be located in the same directory as slurm.conf. Any text following a # in this file is treated as a comment all the way through the end of that line. And changes to the configuration file take effect upon restart of Slurm daemons β not on reconfigure, we'll get to that. π
π PARAMETERS π
namespace.yaml contains the following attributes:
defaultsβ the default namespace configuration. If you specify it, it contains the fields described in options.disable_bpf_tokenβ if you specify this, it disables the use of bpf tokens in the namespace plugin. Now listen: using this option whenConstrainDevicesis set in thecgroup.conffile will result in devices only being constrained at the job level β individual steps won't actually be constrained if they request fewer devices than the job does. This will also permitConstrainDevicesto work on kernels where bpf tokens are not available. So like, tradeoffs, yk? π¦node_confsβ a list of node namespace configurations. The list element attributes are described below, keep scrolling.
π node_confs list element definitions π
Each node_confs element contains the following attributes:
nodesβ list of node names the options will be applied to.optionsβ namespace configuration options. Any options you specify here will override those set bydefaults.
π options definitions π
options contains the following attributes:
auto_base_pathβ this determines if the plugin should create the BasePath directory or not. Set it to'true'if the directory isn't pre-created before slurm startup. If set to true, the directory is created with permission0755. The directory is not deleted during slurm shutdown. If set to'false'or just not specified, the plugin would expect the directory to already exist. This option can be used on a global or per-line basis. Whendir_confsis set, any per-directorybase_pathentries indir_confsare also created. This parameter is optional.base_pathβ specify the PATH that the namespace 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. Thebase_pathgets mounted as'private'during slurmd start and remains mounted until shutdown. The first"%h"within the name is replaced with the hostname on which the slurmd is running. The first"%n"within the name is replaced with the Slurm node name on which the slurmd is running. Set PATH to'none'to disable thenamespace/linuxplugin on node subsets when there's a global setting indefaults.
NOTE: Thebase_pathmust be unique to each node. Ifbase_pathis on a shared filesystem, you can use"%h"or"%n"to create node-unique directories.
NOTE: Thebase_pathparameter 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. So don't. π ββοΈ
clone_ns_scriptβ specify the fully qualified pathname of an optional initialization script. This script runs after the namespace construction of a job. This script will be provided theSLURM_NSenvironment variable containing the path to the namespace that can be used by thensentercommand. This variable lets the script join the newly created namespace and do further setup work. This parameter is optional. β¨clone_ns_script_waitβ the number of seconds to wait for theclone_ns_scriptto complete before considering the script failed. The default value is10seconds.clone_ns_epilogβ specify the fully qualified pathname of an optional epilog script. This script runs just before the namespace is torn down. This script will be provided theSLURM_NSenvironment variable containing the path to the namespace that can be used by thensentercommand. This variable lets the script join the soon-to-be-removed namespace and do any cleanup work. This parameter is optional. π§clone_ns_epilog_waitβ the number of seconds to wait for theclone_ns_epilogto complete before considering the script failed. The default value is10seconds.clone_ns_flagsβ this contains a list of string flag values. This parameter defines what additional namespaces should be created for the job. Valid values are"CLONE_NEWPID"and"CLONE_NEWUSER"to create new PID and USER namespaces respectively."CLONE_NEWNS"will also be accepted, but it's always on anyway. NOTE: WhenCLONE_NEWUSERis specified, bpf token support is also required if you're usingConstrainDevicesincgroup.conf.dirsβ a comma-separated list of directories to create private mount points for. This parameter is optional, and if it's not specified it defaults to"/tmp,/dev/shm". Mutually exclusive withdir_confs. If both are set,dir_confswill take precedence.
NOTE: /dev/shm has special handling β instead of a bind mount it's always a fresh tmpfs filesystem.
NOTE: WhenCLONE_NEWPIDis specified, a unique/procfilesystem for the container will be mounted automatically. Cute, right? πΈ
dir_confsβ a structured list of per-directory mount configurations. Each entry specifies a path, optional per-directory backing storage, and optional mount options. When set, it supersedesdirs. The list element attributes are described in thedir_confslist element definitions below. This parameter is optional.init_scriptβ specify the fully qualified pathname of an optional initialization script. This script runs before the namespace construction of a job. It can be used to make the job join additional namespaces prior to the construction of the/tmpnamespace, or it can be used for any site-specific setup. This parameter is optional.sharedβ specifyingShared=truewill propagate new mounts between the job-specific filesystem namespace and the root filesystem namespace, enabling the use of autofs on the node. This parameter is optional.user_ns_scriptβ specifies the location of a script that will perform the user namespace setup. This script runs first when setting up the namespace. The environment variable"SLURM_NS_PID"is provided to allow constructing the path to the various map files that this script could write to. If it's not specified, every user and group will be mapped.
π¦ dir_confs list element definitions π¦
Each dir_confs element contains the following attributes:
pathβ the target directory to mount privately, e.g."/tmp". The following substitutions are supported:%j(job ID),%S(SLUID), and%u(username). This parameter is required. Don't skip it, bestie. πbase_pathβ optional per-directory backing storage root. It overrides the globalbase_pathfor this mount. A job-specific subdirectory will be created here to back the private mount. Ignored whentmpfsis set. This parameter is optional.optionsβ comma-separated list of mount options. Support is included to pass the following options to the mount command:noatimeβ do not update inode access times on this filesystem.nodevβ do not interpret character or block special devices on the filesystem.nodiratimeβ do not update directory inode access times on this filesystem.noexecβ do not permit direct execution of any binaries on the mounted filesystem.nosuidβ do not honor set-user-ID and set-group-ID bits or file capabilities when executing programs from this filesystem.relatimeβ update inode access times relative to modify or change time.roβ mount the filesystem read-only.
For tmpfs mounts, additional data options such as size=4g and mode=1777 may also be specified and are passed directly to the kernel. Options not recognized as flags are treated as tmpfs mount data and silently ignored on bind mounts. This parameter is optional. π
NOTE: tmpfs mounts always havenosuidandnodevapplied regardless of this setting. Yeah, even if you didn't ask. That's just how it is. π
tmpfsβ if set to true, mounts a fresh tmpfs at this path instead of creating a bind mount backed by thebase_path. This parameter is optional.
β NOTES β
If any parameters in namespace.yaml are changed while slurm is running, then slurmd on the respective nodes will need to be restarted for the changes to take effect (scontrol reconfigure is not sufficient, sorry bestie π). 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 namespace.yaml are deployed. Fr fr.
Restarting slurmd is safe and non-disruptive to running jobs β as long as namespace.yaml is not changed between restarts, in which case the above point applies. π
π EXAMPLE π
okay bestie, here's a full-ass example that just... ate. look at it. study it. it's giving "everything everywhere all at once" but for namespace configs β¨
---
defaults:
auto_base_path: true
base_path: "/var/nvme/storage_0"
clone_ns_flags:
- "CLONE_NEWPID"
- "CLONE_NEWUSER"
- "CLONE_NEWNS"
clone_ns_epilog: "/path/to/epilog_script"
clone_ns_epilog_wait: 10
clone_ns_script: "/path/to/ns_script"
init_script: "/path/to/init_script"
shared: true
node_confs:
- nodes:
- "n1"
- "n[2-4,6]"
options:
auto_base_path: true
base_path: "/var/nvme/storage_1"
clone_ns_script_wait: 20
dir_confs:
- path: "/tmp"
options: "noexec,nosuid,size=8g"
tmpfs: true
- path: "/scratch"
base_path: "/var/nvme/storage_1"
options: "noexec,nosuid"
shared: false
user_ns_script: "/path/to/user_script"
- nodes:
- "n[7-10]"
options:
auto_base_path: true
base_path: "/var/nvme/storage_2"
init_script: "/etc/slurm/init.sh"
so what's happening here, bestie? the defaults block is the main character, setting the vibe for everyone πΈ β auto_base_path: true, base_path: "/var/nvme/storage_0", the whole clone_ns_flags trio ("CLONE_NEWPID", "CLONE_NEWUSER", "CLONE_NEWNS"), plus clone_ns_epilog: "/path/to/epilog_script", clone_ns_epilog_wait: 10, clone_ns_script: "/path/to/ns_script", init_script: "/path/to/init_script" and shared: true.
then node_confs comes in and does its own thing per node group π
β first group is "n1" and "n[2-4,6]", and those are not getting the same treatment. they get their own base_path: "/var/nvme/storage_1", a clone_ns_script_wait: 20, shared: false, a user_ns_script: "/path/to/user_script", and a whole little dir_confs moment:
- one for
/tmpwithoptions: "noexec,nosuid,size=8g"andtmpfs: true - one for
/scratchwithbase_path: "/var/nvme/storage_1"andoptions: "noexec,nosuid"
and then the second group β the "n[7-10]" girlies β get auto_base_path: true, base_path: "/var/nvme/storage_2" and init_script: "/etc/slurm/init.sh". iconic. no notes. π
π COPYING π
Copyright (C) 2025 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.
fr fr, read the license, it's not a vibe suggestion π legal girlies stay winning.
π SEE ALSO π«Ά
and that's a wrap bestie π this was Slurm 26.05, a Slurm Configuration File, filed under namespace.yaml(5) β go forth, configure your namespaces, and slay β¨π¦πΈ
π¦ 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