guix-commits
[Top][All Lists]
Advanced

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

branch master updated: hydra: lakeside: Configure as a proper mirror.


From: Christopher Baines
Subject: branch master updated: hydra: lakeside: Configure as a proper mirror.
Date: Thu, 28 Apr 2022 03:12:51 -0400

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

cbaines pushed a commit to branch master
in repository maintenance.

The following commit(s) were added to refs/heads/master by this push:
     new d2717b7  hydra: lakeside: Configure as a proper mirror.
d2717b7 is described below

commit d2717b7f07dcaab6c7ac97b19e8f33b2e8eaef16
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Thu Apr 28 08:03:54 2022 +0100

    hydra: lakeside: Configure as a proper mirror.
    
    Previously, requests for nars that hadn't been copied over yet from
    bayfront would have resulted in 404's. Now those requests are proxied
    to bordeaux.guix.gnu.org.
    
    * hydra/bayfront.scm (%nginx-server-blocks): Add a named
    nar-storage-location and use this as a fallback when nar's don't exist
    locally.
    <services>: Add a nar-storage upstream configuration and set a ttl for
    the nar-herder.
---
 hydra/lakeside.scm | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/hydra/lakeside.scm b/hydra/lakeside.scm
index dfb9247..7751d8a 100644
--- a/hydra/lakeside.scm
+++ b/hydra/lakeside.scm
@@ -27,6 +27,11 @@
           (nginx-location-configuration
            (uri "/nar/")
            (body '("proxy_pass http://nar-herder;";)))
+          (nginx-named-location-configuration
+           (name "nar-storage-location")
+           (body '("rewrite /internal/(.*) /$1 break;"
+                   "proxy_pass https://nar-storage;";
+                   "proxy_set_header Host bordeaux.guix.gnu.org:443;")))
           (nginx-location-configuration
            (uri "= /latest-database-dump")
            (body '("proxy_pass http://nar-herder;";)))
@@ -40,7 +45,9 @@
            (uri "~ ^/internal/nar/(.*)$")
            (body '("
     internal;
-    alias /var/lib/nars/nar/$1;
+    root /var/lib/nars;
+
+    try_files /nar/$1 @nar-storage-location;
 
     error_page 404 /404;
 
@@ -155,6 +162,7 @@ ssl_prefer_server_ciphers on;"))
              (nar-herder-configuration
               (mirror "https://bordeaux.guix.gnu.org";)
               (storage "/var/lib/nars")
+              (ttl "180d")
               (log-level 'INFO)))
 
     (service nginx-service-type
@@ -162,7 +170,10 @@ ssl_prefer_server_ciphers on;"))
               (upstream-blocks
                (list (nginx-upstream-configuration
                       (name "nar-herder")
-                      (servers '("localhost:8734")))))
+                      (servers '("localhost:8734")))
+                     (nginx-upstream-configuration
+                      (name "nar-storage")
+                      (servers '("bordeaux.guix.gnu.org:443")))))
               (server-blocks
                %nginx-server-blocks)))
 



reply via email to

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