Commit graph

4204 commits

Author SHA1 Message Date
John Ericson b3e0d9a8b7
Merge pull request #1387 from NixOS/pipe-buffer-size
Some checks failed
Test / tests (push) Has been cancelled
queue-runner: try larger pipe buffer sizes
2024-05-23 11:50:15 -04:00
Pierre Bourdon 5728011da1 queue-runner: try larger pipe buffer sizes
(cherry picked from commit 18466e83261d39b997a73bbd9f0f249c3a91fbeb)
2024-05-23 11:42:35 -04:00
John Ericson 559376e907
Merge pull request #1377 from SuperSandro2000/fix-doi-1375
Fix doi resolution after #1375
2024-05-21 18:11:21 -04:00
Janne Heß 998df1657e
Merge pull request #1382 from Mic92/patch-1
README: update wiki link
2024-05-08 21:37:18 +02:00
Jörg Thalheim f99cdaf5fe
README: update wiki link 2024-05-08 21:31:32 +02:00
John Ericson 3bf00e31c0
Merge pull request #1381 from NixOS/factor-out-tests
Try again to ensure hydra module is usable
2024-05-03 12:50:02 -04:00
John Ericson e149da7b9b Try again to ensure hydra module is usable
Nixpkgs only contains a `hydra_unstable`, not `hydra`, package, so
adjust the default accordingly, and then override it to our package in
the separate module which does that.
2024-05-03 12:41:17 -04:00
John Ericson e81c36ac92
Merge pull request #1380 from NixOS/factor-out-tests
Factor out NixOS tests, and clean up
2024-05-03 12:33:50 -04:00
John Ericson 743795b2b0 Factor out NixOS tests, and clean up
Due to newer nixpkgs, there were a number of things that could be
cleaned up in the process.
2024-05-03 12:26:06 -04:00
John Ericson 50378aef22
Merge pull request #1379 from NixOS/remove-unneeded-override
Remove `PrometheusTiny` from overlay
2024-05-03 12:06:29 -04:00
John Ericson 92155f9a07 Remove PrometheusTiny from overlay
It's in Nixpkgs for a good while now.
2024-05-03 11:41:48 -04:00
John Ericson 29ce5c603c
Merge pull request #1378 from NixOS/nix-2.22
Update to Nix 2.22
2024-05-03 11:14:49 -04:00
John Ericson 4bd687e3e6 Update to Nix 2.22
Flake lock file updates:

• Updated input 'nix':
    'github:NixOS/nix/60824fa97c588a0faf68ea61260a47e388b0a4e5' (2024-04-11)
  → 'github:NixOS/nix/1c8150ac312b5f9ba1b3f6768ff43b09867e5883' (2024-04-23)
• Added input 'nix/flake-parts':
    'github:hercules-ci/flake-parts/9126214d0a59633752a136528f5f3b9aa8565b7d' (2024-04-01)
• Added input 'nix/flake-parts/nixpkgs-lib':
    follows 'nix/nixpkgs'
• Added input 'nix/pre-commit-hooks':
    'github:cachix/pre-commit-hooks.nix/40e6053ecb65fcbf12863338a6dcefb3f55f1bf8' (2024-04-12)
• Added input 'nix/pre-commit-hooks/flake-compat':
    follows 'nix'
• Added input 'nix/pre-commit-hooks/flake-utils':
    'github:numtide/flake-utils/5aed5285a952e0b949eb3ba02c12fa4fcfef535f' (2022-11-02)
• Added input 'nix/pre-commit-hooks/gitignore':
    follows 'nix'
• Added input 'nix/pre-commit-hooks/nixpkgs':
    follows 'nix/nixpkgs'
• Added input 'nix/pre-commit-hooks/nixpkgs-stable':
    follows 'nix/nixpkgs'
2024-05-03 10:47:43 -04:00
Sandro Jäckel 1b8154e67f
Fix doi resolution after #1375
This fixes:

> Caught exception in Hydra::Controller::Root->realisations "Undefined subroutine &Hydra::Controller::Root::queryRawRealisation called at /nix/store/v842xb35ph8ka1yi1xanjhk4xh1pn5nm-hydra-2024-04-22/libexec/hydra/lib/Hydra/Controller/Root.pm line 371."
2024-05-03 14:31:34 +02:00
Pierre Bourdon b72528be50
web: serveFile: also serve a CSP putting served HTML in its own origin 2024-04-22 16:28:50 +02:00
John Ericson 8b48579593
Merge pull request #1374 from Mindavi/bugfix/rendering-issue-content-addressed
ca-derivations: fix rendering issue
2024-04-18 13:08:30 -04:00
John Ericson ef7bf1e67b
Merge pull request #1375 from NixOS/nix-2.21
Nix 2.21
2024-04-12 17:28:37 -04:00
John Ericson ab1f64aa4d flake.lock: Update
Flake lock file updates:

• Updated input 'nix':
    'github:NixOS/nix/c4ebb82da4eade975e874da600dc50e9dec610cb' (2024-02-12)
  → 'github:NixOS/nix/60824fa97c588a0faf68ea61260a47e388b0a4e5' (2024-04-11)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/a1982c92d8980a0114372973cbdfe0a307f1bdea' (2024-01-12)
  → 'github:NixOS/nixpkgs/1d6a23f11e44d0fb64b3237569b87658a9eb5643' (2024-04-11)
• Removed input 'nixpkgs-for-fileset'
2024-04-12 12:26:11 -04:00
Rick van Schijndel 3f913a771d t: content-addressed: add a comment about a misleading testcase 2024-04-03 22:55:42 +02:00
Rick van Schijndel 71986632ce hydra-server: findLog: fix issue with ca-derivations enabled
When content addressed derivations are built on the hydra server,
one may run into an issue where some builds suddenly don't load anymore.

This seems to be caused by outPaths that are NULL (which is
allowed for ca-derivations). Filter them out to prevent querying the
database for them, which is not supported by the database abstraction
layer that's currently in use.

On my instance this appears to resolve the issue.
I feel like I might be doing this at the wrong abstraction layer, but on
the other hand -- it seems to resolve it and it also doesn't really look
like it will hurt anything.

The test added in a previous commit uncovers this issue, and this commit
resolves it. So I'm happy with this patch for now.

The issue I was seeing on my server:

hydra-server[2549]: [error] Couldn't render template "undef error - DBIx::Class::SQLMaker::ClassicExtensions::puke(): Fatal: NULL-within-IN not implemented: The upcoming SQL::Abstract::Classic 2.0 will emit the logically correct SQL instead of raising this exception. at /nix/store/<hash>-hydra-unstable-2024-03-08_nix_2_20/libexec/hydra/lib/Hydra/Helper/Nix.pm line 190

See also short discussion here: https://github.com/NixOS/nixpkgs/pull/297392#issuecomment-2035366263
2024-04-03 22:47:22 +02:00
Rick van Schijndel 1665aed5e3 t: content-addressed: add test for caDependingOnFailingCA
This uncovers an issue with the front-end.
2024-04-03 22:45:53 +02:00
John Ericson b676b08fac
Merge pull request #1368 from Ma27/login-submit-btn
Use `submit` event in login form
2024-03-26 11:23:51 -04:00
John Ericson d614163e9c
Merge pull request #1370 from Ma27/reconnect-db
hydra-queue-runner: drop broken connections from pool
2024-03-26 11:21:35 -04:00
Maximilian Bosch 99afff03b0
hydra-queue-runner: drop broken connections from pool
Closes #1336

When restarting postgresql, the connections are still reused in
`hydra-queue-runner` causing errors like this

    main thread: Lost connection to the database server.
    queue monitor: Lost connection to the database server.

and no more builds being processed.

`hydra-evaluator` doesn't have that issue since it crashes right away.
We could let it retry indefinitely as well (see below), but I don't
want to change too much.

If the DB is still unreachable 10s later, the process will stop with a
non-zero exit code because of a missing DB connection. This however
isn't such a big deal because it will be immediately restarted
afterwards. With the current configuration, Hydra will never give up,
but restart (and retry) infinitely. To me that seems reasonable, i.e. to
retry DB connections on a long-running process. If this doesn't work
out, the monitoring should fire anyways because the queue fills up, but
I'm open to discuss that.

Please note that this isn't reproducible with the DB and the queue
runner on the same machine when using `services.hydra-dev`, because of
the `Requires=` dependency `hydra-queue-runner.service` ->
`hydra-init.service` -> `postgresql.service` that causes the queue
runner to be restarted on `systemctl restart postgresql`.

Internally, Hydra uses Nix's pool data structure: it basically has N
slots (here DB connections) and whenever a new one is requested, an idle
slot is provided or a new one is created (when N slots are active, it'll
be waited until one slot is free). The issue in the code here is however
that whenever an error is encountered, the slot is released, however the
same broken connection will be reused the next time. By using
`Pool::Handle::markBad`, Nix will drop a broken slot. This is now being
done when `pqxx::broken_connection` was caught.
2024-03-15 14:09:31 +01:00
ajs124 8f56209bd6
Merge pull request #1361 from Ma27/fix-gitea-test
flake: fix gitea integration test
2024-03-08 15:28:07 +01:00
Maximilian Bosch 806c375c33
Don't send gitea status update when build is started
This was the source of a flaky test because sometimes hydra-notify was
quick enough to send out `buildStarted` and sometimes it apparently
wasn't which was quickly spottable with `nix build --rebuild`.

Removing that status update doesn't make a difference functionally,
gitea doesn't differentiate between "queued" and "running", so we send
the same status ("pending") out on both events, so we'd even safe one
avoidable request.
2024-03-08 11:07:38 +01:00
Maximilian Bosch 669617ab54
Use submit event in login form
It's a pet peeve from me when logging into my personal Hydra that I
always have to press the button rather than hitting Return after entering
my password.

Reason for that is that the form doesn't have a "submit" button, so far
it was always listened to the "click" event. Submit does that and you
can hit Return alternatively.
2024-03-07 18:49:52 +01:00
Janne Heß c45c06509a
Merge pull request #1364 from K900/urlencode-logs
urlencode drv names when fetching logs
2024-03-01 10:11:08 +01:00
Ilya K 9db5d0a88d urlencode drv names when fetching logs
Otherwise names with special characters like + break things.
2024-02-26 22:48:16 +03:00
John Ericson 973cb644d3
Merge pull request #1359 from Ma27/nix-perl-bindings
Update perl bindings for nix#9863
2024-02-12 12:55:50 -05:00
Maximilian Bosch e499509595
Switch to new Nix bindings, update Nix for that
Implements support for Nix's new Perl bindings[1]. The current state
basically does `openStore()`, but always uses `auto` and doesn't support
stores at other URIs.

Even though the stores are cached inside the Perl implementation, I
decided to instantiate those once in the Nix helper module. That way
store openings aren't cluttered across the entire codebase. Also, there
are two stores used later on - MACHINE_LOCAL_STORE for `auto`,
BINARY_CACHE_STORE for the one from `store_uri` in `hydra.conf` - and
using consistent names should make the intent clearer then.

This doesn't contain any behavioral changes, i.e. the build product
availability issue from #1352 isn't fixed. This patch only contains the
migration to the new API.

[1] https://github.com/NixOS/nix/pull/9863
2024-02-12 18:50:56 +01:00
Maximilian Bosch ceff5c5cfe
flake: fix gitea integration test
This is an integration test that confirms that jobset definitions from
git repositories are correctly built and status updates pushed to the
gitea instance. The following things needed to be fixed:

* We're still on 23.05 where gitea is marked as insecure. Not going to
  update nixpkgs right now, but going for the quick fix.
* Since gitea 1.19 tokens have scopes that describe what's possible.
  Not specifying the scope in the DB appears to imply that no
  permissions are granted.
* Apparently we have three status updates now (for three status hooks,
  queued/started/finished). No idea why that was broken before, but the
  behavior still looks correct.
2024-02-12 18:30:03 +01:00
John Ericson 878c0f240e Switch (back) to Nix master
Re-creating `nix-next` after using it in #1354.

Flake lock file updates:

• Updated input 'nix':
    'github:NixOS/nix/8df68a213fc52a57b02a57005b0e06cc8de40ce3' (2024-01-25)
  → 'github:NixOS/nix/75ebb90a70f6320c1c7a1fca87a0a8adb0716143' (2024-01-30)
2024-01-30 14:09:38 -05:00
John Ericson c1bd50a80d
Merge pull request #1354 from NixOS/nix-2.20
Nix 2.20
2024-01-30 14:07:49 -05:00
John Ericson 14aabc1cc9 Update to released Nix 2.20
Flake lock file updates:

• Updated input 'nix':
    'github:NixOS/nix/8df68a213fc52a57b02a57005b0e06cc8de40ce3' (2024-01-25)
  → 'github:NixOS/nix/8f42912c80c0a03f62f6a3d28a3af05a9762565d' (2024-01-30)
2024-01-30 13:33:20 -05:00
John Ericson 7b826ec5ad Merge branch 'nix-next' into nix-2.20 2024-01-30 13:26:45 -05:00
John Ericson 838648c0ce
Merge pull request #1349 from NixOS/ca-no-new-col
Allow building content-addressed derivations with hydra, minimally
2024-01-26 17:54:02 -05:00
John Ericson 6ac4292912
Merge pull request #1351 from Ma27/hacking-fixes
Small fixes for the development environment
2024-01-26 17:22:42 -05:00
John Ericson b503280256 Add migration to drop non-null constraints 2024-01-26 11:53:58 -05:00
Maximilian Bosch b4c91b5a6a
package: move foreman to nativeCheckInputs
In 1bd195a513 strictDeps was set for the
Hydra package. As a result, `checkInputs` aren't available anymore in
the local dev-shell which is the sole purpose of foreman, to start
services and a database for development.
2024-01-26 17:30:07 +01:00
Maximilian Bosch 8477009310
doc/manual: fix instructions in contribution guidelines
In 5db374cb50 the `bootstrap` script was
removed, however it's still referenced in the contribution guidelines.
Change that to `autoreconfPhase` as intended by the commit.
2024-01-26 17:28:07 +01:00
John Ericson c62eaf248f Remove now-unneeded workaround 2024-01-26 01:20:07 -05:00
John Ericson 13b5f007ef Merge branch 'master' into ca-no-new-col 2024-01-26 01:19:45 -05:00
John Ericson 7f5889559e
Merge pull request #1350 from NixOS/remove-old-workaround
Remove now-unneeded workaround
2024-01-26 01:13:37 -05:00
John Ericson 5ee0e443e4 Remove now-unneeded workaround 2024-01-26 01:08:11 -05:00
John Ericson 323b556dc8 Minimal CA support
This verison has a worse UI, but also chnages the schema less: One
non-null constraint is removed, but no new columns are added.

Co-Authored-By: Andrea Ciceri <andrea.ciceri@autistici.org>
Co-Authored-By: regnat <rg@regnat.ovh>
2024-01-26 00:34:58 -05:00
John Ericson 458b9e4242
Merge pull request #1348 from NixOS/ca-prep
More CA derivations prep
2024-01-25 21:53:40 -05:00
John Ericson fcde5908d8 More CA derivations prep
Again, with care not to change the schema in any way.
2024-01-25 21:32:22 -05:00
John Ericson 083ef46c12
Merge pull request #1344 from delroth/google-popup
web: disable Sign in with Google popup
2024-01-25 16:36:16 -05:00
John Ericson 7a53b866f6 Merge branch 'master' into nix-next
• Updated input 'nix' (merge):
    'github:NixOS/nix/212ba69e6f995992f8b4e4c0656d19c0156c8714'
    'github:NixOS/nix/2c4bb93ba5a97e7078896ebc36385ce172960e4e' (2024-01-25)
  → 'github:NixOS/nix/8df68a213fc52a57b02a57005b0e06cc8de40ce3' (2024-01-25)
2024-01-25 16:26:07 -05:00