guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: hydra: berlin: Ensure we have 3 TiB free each day


From: Ludovic Courtès
Subject: branch master updated: hydra: berlin: Ensure we have 3 TiB free each day.
Date: Tue, 12 May 2020 15:55:13 -0400

This is an automated email from the git hooks/post-receive script.

civodul pushed a commit to branch master
in repository maintenance.

The following commit(s) were added to refs/heads/master by this push:
     new 4eca21f  hydra: berlin: Ensure we have 3 TiB free each day.
4eca21f is described below

commit 4eca21f4bd416b4bd051f8e32abb3152a1f4b06e
Author: Ludovic Courtès <address@hidden>
AuthorDate: Tue May 12 21:53:17 2020 +0200

    hydra: berlin: Ensure we have 3 TiB free each day.
    
    * hydra/modules/sysadmin/services.scm (%gc-jobs): Rename to...
    (gc-jobs): ... this, and add a 'threshold' parameter.
    (KiB, MiB, GiB, TiB): New variables.
    (frontend-services): Add #:gc-threshold and pass it to 'gc-jobs'.
    * hydra/berlin.scm (services): Pass #:gc-threshold.
---
 hydra/berlin.scm                    |  1 +
 hydra/modules/sysadmin/services.scm | 23 +++++++++++++++++------
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/hydra/berlin.scm b/hydra/berlin.scm
index 1cc1e4f..6f156ce 100644
--- a/hydra/berlin.scm
+++ b/hydra/berlin.scm
@@ -301,6 +301,7 @@ Happy hacking!\n"))
              (service redis-service-type)
 
              (frontend-services %sysadmins
+                                #:gc-threshold (* 3 TiB)
                                 #:systems '("x86_64-linux" "i686-linux"
                                             "aarch64-linux")
                                 #:motd %motd
diff --git a/hydra/modules/sysadmin/services.scm 
b/hydra/modules/sysadmin/services.scm
index 20c7f7c..81649fc 100644
--- a/hydra/modules/sysadmin/services.scm
+++ b/hydra/modules/sysadmin/services.scm
@@ -41,7 +41,8 @@
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 match)
   #:export (firewall-service
-            frontend-services))
+            frontend-services
+            KiB MiB GiB TiB))
 
 (define not-config?
   ;; Select (guix …) and (gnu …) modules, except (guix config).
@@ -157,17 +158,20 @@
                                       store (root-target root)))
                                    deleted))))))))
 
-(define %gc-jobs
-  ;; The garbage collection mcron jobs.
+(define (gc-jobs threshold)
+  "Return the garbage collection mcron jobs."
   (list #~(job '(next-hour '(3))
                #$cleanup-cuirass-roots)
 
         #~(job '(next-hour '(4))
-               (string-append #$guix "/bin/guix gc -F800G"))
+               (string-append #$guix "/bin/guix gc -F"
+                              #$(number->string threshold)))
 
         ;; Half a day later, make sure half of our quota is available.
         #~(job '(next-hour '(16))
-               (string-append #$guix "/bin/guix gc -F400G"))))
+               (string-append #$guix "/bin/guix gc -F"
+                              #$(number->string
+                                 (quotient threshold 2))))))
 
 (define* (guix-daemon-config #:key (max-jobs 5) (cores 4)
                              (build-accounts-to-max-jobs-ratio 4))
@@ -341,7 +345,13 @@
                     ,@(package-arguments guile-fibers)))))
       ,@(alist-delete "guile-fibers" (package-inputs cuirass))))))
 
+(define KiB (expt 2 10))
+(define MiB (* KiB KiB))
+(define GiB (* MiB KiB))
+(define TiB (* GiB KiB))
+
 (define* (frontend-services sysadmins #:key
+                            (gc-threshold (* 800 GiB))
                             nginx-config-file
                             (max-jobs 5)
                             (cores 4)
@@ -353,7 +363,8 @@
   "Return the list of services for the build farm frontend."
   (cons* (service mcron-service-type
                   (mcron-configuration
-                   (jobs (cons %certbot-job %gc-jobs))))
+                   (jobs (cons %certbot-job
+                               (gc-jobs gc-threshold)))))
 
          firewall-service
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]