aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-05-08 17:30:53 +0100
committerChristopher Baines <mail@cbaines.net>2020-05-08 17:30:53 +0100
commit22e9f7026a98789970a6c2fae62e3b777254e195 (patch)
tree9c6c82cd8b007cfea042d3c198374aff99a8b09a /guix-build-coordinator
parentfe4af6717d87351324afb1fabf5c03f36a981129 (diff)
downloadbuild-coordinator-22e9f7026a98789970a6c2fae62e3b777254e195.tar
build-coordinator-22e9f7026a98789970a6c2fae62e3b777254e195.tar.gz
Make the allocation strategy part of the build-coordinator record
Diffstat (limited to 'guix-build-coordinator')
-rw-r--r--guix-build-coordinator/coordinator.scm20
1 files changed, 13 insertions, 7 deletions
diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm
index 5bef0c3..9fa2ca7 100644
--- a/guix-build-coordinator/coordinator.scm
+++ b/guix-build-coordinator/coordinator.scm
@@ -38,6 +38,7 @@
build-coordinator-datastore
build-coordinator-hooks
build-coordinator-metrics-registry
+ build-coordinator-allocation-strategy
submit-build
new-agent
@@ -53,18 +54,23 @@
handle-setup-failure-report))
(define-record-type <build-coordinator>
- (make-build-coordinator-record datastore hooks metrics-registry)
+ (make-build-coordinator-record datastore hooks metrics-registry
+ allocation-strategy)
build-coordinator?
- (datastore build-coordinator-datastore)
- (hooks build-coordinator-hooks)
- (metrics-registry build-coordinator-metrics-registry))
+ (datastore build-coordinator-datastore)
+ (hooks build-coordinator-hooks)
+ (metrics-registry build-coordinator-metrics-registry)
+ (allocation-strategy build-coordinator-allocation-strategy))
(define* (make-build-coordinator #:key datastore hooks
- (metrics-registry (make-metrics-registry)))
+ (metrics-registry (make-metrics-registry))
+ (allocation-strategy
+ basic-build-allocation-strategy))
(make-build-coordinator-record
datastore
hooks
- metrics-registry))
+ metrics-registry
+ allocation-strategy))
(define* (submit-build build-coordinator derivation
#:key
@@ -134,7 +140,7 @@
(datastore-replace-build-allocation-plan
datastore
- (basic-build-allocation-strategy datastore))
+ ((build-coordinator-allocation-strategy build-coordinator) datastore))
#t)
(define (make-build-allocator-thread build-coordinator)