From d72eef9c918144bd892522722be71321d4a5ad97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 5 Sep 2025 17:18:18 +0200 Subject: [PATCH] services: cuirass: Add more configuration fields. * gnu/services/cuirass.scm ()[parallel-evaluations] [evaluation-ttl, web-threads]: New fields. (cuirass-shepherd-service): Honor them. * doc/guix.texi (Continuous Integration): Document them. Change-Id: I33485b978d2a37ee93230b1d425731e6cb3b80e4 --- doc/guix.texi | 14 +++++++++++++- gnu/services/cuirass.scm | 26 +++++++++++++++++++++++++- gnu/system/examples/bare-bones.tmpl | 14 ++++++++++---- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 625b6dd7faf234696efd912a38e53e70e01573ca..4ab404dcdb208d98cf6ed18e1a66de1a8c72a2a2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -37863,15 +37863,27 @@ Note that individual jobset specifications may override this in their @code{period} field; the value specified here is only used for specifications that use the default @code{period} value, which is zero. +@item @code{parallel-evaluations} (default: @code{#f}) +Maximum number of jobset evaluations that may run concurrently. If +@code{#f}, that number is determined based on a number of CPU cores, +with an upper bound of 8. + @item @code{ttl} (default: @code{2592000}) Duration to keep build results' GC roots alive, in seconds. +@item @code{evaluation-ttl} (default: 24 months) +Number of seconds after which an evaluation may be deleted from the +database. + @item @code{build-expiry} (default: 4 months) Duration in seconds after which pending builds are canceled. This helps ensure that the backlog does not grow indefinitely. @item @code{threads} (default: @code{#f}) -Number of kernel threads to use for Cuirass. The default value should be appropriate for most cases. +@itemx @code{web-threads} (default: @code{#f}) +Number of kernel threads to use for Cuirass (main process) and for the +web interface (the @command{cuirass web} program). The default value +should be appropriate for most cases. @item @code{parameters} (default: @code{#f}) Read parameters from the given @var{parameters} file. The supported diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm index 943d4cea2bca81577b620fc6915ef56c108925eb..27ff87ca56d0c74050ce14ab2fbb25e4bbb3da86 100644 --- a/gnu/services/cuirass.scm +++ b/gnu/services/cuirass.scm @@ -101,12 +101,18 @@ (default "cuirass")) (interval cuirass-configuration-interval ;integer (seconds) (default 300)) - (ttl cuirass-configuration-ttl ;integer + (parallel-evaluations cuirass-configuration-parallel-evaluations + (default #f)) ;integer | #f + (ttl cuirass-configuration-ttl ;integer (default 2592000)) + (evaluation-ttl cuirass-configuration-evaluation-ttl + (default (* 24 30 24 3600))) ;integer (seconds) (build-expiry cuirass-configuration-build-expiry (default (* 4 30 24 3600))) ;integer(seconds) (threads cuirass-configuration-threads ;integer (default #f)) + (web-threads cuirass-configuration-web-threads ;integer | #f + (default #f)) (parameters cuirass-configuration-parameters ;string (default #f)) (remote-server cuirass-configuration-remote-server @@ -145,9 +151,12 @@ (user (cuirass-configuration-user config)) (group (cuirass-configuration-group config)) (interval (cuirass-configuration-interval config)) + (parallel-evaluations (cuirass-configuration-parallel-evaluations config)) (ttl (cuirass-configuration-ttl config)) + (evaluation-ttl (cuirass-configuration-evaluation-ttl config)) (build-expiry (cuirass-configuration-build-expiry config)) (threads (cuirass-configuration-threads config)) + (web-threads (cuirass-configuration-web-threads config)) (parameters (cuirass-configuration-parameters config)) (remote-server (cuirass-configuration-remote-server config)) (database (cuirass-configuration-database config)) @@ -173,12 +182,23 @@ "--specifications" #$config-file "--database" #$database "--interval" #$(number->string interval) + #$@(if parallel-evaluations + (list (string-append + "--parallel-evaluations=" + (number->string evaluation-ttl))) + '()) #$@(if ttl (list (string-append "--ttl=" (number->string ttl) "s")) '()) + #$@(if evaluation-ttl + (list (string-append + "--evaluation-ttl=" + (number->string evaluation-ttl) + "s")) + '()) #$@(if build-expiry (list (string-append "--build-expiry=" @@ -232,6 +252,10 @@ "--database" #$database "--listen" #$host "--port" #$(number->string port) + #$@(if web-threads + (list #~(string-append "--threads=" + #$web-threads)) + '()) #$@(if parameters (list #~(string-append "--parameters=" #$parameters)) diff --git a/gnu/system/examples/bare-bones.tmpl b/gnu/system/examples/bare-bones.tmpl index 6493855a082b55618c987a29cb9780b99a58ca49..16ba12604d2e1b2dfadc990aa00ed7762ec5cecb 100644 --- a/gnu/system/examples/bare-bones.tmpl +++ b/gnu/system/examples/bare-bones.tmpl @@ -3,8 +3,8 @@ ;; for a "bare bones" setup, with no X11 display server. (use-modules (gnu)) -(use-service-modules networking ssh) -(use-package-modules screen ssh) +(use-service-modules cuirass networking ssh databases) +(use-package-modules databases screen ssh) (operating-system (host-name "komputilo") @@ -48,8 +48,14 @@ ;; Add services to the baseline: a DHCP client and an SSH ;; server. You may wish to add an NTP service here. (services (append (list (service dhcpcd-service-type) + (service cuirass-service-type + (cuirass-configuration + (specifications #~(list)))) + (service postgresql-service-type + (postgresql-configuration + (postgresql postgresql-14))) (service openssh-service-type (openssh-configuration - (openssh openssh-sans-x) - (port-number 2222)))) + (openssh openssh-sans-x) + (port-number 2222)))) %base-services)))