Skip to content

Commit 972b223

Browse files
committed
hydra-queue-runner: 54b3c935 -> 3e4c33bf
1 parent 074c87c commit 972b223

File tree

4 files changed

+73
-28
lines changed

4 files changed

+73
-28
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ in
3737
nix.settings = {
3838
# gc outputs as well, since they are served from the cache
3939
gc-keep-outputs = lib.mkForce false;
40-
allowed-users = [ "hydra" "hydra-www" ];
40+
allowed-users = [
41+
"hydra"
42+
"hydra-www"
43+
];
4144
};
4245

4346
# Don't rate-limit the journal.
@@ -117,9 +120,13 @@ in
117120

118121
hydra-queue-runner-v2 = {
119122
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-
];
123+
settings = {
124+
queueTriggerTimerInS = 300;
125+
concurrentUploadLimit = 2;
126+
remoteStoreAddr = [
127+
"s3://nix-cache-staging?secret-key=${config.sops.secrets.signing-key.path}&ls-compression=br&log-compression=br"
128+
];
129+
};
123130
};
124131

125132
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: 21 additions & 22 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,
@@ -11,17 +11,19 @@
1111
nlohmann_json,
1212
libsodium,
1313
boost,
14+
withOtel ? false,
15+
withTokioConsole ? false,
1416
}:
1517
let
16-
version = "unstable-2025-08-07";
18+
version = "unstable-2025-10-17";
1719
src = fetchFromGitHub {
1820
owner = "helsinki-systems";
1921
repo = "hydra-queue-runner";
20-
rev = "54b3c9351d2ae10be5c4d1b97cc0f86300cd70ca";
21-
hash = "sha256-gR2DzWkTykM9GdW3Nf/V8eRv68fl3aO+NW0zNPFSRT0=";
22+
rev = "3e4c33bf76139f752a0a4384e4cf237fdacba5b1";
23+
hash = "sha256-dIkOSBkFs/fBeqIaheSs2KU90Euak/XRc0dm+Ju7cHM=";
2224
};
2325
useFetchCargoVendor = true;
24-
cargoHash = "sha256-oNUMmFfts4rjBX0k5mzsxpYA2JqgsRu1nMRFf/2rZa8=";
26+
cargoHash = "sha256-mElkthAG8AwdnR1ea+FMY4wUc+ZrzAZK68GyLSjFh6Q=";
2527
nativeBuildInputs = [
2628
pkg-config
2729
protobuf
@@ -32,7 +34,7 @@ let
3234
zlib
3335
protobuf
3436

35-
nixVersions.nix_2_29
37+
nixVersions.nix_2_31
3638
nlohmann_json
3739
libsodium
3840
boost
@@ -46,7 +48,7 @@ let
4648
};
4749
in
4850
{
49-
runner = rustPackages.rustPlatform.buildRustPackage (finalAttrs: {
51+
runner = rustPackages_1_88.rustPlatform.buildRustPackage {
5052
pname = "hydra-queue-runner";
5153
inherit version src;
5254
__structuredAttrs = true;
@@ -59,22 +61,21 @@ in
5961
buildInputs
6062
;
6163

62-
cargoBuildFlags = [
63-
"-p"
64-
"queue-runner"
65-
];
66-
cargoTestFlags = finalAttrs.cargoBuildFlags;
64+
buildAndTestSubdir = "queue-runner";
65+
buildFeatures = lib.optional withOtel "otel" ++ lib.optional withTokioConsole "tokio-console";
6766

6867
postInstall = ''
69-
wrapProgram $out/bin/queue-runner --prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_29 ]}
68+
wrapProgram $out/bin/queue-runner \
69+
--prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_31 ]} \
70+
--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"
7071
'';
7172

7273
meta = meta // {
7374
mainProgram = "queue-runner";
7475
};
75-
});
76+
};
7677

77-
builder = rustPackages.rustPlatform.buildRustPackage (finalAttrs: {
78+
builder = rustPackages_1_88.rustPlatform.buildRustPackage {
7879
pname = "hydra-queue-builder";
7980
inherit src version;
8081
__structuredAttrs = true;
@@ -87,18 +88,16 @@ in
8788
buildInputs
8889
;
8990

90-
cargoBuildFlags = [
91-
"-p"
92-
"builder"
93-
];
94-
cargoTestFlags = finalAttrs.cargoBuildFlags;
91+
buildAndTestSubdir = "builder";
9592

9693
postInstall = ''
97-
wrapProgram $out/bin/builder --prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_29 ]}
94+
wrapProgram $out/bin/builder \
95+
--prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_31 ]} \
96+
--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"
9897
'';
9998

10099
meta = meta // {
101100
mainProgram = "builder";
102101
};
103-
});
102+
};
104103
}

0 commit comments

Comments
 (0)