[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/04: berlin: build-machines: Enable 'qemu-binfmt' on the first 10 mach
From: |
Ludovic Courtès |
Subject: |
04/04: berlin: build-machines: Enable 'qemu-binfmt' on the first 10 machines only. |
Date: |
Tue, 19 Nov 2019 06:28:14 -0500 (EST) |
civodul pushed a commit to branch master
in repository maintenance.
commit f2303c3a9aab11d70a45488bd51343aa2760ad16
Author: Ludovic Courtès <address@hidden>
Date: Tue Nov 19 12:24:54 2019 +0100
berlin: build-machines: Enable 'qemu-binfmt' on the first 10 machines only.
This matches what 'machines-for-berlin.scm' says.
* hydra/modules/sysadmin/build-machines.scm (berlin-build-machine-os):
Add #:emulated-architectures. Add 'qemu-binfmt-service' only when
EMULATED-ARCHITECTURES is non-empty.
* hydra/berlin-nodes.scm (system-for): Pass #:emulated-architectures to
'berlin-build-machine-os'.
---
hydra/berlin-nodes.scm | 9 ++++++--
hydra/modules/sysadmin/build-machines.scm | 35 +++++++++++++++++++------------
2 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/hydra/berlin-nodes.scm b/hydra/berlin-nodes.scm
index aa75e70..a17902f 100644
--- a/hydra/berlin-nodes.scm
+++ b/hydra/berlin-nodes.scm
@@ -2,7 +2,8 @@
;; farm hosted at the MDC, Berlin.
(use-modules (sysadmin build-machines)
- (sysadmin people))
+ (sysadmin people)
+ (srfi srfi-1))
(define %ids '(4 5 6 8 9 10 11 12 13 14 15
;;16 -> asks for root password
@@ -14,7 +15,11 @@
))
(define (system-for id)
- (berlin-build-machine-os id))
+ (berlin-build-machine-os id
+ #:emulated-architectures
+ (if (memv id (take %ids 10))
+ `("arm" "aarch64")
+ '())))
(define (id->ip id)
(format #f "141.80.167.~d" (+ 131 id)))
diff --git a/hydra/modules/sysadmin/build-machines.scm
b/hydra/modules/sysadmin/build-machines.scm
index 088c1ae..a0fea34 100644
--- a/hydra/modules/sysadmin/build-machines.scm
+++ b/hydra/modules/sysadmin/build-machines.scm
@@ -74,10 +74,13 @@ HOST-NAME and accessibly by SYSADMINS, with the given
AUTHORIZED-GUIX-KEYS."
authorized-guix-keys))))))))
(define* (berlin-build-machine-os id
- #:key (authorized-guix-keys '()))
+ #: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."
+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.
@@ -144,10 +147,6 @@ AUTHORIZED-GUIX-KEYS."
(service mcron-service-type
(mcron-configuration
(jobs (list gc-job))))
- (service qemu-binfmt-service-type
- (qemu-binfmt-configuration
- (platforms (lookup-qemu-platforms "arm"
"aarch64"))
- (guix-support? #t)))
(service ntp-service-type
(ntp-configuration
(allow-large-adjustment? #t)))
@@ -157,12 +156,22 @@ AUTHORIZED-GUIX-KEYS."
(extra-content "\
Match Address 141.80.167.131
PermitRootLogin yes")))
- (modify-services %base-services
- (guix-service-type config =>
- (guix-configuration
- (inherit config)
- (use-substitutes? #f)
- (authorized-keys
- authorized-guix-keys))))))))
+
+ `(,@(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