Commit graph

4266 commits

Author SHA1 Message Date
Martin Weinelt 031aaa065b
queue-runner: don't decode base64 hostkey in hydra
Nix expects a base64 encoded hostkey in SSHMaster, so make sure we don't
decode this prematurely in hydra.

Reported-By: Puck Meerburg <puck@puck.moe>
2024-10-20 02:07:04 +02:00
Pierre Bourdon 3d519be538 web: replace 'errormsg' with 'errormsg IS NULL' in most cases
This is implement in an extremely hacky way due to poor DBIx feature
support. Ideally, what we'd need is a way to tell DBIx to ignore the
errormsg column unless explicitly requested, and to automatically add a
computed 'errormsg IS NULL' column in others. Since it does not support
that, this commit instead hacks some support via method overrides while
taking care to not break anything obvious.
2024-10-19 18:03:41 +02:00
ajs124 e56fb389b3 lazy-load evaluation errors
Closes #1362
2024-10-19 18:03:39 +02:00
Maximilian Bosch b99276c700 Only show stepname if it doesn't equal the name of the drv
When building e.g. nixpkgs, the "Running builds" view will mostly look
like this

    hello.x86_64-linux (Build of hello-X.Y)
    exa.x86_64-linux (Build of exa-X.Y)
    ...

This doesn't provide any useful information. Showing the step name only
makes sense if it's not a child of the job's derivation. With this
patch, that information will only be shown if the drv name (i.e. w/o
`/nix/store/` prefix, .drv ext & hash) is not equal to the drv name of
the job itself (build.nixname).
2024-10-19 18:01:59 +02:00
Maximilian Bosch d4d6bd2b84 Running builds view: show build step names
When using Hydra to build machine configurations, you'll often see
"nixosConfigurations.foo" five times, i.e. for each build step being
run. This isn't very helpful I think because in such a case, a single
build step can also be compiling the Linux kernel.

This change also fetches the `drvpath` and `type` from the `buildsteps`
relation. We're already joining it, so this doesn't make much difference
(confirmed via query logging that this doesn't cause extra SQL queries).

Unfortunately build steps don't have a human readable name, so I'm
deriving it from the drvpath by stripping away the hash (assuming that
it'll never contain a `-` and that `/nix/store/` is used as prefix). I
decided against using the Nix bindings for that to avoid too much
overhead due to store operations for each build step.
2024-10-19 18:01:55 +02:00
Maximilian Bosch 87f9eb33d3 Make "timed out" and "log limit exceeded" builds aborted
In 73694087a0 I gave builds that failed
because of a timeout or exceeded log limit a stop sign and I stand by
that reasoning: with that it's possible to distinguish between actual
build failures and rather transient things such as timeouts.

Back then I considered it a feature that these are shown in a different
tab, but I don't think that's a good idea anymore. When using a jobset to
e.g. track the regressions from a mass rebuild (like a compiler or gcc
update), "Newly failed builds" should exclusively display regressions (and
flaky builds of course, not much I can do about that).

Also, when a bunch of builds fail in such a jobset because of e.g. a
broken connection to a builder that results in a timeout, I want to be
able to restart them all w/o rebuilding actual regressions.

To make it clear that we not only have "Aborted" builds in the tab, I
renamed the label to "Aborted / Timed out".
2024-10-19 18:01:50 +02:00
Pierre Bourdon 1c951d90e4 queue-runner: release machine reservation while copying outputs
This allows for better builder usage when the queue runner is busy. To
avoid running into uncontrollable imbalances between builder/queue
runner, we only release the machine reservation after the local
throttler has found a slot to start copying the outputs for that build.
2024-10-19 17:51:03 +02:00
Pierre Bourdon 10282dcea0 queue-runner: switch to pseudorandom ordering of builds processing
We don't rely on sequential / monotonic build IDs processing anymore, so
randomizing actually has the advantage of mixing builds for different
systems together, to avoid only one chunk of builds for a single system
getting processed while builders for other systems are starved.
2024-10-19 17:50:59 +02:00
Pierre Bourdon a3fc251adc queue runner: introduce some parallelism for remote paths lookup
Each output for a given step being ingested is looked up in parallel,
which should basically multiply the speed of builds ingestion by the
average number of outputs per derivation.
2024-10-19 17:50:55 +02:00
Pierre Bourdon 56bd53c028 queue-runner: reduce the time between queue monitor restarts
This will induce more DB queries (though these are fairly cheap), but at
the benefit of processing bumps within 1m instead of within 10m.
2024-10-19 17:50:52 +02:00
Pierre Bourdon 6035a59030 queue-runner: remove id > X from new builds query
Running the query with/without it shows that it makes no difference to
postgres, since there's an index on finished=0 already. This allows a
few simplifications, but also paves the way towards running multiple
parallel monitor threads in the future.
2024-10-19 17:50:47 +02:00
Pierre Bourdon 268ba5e8e7 queue-runner: add prom metrics to allow detecting internal bottlenecks
By looking at the ratio of running vs. waiting for the dispatcher and
the queue monitor, we should get better visibility into what hydra is
currently bottlenecked on.

There are other side effects we can try to measure to get to the same
result, but having a simple way doesn't cost us much.
2024-10-19 17:50:43 +02:00
Pierre Bourdon 3992ccd6bb web: include current step status on /machines 2024-10-19 17:48:01 +02:00
Pierre Bourdon ca737c7e12 queue-runner: limit parallelism of CPU intensive operations
My current theory is that running more parallel xz than available CPU
cores is reducing our overall throughput by requiring more scheduling
overhead and more cache thrashing.
2024-10-19 17:47:53 +02:00
John Ericson c69e30122b
Merge pull request #1411 from NixOS/nix-2.24-upgrade-wip
Nix 2.24 upgrade wip
2024-10-08 01:07:18 -04:00
John Ericson 750275d6e8 Avoid trailing slash that broke lookup 2024-10-07 11:43:58 -04:00
John Ericson ceb8b48cce Fix type error with NAR accesssor 2024-09-24 12:14:23 -04:00
John Ericson 95003f2eb5
Merge pull request #1415 from NixOS/nix-2.23
Update to Nix 2.23
2024-09-24 12:00:47 -04:00
John Ericson 012cbd43f5 Add missing include 2024-09-24 11:51:17 -04:00
John Ericson 9a75361781 Merge branch 'nix-2.23' into nix-2.24-upgrade-wip 2024-09-24 11:50:03 -04:00
John Ericson 029116422d Update to Nix 2.23
Flake lock file updates:

• Updated input 'nix':
    'github:NixOS/nix/1c8150ac312b5f9ba1b3f6768ff43b09867e5883' (2024-04-23)
  → 'github:NixOS/nix/5ffd239adc9b7fddca7a2a59a8b87da5af14ec4d' (2024-09-23)
2024-09-24 11:38:01 -04:00
John Ericson 108e409559 Merge branch 'nix-2.22' 2024-09-24 11:25:33 -04:00
John Ericson 1a5bd9e103 Merge remote-tracking branch 'upstream/nix-2.21' into nix-2.22 2024-09-24 11:25:10 -04:00
John Ericson 647191cd4a Merge remote-tracking branch 'upstream/nix-2.21' 2024-09-24 11:23:21 -04:00
Jörg Thalheim 73e51b94b1
Merge pull request #1414 from cleverca22/fix-binary-cache
fix nar endpoint for binary cache hosting
2024-09-20 13:24:47 +02:00
hacker1024 1ef6b5e7b4 Use Nix::Store and Nix::Utils in NARInfo.pm
These are required for the `signString` and `readFile` subroutines used when signing NARs.

(cherry picked from commit b94a7b6d5c)
2024-09-20 08:04:23 -03:00
Jörg Thalheim 44248d3cf4
Merge pull request #1412 from NixOS/hydra-compress-logs
set a default for hydra-compress-logs service
2024-09-20 09:21:34 +02:00
Michael Bishop cc1b6d394e fix the binary cache calling isValidPath, and 2 other files with the same issue 2024-09-20 04:08:22 -03:00
zowoq b472f55563 set a default for hydra-compress-logs service
follow up from 99ca560d58
2024-09-20 09:04:15 +02:00
Jörg Thalheim c61bdd2c28
Merge pull request #1410 from NixOS/compiler-warnings
hydra-queue-runner: fix compilation warning
2024-09-20 09:00:55 +02:00
Jörg Thalheim 0231453cc5 hydra-eval-jobs: fix build against nix 2.24 2024-09-20 08:49:46 +02:00
Jörg Thalheim ae787e5799 bump nix to 2.24 2024-09-20 08:49:32 +02:00
Jörg Thalheim 2dad87ad89 hydra-queue-runner: fix compilation warning
instead of converting to double, we can convert to float right away.
2024-09-20 07:50:24 +02:00
Jörg Thalheim b6f44b5cd0
Merge pull request #1402 from NixOS/like-sub
tests: use `like` for testing regexes
2024-09-15 23:50:13 +02:00
Janne Heß c8b7a0fea9
Merge pull request #1403 from NixOS/docs
Devdocs: mention nix develop and nproc
2024-09-03 15:03:01 +02:00
Jörg Thalheim 2d79b0a4da
Merge pull request #1406 from NixOS/fix/remove-url-literal
default.nix: Drop URL literal
2024-08-27 21:41:42 +02:00
Martin Weinelt f730433789
Create eval-jobset role and guard /api/push route 2024-08-27 19:49:05 +02:00
Janne Heß 916531dc9c
api: Require POST for /api/push 2024-08-27 17:52:13 +02:00
Janne Heß 0ead8dc65c
default.nix: Drop URL literal 2024-08-27 17:44:36 +02:00
Jörg Thalheim b1a0501520
Merge pull request #1405 from hacker1024/patch-2
Use Nix::Store and Nix::Utils in NARInfo.pm
2024-08-27 17:09:37 +02:00
hacker1024 b94a7b6d5c Use Nix::Store and Nix::Utils in NARInfo.pm
These are required for the `signString` and `readFile` subroutines used when signing NARs.
2024-08-25 17:25:08 +10:00
Jörg Thalheim 9ee3c6aea2
Merge pull request #1400 from SuperSandro2000/feat/buildlogs-zstd
CompressLog: Add zstd compression
2024-08-21 09:43:39 +02:00
Jörg Thalheim 02a514234b hacking.md: make build parallel 2024-08-21 08:42:22 +02:00
Jörg Thalheim 54a9729a0f hacking.md: mention nix develop 2024-08-21 08:42:22 +02:00
Jörg Thalheim 250780aaf2 tests: use like for testing regexes
This gives us better diagnostics when the test fails.
2024-08-21 08:34:25 +02:00
Jörg Thalheim 4bb2f08be1
Merge pull request #1396 from nh2/hash-length-12
renderInputDiff: Increase git hash length 8 -> 12
2024-08-20 09:55:04 +02:00
Jörg Thalheim c23973785f
Merge pull request #1399 from Mindavi/bugfix/too-strict-timeouts
Looser timeouts, disable broken test, less verbose output
2024-08-20 09:54:40 +02:00
Sandro Jäckel b2b2d6e26c
Expand docs with new compression options 2024-08-18 17:59:36 +02:00
Sandro Jäckel 99ca560d58
Use configured compression in hydra-compress-logs service 2024-08-18 17:59:36 +02:00
Janne Heß 2c886f51d3
CompressLog: Add zstd compression 2024-08-09 18:52:03 +02:00