diff options
author | Christopher Baines <mail@cbaines.net> | 2022-02-02 18:14:23 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-02-02 18:14:23 +0000 |
commit | 0f4507897b7c278a5afbf182d4b5c9ffdb65d2a4 (patch) | |
tree | bfdb9aeb60f027ae680eb4d9f2818ff28b64d797 | |
parent | 710baaeb68ca1084ef83a0be3ca7e717b29ea727 (diff) | |
download | build-coordinator-0f4507897b7c278a5afbf182d4b5c9ffdb65d2a4.tar build-coordinator-0f4507897b7c278a5afbf182d4b5c9ffdb65d2a4.tar.gz |
Move priority-for-derivation
So that it's easier to incorporate the options into this.
-rw-r--r-- | scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in | 35 |
1 files changed, 19 insertions, 16 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 9536fed..28c18b3 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 @@ -176,25 +176,11 @@ #:times 30 #:delay 30)) -(define (priority-for-derivation type system target) - (cond - ((eq? type 'channel-instance) - (if (and (string=? system "x86_64-linux") - (string=? target "none")) - 1000 - 500)) - ((eq? type 'package) - (if (and (string=? system "x86_64-linux") - (string=? target "none")) - 500 - 0)) - (else - 0))) - (define* (submit-builds-for-revision coordinator guix-data-service commit systems-and-targets + priority-for-derivation #:key (submit-builds-for-channel-instances? #t)) (simple-format #t "looking at revision ~A\n" commit) @@ -307,6 +293,21 @@ (processed-commits-file (assq-ref opts 'processed-commits-file))) + (define (priority-for-derivation type system target) + (cond + ((eq? type 'channel-instance) + (if (and (string=? system "x86_64-linux") + (string=? target "none")) + 1000 + 500)) + ((eq? type 'package) + (if (and (string=? system "x86_64-linux") + (string=? target "none")) + 500 + 0)) + (else + 0))) + (unless systems-and-targets (simple-format (current-error-port) "error: you must specify at least one system to fetch builds for\n") @@ -318,7 +319,8 @@ (submit-builds-for-revision (assq-ref opts 'coordinator) guix-data-service commit - systems-and-targets)) + systems-and-targets + priority-for-derivation)) arguments) (exit 0))) @@ -348,6 +350,7 @@ guix-data-service commit systems-and-targets + priority-for-derivation #:submit-builds-for-channel-instances? (assq-ref opts 'fetch-channel-instance-derivations)) (record-revision-as-processed processed-commits-file commit)) |