aboutsummaryrefslogtreecommitdiff
path: root/scripts/guix-build-coordinator.in
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-12-27 09:11:03 +0000
committerChristopher Baines <mail@cbaines.net>2020-12-27 09:12:46 +0000
commitc76821f570cfb8702e345859f827b06b28fc9b43 (patch)
tree0f4941ae4d1643e00b124e9caa1b603415594737 /scripts/guix-build-coordinator.in
parent0535368864fa0d8e17ce9ee97ebb98dc67517af2 (diff)
downloadbuild-coordinator-c76821f570cfb8702e345859f827b06b28fc9b43.tar
build-coordinator-c76821f570cfb8702e345859f827b06b28fc9b43.tar.gz
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.
Diffstat (limited to 'scripts/guix-build-coordinator.in')
-rw-r--r--scripts/guix-build-coordinator.in11
1 files changed, 9 insertions, 2 deletions
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