mirror of
https://gitlab.univ-nantes.fr/glicid-public/guix-glicid.git
synced 2025-04-30 06:08:37 +02:00
Merge branch 'devel' into 'main'
adding slurmd service See merge request glicid-public/guix-glicid!35
This commit is contained in:
commit
f0836de6fc
1 changed files with 78 additions and 0 deletions
|
@ -216,3 +216,81 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;
|
||||||
|
; slurmd
|
||||||
|
;
|
||||||
|
(define-record-type* <slurmd-configuration>
|
||||||
|
slurmd-configuration make-slurmd-configuration
|
||||||
|
slurmd-configuration?
|
||||||
|
(slurm slurm-configuration-slurm
|
||||||
|
(default slurm)
|
||||||
|
)
|
||||||
|
(slurmd-conf slurmd-slurmd-conf
|
||||||
|
(default (file-append slurm "/etc/slurm/slurm.conf"))
|
||||||
|
)
|
||||||
|
(log-file slurmd-log-file
|
||||||
|
(default "/var/log/slurmd.log")
|
||||||
|
)
|
||||||
|
(slurmctld-host slurmd-slurmctld-host
|
||||||
|
(default #f) ; string slurmctld-host[:port]
|
||||||
|
)
|
||||||
|
(log-level slurmd-log-level
|
||||||
|
(default #f) ; string Verbose mode. Multiple -v's increase verbosity
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(define slurmd-service
|
||||||
|
(match-lambda
|
||||||
|
(($ <slurmd-configuration> slurm slurmd-conf slurmctld-host log-file log-level)
|
||||||
|
(list
|
||||||
|
(shepherd-service
|
||||||
|
(provision '(slurmd) )
|
||||||
|
(documentation "Run slurmd.")
|
||||||
|
(requirement '(user-processes))
|
||||||
|
(respawn? #t)
|
||||||
|
(start #~(make-forkexec-constructor
|
||||||
|
(list
|
||||||
|
#$(file-append slurm "/sbin/slurmd")
|
||||||
|
"-D"
|
||||||
|
#$@(if slurmctld-host
|
||||||
|
(list (string-append "--conf-server" slurmctld-host))
|
||||||
|
(list (string-append "-f" slurmd-conf))
|
||||||
|
)
|
||||||
|
#$@(if log-level
|
||||||
|
(list log-level)
|
||||||
|
'()
|
||||||
|
)
|
||||||
|
|
||||||
|
)
|
||||||
|
#:log-file #$log-file
|
||||||
|
))
|
||||||
|
(stop #~(make-kill-destructor))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(define %slurmd-activation
|
||||||
|
(with-imported-modules '((guix build utils))
|
||||||
|
#~(begin
|
||||||
|
(use-modules (guix build utils))
|
||||||
|
(mkdir-p "/var/log/slurm")
|
||||||
|
(mkdir-p "/var/lib/slurm-archives")
|
||||||
|
(mkdir-p "/var/lib/slurm")
|
||||||
|
#t
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(define slurmd-service-type
|
||||||
|
(service-type (name 'slurmd)
|
||||||
|
(extensions
|
||||||
|
(list
|
||||||
|
(service-extension shepherd-root-service-type slurmd-service)
|
||||||
|
(service-extension activation-service-type (const %slurmd-activation))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(description "Run slurmd")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue