From 76d129dc19cc0e14441ae3a74bbc44e3be570b21 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 8 Oct 2021 21:02:33 +0100 Subject: Support queuing builds in parallel At least by system+target, as this can help when you're queuing builds for a bunch of systems and targets. --- ...rdinator-queue-builds-from-guix-data-service.in | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in b/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in index 0adb64c..9536fed 100644 --- a/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in +++ b/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in @@ -29,6 +29,7 @@ (srfi srfi-11) (srfi srfi-37) (ice-9 match) + (ice-9 threads) (ice-9 textual-ports) (rnrs bytevectors) (json) @@ -142,11 +143,12 @@ (assoc-ref data "derivations"))))) (define (record-derivations-as-processed derivations) - (for-each (lambda (derivation) - (hash-set! processed-derivations-hash - derivation - #t)) - derivations)) + (monitor + (for-each (lambda (derivation) + (hash-set! processed-derivations-hash + derivation + #t)) + derivations))) (define* (submit-build coordinator guix-data-service derivation #:key (priority 0)) (retry-on-error @@ -196,7 +198,7 @@ #:key (submit-builds-for-channel-instances? #t)) (simple-format #t "looking at revision ~A\n" commit) - (for-each + (par-for-each (match-lambda ((system . target) (when (string=? target "none") @@ -216,10 +218,13 @@ (let ((unprocessed-package-derivations (filter (lambda (derivation) (not (hash-ref processed-derivations-hash derivation))) - (package-derivations-for-commit guix-data-service - commit - #:system system - #:target target)))) + ;; Only request derivations in one thread at a time, just + ;; in cause doing this in parallel could lead to timeouts + (monitor + (package-derivations-for-commit guix-data-service + commit + #:system system + #:target target))))) (for-each (lambda (derivation) (submit-build coordinator -- cgit v1.2.3