;; ;; slurm deployment on octopus ;; (use-modules ((gnu packages check) #:select (check)) ((gnu packages databases) #:select (mariadb)) ((gnu packages glib) #:select (dbus)) ((gnu packages linux) #:select (linux-libre-headers)) ((gnu packages networking) #:select (librdkafka)) ((gnu packages parallel) #:select (slurm) #:prefix guix:) ((gnu packages pkg-config) #:select (pkg-config)) ((gnu packages serialization) #:select (libyaml)) ((gnu packages tls) #:select (openssl)) ((gnu packages web) #:select (http-parser jansson json-c)) (guix download) (guix build-system gnu) (guix gexp) (guix git-download) ((guix licenses) #:prefix license:) (guix packages) (guix utils)) (define-public libjwt (package (name "libjwt") (version "1.17.1") (source (origin (method url-fetch) (uri (string-append "https://github.com/benmcollins/libjwt/releases/download/v" version "/libjwt-" version ".tar.bz2")) (sha256 (base32 "0wkdl2qnic2by0j8bj1n90m2hrzlxjm913gf19syxq655z6zzf0x")))) (build-system gnu-build-system) (inputs (list jansson openssl)) (native-inputs (list check pkg-config)) (home-page "https://github.com/benmcollins/libjwt") (synopsis "C JWT library") (description "@code{libjwt} is a JWT library for C.") (license license:mpl2.0))) (define slurm (package (inherit guix:slurm) (arguments (substitute-keyword-arguments (package-arguments guix:slurm) ((#:configure-flags flags #~'()) #~(cons* "--enable-slurmrestd" (string-append "--with-http-parser=" #$(this-package-input "http-parser")) (string-append "--with-rdkafka=" #$(this-package-input "librdkafka")) (string-append "--with-yaml=" #$(this-package-input "libyaml")) (string-append "--with-bpf=" #$(this-package-input "linux-libre-headers")) "--sysconfdir=/etc" #$flags)) ((#:phases phases #~%standard-phases) #~(modify-phases #$phases (add-after 'install 'install-systemd-service-files (lambda _ (for-each (lambda (file) (install-file file (string-append #$output "/etc"))) (list "etc/slurmrestd.service" "etc/slurmdbd.service" "etc/slurmd.service" "etc/slurmctld.service")) (substitute* (string-append #$output "/etc/slurmrestd.service") ;; Set user and group to run slurmrestd as. (("# User=") "User=slurmrestd") (("# Group=") "Group=slurmrestd") ;; Disable listening on Unix socket by default. ((" unix:[^ ]*") "")))))))) (inputs (modify-inputs (package-inputs guix:slurm) (prepend dbus http-parser json-c libjwt librdkafka libyaml linux-libre-headers (list mariadb "dev")))))) slurm