[PATCH 0/3 maintenance] Web site at 10years.guix.gnu.org

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
Ludovic Courtès
Severity
normal
L
L
Ludovic Courtès wrote on 4 Jun 2022 10:36
(address . guix-patches@gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20220604083619.22101-1-ludo@gnu.org
Hello Guix!

These changes are about serving a web site for the 10-year event¹
at 10years.guix.gnu.org. If there are no objections, I'd like to
push it by Monday.

(The web site is being hacked on at

Thoughts?

Ludo’.


Ludovic Courtès (3):
hydra: dns: Add entry for '10years'.
hydra: bayfront: Serve the 10years.guix.gnu.org web site.
hydra: web: Make mcron job derivations deterministic.

hydra/bayfront.scm | 13 ++++++++++++-
hydra/modules/sysadmin/dns.scm | 4 +++-
hydra/modules/sysadmin/web.scm | 12 ++++++++++--
3 files changed, 25 insertions(+), 4 deletions(-)


base-commit: a0206512ec9309c6b69dd9aba8d2302925179a93
--
2.36.1
L
L
Ludovic Courtès wrote on 4 Jun 2022 10:37
[PATCH 1/3] hydra: dns: Add entry for '10years'.
(address . 55792@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20220604083736.22152-1-ludo@gnu.org
* hydra/modules/sysadmin/dns.scm (guix.gnu.org.zone): Add "10years".
(guix.gnu.org-zone): Bump 'serial'.
---
hydra/modules/sysadmin/dns.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (21 lines)
diff --git a/hydra/modules/sysadmin/dns.scm b/hydra/modules/sysadmin/dns.scm
index d0a7fd1..30e1563 100644
--- a/hydra/modules/sysadmin/dns.scm
+++ b/hydra/modules/sysadmin/dns.scm
@@ -123,6 +123,8 @@
"" "IN" "AAAA" bayfront-ip6)
("bordeaux" "" "IN" "A" bayfront-ip4)
("bordeaux" "" "IN" "AAAA" bayfront-ip6)
+ ("10years" "" "IN" "A" bayfront-ip4)
+ ("10years" "" "IN" "AAAA" bayfront-ip6)
;; This record is required in order to prove to Amazon ACM that we
;; own the domain. As long as it exists, ACM will automatically
@@ -137,4 +139,4 @@
(origin "guix.gnu.org")
(ns primary-ns)
(entries guix.gnu.org.zone)
- (serial 2022050712)))))
+ (serial 2022060411)))))
--
2.36.1
L
L
Ludovic Courtès wrote on 4 Jun 2022 10:37
[PATCH 3/3] hydra: web: Make mcron job derivations deterministic.
(address . 55792@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20220604083736.22152-3-ludo@gnu.org
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(-)

Toggle diff (28 lines)
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)))
--
2.36.1
L
L
Ludovic Courtès wrote on 4 Jun 2022 10:37
[PATCH 2/3] hydra: bayfront: Serve the 10years.guix.gnu.org web site.
(address . 55792@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20220604083736.22152-2-ludo@gnu.org
* hydra/bayfront.scm (ten-years-of-guix-web-site): New variable.
(services): Add instance via 'simple-service' call.
---
hydra/bayfront.scm | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

Toggle diff (38 lines)
diff --git a/hydra/bayfront.scm b/hydra/bayfront.scm
index e0f65ba..b5a1afc 100644
--- a/hydra/bayfront.scm
+++ b/hydra/bayfront.scm
@@ -1,5 +1,5 @@
;; OS configuration for bayfront
-;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;; Copyright © 2016-2022 Ludovic Courtès <ludo@gnu.org>
;; Copyright © 2016, 2017, 2018, 2019, 2020 Andreas Enge <andreas@enge.fr>
;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
@@ -94,6 +94,12 @@
(git-url "https://gitlab.inria.fr/guix-hpc/website.git")
(directory "/srv/guix-hpc-web")))
+(define ten-years-of-guix-web-site
+ (static-web-site-configuration
+ (git-url "https://gitlab.com/zimoun/website-guix-10years")
+ (directory "/srv/ten-years-of-guix")))
+
+
(define %motd
(plain-file "motd"
"\
@@ -949,6 +955,11 @@ access_log /var/log/nginx/bordeaux.access.log;"))
static-web-site-service-type
(list guix-hpc-web-site))
+ ;; Running 10years.guix.gnu.org.
+ (simple-service 'ten-years-of-guix-web-site
+ static-web-site-service-type
+ (list ten-years-of-guix-web-site))
+
;; hpcguix-web as it can be seen at
;; <https://hpc.guix.info/browse>.
(service hpcguix-web-service-type
--
2.36.1
T
T
Tobias Geerinckx-Rice wrote on 4 Jun 2022 23:13
Re: [bug#55792] [PATCH 0/3 maintenance] Web site at 10years.guix.gnu.org
(name . Ludovic Courtès)(address . ludo@gnu.org)
87o7z8cenx@nckx
Ludo',

SGTM!

Ludovic Courtès ???
Toggle quote (2 lines)
> hydra/modules/sysadmin/dns.scm | 4 +++-

(How) is this file actually used? The previous serial:

- (serial 2022050712)))))
+ (serial 2022060411)))))

is much newer than the one actually being served:

… SOA ns1.gnu.org. hostmaster.guix.gnu.org. 2021101415 …

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYpvLwg0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW157I0BAL6gunxHs7kUvkj4RSWI6ctFrhHgN3E99y8jqSQz
X63qAQDQCb9JEEpQtGTBvjg53rile0YjeqIDkUuFZlmTugDxDg==
=b6JQ
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 6 Jun 2022 15:03
Re: bug#55792: [PATCH 0/3 maintenance] Web site at 10years.guix.gnu.org
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87h74yc5ao.fsf_-_@gnu.org
Hi!

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

Toggle quote (2 lines)
> SGTM!

I noticed I forgot to add an nginx server block in the config, so I did
that and a few other things:

Toggle snippet (12 lines)
b0675b8 * hydra: bayfront: Use the right branch for 10years.guix.
1d9995d * hydra: bayfront: Fix 10years.guix domain name in nginx config.
437e42c * hydra: bayfront: Serve the 10years.guix.gnu.org web site.
b09cfc2 * hydra: dns: Add entry for '10years'.
67aa0a5 * hydra: bayfront: Factorize common TLS options.
fc7a6a5 * hydra: bayfront: Update fallback URL for hpc.guix.info/browse.
644dc8f * hydra: bayfront: Limit embedding of hpc.guix.info in frames.
c5aaa57 * hydra: bayfront: Add 'Strict-Transport-Security' for hpc.guix.info.
6c969b4 * hydra: Drop TLSv1 and enable TLSv1.3.
4a9a90c * hydra: web: Make mcron job derivations deterministic.

I’ve now reconfigure bayfront, from the same channel commit that ‘guix
system describe’ reported, and the 10years.guix.gnu.org entry works.

I have yet to create Let’s Encrypt certificates and set up HTTPS.

Toggle quote (12 lines)
> Ludovic Courtès ???
>> hydra/modules/sysadmin/dns.scm | 4 +++-
>
> (How) is this file actually used? The previous serial:
>
> - (serial 2022050712)))))
> + (serial 2022060411)))))
>
> is much newer than the one actually being served:
>
> … SOA ns1.gnu.org. hostmaster.guix.gnu.org. 2021101415 …

Yes, it’s most likely used. :-)

How d’you actually display the serial? Is that an option of ‘dig’?

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 6 Jun 2022 15:38
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87czfldi8u.fsf_-_@gnu.org
Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (2 lines)
> I have yet to create Let’s Encrypt certificates and set up HTTPS.

Done now!

Ludo’.
Closed
?