aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-07-05 22:29:02 +0100
committerChristopher Baines <mail@cbaines.net>2022-07-05 22:29:02 +0100
commita02a4542a6946052100862373da37e278e4a6b46 (patch)
treee05c3aacdedb46b9bce43fc67c18d3e03da829f9
parent2856e296a2d1dd5fc67ef41a94b8e84dfb4853fa (diff)
downloadbuild-coordinator-a02a4542a6946052100862373da37e278e4a6b46.tar
build-coordinator-a02a4542a6946052100862373da37e278e4a6b46.tar.gz
Move getting output details soon after the outputs are generated
Like compressing the outputs, it's worth doing this sooner rather than later.
-rw-r--r--guix-build-coordinator/agent.scm43
1 files changed, 26 insertions, 17 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm
index c1005ee..ebd90fb 100644
--- a/guix-build-coordinator/agent.scm
+++ b/guix-build-coordinator/agent.scm
@@ -260,6 +260,25 @@
(cons output-name template))))
outputs)))
+ (define (get-output-details outputs)
+ (map
+ (match-lambda
+ ((output-name . output)
+ (let ((path-info
+ (with-store store
+ (query-path-info
+ store
+ (derivation-output-path output)))))
+ `((name . ,output-name)
+ (hash . ,(bytevector->nix-base32-string
+ (path-info-hash path-info)))
+ (size . ,(path-info-nar-size path-info))
+ (references . ,(list->vector
+ (map basename
+ (path-info-references
+ path-info))))))))
+ outputs))
+
(log-msg lgr 'INFO
build-id
": setting up to build: "
@@ -291,6 +310,11 @@
(result (perform-build lgr store build-id derivation-name))
;; TODO Check this handles timezones right
(end-time (localtime (time-second (current-time)) "UTC"))
+ (output-details
+ (if result
+ (get-output-details
+ (derivation-outputs derivation))
+ #f))
(compressed-outputs
(and result submit-outputs?
(get-compressed-outputs store))))
@@ -309,6 +333,7 @@
derivation
end-time
submit-outputs?
+ output-details
compressed-outputs
with-upload-monitoring)
(post-build-failure lgr
@@ -834,28 +859,12 @@ but the guix-daemon claims it's unavailable"
(define (post-build-success lgr coordinator-interface
build-id derivation end-time
submit-outputs?
+ output-details
compressed-outputs
with-upload-monitoring)
(define outputs
(derivation-outputs derivation))
- (define output-details
- (map
- (match-lambda
- ((output-name . output)
- (let ((path-info (with-store store
- (query-path-info
- store
- (derivation-output-path output)))))
- `((name . ,output-name)
- (hash . ,(bytevector->nix-base32-string
- (path-info-hash path-info)))
- (size . ,(path-info-nar-size path-info))
- (references . ,(list->vector
- (map basename
- (path-info-references path-info))))))))
- outputs))
-
(define (attempt-submit-build-result)
(with-exception-handler
(lambda (exn)