;;; Build Farm Front-End ;;; ;;; Copyright © 2023 Christopher Baines ;;; ;;; This program is free software: you can redistribute it and/or ;;; modify it under the terms of the GNU Affero General Public License ;;; as published by the Free Software Foundation, either version 3 of ;;; the License, or (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; Affero General Public License for more details. ;;; ;;; You should have received a copy of the GNU Affero General Public ;;; License along with this program. If not, see ;;; . (define-module (bffe) #:use-module (ice-9 format) #:use-module (oop goops) #:use-module (prometheus) #:use-module (logging logger) #:use-module (logging port-log) #:use-module (bffe server) #:use-module (bffe manage-builds) #:export (run-bffe-service)) (define* (run-bffe-service #:key (metrics-registry (make-metrics-registry #:namespace "bffe")) (build '()) web-server-args) (let ((lgr (make )) (port-log (make #:port (current-output-port) #:formatter (lambda (lvl time str) (format #f "~a (~5a): ~a~%" (strftime "%F %H:%M:%S" (localtime time)) lvl str))))) (add-handler! lgr port-log) (open-log! lgr) (set-default-logger! lgr) (for-each start-submit-builds-thread build) (apply start-bffe-web-server `(,@web-server-args #:metrics-registry ,metrics-registry))))