aboutsummaryrefslogtreecommitdiff
path: root/gn/deploy/octopus.scm
blob: 9d1e7d341c0defa180bd63a4c37e420bdd10de48 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
(define-module (gn deploy octopus))

(use-modules (gnu)
             (gn services science)
             (gn packages parallel))
(use-service-modules networking ssh web)
(use-package-modules certs tmux screen vim)

(define %slurm.conf
  (plain-file "slurm.conf"
              (string-append
"ClusterName=linux
ControlMachine=octopus

SlurmUser=slurm
#SlurmdUser=root
SlurmctldPort=6817
SlurmdPort=6818
AuthType=auth/munge
StateSaveLocation=/var/spool/slurmd/ctld
SlurmdSpoolDir=/var/spool/slurmd
SwitchType=switch/none
MpiDefault=none
SlurmctldPidFile=/var/run/slurm/slurmctld.pid
SlurmdPidFile=/var/run/slurm/slurmd.pid
ProctrackType=proctrack/pgid
ReturnToService=1

# TIMERS
InactiveLimit=0
MinJobAge=300
KillWait=30
#

# LOGGING
SlurmctldDebug=3
SlurmctldLogFile=/var/log/slurm/slurmctld.log
SlurmdDebug=3
SlurmdLogFile=/var/log/slurm/slurmd.log
JobCompType=jobcomp/none

# COMPUTE NODES
NodeName=octopus CPUs=1 Boards=1 SocketsPerBoard=1 CoresPerSocket=1 ThreadsPerCore=1 RealMemory=1024
PartitionName=debug Nodes=ALL Default=YES MaxTime=INFINITE State=UP")))

(define %cgroup.conf
  (plain-file "cgroup.conf"
              (string-append
"###
# Slurm cgroup support configuration file
###
CgroupAutomount=yes
ConstrainCores=yes
#")))

(define %slurmdbd.conf
  (plain-file "slurmdbd.conf"
              (string-append
"AuthType=auth/munge
AuthInfo=/var/run/munge/munge.socket.2
DbdHost=localhost
StorageHost=localhost
StorageType=accounting_storage/none
StorageUser=slurm
PidFile=/var/run/slurm/slurmdbd.pid
LogFile=/var/log/slurm/slurmdbd.log
SlurmUser=slurm")))

(operating-system
  (host-name "octopus")
  (timezone "Etc/UTC")
  (locale "en_US.utf8")

  (bootloader (bootloader-configuration
               (bootloader grub-bootloader)
               (target "/dev/sda")
               (terminal-outputs '(console serial))))
  (kernel-arguments '("console=tty1" "console=ttyS0,115200n8"))

  (file-systems
    (append (list
              (file-system
                (device "/dev/sda3")
                (mount-point "/")
                (type "ext4")
                (options "errors=remount-ro"))
              ;(file-system
              ;  (device "/dev/sdb1")
              ;  (mount-point "/mnt/sdb1")
              ;  (type "xfs")
              ;  (flags '(no-exec no-dev no-atime))
              ;  (options "rw,nodiratime,largeio,inode64")
              ;  (create-mount-point? #t))
              ;(file-system
              ;  (device "octopus01:/home")
              ;  (mount-point "/home")
              ;  (type "nfs")
              ;  (mount? #f)    ; is this necessary?
              ;  (check? #f))
              )
              %base-file-systems))

  (swap-devices '("/dev/sda2"))
  ;; No firmware needed
  (firmware '())

  (users (cons*
           (user-account
             (name "efraimf")
             (comment "Efraim Flashner")
             (uid 1000)
             (group "users")
             (supplementary-groups '("wheel" "kvm")))
           (user-account
             (name "wrk")
             (comment "Pjotr Prins")
             (uid 502)
             (group "users")
             (supplementary-groups '("wheel" "kvm")))
           %base-user-accounts))


  (packages (cons*
              nss-certs
              screen
              tmux
              vim
              %base-packages))

  (services
    (append (list
              ;; This conflicts with everything when testing in a VM.
              ;(agetty-service
              ;  (agetty-configuration
              ;    (extra-options '("-L"))
              ;    (baud-rate "115200")
              ;    (term "vt100")
              ;    (tty "ttyS0")))

              (service openssh-service-type
                       (openssh-configuration
                         (authorized-keys
                           `(("efraimf" ,(local-file "/home/efraimf/.ssh/id_rsa.pub"))))))

              (service munge-service-type)
              (service slurmd-service-type
                       (slurm-configuration
                         (package slurm-18.08)))
              (service slurmdbd-service-type
                       (slurm-configuration
                         (package slurm-18.08)
                         (run-slurmdbd? #t)))
              (service slurmctld-service-type
                       (slurm-configuration
                         (package slurm-18.08)
                         (run-slurmctld? #t)))

              ;; Some slurm configuration files
              (simple-service 'slurm-conf etc-service-type
                              `(("slurm/slurm.conf" ,%slurm.conf)
                                ("slurm/cgroup.conf" ,%cgroup.conf)
                                ("slurm/slurmdbd.conf" ,%slurmdbd.conf)))

              (service dhcp-client-service-type)
              (service openntpd-service-type))
            %base-services)))