diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/guix-build-coordinator.in | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in index 328d5d5..02ae22d 100644 --- a/scripts/guix-build-coordinator.in +++ b/scripts/guix-build-coordinator.in @@ -25,6 +25,7 @@ (use-modules (srfi srfi-1) (srfi srfi-37) (ice-9 match) + (web uri) ((guix ui) #:select (read/eval)) (guix derivations) (guix-build-coordinator hooks) @@ -108,16 +109,11 @@ (alist-cons 'pid-file arg result))) - (option '("port") #t #f + (option '("agent-communication") #t #f (lambda (opt name arg result) - (alist-cons 'port - (string->number arg) - (alist-delete 'port result)))) - (option '("host") #t #f - (lambda (opt name arg result) - (alist-cons 'host + (alist-cons 'agent-communication arg - (alist-delete 'host result)))) + (alist-delete 'agent-communication result)))) (option '("allocation-strategy") #t #f (lambda (opt name arg result) (alist-cons @@ -152,8 +148,7 @@ (define %service-option-defaults ;; Alist of default option values - `((port . 8745) - (host . "0.0.0.0") + `((agent-communication . "http://0.0.0.0:8745") (allocation-strategy . ,basic-build-allocation-strategy) (build-success-hook . ,default-build-success-hook) (build-failure-hook . ,default-build-failure-hook) @@ -379,11 +374,16 @@ processed?: ~A (parameterize ((%show-error-details (assoc-ref opts 'show-error-details))) - (simple-format #t "listening on ~A:~A\n" - (assq-ref opts 'host) - (assq-ref opts 'port)) - (http-agent-messaging-start-server - (assq-ref opts 'port) - (assq-ref opts 'host) - (assq-ref opts 'secret-key-base) - build-coordinator))))) + (let ((agent-communication-uri + (string->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))) + (simple-format #t "listening on ~A:~A\n" + host port) + (http-agent-messaging-start-server + port + host + (assq-ref opts 'secret-key-base) + build-coordinator))))))))) |