forked from giovtorres/slurm-docker-cluster
-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (54 loc) · 3.22 KB
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
[Unit]
Description=Podman slurm-slurmd.service
Wants=network.target
After=network-online.target
Wants=slurm-create-datadir.service
After=slurm-create-datadir.service
# AssertFileNotEmpty=%S/slurm-container-cluster/etc_munge/munge.key (other subuid UID)
AssertFileNotEmpty=%S/slurm-container-cluster/etc_slurm/slurm.conf
AssertFileNotEmpty=%S/slurm-container-cluster/etc_slurm/slurmdbd.conf
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
#Restart=on-failure
Restart=no
StateDirectory=slurm-container-cluster
StateDirectoryMode=0700
ExecStartPre=rm -f %t/slurm-slurmd%i.pid %t/slurm-slurmd%i.ctr-id
ExecStartPre=mkdir -p %S/slurm-container-cluster/computenode/%i/var_lib_containers
ExecStartPre=mkdir -p %S/slurm-container-cluster/computenode/%i/var_log_slurm
ExecStartPre=podman unshare chmod 700 %S/slurm-container-cluster/computenode/%i/var_log_slurm
ExecStartPre=podman unshare chown 992:991 %S/slurm-container-cluster/computenode/%i/var_log_slurm
ExecStartPre=podman unshare rm -rf %S/slurm-container-cluster/computenode/%i/var_log_munge
ExecStartPre=podman unshare mkdir -p %S/slurm-container-cluster/computenode/%i/var_log_munge
ExecStartPre=/usr/bin/podman unshare chmod 755 %S/slurm-container-cluster/computenode/%i/var_lib_containers
ExecStartPre=/usr/bin/podman unshare chmod 755 %S/slurm-container-cluster/computenode/%i/var_log_munge
ExecStartPre=/usr/bin/podman unshare chown 993:992 %S/slurm-container-cluster/computenode/%i/var_log_munge
ExecStart=/usr/bin/podman run --cgroups=no-conmon \
--cidfile %t/slurm-slurmd%i.ctr-id \
--conmon-pidfile %t/slurm-slurmd%i.pid \
--detach \
--name c%i \
--hostname c%i \
--privileged=true \
--replace \
--security-opt label=disable \
--volume=%S/slurm-container-cluster/adjusting_ports_for_norouter/slurmd:/etc/slurm/adjusting_ports_for_norouter:z \
--volume=%S/slurm-container-cluster/computenode/%i/var_lib_containers:/var/lib/containers:Z \
--volume=%S/slurm-container-cluster/computenode/%i/var_log_munge:/var/log/munge:z \
--volume=%S/slurm-container-cluster/computenode/%i/var_log_slurm:/var/log/slurm:Z \
--volume=%S/slurm-container-cluster/etc_munge:/etc/munge:z \
--volume=%S/slurm-container-cluster/etc_slurm:/etc/slurm:z \
--volume=%S/slurm-container-cluster/extra-containerimages:/var/lib/shared:ro \
--volume=%S/slurm-container-cluster/slurm_jobdir:/data:slave \
localhost/slurm-with-norouter slurmd
ExecStop=/usr/bin/podman stop --cidfile %t/slurm-slurmd%i.ctr-id \
--ignore \
--time 10
ExecStopPost=/usr/bin/podman rm --cidfile %t/slurm-slurmd%i.ctr-id \
--force \
--ignore
PIDFile=%t/slurm-slurmd%i.pid
KillMode=control-group
Type=forking
[Install]
WantedBy=multi-user.target default.target