From e1eff9b1310d099d8a3c38bff15d8973f4589f04 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Fri, 15 Aug 2025 09:16:39 +0200 Subject: [PATCH 1/8] feat: configure zramSwap on staging-hydra --- non-critical-infra/hosts/staging-hydra/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/non-critical-infra/hosts/staging-hydra/default.nix b/non-critical-infra/hosts/staging-hydra/default.nix index 618bd3ab..1a809c1b 100644 --- a/non-critical-infra/hosts/staging-hydra/default.nix +++ b/non-critical-infra/hosts/staging-hydra/default.nix @@ -50,4 +50,9 @@ "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIEPPocCK4JCbFWshVHMgICOm61LC6V2JAXThzKjXv7TSAAAABHNzaDo=" "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIEWWZ8LjNo41679gFI4Iv4YtjFxwhSbMZVsvvYYaTXdxAAAABHNzaDo= picnoir@framework" ]; + + zramSwap = { + enable = true; + memoryPercent = 150; + }; } From 30dd106ae488a2d22818172fb02f1e0ec597b7a1 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Fri, 15 Aug 2025 09:16:55 +0200 Subject: [PATCH 2/8] fix: add hydra user to allowed users --- non-critical-infra/hosts/staging-hydra/hydra.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/non-critical-infra/hosts/staging-hydra/hydra.nix b/non-critical-infra/hosts/staging-hydra/hydra.nix index 977eefa4..d97730b8 100644 --- a/non-critical-infra/hosts/staging-hydra/hydra.nix +++ b/non-critical-infra/hosts/staging-hydra/hydra.nix @@ -27,7 +27,7 @@ in nix.settings = { # gc outputs as well, since they are served from the cache gc-keep-outputs = lib.mkForce false; - allowed-users = [ "hydra-www" ]; + allowed-users = [ "hydra" "hydra-www" ]; }; # Don't rate-limit the journal. From f46a0deae96bb7b012f97b19180158b4aaa06ddd Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Fri, 15 Aug 2025 09:17:07 +0200 Subject: [PATCH 3/8] fix(hydra-queue-runner): dont restrict on client body size in nginx This will fail uploads of completed builds --- non-critical-infra/hosts/staging-hydra/hydra.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/non-critical-infra/hosts/staging-hydra/hydra.nix b/non-critical-infra/hosts/staging-hydra/hydra.nix index d97730b8..db5fe970 100644 --- a/non-critical-infra/hosts/staging-hydra/hydra.nix +++ b/non-critical-infra/hosts/staging-hydra/hydra.nix @@ -143,6 +143,7 @@ in # This is necessary so that grpc connections do not get closed early # see https://stackoverflow.com/a/67805465 client_body_timeout 31536000s; + client_max_body_size 0; grpc_pass grpc://[::1]:50051; From 9359f8b124318b8378336cc440f550360338955c Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Fri, 15 Aug 2025 11:40:00 +0200 Subject: [PATCH 4/8] fix: disable local building --- .../hosts/staging-hydra/client.crt | 11 ------ .../hosts/staging-hydra/hydra.nix | 16 --------- .../queue-runner-client.key.staging-hydra | 35 ------------------- 3 files changed, 62 deletions(-) delete mode 100644 non-critical-infra/hosts/staging-hydra/client.crt delete mode 100644 non-critical-infra/secrets/queue-runner-client.key.staging-hydra diff --git a/non-critical-infra/hosts/staging-hydra/client.crt b/non-critical-infra/hosts/staging-hydra/client.crt deleted file mode 100644 index 2d0682ca..00000000 --- a/non-critical-infra/hosts/staging-hydra/client.crt +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIBlDCCAUagAwIBAgIUfUYjDOaJML1lIMkAMvLjnSTscYwwBQYDK2VwMEMxCzAJ -BgNVBAYTAkRFMRQwEgYDVQQKDAtOaXhPUyBJbmZyYTEeMBwGA1UEAwwVaHlkcmEt -cXVldWUtcnVubmVyLWNhMCAXDTI1MDczMTEyMDQxN1oYDzIwNzUwNzE5MTIwNDE3 -WjBLMQswCQYDVQQGEwJERTEUMBIGA1UECgwLTml4T1MgSW5mcmExJjAkBgNVBAMM -HWh5ZHJhLXF1ZXVlLWJ1aWxkZXItbG9jYWxob3N0MCowBQYDK2VwAyEAJqCvjdwY -0l4z0cbwecONx3DfhpPo+SBymv7H2OQt4aejQjBAMB0GA1UdDgQWBBQw54bw+CrK -O53J4qzB4Cknzf7CzTAfBgNVHSMEGDAWgBTTBAboHFMq1jCXLC7IPRpWv/WviDAF -BgMrZXADQQB+XUCZQo0aX6IyEQDrds1d3SWF1rFBv5MjtZS25TYpnQQPgt9iiD6Q -dtCwSVqyAgCG4XlkYBpU4AKVKqyMsSAC ------END CERTIFICATE----- diff --git a/non-critical-infra/hosts/staging-hydra/hydra.nix b/non-critical-infra/hosts/staging-hydra/hydra.nix index db5fe970..5cf55db8 100644 --- a/non-critical-infra/hosts/staging-hydra/hydra.nix +++ b/non-critical-infra/hosts/staging-hydra/hydra.nix @@ -115,17 +115,6 @@ in ]; }; - hydra-queue-builder-v2 = { - enable = true; - queueRunnerAddr = "https://queue-runner.staging-hydra.nixos.org"; - mtls = { - serverRootCaCertPath = "${./ca.crt}"; - clientCertPath = "${./client.crt}"; - clientKeyPath = config.sops.secrets."queue-runner-client.key".path; - domainName = "queue-runner.staging-hydra.nixos.org"; - }; - }; - nginx = { enable = true; virtualHosts."queue-runner.staging-hydra.nixos.org" = { @@ -169,11 +158,6 @@ in format = "binary"; owner = config.systemd.services.nginx.serviceConfig.User; }; - "queue-runner-client.key" = { - sopsFile = ../../secrets/queue-runner-client.key.staging-hydra; - format = "binary"; - owner = config.systemd.services.hydra-queue-builder-v2.serviceConfig.User; - }; hydra-users = { sopsFile = ../../secrets/hydra-users.staging-hydra; format = "binary"; diff --git a/non-critical-infra/secrets/queue-runner-client.key.staging-hydra b/non-critical-infra/secrets/queue-runner-client.key.staging-hydra deleted file mode 100644 index e32c6090..00000000 --- a/non-critical-infra/secrets/queue-runner-client.key.staging-hydra +++ /dev/null @@ -1,35 +0,0 @@ -{ - "data": "ENC[AES256_GCM,data:mER5O7YO36svhuSk8u5FLgBUkRaFs+k4sBccPqx0JZ5BWPhWDKQwlEKHeNuuMRPwbhtTEoKXFHN7PdcOKG3jtDNZuNuOvupNxeF8By47XpBFRJm7W9BhPdlN4UA8qoDdlWMZLBFjNSSGhV6+wGL/HGao/hpWDn0=,iv:JmAHNp6G4kVjhsLv5BgizEUatt+NbIyz8wi0YVdtN50=,tag:yAN1D0DMvOs0g4715HD6PQ==,type:str]", - "sops": { - "age": [ - { - "recipient": "age1xj4dl6xdl5ztmetp9axa0epjj922hu6a2gut3rrs5rdc5xv85yjsq5ggpx", - "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBiUEkwL0xvV2trSUFUN1Ny\nNnBLOHhvaVFuNWxuQnE2Yys3MVAycjRCM0QwCmI1M0haRzJhUEw3aURhRmtWUG1C\nMWhpZHJiSnM4RXJvZ09WQWxxN3QyS28KLS0tIFo5Nm15U2hPSkxRUUZpRWdZTVJO\nV2p0QVlVbHV6am1LTTVoQzRLWkloUnMK6mK+TeQKok/XNH+wmGa1N1lVX3ME562o\nEev3kaAGWqz6f4bMacbCkgXmhOEryFiDCgok/TMQ6hSGa3COFXrzmQ==\n-----END AGE ENCRYPTED FILE-----\n" - }, - { - "recipient": "age17n64ahe3wesh8l8lj0zylf4nljdmqn28hvqns2g7hgm9mdkhlsvsjuvkxz", - "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBPcCtST1pMdk1vNFBLRlJN\nd2IvTmUwcGQ2cm5aaXgvQTdoMkFFbnJYVm00CjJmYS95Z2FrMUdrcDJwWDFYWXY0\nNGZkSkZMRDA3NUxjVG1NdExKTjNVM1kKLS0tIEN6eHJlazlRa3NIaUUvSWtTdTYw\nZXpmcXJpY1pwUzkva2hYM1R3THhIM00KiwOB/Twye2mzFzLUiF01DTaqb0OLybSF\njRYHaZ5KWZ756c2DEnnB8TbQsN2JDpfe8pYW7tdgyfqNKaYV/l8nxQ==\n-----END AGE ENCRYPTED FILE-----\n" - }, - { - "recipient": "age1nnm255ah9wa4gpsaq0v023a75lnmlcxszt9lc6az3mtwzxgrucfq45rp7h", - "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6Q1htRVFycERhRHRSanFt\nTEhaTnIvMG1iYy9MZ0pLLzZqaVN0bVB1ZERNCjhkaVRXaXZoQjl6aUZYWnlvMGdG\nSDh1M09MU2I3aUF2YVgxUTVHZHYxazAKLS0tIFJtUzk1Wk9xazNUK3BJWTJMbGx6\nTzh5SlVBUkFIckQ3b0VYQWlyaGhuMEUKg+bdoltiqfMwrzytk4kwRKqUjS3XyUuN\ngX3ksj9ODZDvbwNXhgBLXkXpmefwUt0k2TJL/fTr4tqTU6hchkg7aA==\n-----END AGE ENCRYPTED FILE-----\n" - }, - { - "recipient": "age1j3mkgedmeru63vwww6m44zfw09tg8yw6xdzstaq7ejfkvgcau40qwakm8x", - "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBqS1pTY0Rzci94Ykd3Wm1t\nVVl1TWlQc2xjdTBBbjZCWGF3bWZXaTlNaWxjCjJ0OFd3bWRTYjF5cnRaSy8zeFFF\nSWd0bkpSbnVyNTZOMU0yR1dVcUtlQlkKLS0tICt2QkdsUDcyZ1J2YjRJRkIyYW5u\naDBPWUEwNkJ5dkxqaGhCcWlNZVNXOEkK6SEQCqKZ0OsWKs6vmG18ikaeSkS7Zo9+\npUc4e/QWsRDOd/frLWzKIo8JujckNpMbbalQfykW7s0xCvGnZ1NYfQ==\n-----END AGE ENCRYPTED FILE-----\n" - }, - { - "recipient": "age1jrh8yyq3swjru09s75s4mspu0mphh7h6z54z946raa9wx3pcdegq0x8t4h", - "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBwdXJ2bHIrdGdCSlRLL3Za\nVWZCUWRXajVmS2JCMkQ2NmZqMkVHcHAyTFc0Cngyd0QzbU9VMEVrOUxsSGVsWWNy\neGRNK3JleDFXN2p0dFYrYktVbzcrSGMKLS0tIFQ4WFc2RTFFNkx3ajUvQWJqWUpV\nUDBiOTFKQ0hIOWsxS2xYM1ptVDBwcGcK41AK30TtmKw9DCPCMnAZXl/C26t3NBNK\n3Sh4wL7yyhKmRUNutq5cnAw8vjzhRsgjJkZGmOuv5qN3s7nFTGdC5A==\n-----END AGE ENCRYPTED FILE-----\n" - }, - { - "recipient": "age17ez23w2kpxl0gcdx4ehcglkcfcfnv4qz0gq2n8ylxwx4yrtjpvjqxfasua", - "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBqNFB6OW1sOHpseEdJSll4\neDlDN0xKQnJPMUFQcnpHaHFURUg4NmhNT3k0CmFJV2xSMnhocnlMQWI5ZThLK2R4\nZE1mRHBGbGM4UmxvalJ5TWpOUW1JR2cKLS0tIEd6UFNFc0E0QVI2bFBRUlFsWHh6\nLy9WYWpTK3E2ZjJEb01rNC84UG1DUTAKv1T3UPMBBYGHdmKCsSCUtBg/7SoQ7RjO\n0PyeOnGlvUUxj4H/z2sPRxuKj2QiqIiGqdSqOoGXNmp3omrQHtVfxg==\n-----END AGE ENCRYPTED FILE-----\n" - } - ], - "lastmodified": "2025-07-31T12:14:02Z", - "mac": "ENC[AES256_GCM,data:KWe6LDUZtpGR8btMzp4Arb4b3rooS+pGOOs0W0gZYLovh4RdvMSdOHbslIZt3HzNvOWDNz3BM77jdNiSctZpLK6sXxzXB0JH7dq3H9+7cPRGyEIUYRvysjmFF1HHEw0isVkV7mPHNAQBL7y716Gw5plAfyEgCqpknbnQpKMIGmI=,iv:rRfVfr30XfMuAgkeNWq6x3l4LVFArC3X2sPz8dCamfo=,tag:lKKy+PvsuwG99mEu0/OZ7w==,type:str]", - "unencrypted_suffix": "_unencrypted", - "version": "3.10.2" - } -} From 2fa9afb0f73193c7089a03d4906eb33c2161580b Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Thu, 21 Aug 2025 20:32:16 +0200 Subject: [PATCH 5/8] fix: limit nofile --- non-critical-infra/modules/hydra-queue-runner-v2.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/non-critical-infra/modules/hydra-queue-runner-v2.nix b/non-critical-infra/modules/hydra-queue-runner-v2.nix index 0f1347a6..bac8381a 100644 --- a/non-critical-infra/modules/hydra-queue-runner-v2.nix +++ b/non-critical-infra/modules/hydra-queue-runner-v2.nix @@ -198,6 +198,7 @@ in HOME = "/var/lib/hydra/queue-runner"; }; + restartIfChanged = false; serviceConfig = { Type = "notify"; Restart = "always"; @@ -244,6 +245,8 @@ in "~@privileged" "~@resources" ]; + ManagedOOMPreference = "avoid"; + LimitNOFILE = 65536; ProtectSystem = "strict"; ProtectHome = true; From 6f683b45b44b1fb5dca62bf88e3b1f3989a72a54 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Tue, 26 Aug 2025 11:53:38 +0200 Subject: [PATCH 6/8] fix: postgresql runs into max connection issue --- non-critical-infra/hosts/staging-hydra/hydra.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/non-critical-infra/hosts/staging-hydra/hydra.nix b/non-critical-infra/hosts/staging-hydra/hydra.nix index 5cf55db8..0e15a9a9 100644 --- a/non-critical-infra/hosts/staging-hydra/hydra.nix +++ b/non-critical-infra/hosts/staging-hydra/hydra.nix @@ -17,6 +17,16 @@ in 9199 # hydra-notify metrics ]; + services.postgresql.settings = { + log_min_duration_statement = 5000; + log_duration = "off"; + log_statement = "none"; + + max_connections = 500; + work_mem = "20MB"; + maintenance_work_mem = "2GB"; + }; + # garbage collection nix.gc = { automatic = true; From e859526b2444edd1c23c6ec97dcb71c69a1b1704 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Thu, 9 Oct 2025 17:13:46 +0200 Subject: [PATCH 7/8] fix: reconfigure evaluator --- non-critical-infra/hosts/staging-hydra/hydra.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/non-critical-infra/hosts/staging-hydra/hydra.nix b/non-critical-infra/hosts/staging-hydra/hydra.nix index 0e15a9a9..bcd9188a 100644 --- a/non-critical-infra/hosts/staging-hydra/hydra.nix +++ b/non-critical-infra/hosts/staging-hydra/hydra.nix @@ -90,22 +90,19 @@ in log_prefix = https://cache.nixos.org/ - evaluator_workers = 1 + evaluator_workers = 4 evaluator_max_memory_size = 4096 queue_runner_endpoint = http://localhost:8080 max_concurrent_evals = 1 - # increase the number of active compress slots (CPU is 48*2 on mimas) - max_local_worker_threads = 144 - max_unsupported_time = 86400 allow_import_from_derivation = false max_output_size = 3821225472 # 3 << 30 + 600000000 = 3 GiB + 0.6 GB - max_db_connections = 350 + max_db_connections = 50 queue_runner_metrics_address = [::]:9198 From e8a32e9591df7285e50d1df49e6fb62345236bf4 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Fri, 15 Aug 2025 09:17:42 +0200 Subject: [PATCH 8/8] hydra-queue-runner: 54b3c935 -> 79ac1093 --- .../hosts/staging-hydra/hydra.nix | 15 +++++-- .../modules/hydra-queue-builder-v2.nix | 19 +++++++- .../modules/hydra-queue-runner-v2.nix | 24 ++++++++++- .../packages/hydra-queue-runner/default.nix | 43 +++++++++---------- 4 files changed, 73 insertions(+), 28 deletions(-) diff --git a/non-critical-infra/hosts/staging-hydra/hydra.nix b/non-critical-infra/hosts/staging-hydra/hydra.nix index bcd9188a..40b30626 100644 --- a/non-critical-infra/hosts/staging-hydra/hydra.nix +++ b/non-critical-infra/hosts/staging-hydra/hydra.nix @@ -37,7 +37,10 @@ in nix.settings = { # gc outputs as well, since they are served from the cache gc-keep-outputs = lib.mkForce false; - allowed-users = [ "hydra" "hydra-www" ]; + allowed-users = [ + "hydra" + "hydra-www" + ]; }; # Don't rate-limit the journal. @@ -117,9 +120,13 @@ in hydra-queue-runner-v2 = { enable = true; - settings.remoteStoreAddr = [ - "s3://nix-cache-staging?secret-key=${config.sops.secrets.signing-key.path}&ls-compression=br&log-compression=br" - ]; + settings = { + queueTriggerTimerInS = 300; + concurrentUploadLimit = 2; + remoteStoreAddr = [ + "s3://nix-cache-staging?secret-key=${config.sops.secrets.signing-key.path}&ls-compression=br&log-compression=br" + ]; + }; }; nginx = { diff --git a/non-critical-infra/modules/hydra-queue-builder-v2.nix b/non-critical-infra/modules/hydra-queue-builder-v2.nix index ad08fdc6..daca2c30 100644 --- a/non-critical-infra/modules/hydra-queue-builder-v2.nix +++ b/non-critical-infra/modules/hydra-queue-builder-v2.nix @@ -2,10 +2,12 @@ config, pkgs, lib, + inputs, ... }: let cfg = config.services.hydra-queue-builder-v2; + unstable = import inputs.nixpkgs-unstable { inherit (pkgs) system; }; in { options = { @@ -98,6 +100,12 @@ in default = true; }; + authorizationFile = lib.mkOption { + description = "Path to token authorization file if token auth should be used."; + type = lib.types.nullOr lib.types.path; + default = null; + }; + mtls = lib.mkOption { description = "mtls options"; default = null; @@ -127,7 +135,12 @@ in package = lib.mkOption { type = lib.types.package; - default = (pkgs.recurseIntoAttrs (pkgs.callPackage ../packages/hydra-queue-runner { })).builder; + default = + (pkgs.recurseIntoAttrs ( + pkgs.callPackage ../packages/hydra-queue-runner { + inherit (unstable) nixVersions openssl; + } + )).builder; }; }; }; @@ -197,6 +210,10 @@ in ++ lib.optionals (cfg.useSubstitutes != null) [ "--use-substitutes" ] + ++ lib.optionals (cfg.authorizationFile != null) [ + "--authorization-file" + cfg.authorizationFile + ] ++ lib.optionals (cfg.mtls != null) [ "--server-root-ca-cert-path" cfg.mtls.serverRootCaCertPath diff --git a/non-critical-infra/modules/hydra-queue-runner-v2.nix b/non-critical-infra/modules/hydra-queue-runner-v2.nix index bac8381a..db562bc7 100644 --- a/non-critical-infra/modules/hydra-queue-runner-v2.nix +++ b/non-critical-infra/modules/hydra-queue-runner-v2.nix @@ -2,12 +2,14 @@ config, pkgs, lib, + inputs, ... }: let cfg = config.services.hydra-queue-runner-v2; format = pkgs.formats.toml { }; + unstable = import inputs.nixpkgs-unstable { inherit (pkgs) system; }; in { options = { @@ -101,6 +103,21 @@ in type = lib.types.int; default = 60; }; + maxConcurrentDownloads = lib.mkOption { + description = "Max count of concurrent downloads per build. Increasing this will increase memory usage of the queue runner."; + type = lib.types.ints.positive; + default = 5; + }; + concurrentUploadLimit = lib.mkOption { + description = "Concurrent limit for uploading to s3."; + type = lib.types.ints.positive; + default = 5; + }; + tokenListPath = lib.mkOption { + description = "Path to a list of allowed authentication tokens."; + type = lib.types.nullOr lib.types.path; + default = null; + }; }; }; default = { }; @@ -170,7 +187,12 @@ in }; package = lib.mkOption { type = lib.types.package; - default = (pkgs.recurseIntoAttrs (pkgs.callPackage ../packages/hydra-queue-runner { })).runner; + default = + (pkgs.recurseIntoAttrs ( + pkgs.callPackage ../packages/hydra-queue-runner { + inherit (unstable) nixVersions openssl; + } + )).runner; }; }; }; diff --git a/non-critical-infra/packages/hydra-queue-runner/default.nix b/non-critical-infra/packages/hydra-queue-runner/default.nix index b6543357..643df3b2 100644 --- a/non-critical-infra/packages/hydra-queue-runner/default.nix +++ b/non-critical-infra/packages/hydra-queue-runner/default.nix @@ -1,5 +1,5 @@ { - rustPackages, + rustPackages_1_88, fetchFromGitHub, pkg-config, openssl, @@ -11,17 +11,19 @@ nlohmann_json, libsodium, boost, + withOtel ? false, + withTokioConsole ? false, }: let - version = "unstable-2025-08-07"; + version = "unstable-2025-10-17"; src = fetchFromGitHub { owner = "helsinki-systems"; repo = "hydra-queue-runner"; - rev = "54b3c9351d2ae10be5c4d1b97cc0f86300cd70ca"; - hash = "sha256-gR2DzWkTykM9GdW3Nf/V8eRv68fl3aO+NW0zNPFSRT0="; + rev = "79ac10936fcc4cacb97f81bb3bf95a08e268804b"; + hash = "sha256-l+8/UXH4bX5u17tkL8PVL+hRUC8G2wsUFa7De4rY6Fo="; }; useFetchCargoVendor = true; - cargoHash = "sha256-oNUMmFfts4rjBX0k5mzsxpYA2JqgsRu1nMRFf/2rZa8="; + cargoHash = "sha256-mElkthAG8AwdnR1ea+FMY4wUc+ZrzAZK68GyLSjFh6Q="; nativeBuildInputs = [ pkg-config protobuf @@ -32,7 +34,7 @@ let zlib protobuf - nixVersions.nix_2_29 + nixVersions.nix_2_31 nlohmann_json libsodium boost @@ -46,7 +48,7 @@ let }; in { - runner = rustPackages.rustPlatform.buildRustPackage (finalAttrs: { + runner = rustPackages_1_88.rustPlatform.buildRustPackage { pname = "hydra-queue-runner"; inherit version src; __structuredAttrs = true; @@ -59,22 +61,21 @@ in buildInputs ; - cargoBuildFlags = [ - "-p" - "queue-runner" - ]; - cargoTestFlags = finalAttrs.cargoBuildFlags; + buildAndTestSubdir = "queue-runner"; + buildFeatures = lib.optional withOtel "otel" ++ lib.optional withTokioConsole "tokio-console"; postInstall = '' - wrapProgram $out/bin/queue-runner --prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_29 ]} + wrapProgram $out/bin/queue-runner \ + --prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_31 ]} \ + --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" ''; meta = meta // { mainProgram = "queue-runner"; }; - }); + }; - builder = rustPackages.rustPlatform.buildRustPackage (finalAttrs: { + builder = rustPackages_1_88.rustPlatform.buildRustPackage { pname = "hydra-queue-builder"; inherit src version; __structuredAttrs = true; @@ -87,18 +88,16 @@ in buildInputs ; - cargoBuildFlags = [ - "-p" - "builder" - ]; - cargoTestFlags = finalAttrs.cargoBuildFlags; + buildAndTestSubdir = "builder"; postInstall = '' - wrapProgram $out/bin/builder --prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_29 ]} + wrapProgram $out/bin/builder \ + --prefix PATH : ${lib.makeBinPath [ nixVersions.nix_2_31 ]} \ + --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" ''; meta = meta // { mainProgram = "builder"; }; - }); + }; }