aboutsummaryrefslogtreecommitdiff
path: root/scripts/guix-build-coordinator.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/guix-build-coordinator.in')
-rw-r--r--scripts/guix-build-coordinator.in60
1 files changed, 8 insertions, 52 deletions
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in
index 59341cc..1c4f673 100644
--- a/scripts/guix-build-coordinator.in
+++ b/scripts/guix-build-coordinator.in
@@ -37,7 +37,6 @@
(guix-build-coordinator datastore)
(guix-build-coordinator coordinator)
(guix-build-coordinator build-allocator)
- (guix-build-coordinator agent-messaging http)
(guix-build-coordinator client-communication))
(define %base-options
@@ -182,8 +181,8 @@
(define %service-option-defaults
;; Alist of default option values
- `((agent-communication . "http://0.0.0.0:8745")
- (client-communication . "http://127.0.0.1:8746")
+ `((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)
@@ -420,55 +419,12 @@ processed?: ~A
#:allocation-strategy
(assq-ref opts 'allocation-strategy))))
- (perform-coordinator-service-startup
- build-coordinator
- #:update-datastore? (assoc-ref opts 'update-database)
- #:pid-file (assq-ref opts 'pid-file))
-
(parameterize ((%show-error-details
(assoc-ref opts 'show-error-details)))
- ;; Create some worker thread channels, which need to be created prior
- ;; to run-fibers being called.
- (let ((chunked-request-channel
- ;; There are fibers issues when trying to read the chunked
- ;; requests, so do this in dedicated threads.
- (make-worker-thread-channel (const '())
- #:parallelism 8))
- (substitutes-channel
- (make-worker-thread-channel (const '())
- #:parallelism 2)))
-
- (let ((finished? (make-condition)))
- (call-with-sigint
- (lambda ()
- (run-fibers
- (lambda ()
- ;; Start the agent messaging server
- (let ((agent-communication-uri
- (assq-ref opts 'agent-communication)))
- (match (uri-scheme agent-communication-uri)
- ('http
- (let ((host (uri-host agent-communication-uri))
- (port (uri-port agent-communication-uri)))
- (http-agent-messaging-start-server
- port
- host
- (assq-ref opts 'secret-key-base)
- build-coordinator
- chunked-request-channel)
- (simple-format #t "listening on ~A:~A\n"
- host port)))))
-
- ;; Start the client messaging server
- (let ((client-communication-uri
- (assq-ref opts 'client-communication)))
- (start-client-request-server
- (assq-ref opts 'secret-key-base)
- (uri-host client-communication-uri)
- (uri-port client-communication-uri)
- build-coordinator
- substitutes-channel))
-
- (wait finished?))))
- finished?)))))))
+ (run-coordinator-service
+ build-coordinator
+ #:update-datastore? (assoc-ref opts 'update-database)
+ #:pid-file (assq-ref opts 'pid-file)
+ #:agent-communication-uri (assq-ref opts 'agent-communication)
+ #:client-communication-uri (assq-ref opts 'client-communication))))))