aboutsummaryrefslogtreecommitdiff
path: root/slurm.scm
blob: 83f40325fe275f9fd4367d6fcd7435bde6b29718 (plain)
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
76
77
78
79
80
81
82
83
84
85
;;
;; 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