aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-02-08 13:35:35 +0000
committerChristopher Baines <mail@cbaines.net>2024-02-08 13:35:35 +0000
commit6e1da5700fc43b1e4f98bca2ed8518839cdb2173 (patch)
tree89fffabc9d10ed1272f3033fac464ff11a6dd201 /scripts
parentd9fa7947c25d0624c568f744ad2a2683a43e5644 (diff)
downloadbuild-coordinator-6e1da5700fc43b1e4f98bca2ed8518839cdb2173.tar
build-coordinator-6e1da5700fc43b1e4f98bca2ed8518839cdb2173.tar.gz
Expose information about setup failures
Diffstat (limited to 'scripts')
-rw-r--r--scripts/guix-build-coordinator.in38
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in
index 62b48e2..10970d7 100644
--- a/scripts/guix-build-coordinator.in
+++ b/scripts/guix-build-coordinator.in
@@ -156,6 +156,17 @@
(ensure-all-related-derivation-outputs-have-builds . #f)
(tags . ())))
+(define %setup-failure-options
+ (list
+ (option '("agent-id") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'agent-id
+ arg
+ (alist-delete 'agent-id result))))))
+
+(define %setup-failure-option-defaults
+ `((agent-id . #f)))
+
(define %common-build-filtering-options
(list
(option '("tag") #t #f
@@ -988,6 +999,33 @@ tags:
(assoc-ref
(request-agents-list (assq-ref opts 'coordinator))
"agents")))))
+ (("setup-failures" "list" rest ...)
+ (let ((opts (parse-options (append %client-options
+ %base-options
+ %setup-failure-options)
+ (append %client-option-defaults
+ %base-option-defaults
+ %setup-failure-option-defaults)
+ rest)))
+ (for-each
+ (match-lambda
+ ((build-id . setup-failures)
+ (for-each
+ (lambda (setup-failure)
+ (simple-format #t "~A:\n"
+ (assoc-ref setup-failure "id"))
+ (simple-format #t " build-id: ~A\n"
+ build-id)
+ (simple-format #t " agent-id: ~A\n"
+ (assoc-ref setup-failure "agent-id"))
+ (simple-format #t " failure-reason: ~A\n"
+ (assoc-ref setup-failure "failure-reason"))
+ (newline))
+ (vector->list setup-failures))))
+ (assoc-ref
+ (request-setup-failures (assq-ref opts 'coordinator)
+ #:agent-id (assq-ref opts 'agent-id))
+ "setup_failures"))))
(("dynamic-auth" "create-token")
(let ((opts (parse-options (append %client-options
%base-options)