From d081b41d2ec2cb072e26a9e214705c9a004ba53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 11 Jan 2025 19:18:01 +0100 Subject: [PATCH] =?UTF-8?q?services:=20cuirass:=20Add=20=E2=80=98build-exp?= =?UTF-8?q?iry=E2=80=99=20field.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/cuirass.scm ()[build-expiry]: New field. (cuirass-shepherd-service): Honor it. * doc/guix.texi (Continuous Integration): Document it. Change-Id: I1f9e21368437fd8fc236719e32bad7656928c926 --- doc/guix.texi | 4 ++++ gnu/services/cuirass.scm | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index caebe3b03c..42381a7b39 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35285,6 +35285,10 @@ Cuirass jobs. @item @code{ttl} (default: @code{2592000}) Duration to keep build results' GC roots alive, in seconds. +@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. diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm index cc5cd62672..2165059fd2 100644 --- a/gnu/services/cuirass.scm +++ b/gnu/services/cuirass.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Mathieu Lirzin -;;; Copyright © 2016-2024 Ludovic Courtès +;;; Copyright © 2016-2025 Ludovic Courtès ;;; Copyright © 2017, 2020 Mathieu Othacehe ;;; Copyright © 2017 Jan Nieuwenhuizen ;;; Copyright © 2018, 2019 Ricardo Wurmus @@ -103,6 +103,8 @@ (define-record-type* (default 60)) (ttl cuirass-configuration-ttl ;integer (default 2592000)) + (build-expiry cuirass-configuration-build-expiry + (default (* 4 30 24 3600))) ;integer(seconds) (threads cuirass-configuration-threads ;integer (default #f)) (parameters cuirass-configuration-parameters ;string @@ -136,6 +138,7 @@ (define (cuirass-shepherd-service config) (group (cuirass-configuration-group config)) (interval (cuirass-configuration-interval config)) (ttl (cuirass-configuration-ttl config)) + (build-expiry (cuirass-configuration-build-expiry config)) (threads (cuirass-configuration-threads config)) (parameters (cuirass-configuration-parameters config)) (remote-server (cuirass-configuration-remote-server config)) @@ -168,6 +171,12 @@ (define (cuirass-shepherd-service config) (number->string ttl) "s")) '()) + #$@(if build-expiry + (list (string-append + "--build-expiry=" + (number->string build-expiry) + "s")) + '()) #$@(if threads (list (string-append "--threads="