Commit Graph

64 Commits

Author SHA1 Message Date
67ebce8493 Output evaluation errors without crashing if aggregate job is broken.
At the moment, aggregate jobs can easily break and cause the entire
evaluation to fail, which is not ideal. For Nixpkgs, we do have some
important aggregate jobs (like `tested`), but for debugging and building
purposes it's still useful to get a partial result even if the channel
won't actually advance.

This commit changes the behaviour of hydra-eval-jobs such that it
aggregates any errors found during the construction of an aggregate, and
will instead annotate the job with the evaluation failure such that it
shows up in a "cleaner" way.

There are really two types of failure that we care about: one is where
the attribute just ends up missing altogether in the final output, and
also where the attribute is in the output but fails to evaluate. Both
are handled here.

Note that this does mean that the same error message may be output
multiple times, but this aids debuggability because it'll be much
clearer what's blocking the job from being created.
2021-10-26 10:14:34 +01:00
8cf158b7a9 Revert "Fix unhelpful error messages in aggregate jobs." 2021-10-23 22:23:29 -04:00
3516950d3c Merge pull request #825 from samueldr/fix/unhelpful-errors-in-aggregates
Fix unhelpful error messages in aggregate jobs.
2021-10-23 20:34:50 -04:00
24959a3ca6 Allow for evaluator_pure_eval to be configured 2021-06-28 16:24:40 -07:00
107d60027f hydra-eval-jobs: Fix unexpected EOF when a top-level attr fails 2021-02-22 16:29:07 +01:00
a7d8ee98da Fix build 2021-02-22 15:10:24 +01:00
d38ef4492e Update for Nix Value::type API changes
This updates hydra to be compatible with Nix https://github.com/NixOS/nix/pull/4355.

Along with https://github.com/NixOS/hydra/pull/840 needed for https://github.com/NixOS/nixpkgs/pull/107909

/cc @edolstra
2020-12-29 17:25:51 -06:00
b5140c1da1 hydra-eval-jobs: Transmit original Nix error when handling aggregate jobs
It might happen that a job from the aggregate returned an error!

This is what the vague "[json.exception.type_error.302] type must be string, but is null"
was all about in this instance; there was no `drvPath` to stringify!

So we now actively watch for errors and copy them to the aggregate job.
2020-10-25 20:13:07 -04:00
68e689cace hydra-eval-jobs: Identify unexpected errors in handling aggregate jobs
The vague "[json.exception.type_error.302] type must be string, but is null"
is **absolutely** unhelpful in the way Hydra currently handles it on
evaluation.

This is handling *unexpected* errors only; the following commit will
handle the specific instance of the previously mentioned error.
2020-10-25 19:27:15 -04:00
6cd2bb6954 Fix build 2020-10-18 21:01:06 +02:00
9cc76f6d69 Fix build with latest Nix
Recently a few internal APIs have changed[1]. The `outputPaths` function
has been removed and a lot of data structures are modeled with
`std::optional` which broke compilation.

This patch updates the code in `hydra-queue-runner` accordingly to make
sure that Hydra compiles again.

[1] https://github.com/NixOS/nix/pull/3883
2020-09-26 23:37:39 +02:00
2c61779816 fix build after nix commit 82b77a77262c414044fffc7ad8b955ad91827995 2020-09-14 15:30:59 +02:00
405c52b589 Fix build 2020-08-27 17:46:36 +02:00
1113c2895a Fix build 2020-08-07 21:42:09 +02:00
7d3ba616a9 Fix build 2020-08-04 11:33:29 +02:00
7985757a1d Fix build 2020-07-08 12:50:02 +02:00
bb32aafa4a Fix build 2020-06-23 13:56:44 +02:00
15a45f1a8a Fix build 2020-05-12 16:14:20 +02:00
7889aef792 hydra-eval-jobs: Mirror eval errors in STDERR
Otherwise, errors will not be shown to end-users, which makes debugging
long evals pretty much impossible.

(cherry picked from commit 76299b9174)
2020-03-31 12:48:33 +02:00
4b5bb4e760 Merge remote-tracking branch 'origin/master' into flake 2020-03-04 15:28:23 +01:00
123bee1db5 Restore job type checking 2020-03-04 15:16:26 +01:00
69a6f3448a Fix calling job functions
Fixes #718.
2020-03-04 15:16:04 +01:00
eb5873ae53 Fix build 2020-02-20 11:19:45 +01:00
c642f787ee hydra-eval-jobs: Parallelize
(cherry picked from commit be8eb9d00d)
2020-02-20 10:28:58 +01:00
e4f5156c41 Build against nix-master
(cherry picked from commit e7f2139e25)
2020-02-20 10:24:04 +01:00
be8eb9d00d hydra-eval-jobs: Parallelize 2020-02-19 21:10:22 +01:00
6f1d68bda4 Revert "hydra-eval-jobs -> nix eval-hydra-jobs"
This reverts commit 345512a6d0.
2020-02-19 20:36:52 +01:00
345512a6d0 hydra-eval-jobs -> nix eval-hydra-jobs 2020-02-15 15:59:34 +01:00
ba8814a245 Fix build 2020-02-03 18:43:45 +01:00
e7f2139e25 Build against nix-master 2019-12-30 22:49:26 +01:00
7936a29364 hydra-eval-jobs: Use 'checks' output if there is no 'hydraJobs' output 2019-06-03 13:55:32 +02:00
9a8880fd28 Doh 2019-06-03 13:53:22 +02:00
0042183717 Fix build 2019-06-03 12:23:49 +02:00
b7be2bf9ad Fix build against the latest flakes branch 2019-05-22 14:51:55 +02:00
6ee6ec3bda hydra-eval-jobs: Support flakes
E.g. 'hydra-eval-jobs ~/Dev/patchelf' is enough to evaluate patchelf -
no need to set up a $NIX_PATH, pass arguments, etc.
2019-05-11 00:11:38 +02:00
2c60019910 hydra-eval-jobs: Modernize argument parser 2019-05-11 00:11:38 +02:00
8f3114960c Remove the hydra-eval-jobs restart hack
It's not very effective.
2019-05-10 21:57:19 +02:00
0721f6623f Merge pull request #627 from samueldr/hydra-eval-jobs/warn-max-heap-size
hydra-eval-jobs: Warn and resets maxHeapSize on bad values
2019-03-17 19:36:53 -04:00
aa87e7a52e hydra-eval-jobs: fix maintainer resolution
Some time ago the data structure for maintainer descriptions in
`nixpkgs` changed from a simple attr set with maintainer emails as
values to an attribute set where the maintainer' nick is associated to
an attribute set with email, GitHub handle and full name.

Hydra can either parse a Nix list or fetches `shortName` from the
associated attribute set (which is used for `meta.licenses` as each
value in it contains a `shortName`). This behavior needs to be
replicated for maintainers to retrieve the emails for `hydra-notify`.

This change is backwards-compatible since `queryMetaStrings` is still
able to understand lists, so old versions of `nixpkgs` or packages using
the old maintainer data structure remain usable.
2018-12-29 14:47:03 +01:00
dd188d3035 hydra-eval-jobs: Warn and resets maxHeapSize on bad values
This is because setting only the initial heap size to more than
the default value (or the configured value) will cause all initial evals
until maxHeapSize expands to the given value to abort.

The 1.1 multiplier comes from the the configured defaults on NixOS' hydra,
and from the previous multiplier used before
7876cf677c.
2018-12-21 22:57:07 -05:00
b542b73ced hydra-eval-jobs: Reinitialize Boehm GC in the child
This is necessary to prevent hangs in the garbage collector.
2018-08-10 20:25:43 +02:00
7876cf677c Increase maxHeapSize more gradually 2018-08-10 19:23:31 +02:00
4dca8fe14d Gradually increase maxHeapSize 2018-08-07 11:47:53 +02:00
dca6c5a983 hydra-eval-jobs: Filter ANSI escape sequences 2018-08-01 17:06:32 +02:00
162d671c48 Revert "Fix broken build.x86_64-linux job (#573)"
This reverts commit c2e2b42877, which
breaks building with nixUnstable.
2018-07-31 10:23:41 +02:00
c2e2b42877 Fix broken build.x86_64-linux job (#573)
The job has been failing since https://hydra.nixos.org/eval/1461286
with the following error:

    hydra-eval-jobs.cc:278:17: error: 'evalSettings' was not declared in this scope
                     evalSettings.restrictEval = true;
                     ^~~~~~~~~~~~

This is likely due to a typo in 0882519 where that line and the
corresponding comment were moved, and `settings` was changed in that
one place to `evalSettings`.

I reproduced the error by running `nix-build release.nix -A
build.x86_64-linux` on my machine, and this small change fixes it.
2018-07-07 19:15:01 +01:00
0882519b10 hydra-eval-jobs: Ugly hackery to reduce memory usage
You can now set 'evaluator_max_heap_size' to make hydra-eval-jobs
restart itself if the Boehm heap exceeds the specified size.

For example, with 'evaluator_max_heap_size = 256000000',

  $ hydra-eval-jobs '<nixpkgs/pkgs/top-level/release.nix>' -I nixpkgs=channel:nixos-17.09

has a max RSS of .56 GiB rather than 4.7 GiB.

Unfortunately it doesn't help much for the NixOS jobsets because of
the "tested" job which requires a huge amount of memory all by itself.
2018-06-05 13:24:23 +02:00
39eca8bef1 Fix build against Nix master 2018-06-05 13:24:23 +02:00
4e27796eba Allow setting GC_INITIAL_HEAP_SIZE for hydra-eval-jobs
This cannot be done in the hydra-evaluator systemd unit, since then
every other Nix process (e.g. hydra-evaluator and nix-prefetch-*) will
also allocate the specified heap size, probably leading to OOM.
2018-05-16 14:14:53 +02:00
364e21919a hydra-eval-{jobs,jobset}: Pass file name as <...> 2017-11-28 16:51:00 +01:00