|
44 | 44 | }; |
45 | 45 | }; |
46 | 46 |
|
47 | | - services.hydra-dev = { |
48 | | - enable = true; |
49 | | - package = pkgs.hydra; |
50 | | - buildMachinesFiles = [ |
51 | | - (pkgs.writeText "local" '' |
52 | | - localhost ${lib.concatStringsSep "," localSystems} - 3 1 ${lib.concatStringsSep "," config.nix.settings.system-features} - - |
53 | | - '') |
54 | | - ]; |
55 | | - logo = ../../../build/hydra-logo.png; |
56 | | - hydraURL = "https://hydra.nixos.org"; |
57 | | - notificationSender = "[email protected]"; |
58 | | - smtpHost = "localhost"; |
59 | | - useSubstitutes = true; |
60 | | - extraConfig = '' |
61 | | - max_servers 30 |
| 47 | + services = { |
| 48 | + hydra-dev = { |
| 49 | + enable = true; |
| 50 | + package = pkgs.hydra; |
| 51 | + buildMachinesFiles = [ |
| 52 | + (pkgs.writeText "local" '' |
| 53 | + localhost ${lib.concatStringsSep "," localSystems} - 3 1 ${lib.concatStringsSep "," config.nix.settings.system-features} - - |
| 54 | + '') |
| 55 | + ]; |
| 56 | + logo = ../../../build/hydra-logo.png; |
| 57 | + hydraURL = "https://hydra.nixos.org"; |
| 58 | + notificationSender = "[email protected]"; |
| 59 | + smtpHost = "localhost"; |
| 60 | + useSubstitutes = true; |
| 61 | + extraConfig = '' |
| 62 | + max_servers 30 |
62 | 63 |
|
63 | | - store_uri = s3://nix-cache-staging?secret-key=${config.sops.secrets.signing-key.path}&ls-compression=br&log-compression=br |
64 | | - server_store_uri = https://cache-staging.nixos.org?local-nar-cache=${narCache} |
65 | | - binary_cache_public_uri = https://cache-staging.nixos.org |
| 64 | + store_uri = s3://nix-cache-staging?secret-key=${config.sops.secrets.signing-key.path}&ls-compression=br&log-compression=br |
| 65 | + server_store_uri = https://cache-staging.nixos.org?local-nar-cache=${narCache} |
| 66 | + binary_cache_public_uri = https://cache-staging.nixos.org |
66 | 67 |
|
67 | | - <Plugin::Session> |
68 | | - cache_size = 32m |
69 | | - </Plugin::Session> |
| 68 | + <Plugin::Session> |
| 69 | + cache_size = 32m |
| 70 | + </Plugin::Session> |
70 | 71 |
|
71 | | - # patchelf:master:3 |
72 | | - xxx-jobset-repeats = nixos:reproducibility:1 |
| 72 | + # patchelf:master:3 |
| 73 | + xxx-jobset-repeats = nixos:reproducibility:1 |
73 | 74 |
|
74 | | - upload_logs_to_binary_cache = true |
75 | | - compress_build_logs = false # conflicts with upload_logs_to_binary_cache |
| 75 | + upload_logs_to_binary_cache = true |
| 76 | + compress_build_logs = false # conflicts with upload_logs_to_binary_cache |
76 | 77 |
|
77 | | - log_prefix = https://cache.nixos.org/ |
| 78 | + log_prefix = https://cache.nixos.org/ |
78 | 79 |
|
79 | | - evaluator_workers = 1 |
80 | | - evaluator_max_memory_size = 4096 |
| 80 | + evaluator_workers = 1 |
| 81 | + evaluator_max_memory_size = 4096 |
81 | 82 |
|
82 | | - max_concurrent_evals = 1 |
| 83 | + queue_runner_endpoint = http://localhost:8080 |
83 | 84 |
|
84 | | - # increase the number of active compress slots (CPU is 48*2 on mimas) |
85 | | - max_local_worker_threads = 144 |
| 85 | + max_concurrent_evals = 1 |
86 | 86 |
|
87 | | - max_unsupported_time = 86400 |
| 87 | + # increase the number of active compress slots (CPU is 48*2 on mimas) |
| 88 | + max_local_worker_threads = 144 |
88 | 89 |
|
89 | | - allow_import_from_derivation = false |
| 90 | + max_unsupported_time = 86400 |
90 | 91 |
|
91 | | - max_output_size = 3821225472 # 3 << 30 + 600000000 = 3 GiB + 0.6 GB |
92 | | - max_db_connections = 350 |
| 92 | + allow_import_from_derivation = false |
93 | 93 |
|
94 | | - queue_runner_metrics_address = [::]:9198 |
| 94 | + max_output_size = 3821225472 # 3 << 30 + 600000000 = 3 GiB + 0.6 GB |
| 95 | + max_db_connections = 350 |
95 | 96 |
|
96 | | - <hydra_notify> |
97 | | - <prometheus> |
98 | | - listen_address = 0.0.0.0 |
99 | | - port = 9199 |
100 | | - </prometheus> |
101 | | - </hydra_notify> |
102 | | - ''; |
| 97 | + queue_runner_metrics_address = [::]:9198 |
| 98 | +
|
| 99 | + <hydra_notify> |
| 100 | + <prometheus> |
| 101 | + listen_address = 0.0.0.0 |
| 102 | + port = 9199 |
| 103 | + </prometheus> |
| 104 | + </hydra_notify> |
| 105 | + ''; |
| 106 | + }; |
| 107 | + |
| 108 | + hydra-queue-runner-v2 = { |
| 109 | + enable = true; |
| 110 | + settings.remoteStoreAddr = [ |
| 111 | + "s3://nix-cache-staging?secret-key=${config.sops.secrets.signing-key.path}&ls-compression=br&log-compression=br" |
| 112 | + ]; |
| 113 | + }; |
| 114 | + |
| 115 | + hydra-queue-builder-v2 = { |
| 116 | + enable = true; |
| 117 | + queueRunnerAddr = "https://queue-runner.staging-hydra.nixos.org"; |
| 118 | + mtls = { |
| 119 | + serverRootCaCertPath = "${./ca.crt}"; |
| 120 | + clientCertPath = "${./client.crt}"; |
| 121 | + clientKeyPath = config.sops.secrets."queue-runner-client.key".path; |
| 122 | + domainName = "queue-runner.staging-hydra.nixos.org"; |
| 123 | + }; |
| 124 | + }; |
| 125 | + |
| 126 | + nginx = { |
| 127 | + enable = true; |
| 128 | + virtualHosts."queue-runner.staging-hydra.nixos.org" = { |
| 129 | + extraConfig = '' |
| 130 | + ssl_client_certificate ${./ca.crt}; |
| 131 | + ssl_verify_depth 2; |
| 132 | + ssl_verify_client on; |
| 133 | + ''; |
| 134 | + |
| 135 | + sslCertificate = ./server.crt; |
| 136 | + sslCertificateKey = config.sops.secrets."queue-runner-server.key".path; |
| 137 | + onlySSL = true; |
| 138 | + |
| 139 | + locations."/".extraConfig = '' |
| 140 | + # This is necessary so that grpc connections do not get closed early |
| 141 | + # see https://stackoverflow.com/a/67805465 |
| 142 | + client_body_timeout 31536000s; |
| 143 | +
|
| 144 | + grpc_pass grpc://[::1]:50051; |
| 145 | +
|
| 146 | + grpc_read_timeout 31536000s; # 1 year in seconds |
| 147 | + grpc_send_timeout 31536000s; # 1 year in seconds |
| 148 | + grpc_socket_keepalive on; |
| 149 | +
|
| 150 | + grpc_set_header Host $host; |
| 151 | + grpc_set_header X-Real-IP $remote_addr; |
| 152 | + grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 153 | + grpc_set_header X-Forwarded-Proto $scheme; |
| 154 | +
|
| 155 | + grpc_set_header X-Client-DN $ssl_client_s_dn; |
| 156 | + grpc_set_header X-Client-Cert $ssl_client_escaped_cert; |
| 157 | + ''; |
| 158 | + }; |
| 159 | + }; |
103 | 160 | }; |
104 | 161 |
|
105 | | - sops.secrets.hydra-users = { |
106 | | - sopsFile = ../../secrets/hydra-users.staging-hydra; |
107 | | - format = "binary"; |
| 162 | + sops.secrets = { |
| 163 | + "queue-runner-server.key" = { |
| 164 | + sopsFile = ../../secrets/queue-runner-server.key.staging-hydra; |
| 165 | + format = "binary"; |
| 166 | + owner = config.systemd.services.hydra-queue-runner.serviceConfig.User; |
| 167 | + }; |
| 168 | + "queue-runner-client.key" = { |
| 169 | + sopsFile = ../../secrets/queue-runner-client.key.staging-hydra; |
| 170 | + format = "binary"; |
| 171 | + owner = config.systemd.services.hydra-queue-runner.serviceConfig.User; |
| 172 | + }; |
| 173 | + hydra-users = { |
| 174 | + sopsFile = ../../secrets/hydra-users.staging-hydra; |
| 175 | + format = "binary"; |
| 176 | + }; |
108 | 177 | }; |
109 | 178 |
|
110 | 179 | systemd = { |
|
117 | 186 | services = { |
118 | 187 | hydra-notify.enable = false; |
119 | 188 | hydra-queue-runner = { |
| 189 | + enable = false; |
| 190 | + |
120 | 191 | # restarting the scheduler is very expensive |
121 | 192 | restartIfChanged = false; |
122 | 193 | serviceConfig = { |
|
0 commit comments