forked from hpc2n/spank-private-tmp
-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
75 lines (53 loc) · 2.03 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
This is a SPANK plugin for Slurm that can create private temporary
directories for each job. This is useful for /tmp, /var/tmp and other
node-local temporary directories.
The implementation uses unshare(CLONE_NEWNS) to unshare the mount
namespace and then bind mounts the private directories.
If you have issues please let us know or fix it and send us a patch.
Author:
Magnus Jonsson <[email protected]>
Contributions from:
Lars Viklund <[email protected]>
Ake Sandgren <[email protected]>
Pär Lindfors <[email protected]>
Configuration parameters
------------------------
The SPANK plugin use the following parameters.
base: For each job the plugin will create a directory named
$base.$SLURM_JOB_ID.$SLURM_RESTART_COUNT
mount: Private mount point. This can be specified more than once.
For each mount, a directory will be created in the base dir
and then bind mounted on the specified mount point.
Example
-------
plugstack.conf:
required private-tmpdir.so base=/tmp/slurm mount=/var/tmp mount=/tmp
When a job with jobid 100 and restart count 0, the following
directories will be created on compute nodes:
/tmp/slurm.100.0
/tmp/slurm.100.0/var_tmp
/tmp/slurm.100.0/tmp
In private namespaces the following bind mounts are done:
/tmp/slurm.100.0/var_tmp on /var/tmp
/tmp/slurm.100.0/tmp on /tmp
Note: In this example it is important that mount=/tmp is specified
last, since after /tmp/slurm.100.0/tmp is bind mounted on /tmp
directories in /tmp/slurm.* can no longer be accessed.
Cleanup
-------
The plugin does not do any cleanup.
See below for an example of how to remove temporary directories from
Slurms Epilog script.
Epilog example
--------------
#!/bin/bash
#
# Slurm Epilog script that removes directories created by the
# private-tmpdir SPANK plugin.
#
# TMPDIR_BASE needs to match the configured base= in plugstack.conf
TMPDIR_BASE=/tmp/slurm
PRIVATE_TMPDIR="${TMPDIR_BASE}.${SLURM_JOB_ID}.${SLURM_RESTART_COUNT:=0}"
if [ -d "${PRIVATE_TMPDIR}" ]; then
rm -rf "${PRIVATE_TMPDIR}"
fi