Merge pull request #98973 from Ma27/bump-hydra

hydra-unstable: 2020-09-02 -> 2020-10-20

authored by Eelco Dolstra and committed by GitHub 05bdfd6f d82e6359

+8 -152
+2 -31
nixos/modules/services/continuous-integration/hydra/default.nix
··· 37 37 38 38 haveLocalDB = cfg.dbi == localDB; 39 39 40 - inherit (config.system) stateVersion; 41 - 42 40 hydra-package = 43 41 let 44 42 makeWrapperArgs = concatStringsSep " " (mapAttrsToList (key: value: "--set \"${key}\" \"${value}\"") hydraEnv); ··· 96 94 97 95 package = mkOption { 98 96 type = types.package; 99 - defaultText = "pkgs.hydra"; 97 + default = pkgs.hydra-unstable; 98 + defaultText = "pkgs.hydra-unstable"; 100 99 description = "The Hydra package."; 101 100 }; 102 101 ··· 224 223 ###### implementation 225 224 226 225 config = mkIf cfg.enable { 227 - 228 - warnings = optional (cfg.package.migration or false) '' 229 - You're currently deploying an older version of Hydra which is needed to 230 - make some required database changes[1]. As soon as this is done, it's recommended 231 - to run `hydra-backfill-ids` and set `services.hydra.package` to `pkgs.hydra-unstable` 232 - after that. 233 - 234 - [1] https://github.com/NixOS/hydra/pull/711 235 - ''; 236 - 237 - services.hydra.package = with pkgs; 238 - mkDefault ( 239 - if pkgs ? hydra 240 - then throw '' 241 - The Hydra package doesn't exist anymore in `nixpkgs`! It probably exists 242 - due to an overlay. To upgrade Hydra, you need to take two steps as some 243 - bigger changes in the database schema were implemented recently[1]. You first 244 - need to deploy `pkgs.hydra-migration`, run `hydra-backfill-ids` on the server 245 - and then deploy `pkgs.hydra-unstable`. 246 - 247 - If you want to use `pkgs.hydra` from your overlay, please set `services.hydra.package` 248 - explicitly to `pkgs.hydra` and make sure you know what you're doing. 249 - 250 - [1] https://github.com/NixOS/hydra/pull/711 251 - '' 252 - else if versionOlder stateVersion "20.03" then hydra-migration 253 - else hydra-unstable 254 - ); 255 226 256 227 users.groups.hydra = { 257 228 gid = config.ids.gids.hydra;
-1
nixos/tests/all-tests.nix
··· 150 150 hostname = handleTest ./hostname.nix {}; 151 151 hound = handleTest ./hound.nix {}; 152 152 hydra = handleTest ./hydra {}; 153 - hydra-db-migration = handleTest ./hydra/db-migration.nix {}; 154 153 i3wm = handleTest ./i3wm.nix {}; 155 154 icingaweb2 = handleTest ./icingaweb2.nix {}; 156 155 iftop = handleTest ./iftop.nix {};
-92
nixos/tests/hydra/db-migration.nix
··· 1 - { system ? builtins.currentSystem 2 - , pkgs ? import ../../.. { inherit system; } 3 - , ... 4 - }: 5 - 6 - let inherit (import ./common.nix { inherit system; }) baseConfig; in 7 - 8 - with import ../../lib/testing-python.nix { inherit system pkgs; }; 9 - with pkgs.lib; 10 - 11 - { mig = makeTest { 12 - name = "hydra-db-migration"; 13 - meta = with pkgs.stdenv.lib.maintainers; { 14 - maintainers = [ ma27 ]; 15 - }; 16 - 17 - nodes = { 18 - original = { pkgs, lib, ... }: { 19 - imports = [ baseConfig ]; 20 - 21 - # An older version of Hydra before the db change 22 - # for testing purposes. 23 - services.hydra.package = pkgs.hydra-migration.overrideAttrs (old: { 24 - inherit (old) pname; 25 - version = "2020-02-06"; 26 - src = pkgs.fetchFromGitHub { 27 - owner = "NixOS"; 28 - repo = "hydra"; 29 - rev = "2b4f14963b16b21ebfcd6b6bfa7832842e9b2afc"; 30 - sha256 = "16q0cffcsfx5pqd91n9k19850c1nbh4vvbd9h8yi64ihn7v8bick"; 31 - }; 32 - }); 33 - }; 34 - 35 - migration_phase1 = { pkgs, lib, ... }: { 36 - imports = [ baseConfig ]; 37 - services.hydra.package = pkgs.hydra-migration; 38 - }; 39 - 40 - finished = { pkgs, lib, ... }: { 41 - imports = [ baseConfig ]; 42 - services.hydra.package = pkgs.hydra-unstable; 43 - }; 44 - }; 45 - 46 - testScript = { nodes, ... }: let 47 - next = nodes.migration_phase1.config.system.build.toplevel; 48 - finished = nodes.finished.config.system.build.toplevel; 49 - in '' 50 - original.start() 51 - original.wait_for_unit("multi-user.target") 52 - original.wait_for_unit("postgresql.service") 53 - original.wait_for_unit("hydra-init.service") 54 - original.require_unit_state("hydra-queue-runner.service") 55 - original.require_unit_state("hydra-evaluator.service") 56 - original.require_unit_state("hydra-notify.service") 57 - original.succeed("hydra-create-user admin --role admin --password admin") 58 - original.wait_for_open_port(3000) 59 - original.succeed("create-trivial-project.sh") 60 - original.wait_until_succeeds( 61 - 'curl -L -s http://localhost:3000/build/1 -H "Accept: application/json" | jq .buildstatus | xargs test 0 -eq' 62 - ) 63 - 64 - out = original.succeed("su -l postgres -c 'psql -d hydra <<< \"\\d+ builds\" -A'") 65 - assert "jobset_id" not in out 66 - 67 - original.succeed( 68 - "${next}/bin/switch-to-configuration test >&2" 69 - ) 70 - original.wait_for_unit("hydra-init.service") 71 - 72 - out = original.succeed("su -l postgres -c 'psql -d hydra <<< \"\\d+ builds\" -A'") 73 - assert "jobset_id|integer|||" in out 74 - 75 - original.succeed("hydra-backfill-ids") 76 - 77 - original.succeed( 78 - "${finished}/bin/switch-to-configuration test >&2" 79 - ) 80 - original.wait_for_unit("hydra-init.service") 81 - 82 - out = original.succeed("su -l postgres -c 'psql -d hydra <<< \"\\d+ builds\" -A'") 83 - assert "jobset_id|integer||not null|" in out 84 - 85 - original.wait_until_succeeds( 86 - 'curl -L -s http://localhost:3000/build/1 -H "Accept: application/json" | jq .buildstatus | xargs test 0 -eq' 87 - ) 88 - 89 - original.shutdown() 90 - ''; 91 - }; 92 - }
+1 -1
nixos/tests/hydra/default.nix
··· 11 11 inherit (import ./common.nix { inherit system; }) baseConfig; 12 12 13 13 hydraPkgs = { 14 - inherit (pkgs) hydra-migration hydra-unstable; 14 + inherit (pkgs) hydra-unstable; 15 15 }; 16 16 17 17 makeHydraTest = with pkgs.lib; name: package: makeTest {
+1
pkgs/development/tools/misc/hydra/common.nix
··· 66 66 TextDiff 67 67 TextTable 68 68 XMLSimple 69 + YAML 69 70 nix 70 71 nix.perl-bindings 71 72 git
+3 -26
pkgs/development/tools/misc/hydra/default.nix
··· 1 1 { fetchFromGitHub, nixStable, callPackage, nixFlakes, nixosTests }: 2 2 3 3 { 4 - # Package for phase-1 of the db migration for Hydra. 5 - # https://github.com/NixOS/hydra/pull/711 6 - hydra-migration = callPackage ./common.nix { 7 - version = "2020-02-10"; 8 - src = fetchFromGitHub { 9 - owner = "NixOS"; 10 - repo = "hydra"; 11 - rev = "add4f610ce6f206fb44702b5a894d877b3a30e3a"; 12 - sha256 = "1d8hdgjx2ys0zmixi2ydmimdq7ml20h1ji4amwawcyw59kssh6l3"; 13 - }; 14 - nix = nixStable; 15 - migration = true; 16 - 17 - tests = { 18 - db-migration = nixosTests.hydra-db-migration.mig; 19 - basic = nixosTests.hydra.hydra-migration; 20 - }; 21 - }; 22 - 23 - # Hydra from latest master branch. Contains breaking changes, 24 - # so when having an older version, `pkgs.hydra-migration` should be deployed first. 25 - 26 4 hydra-unstable = callPackage ./common.nix { 27 - version = "2020-09-02"; 5 + version = "2020-10-20"; 28 6 src = fetchFromGitHub { 29 7 owner = "NixOS"; 30 8 repo = "hydra"; 31 - rev = "e707990e2d6afab203c7ef1d769d49c564eff151"; 32 - sha256 = "0iilf953f6s58szzyd1hzc9b2b2yw8lhbsb8xrb08szpfz7ifwqa"; 9 + rev = "79d34ed7c93af2daf32cf44ee0e3e0768f13f97c"; 10 + sha256 = "1lql899430137l6ghnhyz0ivkayy83fdr087ck2wq3gf1jv8pccj"; 33 11 }; 34 12 nix = nixFlakes; 35 13 36 14 tests = { 37 - db-migration = nixosTests.hydra-db-migration.mig; 38 15 basic = nixosTests.hydra.hydra-unstable; 39 16 }; 40 17 };
+1 -1
pkgs/top-level/all-packages.nix
··· 13042 13042 hwloc = callPackage ../development/libraries/hwloc {}; 13043 13043 13044 13044 inherit (callPackage ../development/tools/misc/hydra { }) 13045 - hydra-migration hydra-unstable; 13045 + hydra-unstable; 13046 13046 13047 13047 hydra-flakes = throw '' 13048 13048 Flakes support has been merged into Hydra's master. Please use