aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-09-17 10:41:11 +0100
committerChristopher Baines <mail@cbaines.net>2020-09-17 10:41:11 +0100
commitf7dbc0cb3ac572e4dabad88696550c4a19d0e1a5 (patch)
tree3c7445edeb5f917e458408969ac4b2dbfde73f59
parent6c9e59dd65fe97f48ed6ea451afd23bb29e6bdff (diff)
downloadbuild-coordinator-f7dbc0cb3ac572e4dabad88696550c4a19d0e1a5.tar
build-coordinator-f7dbc0cb3ac572e4dabad88696550c4a19d0e1a5.tar.gz
Better describe the default hooks
-rw-r--r--guix-build-coordinator/hooks.scm9
-rw-r--r--scripts/guix-build-coordinator.in14
2 files changed, 16 insertions, 7 deletions
diff --git a/guix-build-coordinator/hooks.scm b/guix-build-coordinator/hooks.scm
index 629372f..c99f291 100644
--- a/guix-build-coordinator/hooks.scm
+++ b/guix-build-coordinator/hooks.scm
@@ -39,6 +39,8 @@
build-failure-retry-hook
default-build-missing-inputs-hook
+ %default-hooks
+
build-submitted-send-event-to-guix-data-service-hook
build-started-send-event-to-guix-data-service-hook
build-success-send-event-to-guix-data-service-hook
@@ -261,6 +263,13 @@
missing-input)))))
missing-inputs))))
+(define %default-hooks
+ `((build-submitted . ,default-build-submitted-hook)
+ (build-started . ,default-build-started-hook)
+ (build-success . ,default-build-success-hook)
+ (build-failure . ,default-build-failure-hook)
+ (build-missing-inputs . ,default-build-missing-inputs-hook)))
+
(define (build-submitted-send-event-to-guix-data-service-hook target-url)
(lambda (build-coordinator build-id)
(define datastore
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in
index 346f289..72182b1 100644
--- a/scripts/guix-build-coordinator.in
+++ b/scripts/guix-build-coordinator.in
@@ -186,12 +186,7 @@
;; Alist of default option values
`((agent-communication . ,%default-agent-uri)
(client-communication . ,%default-client-uri)
- (allocation-strategy . ,basic-build-allocation-strategy)
- (build-submitted-hook . ,default-build-submitted-hook)
- (build-started-hook . ,default-build-started-hook)
- (build-success-hook . ,default-build-success-hook)
- (build-failure-hook . ,default-build-failure-hook)
- (build-missing-inputs-hook . ,default-build-missing-inputs-hook)))
+ (allocation-strategy . ,basic-build-allocation-strategy)))
(define %agent-options
(list (option '("uuid") #t #f
@@ -412,9 +407,14 @@ processed?: ~A
(build-success . ,(assq-ref opts 'build-success-hook))
(build-failure . ,(assq-ref opts 'build-failure-hook))
(build-missing-inputs . ,(assq-ref opts 'build-missing-inputs-hook))))
+ (hooks-with-defaults
+ `(,@(filter identity hooks)
+ ,@(remove (match-lambda
+ ((name . _) (assq-ref hooks name)))
+ %default-hooks)))
(build-coordinator (make-build-coordinator
#:datastore datastore
- #:hooks hooks
+ #:hooks hooks-with-defaults
#:metrics-registry metrics-registry
#:allocation-strategy
(assq-ref opts 'allocation-strategy))))