@cryptotaxi247 / infra / commits / 71470d45

Use a NAR cache for hydra-server

Eelco Dolstra committed Oct 18, 2017 at 16:04 UTC 71470d45da774b86f1d05450c02c747370a0cab3
1 file changed +11 -1
delft/hydra.nix
+11 -1
@@ -5,6 +5,7 @@ with lib;
5 let
6 hydraSrc = ../../hydra;
7 hydra = (import (hydraSrc + "/release.nix") {}).build.x86_64-linux;
8 + narCache = "/var/cache/hydra/nar-cache";
9 in
10
11 {
@@ -33,7 +34,8 @@ in
34 enable_google_login = 1
35 google_client_id = 816926039128-ia4s4rsqrq998rsevce7i09mo6a4nffg.apps.googleusercontent.com
36
36 - store_uri = s3://nix-cache?secret-key=/var/lib/hydra/queue-runner/keys/cache.nixos.org-1/secret&write-nar-listing=1&ls-compression=br&log-compression=br
37 + store_uri = s3://nix-cache?secret-key=/var/lib/hydra/queue-runner/keys/cache.nixos.org-1/secret&write-nar-listing=1&ls-compression=br&log-compression=br&local-nar-cache=${narCache}
38 + server_store_uri = https://cache.nixos.org?local-nar-cache=${narCache}
39 binary_cache_public_uri = https://cache.nixos.org
40
41 <hipchat>
@@ -59,6 +61,14 @@ in
61 log_prefix = https://nix-cache.s3.amazonaws.com/
62 '';
63
64 + system.activationScripts.createNarCache =
65 + ''
66 + mkdir -p /var/cache/hydra -m 0755
67 + chown hydra.hydra /var/cache/hydra
68 + mkdir -p ${narCache} -m 0775
69 + chown hydra.hydra ${narCache}
70 + '';
71 +
72 users.extraUsers.hydra.home = mkForce "/home/hydra";
73
74 systemd.services.hydra-queue-runner.restartIfChanged = false;