Skip to content

Commit a5bbf0b

Browse files
committed
hydra-queue-runner: 54b3c935 -> ad269245
1 parent 0f78de1 commit a5bbf0b

File tree

4 files changed

+62
-15
lines changed

4 files changed

+62
-15
lines changed

non-critical-infra/hosts/staging-hydra/hydra.nix

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ in
117117

118118
hydra-queue-runner-v2 = {
119119
enable = true;
120-
settings.remoteStoreAddr = [
121-
"s3://nix-cache-staging?secret-key=${config.sops.secrets.signing-key.path}&ls-compression=br&log-compression=br"
122-
];
120+
settings = {
121+
queueTriggerTimerInS = 300;
122+
concurrentUploadLimit = 2;
123+
remoteStoreAddr = [
124+
"s3://nix-cache-staging?secret-key=${config.sops.secrets.signing-key.path}&ls-compression=br&log-compression=br"
125+
];
126+
};
123127
};
124128

125129
nginx = {

non-critical-infra/modules/hydra-queue-builder-v2.nix

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
config,
33
pkgs,
44
lib,
5+
inputs,
56
...
67
}:
78
let
89
cfg = config.services.hydra-queue-builder-v2;
10+
unstable = import inputs.nixpkgs-unstable { inherit (pkgs) system; };
911
in
1012
{
1113
options = {
@@ -98,6 +100,12 @@ in
98100
default = true;
99101
};
100102

103+
authorizationFile = lib.mkOption {
104+
description = "Path to token authorization file if token auth should be used.";
105+
type = lib.types.nullOr lib.types.path;
106+
default = null;
107+
};
108+
101109
mtls = lib.mkOption {
102110
description = "mtls options";
103111
default = null;
@@ -127,7 +135,12 @@ in
127135

128136
package = lib.mkOption {
129137
type = lib.types.package;
130-
default = (pkgs.recurseIntoAttrs (pkgs.callPackage ../packages/hydra-queue-runner { })).builder;
138+
default =
139+
(pkgs.recurseIntoAttrs (
140+
pkgs.callPackage ../packages/hydra-queue-runner {
141+
inherit (unstable) nixVersions openssl;
142+
}
143+
)).builder;
131144
};
132145
};
133146
};
@@ -197,6 +210,10 @@ in
197210
++ lib.optionals (cfg.useSubstitutes != null) [
198211
"--use-substitutes"
199212
]
213+
++ lib.optionals (cfg.authorizationFile != null) [
214+
"--authorization-file"
215+
cfg.authorizationFile
216+
]
200217
++ lib.optionals (cfg.mtls != null) [
201218
"--server-root-ca-cert-path"
202219
cfg.mtls.serverRootCaCertPath

non-critical-infra/modules/hydra-queue-runner-v2.nix

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
config,
33
pkgs,
44
lib,
5+
inputs,
56
...
67
}:
78
let
89
cfg = config.services.hydra-queue-runner-v2;
910

1011
format = pkgs.formats.toml { };
12+
unstable = import inputs.nixpkgs-unstable { inherit (pkgs) system; };
1113
in
1214
{
1315
options = {
@@ -101,6 +103,21 @@ in
101103
type = lib.types.int;
102104
default = 60;
103105
};
106+
maxConcurrentDownloads = lib.mkOption {
107+
description = "Max count of concurrent downloads per build. Increasing this will increase memory usage of the queue runner.";
108+
type = lib.types.ints.positive;
109+
default = 5;
110+
};
111+
concurrentUploadLimit = lib.mkOption {
112+
description = "Concurrent limit for uploading to s3.";
113+
type = lib.types.ints.positive;
114+
default = 5;
115+
};
116+
tokenListPath = lib.mkOption {
117+
description = "Path to a list of allowed authentication tokens.";
118+
type = lib.types.nullOr lib.types.path;
119+
default = null;
120+
};
104121
};
105122
};
106123
default = { };
@@ -170,7 +187,12 @@ in
170187
};
171188
package = lib.mkOption {
172189
type = lib.types.package;
173-
default = (pkgs.recurseIntoAttrs (pkgs.callPackage ../packages/hydra-queue-runner { })).runner;
190+
default =
191+
(pkgs.recurseIntoAttrs (
192+
pkgs.callPackage ../packages/hydra-queue-runner {
193+
inherit (unstable) nixVersions openssl;
194+
}
195+
)).runner;
174196
};
175197
};
176198
};

non-critical-infra/packages/hydra-queue-runner/default.nix

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
rustPackages,
2+
rustPackages_1_88,
33
fetchFromGitHub,
44
pkg-config,
55
openssl,
@@ -13,15 +13,15 @@
1313
boost,
1414
}:
1515
let
16-
version = "unstable-2025-08-07";
16+
version = "unstable-2025-10-09";
1717
src = fetchFromGitHub {
1818
owner = "helsinki-systems";
1919
repo = "hydra-queue-runner";
20-
rev = "54b3c9351d2ae10be5c4d1b97cc0f86300cd70ca";
21-
hash = "sha256-gR2DzWkTykM9GdW3Nf/V8eRv68fl3aO+NW0zNPFSRT0=";
20+
rev = "ad26924556d7ff6b4945a8f15c04271e8210e703";
21+
hash = "sha256-hKZ//s4N+GPiKqRI8AzMO32HZOcJWYu6n5+uwhjx6vA=";
2222
};
2323
useFetchCargoVendor = true;
24-
cargoHash = "sha256-oNUMmFfts4rjBX0k5mzsxpYA2JqgsRu1nMRFf/2rZa8=";
24+
cargoHash = "sha256-eDkU+K2XvFU9OPhlPPcjqssabWwU8EqWzj7da0MuMAI=";
2525
nativeBuildInputs = [
2626
pkg-config
2727
protobuf
@@ -32,7 +32,7 @@ let
3232
zlib
3333
protobuf
3434

35-
nixVersions.nix_2_29
35+
nixVersions.nix_2_31
3636
nlohmann_json
3737
libsodium
3838
boost
@@ -46,7 +46,7 @@ let
4646
};
4747
in
4848
{
49-
runner = rustPackages.rustPlatform.buildRustPackage (finalAttrs: {
49+
runner = rustPackages_1_88.rustPlatform.buildRustPackage (finalAttrs: {
5050
pname = "hydra-queue-runner";
5151
inherit version src;
5252
__structuredAttrs = true;
@@ -66,15 +66,17 @@ in
6666
cargoTestFlags = finalAttrs.cargoBuildFlags;
6767

6868
postInstall = ''
69-
wrapProgram $out/bin/queue-runner --prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_29 ]}
69+
wrapProgram $out/bin/queue-runner \
70+
--prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_31 ]} \
71+
--set-default JEMALLOC_SYS_WITH_MALLOC_CONF "background_thread:true,narenas:1,tcache:false,dirty_decay_ms:0,muzzy_decay_ms:0,abort_conf:true"
7072
'';
7173

7274
meta = meta // {
7375
mainProgram = "queue-runner";
7476
};
7577
});
7678

77-
builder = rustPackages.rustPlatform.buildRustPackage (finalAttrs: {
79+
builder = rustPackages_1_88.rustPlatform.buildRustPackage (finalAttrs: {
7880
pname = "hydra-queue-builder";
7981
inherit src version;
8082
__structuredAttrs = true;
@@ -94,7 +96,9 @@ in
9496
cargoTestFlags = finalAttrs.cargoBuildFlags;
9597

9698
postInstall = ''
97-
wrapProgram $out/bin/builder --prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_29 ]}
99+
wrapProgram $out/bin/builder \
100+
--prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_31 ]} \
101+
--set-default JEMALLOC_SYS_WITH_MALLOC_CONF "background_thread:true,narenas:1,tcache:false,dirty_decay_ms:0,muzzy_decay_ms:0,abort_conf:true"
98102
'';
99103

100104
meta = meta // {

0 commit comments

Comments
 (0)