Merge branch 'devel' into 'main'

updating slurm* services

See merge request glicid-public/guix-glicid!124
This commit is contained in:
Jean-François GUILLAUME 2022-11-18 15:23:30 +00:00
commit 022036cb75

View file

@ -1,6 +1,8 @@
(define-module (glicid services parallel)
#:use-module (gnu packages bash)
#:use-module (gnu services)
#:use-module (gnu services shepherd)
#:use-module (gnu system shadow)
#:use-module (guix)
#:use-module (guix records)
#:use-module (ice-9 match)
@ -91,6 +93,24 @@
)
)
;
; Shared slurm account
;
(define %slurm-accounts
(list
(user-group (name "slurm") (system? #t))
(user-account
(name "slurm")
(group "slurm")
(system? #t)
(comment "slurm server user")
(home-directory "/var/spool/slurm")
(shell (file-append bash "/bin/bash"))
)
)
)
;
; slurmdbd
;
@ -123,6 +143,8 @@
"-D"
)
#:log-file #$log-file
#:user (passwd:uid (getpwnam "slurm"))
#:group (passwd:gid (getpwnam "slurm"))
))
(stop #~(make-kill-destructor))
)
@ -135,10 +157,15 @@
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils))
;(chmod "0600" "/etc/slurm/slurmdbd.conf")
(mkdir-p "/var/log/slurm")
(mkdir-p "/var/lib/slurm-archives")
(mkdir-p "/var/lib/slurm")
;(chmod "0600" "/etc/slurm/slurmdbd.conf")
(mkdir-p "/var/spool/slurmctld")
(chown "/var/log/slurm" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
(chown "/var/lib/slurm-archives" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
(chown "/var/lib/slurm" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
(chown "/var/spool/slurmctld" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
#t
)
)
@ -150,6 +177,7 @@
(list
(service-extension shepherd-root-service-type slurmdbd-service)
(service-extension activation-service-type (const %slurmdbd-activation))
(service-extension account-service-type (const %slurm-accounts))
)
)
(description "Run slurmdbd")
@ -189,6 +217,8 @@
"-f" #$slurmctld-conf
)
#:log-file #$log-file
#:user (passwd:uid (getpwnam "slurm"))
#:group (passwd:gid (getpwnam "slurm"))
))
(stop #~(make-kill-destructor))
)
@ -204,6 +234,11 @@
(mkdir-p "/var/log/slurm")
(mkdir-p "/var/lib/slurm-archives")
(mkdir-p "/var/lib/slurm")
(mkdir-p "/var/spool/slurmctld")
(chown "/var/log/slurm" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
(chown "/var/lib/slurm-archives" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
(chown "/var/lib/slurm" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
(chown "/var/spool/slurmctld" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
#t
)
)
@ -215,6 +250,7 @@
(list
(service-extension shepherd-root-service-type slurmctld-service)
(service-extension activation-service-type (const %slurmctld-activation))
(service-extension account-service-type (const %slurm-accounts))
)
)
(description "Run slurmctld")
@ -287,6 +323,8 @@
)
#:log-file #$log-file
#:user (passwd:uid (getpwnam "slurm"))
#:group (passwd:gid (getpwnam "slurm"))
))
(stop #~(make-kill-destructor))
)
@ -302,6 +340,11 @@
(mkdir-p "/var/log/slurm")
(mkdir-p "/var/lib/slurm-archives")
(mkdir-p "/var/lib/slurm")
(mkdir-p "/var/spool/slurmctld")
(chown "/var/log/slurm" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
(chown "/var/lib/slurm-archives" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
(chown "/var/lib/slurm" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
(chown "/var/spool/slurmctld" (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
#t
)
)
@ -313,6 +356,7 @@
(list
(service-extension shepherd-root-service-type slurmd-service)
(service-extension activation-service-type (const %slurmd-activation))
(service-extension account-service-type (const %slurm-accounts))
)
)
(description "Run slurmd")