[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/08: hydra: web: Make mcron job derivations deterministic.
From: |
Ludovic Courtès |
Subject: |
01/08: hydra: web: Make mcron job derivations deterministic. |
Date: |
Mon, 6 Jun 2022 06:07:17 -0400 (EDT) |
civodul pushed a commit to branch master
in repository maintenance.
commit 4a9a90c587b22500aaf48d18b2acbe6e8337ce4f
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Jun 4 10:27:51 2022 +0200
hydra: web: Make mcron job derivations deterministic.
The result of (hash config period) varies between runs. Thus, starting
from bdb914a1242cb0c00957050c96d1e279d2eb5dec, each run of "guix system
build -d ..." would produce a different derivation.
This commit fixes that.
* hydra/modules/sysadmin/web.scm (static-web-site-mcron-jobs)[record->list]:
New procedure.
Use it.
---
hydra/modules/sysadmin/web.scm | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/hydra/modules/sysadmin/web.scm b/hydra/modules/sysadmin/web.scm
index e04ac1b..f26ed24 100644
--- a/hydra/modules/sysadmin/web.scm
+++ b/hydra/modules/sysadmin/web.scm
@@ -179,11 +179,19 @@ that's built with Haunt or similar."
(basename
(static-web-site-configuration-directory
config)))))
+ (define (record->list record)
+ (let ((fields (record-type-fields <static-web-site-configuration>)))
+ (map (lambda (n)
+ (struct-ref record n))
+ (iota (length fields)))))
+
(map (lambda (config)
;; Add an offset to spread web site updates over the period to avoid
I/O
- ;; load peaks when there are several such jobs.
+ ;; load peaks when there are several such jobs. Compute a hash over
+ ;; a list representation of CONFIG, rather than over CONFIG, because
+ ;; hash of a struct depends on the object identity of its vtable.
(let* ((period (static-web-site-configuration-period config))
- (offset (hash config period)))
+ (offset (hash (record->list config) period)))
#~(job (lambda (now)
(let ((elapsed (modulo now #$period)))
(+ now (- #$period elapsed) #$offset)))
- branch master updated (a020651 -> 437e42c), Ludovic Courtès, 2022/06/06
- 03/08: hydra: bayfront: Add 'Strict-Transport-Security' for hpc.guix.info., Ludovic Courtès, 2022/06/06
- 02/08: hydra: Drop TLSv1 and enable TLSv1.3., Ludovic Courtès, 2022/06/06
- 06/08: hydra: bayfront: Factorize common TLS options., Ludovic Courtès, 2022/06/06
- 05/08: hydra: bayfront: Update fallback URL for hpc.guix.info/browse., Ludovic Courtès, 2022/06/06
- 08/08: hydra: bayfront: Serve the 10years.guix.gnu.org web site., Ludovic Courtès, 2022/06/06
- 04/08: hydra: bayfront: Limit embedding of hpc.guix.info in frames., Ludovic Courtès, 2022/06/06
- 01/08: hydra: web: Make mcron job derivations deterministic.,
Ludovic Courtès <=
- 07/08: hydra: dns: Add entry for '10years'., Ludovic Courtès, 2022/06/06