From c76821f570cfb8702e345859f827b06b28fc9b43 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 27 Dec 2020 09:11:03 +0000 Subject: Implement deferring builds This isn't intended as some time based scheduling, but more as a way to slow down builds by deferring processing them until some point in the future. I'm intending to use this to test fixed output derivations. I can look up all the derivations I want to test, then defer the builds to run spread out across some period. This feature saves having to submit the builds gradually. --- scripts/guix-build-coordinator.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'scripts/guix-build-coordinator.in') diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in index 7bb0593..da63025 100644 --- a/scripts/guix-build-coordinator.in +++ b/scripts/guix-build-coordinator.in @@ -26,6 +26,7 @@ (setvbuf (current-error-port) 'line) (use-modules (srfi srfi-1) + (srfi srfi-19) (srfi srfi-37) (ice-9 match) (web uri) @@ -116,7 +117,12 @@ ((key value) (cons key value))) (or (assq-ref result 'tags) '())) - (alist-delete 'tags result)))))) + (alist-delete 'tags result)))) + (option '("defer-until") #t #f + (lambda (opt name arg result) + (alist-cons 'defer-until + (string->date arg "~Y-~m-~d ~H:~M:~S") + result))))) (define %build-option-defaults `((priority . 0) @@ -508,7 +514,8 @@ tags: (assq-ref opts 'ignore-if-build-for-outputs-exists) (assq-ref opts 'ensure-all-related-derivation-outputs-have-builds) - (assq-ref opts 'tags)))) + (assq-ref opts 'tags) + #:defer-until (assq-ref opts 'defer-until)))) (let ((no-build-submitted-response (assoc-ref response "no-build-submitted"))) (if no-build-submitted-response -- cgit v1.2.3