aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-07-06 18:11:42 +0100
committerChristopher Baines <mail@cbaines.net>2022-07-06 18:15:07 +0100
commitcfd3f8d49aa16772b9b62cc24aff6c1e68b27f63 (patch)
tree28c3ea4dc31e265bad6964cf3f8072d803642eb6
parenta02a4542a6946052100862373da37e278e4a6b46 (diff)
downloadbuild-coordinator-cfd3f8d49aa16772b9b62cc24aff6c1e68b27f63.tar
build-coordinator-cfd3f8d49aa16772b9b62cc24aff6c1e68b27f63.tar.gz
Allow changing the agent parallel uploads
-rw-r--r--guix-build-coordinator/agent.scm7
-rw-r--r--scripts/guix-build-coordinator-agent.in13
2 files changed, 13 insertions, 7 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm
index ebd90fb..762a7e7 100644
--- a/guix-build-coordinator/agent.scm
+++ b/guix-build-coordinator/agent.scm
@@ -64,6 +64,7 @@
coordinator-interface
systems
max-parallel-builds
+ max-parallel-uploads
derivation-substitute-urls
non-derivation-substitute-urls
metrics-file
@@ -112,10 +113,8 @@
(write-textfile metrics-registry
metrics-file)))
- (define parallel-uploads
- 1)
(define upload-slots
- (make-vector parallel-uploads #f))
+ (make-vector max-parallel-uploads #f))
(define uploads-mutex
(make-mutex))
@@ -385,7 +384,7 @@
(let*-values (((perform-post-build-actions count-post-build-jobs
count-post-build-threads
list-post-build-jobs)
- (create-work-queue parallel-uploads
+ (create-work-queue max-parallel-uploads
(lambda (build thunk)
(thunk))
#:name "upload"))
diff --git a/scripts/guix-build-coordinator-agent.in b/scripts/guix-build-coordinator-agent.in
index 0ac36f9..7cfb449 100644
--- a/scripts/guix-build-coordinator-agent.in
+++ b/scripts/guix-build-coordinator-agent.in
@@ -72,6 +72,11 @@
(string-trim-right
(call-with-input-file arg get-string-all))
result)))
+ (option '("max-parallel-uploads") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'max-parallel-uploads
+ (string->number arg)
+ result)))
(option '("max-parallel-builds") #t #f
(lambda (opt name arg result)
(alist-cons 'max-parallel-builds
@@ -111,9 +116,10 @@
result)))))
(define %option-defaults
- `((coordinator . "http://localhost:8745")
- (max-parallel-builds . 1)
- (systems . (,guix-config:%system))
+ `((coordinator . "http://localhost:8745")
+ (max-parallel-builds . 1)
+ (max-parallel-uploads . 1)
+ (systems . (,guix-config:%system))
(metrics-file
. "/var/lib/prometheus/node-exporter/guix-build-coordinator-agent.prom")
(max-1min-load-average
@@ -175,6 +181,7 @@
coordinator-interface
(delete-duplicates (assq-ref opts 'systems))
(assq-ref opts 'max-parallel-builds)
+ (assq-ref opts 'max-parallel-uploads)
(or (assq-ref opts 'derivation-substitute-urls)
(assq-ref opts 'substitute-urls))
(or (assq-ref opts 'non-derivation-substitute-urls)