From d6edfc8f8f474ccb1c200f2135384646f11c8fb5 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 12 Jan 2024 14:55:30 +0000 Subject: Add more options when updating build priorities Computing new derived priorities is slow, so these options allow skipping that if you know what you're doing. For example, if you're updating a batch of related builds and you want them all to have the same priorities and derived priorities, you can now do that much quicker. --- scripts/guix-build-coordinator.in | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in index 4ceace0..23a356f 100644 --- a/scripts/guix-build-coordinator.in +++ b/scripts/guix-build-coordinator.in @@ -40,6 +40,7 @@ (srfi srfi-71) (ice-9 match) (ice-9 streams) + (ice-9 exceptions) (ice-9 suspendable-ports) (web uri) (fibers) @@ -313,6 +314,16 @@ (alist-cons 'new-priority (string->number arg) (alist-delete 'new-priority result)))) + (option '("override-derived-priority") #t #f + (lambda (opt name arg result) + (alist-cons 'override-derived-priority + (string->number arg) + (alist-delete 'override-derived-priority result)))) + (option '("skip-updating-derived-priorities") #f #f + (lambda (opt name _ result) + (alist-cons 'skip-updating-derived-priorities + #t + result))) %common-build-filtering-options)) (define %build-update-priority-option-defaults @@ -725,10 +736,20 @@ tags: (send-update-build-priority-request (assq-ref opts 'coordinator) id - (assq-ref opts 'new-priority)) + (assq-ref opts 'new-priority) + #:skip-updating-derived-priorities? + (assq-ref opts 'skip-updating-derived-priorities) + #:override-derived-priority + (assq-ref opts 'override-derived-priority)) (report)) #:times 6 - #:delay 5)) + #:delay 5 + #:ignore + (lambda (exn) + (member (assoc-ref (exception-message exn) + "error") + '("build-already-canceled" + "build-already-processed"))))) matching-builds))))) ((build-id) (send-update-build-priority-request (assq-ref opts 'coordinator) -- cgit v1.2.3