aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-01-16 19:21:02 +0000
committerChristopher Baines <mail@cbaines.net>2021-01-16 19:21:02 +0000
commitbc2c821b6f0456b8812dd15e1dbbfa22d2813d92 (patch)
treeb6eb340491353c34304741077f1dcdf0e876e5ce
parent7b34a18f4e1bb2ddbd72ccd465294acc6b3d1ab2 (diff)
downloadbuild-coordinator-bc2c821b6f0456b8812dd15e1dbbfa22d2813d92.tar
build-coordinator-bc2c821b6f0456b8812dd15e1dbbfa22d2813d92.tar.gz
Allow agents to skip submitting build outputs
If the coordinator isn't going to use the outputs, because they've already been built for example, then save some time by not processing and submitting them. This will probably need to get more configurable on the coordinator side in the future.
-rw-r--r--guix-build-coordinator/agent.scm49
1 files changed, 32 insertions, 17 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm
index 8c038ab..cdacdaa 100644
--- a/guix-build-coordinator/agent.scm
+++ b/guix-build-coordinator/agent.scm
@@ -98,7 +98,10 @@
(define (process-job build)
(let ((build-id (assoc-ref build "uuid"))
(derivation-name (or (assoc-ref build "derivation_name")
- (assoc-ref build "derivation-name"))))
+ (assoc-ref build "derivation-name")))
+ (submit-outputs? (match (assoc build "submit_outputs")
+ ((_ . val) val)
+ (#f #t)))) ; default to submitting outputs
(log-msg lgr 'INFO
build-id
": setting up to build: "
@@ -134,14 +137,18 @@
coordinator-interface
build-id derivation-name)
- ((if result
- post-build-success
- post-build-failure)
- lgr
- coordinator-interface
- build-id
- derivation-name
- end-time)))
+ (if result
+ (post-build-success lgr
+ coordinator-interface
+ build-id
+ derivation-name
+ end-time
+ submit-outputs?)
+ (post-build-failure lgr
+ coordinator-interface
+ build-id
+ derivation-name
+ end-time))))
(begin
(log-msg lgr 'INFO
build-id
@@ -561,7 +568,8 @@ but the guix-daemon claims it's unavailable"
#:unwind? #t))
(define (post-build-success lgr coordinator-interface
- build-id derivation end-time)
+ build-id derivation end-time
+ submit-outputs?)
(define output-details
(map
(match-lambda
@@ -660,12 +668,19 @@ but the guix-daemon claims it's unavailable"
(derivation-output-path output)
#:log (build-log-procedure lgr build-id)))
- (log-msg lgr 'INFO build-id ": build successful, submitting outputs")
- (for-each (match-lambda
- ((output-name . output)
- (submit-one-output output-name output)))
- (derivation-outputs (read-derivation-from-file derivation)))
+ (if submit-outputs?
+ (begin
+ (log-msg lgr 'INFO build-id ": build successful, submitting outputs")
+ (for-each (match-lambda
+ ((output-name . output)
+ (submit-one-output output-name output)))
+ (derivation-outputs (read-derivation-from-file derivation)))
+ (log-msg lgr 'INFO build-id
+ ": finished submitting outputs, reporting build success"))
+ (begin
+ (log-msg lgr 'INFO build-id
+ ": build successful, skipping submitting outputs")
+ (log-msg lgr 'INFO build-id
+ ": reporting build success")))
- (log-msg lgr 'INFO
- build-id ": finished submitting outputs, reporting build success")
(attempt-submit-build-result))