[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/04: hydra: bayfront: Pass nar requests through the nar-herder.
From: |
Christopher Baines |
Subject: |
04/04: hydra: bayfront: Pass nar requests through the nar-herder. |
Date: |
Fri, 22 Apr 2022 13:29:04 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository maintenance.
commit f72e1f2c51037a8353f73014a636263c36ca788d
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Fri Apr 22 18:28:25 2022 +0100
hydra: bayfront: Pass nar requests through the nar-herder.
This means the nar-herder can instrument the requests for nars. This
commit also exposes nar-herder metrics through NGinx.
* hydra/bayfront.scm (%bordeaux.guix.gnu.org-nginx-servers): Proxy
/nar requests to the nar-herder, and expose /metrics.
---
hydra/bayfront.scm | 34 +++++++++++++++++++++-------------
1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/hydra/bayfront.scm b/hydra/bayfront.scm
index bfa45c7..e0f65ba 100644
--- a/hydra/bayfront.scm
+++ b/hydra/bayfront.scm
@@ -595,21 +595,11 @@ add_header Content-Type text/plain;")))
(body '("proxy_pass http://nar-herder;")))
(nginx-location-configuration
(uri "/nar/")
- (body '("
- root /var/lib/nars;
-
- try_files $uri @nar-storage;
-
- error_page 404 /404;
-
- client_body_buffer_size 256k;
-
- # Nars are already compressed.
- gzip off;
-")))
+ (body '("proxy_pass http://nar-herder;")))
(nginx-named-location-configuration
(name "nar-storage")
- (body '("proxy_pass https://nar-storage;"
+ (body '("rewrite /internal/(.*) /$1 break;"
+ "proxy_pass https://nar-storage;"
"proxy_cache bordeaux-nar;"
"proxy_cache_valid 200 28d;"
"proxy_ignore_client_abort on;")))
@@ -619,10 +609,28 @@ add_header Content-Type text/plain;")))
(nginx-location-configuration
(uri "= /recent-changes")
(body '("proxy_pass http://nar-herder;")))
+ (nginx-location-configuration
+ (uri "= /metrics")
+ (body '("proxy_pass http://nar-herder;")))
(nginx-location-configuration
(uri "~ ^/internal/database/(.*)$")
(body '("internal;"
"alias /var/lib/nar-herder/$1;")))
+ (nginx-location-configuration
+ (uri "~ ^/internal/nar/(.*)$")
+ (body '("
+ internal;
+ root /var/lib/nars;
+
+ try_files /nar/$1 @nar-storage;
+
+ error_page 404 /404;
+
+ client_body_buffer_size 256k;
+
+ # Nars are already compressed.
+ gzip off;
+")))
(nginx-location-configuration
(uri "~ \"\\/build\\/([a-z0-9-]{36})$\"")
;; At some point a detailed page for each build would be