lol

Merge pull request #112637 from hercules-ci/hercules-ci-agent-maintenance

nixos/hercules-ci-agent: maintenance

authored by

Robert Hensing and committed by
GitHub
075e1f7e 938f013b

+35 -31
+31 -27
nixos/modules/services/continuous-integration/hercules-ci-agent/common.nix
··· 7 7 */ 8 8 9 9 { config, lib, options, pkgs, ... }: 10 - 11 10 let 12 11 inherit (lib) 13 12 filterAttrs ··· 22 21 cfg = 23 22 config.services.hercules-ci-agent; 24 23 25 - format = pkgs.formats.toml {}; 24 + format = pkgs.formats.toml { }; 26 25 27 26 settingsModule = { config, ... }: { 28 27 freeformType = format.type; ··· 36 35 }; 37 36 concurrentTasks = mkOption { 38 37 description = '' 39 - Number of tasks to perform simultaneously, such as evaluations, derivations. 38 + Number of tasks to perform simultaneously. 39 + 40 + A task is a single derivation build or an evaluation. 41 + At minimum, you need 2 concurrent tasks for <literal>x86_64-linux</literal> 42 + in your cluster, to allow for import from derivation. 40 43 41 - You must have a total capacity across agents of at least 2 concurrent tasks on <literal>x86_64-linux</literal> 42 - to allow for import from derivation. 44 + <literal>concurrentTasks</literal> can be around the CPU core count or lower if memory is 45 + the bottleneck. 43 46 ''; 44 47 type = types.int; 45 48 default = 4; ··· 85 88 }; 86 89 }; 87 90 88 - # TODO (2022) remove 91 + # TODO (roberth, >=2022) remove 89 92 checkNix = 90 93 if !cfg.checkNix 91 94 then "" 92 95 else if lib.versionAtLeast config.nix.package.version "2.3.10" 93 96 then "" 94 - else pkgs.stdenv.mkDerivation { 95 - name = "hercules-ci-check-system-nix-src"; 96 - inherit (config.nix.package) src patches; 97 - configurePhase = ":"; 98 - buildPhase = '' 99 - echo "Checking in-memory pathInfoCache expiry" 100 - if ! grep 'PathInfoCacheValue' src/libstore/store-api.hh >/dev/null; then 101 - cat 1>&2 <<EOF 97 + else 98 + pkgs.stdenv.mkDerivation { 99 + name = "hercules-ci-check-system-nix-src"; 100 + inherit (config.nix.package) src patches; 101 + configurePhase = ":"; 102 + buildPhase = '' 103 + echo "Checking in-memory pathInfoCache expiry" 104 + if ! grep 'PathInfoCacheValue' src/libstore/store-api.hh >/dev/null; then 105 + cat 1>&2 <<EOF 102 106 103 - You are deploying Hercules CI Agent on a system with an incompatible 104 - nix-daemon. Please make sure nix.package is set to a Nix version of at 105 - least 2.3.10 or a master version more recent than Mar 12, 2020. 106 - EOF 107 - exit 1 108 - fi 109 - ''; 110 - installPhase = "touch $out"; 111 - }; 107 + You are deploying Hercules CI Agent on a system with an incompatible 108 + nix-daemon. Please make sure nix.package is set to a Nix version of at 109 + least 2.3.10 or a master version more recent than Mar 12, 2020. 110 + EOF 111 + exit 1 112 + fi 113 + ''; 114 + installPhase = "touch $out"; 115 + }; 112 116 113 117 in 114 118 { 115 119 imports = [ 116 - (mkRenamedOptionModule ["services" "hercules-ci-agent" "extraOptions"] ["services" "hercules-ci-agent" "settings"]) 117 - (mkRenamedOptionModule ["services" "hercules-ci-agent" "baseDirectory"] ["services" "hercules-ci-agent" "settings" "baseDirectory"]) 118 - (mkRenamedOptionModule ["services" "hercules-ci-agent" "concurrentTasks"] ["services" "hercules-ci-agent" "settings" "concurrentTasks"]) 119 - (mkRemovedOptionModule ["services" "hercules-ci-agent" "patchNix"] "Nix versions packaged in this version of Nixpkgs don't need a patched nix-daemon to work correctly in Hercules CI Agent clusters.") 120 + (mkRenamedOptionModule [ "services" "hercules-ci-agent" "extraOptions" ] [ "services" "hercules-ci-agent" "settings" ]) 121 + (mkRenamedOptionModule [ "services" "hercules-ci-agent" "baseDirectory" ] [ "services" "hercules-ci-agent" "settings" "baseDirectory" ]) 122 + (mkRenamedOptionModule [ "services" "hercules-ci-agent" "concurrentTasks" ] [ "services" "hercules-ci-agent" "settings" "concurrentTasks" ]) 123 + (mkRemovedOptionModule [ "services" "hercules-ci-agent" "patchNix" ] "Nix versions packaged in this version of Nixpkgs don't need a patched nix-daemon to work correctly in Hercules CI Agent clusters.") 120 124 ]; 121 125 122 126 options.services.hercules-ci-agent = {
+4 -4
nixos/modules/services/continuous-integration/hercules-ci-agent/default.nix
··· 7 7 */ 8 8 9 9 { pkgs, config, lib, ... }: 10 - 11 10 let 12 - 13 11 inherit (lib) mkIf mkDefault; 14 12 15 13 cfg = config.services.hercules-ci-agent; ··· 21 19 { 22 20 imports = [ 23 21 ./common.nix 24 - (lib.mkRenamedOptionModule ["services" "hercules-ci-agent" "user"] ["systemd" "services" "hercules-ci-agent" "serviceConfig" "User"]) 22 + (lib.mkRenamedOptionModule [ "services" "hercules-ci-agent" "user" ] [ "systemd" "services" "hercules-ci-agent" "serviceConfig" "User" ]) 25 23 ]; 26 24 27 25 config = mkIf cfg.enable { ··· 80 78 isSystemUser = true; 81 79 }; 82 80 83 - users.groups.hercules-ci-agent = {}; 81 + users.groups.hercules-ci-agent = { }; 84 82 }; 83 + 84 + meta.maintainers = [ lib.maintainers.roberth ]; 85 85 }