guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: hydra: build-machines: Add configuration for new build nodes.


From: Ricardo Wurmus
Subject: 01/01: hydra: build-machines: Add configuration for new build nodes.
Date: Fri, 20 Dec 2019 14:04:44 -0500 (EST)

rekado pushed a commit to branch master
in repository maintenance.

commit 16dd24187aaf69364d3b3199cd74ed4b7f4b36be
Author: Ricardo Wurmus <address@hidden>
Date:   Fri Dec 20 20:02:46 2019 +0100

    hydra: build-machines: Add configuration for new build nodes.
    
    * hydra/modules/sysadmin/build-machines.scm (berlin-new-build-machine-os):
    New procedure.
---
 hydra/modules/sysadmin/build-machines.scm | 108 +++++++++++++++++++++++++++++-
 1 file changed, 107 insertions(+), 1 deletion(-)

diff --git a/hydra/modules/sysadmin/build-machines.scm 
b/hydra/modules/sysadmin/build-machines.scm
index 3849ccf..d4cea59 100644
--- a/hydra/modules/sysadmin/build-machines.scm
+++ b/hydra/modules/sysadmin/build-machines.scm
@@ -30,7 +30,8 @@
   #:use-module (sysadmin people)
   #:use-module (gnu packages ssh)
   #:export (build-machine-os
-            berlin-build-machine-os))
+            berlin-build-machine-os
+            berlin-new-build-machine-os))
 
 ;;; Commentary:
 ;;;
@@ -174,4 +175,109 @@ Match Address 141.80.167.131
                                                (authorized-keys
                                                 authorized-guix-keys)))))))))
 
+(define* (berlin-new-build-machine-os id
+                                      #:key
+                                      (authorized-guix-keys '())
+                                      (emulated-architectures '()))
+  "Return the <operating-system> declaration for a build machine for
+berlin.guixsd.org with integer ID, with the given
+AUTHORIZED-GUIX-KEYS.  Add a 'qemu-binfmt-service' for
+EMULATED-ARCHITECTURES, unless it's empty."
+
+  (define gc-job
+    ;; Run 'guix gc' at 3AM and 3PM every day.
+    #~(job '(next-hour '(3 15))
+           "guix gc -F 90G"))
+
+  (define sysadmins
+    (list (sysadmin (name "ludo")
+                    (full-name "Ludovic Court├Ęs")
+                    (ssh-public-key (local-file "../../keys/ssh/ludo.pub")))
+          (sysadmin (name "rekado")
+                    (full-name "Ricardo Wurmus")
+                    (ssh-public-key (local-file "../../keys/ssh/rekado.pub")))
+          (sysadmin (name "hydra")      ;fake sysadmin
+                    (full-name "Hydra User")
+                    (restricted? #t)
+                    (ssh-public-key
+                     (local-file "../../keys/ssh/hydra.gnu.org.pub")))))
+  (operating-system
+    (host-name (format #f "hydra-guix-~3,'0d" id))
+    (timezone "Europe/Berlin")
+    (locale "en_US.utf8")
+    (kernel-arguments '("console=tty0" "console=ttyS1,9600n8"))
+    (keyboard-layout
+     (keyboard-layout "us" "altgr-intl"))
+    (bootloader
+     (bootloader-configuration
+      (bootloader grub-efi-bootloader)
+      (target "/boot/efi")
+      (keyboard-layout keyboard-layout)
+      (terminal-inputs '(serial))
+      (terminal-outputs '(serial))))
+    (initrd-modules (append (list "megaraid_sas")
+                            %base-initrd-modules))
+    (hosts-file
+     (plain-file "hosts"
+                 (string-append "127.0.0.1 localhost " host-name "\n"
+                                "::1       localhost " host-name "\n"
+                                "141.80.167.131 ci.guix.gnu.org\n")))
+    (swap-devices (list "/dev/sda2"))
+    (file-systems
+     (cons* (file-system
+              (mount-point "/boot/efi")
+              (device "/dev/sda1")
+              (type "vfat"))
+            (file-system
+              (mount-point "/")
+              (device (file-system-label "my-root"))
+              (type "ext4"))
+            %base-file-systems))
+    (packages (cons* openssh %base-packages))
+    (services
+     (cons* (simple-service 'guile-load-path-in-global-env
+                            session-environment-service-type
+                            `(("GUILE_LOAD_PATH"
+                               . 
"/run/current-system/profile/share/guile/site/2.2")
+                              ("GUILE_LOAD_COMPILED_PATH"
+                               . ,(string-append 
"/run/current-system/profile/lib/guile/2.2/site-ccache:"
+                                                 
"/run/current-system/profile/share/guile/site/2.2"))))
+            (agetty-service (agetty-configuration
+                             (tty "ttyS1")
+                             (baud-rate "9600")))
+            (service dhcp-client-service-type)
+            (service zabbix-agent-service-type
+                     (zabbix-agent-configuration
+                      (server '("141.80.167.131"))
+                      (server-active '("141.80.167.131"))))
+            (service mcron-service-type
+                     (mcron-configuration
+                      (jobs (list gc-job))))
+            (service ntp-service-type
+                     (ntp-configuration
+                      (allow-large-adjustment? #t)))
+            (service sysadmin-service-type sysadmins)
+            (service openssh-service-type
+                     (openssh-configuration
+                      (extra-content "\
+Match Address 141.80.167.131
+  PermitRootLogin yes")))
+
+            `(,@(if (null? emulated-architectures)
+                    '()
+                    (list (service qemu-binfmt-service-type
+                                   (qemu-binfmt-configuration
+                                    (platforms
+                                     (apply lookup-qemu-platforms
+                                            emulated-architectures))
+                                    (guix-support? #t)))))
+
+              ,@(modify-services %base-services
+                  (guix-service-type config =>
+                                     (guix-configuration
+                                      (inherit config)
+                                      (use-substitutes? #f)
+                                      (authorized-keys
+                                       authorized-guix-keys)))))))))
+
 ;;; build-machines.scm end here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]