Skip to content

Split checking hydra eval on buildkite #1633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,39 @@ steps:
agents:
system: x86_64-linux

- label: 'Check that jobset will evaluate in Hydra'
- label: 'Check that jobset will evaluate in Hydra at ifdLevel 0 and 1'
command:
- nix-build build.nix -A maintainer-scripts.check-hydra -o check-hydra.sh
- ./check-hydra.sh 0
- ./check-hydra.sh 1
- ./check-hydra.sh 2
- ./check-hydra.sh 3
- ./check-hydra.sh --arg ifdLevel 0
- ./check-hydra.sh --arg ifdLevel 1
agents:
system: x86_64-linux

- label: 'Check that jobset will evaluate in Hydra at ifdLevel 2'
command:
- nix-build build.nix -A maintainer-scripts.check-hydra -o check-hydra.sh
- ./check-hydra.sh --arg ifdLevel 2
agents:
system: x86_64-linux

- label: 'Check that jobset will evaluate in Hydra at ifdLevel 3 and ghc 8.10'
command:
- nix-build build.nix -A maintainer-scripts.check-hydra -o check-hydra.sh
- "./check-hydra.sh --arg ifdLevel 3 --arg include 'x: __substring 0 6 x == \"ghc810\"'"
agents:
system: x86_64-linux

- label: 'Check that jobset will evaluate in Hydra at ifdLevel 3 and ghc 9.2'
command:
- nix-build build.nix -A maintainer-scripts.check-hydra -o check-hydra.sh
- "./check-hydra.sh --arg ifdLevel 3 --arg include 'x: __substring 0 5 x == \"ghc92\"'"
agents:
system: x86_64-linux

- label: 'Check that jobset will evaluate in Hydra at ifdLevel 3 and not (ghc 8.10 or ghc 9.2)'
command:
- nix-build build.nix -A maintainer-scripts.check-hydra -o check-hydra.sh
- "./check-hydra.sh --arg ifdLevel 3 --arg include 'x: !(__substring 0 6 x == \"ghc810\" || __substring 0 5 x == \"ghc92\")'"
agents:
system: x86_64-linux

Expand Down
7 changes: 4 additions & 3 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# on a machine with e.g. no way to build the Darwin IFDs you need!
{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
, ifdLevel ? 3
, include ? (compiler-nix-name: true)
, checkMaterialization ? false }:

let
Expand All @@ -16,7 +17,7 @@ let
lib = genericPkgs.lib;
ci = import ./ci.nix { inherit supportedSystems ifdLevel checkMaterialization; restrictEval = true; };
allJobs = stripAttrsForHydra (filterDerivations ci);
latestJobs = {
latestJobs = lib.optionalAttrs (include "ghc8107") {
# All the jobs are included in the `requiredJobs`, but the ones
# added here will also included without aggregation, making it easier
# to find a failing test. Keep in mind though that adding too many
Expand All @@ -32,7 +33,7 @@ let
let nixpkgsJobs = allJobs.${nixpkgsVer};
in lib.concatMap (compiler-nix-name:
let ghcJobs = nixpkgsJobs.${compiler-nix-name};
in builtins.concatMap (platform:
in lib.optionals (include compiler-nix-name) (builtins.concatMap (platform:
let platformJobs = ghcJobs.${platform};
in builtins.map (crossPlatform: {
name = "required-${nixpkgsVer}-${compiler-nix-name}-${platform}-${crossPlatform}";
Expand All @@ -42,7 +43,7 @@ let
constituents = lib.collect (d: lib.isDerivation d) platformJobs.${crossPlatform};
};
}) (names platformJobs)
) (names ghcJobs)
) (names ghcJobs))
) (names nixpkgsJobs)
) (names allJobs));
in traceNames "job " (latestJobs // requiredJobs // {
Expand Down
4 changes: 2 additions & 2 deletions scripts/check-hydra.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ writeScript "check-hydra.sh" ''
export PATH="${makeBinPath [ coreutils time gnutar gzip hydra-unstable jq gitMinimal ]}"
export NIX_PATH=

echo '~~~ Evaluating release.nix with --arg ifdLevel '$1
echo '~~~ Evaluating release.nix with' "$@"
command time --format '%e' -o eval-time.txt \
hydra-eval-jobs \
--option allowed-uris "https://github.com/NixOS https://github.com/input-output-hk" \
--arg supportedSystems '[ builtins.currentSystem ]' \
--arg ifdLevel $1 \
"$@" \
-I $(realpath .) release.nix > eval.json
EVAL_EXIT_CODE="$?"
if [ "$EVAL_EXIT_CODE" != 0 ]
Expand Down