Commit Graph

442 Commits

Author SHA1 Message Date
7b705758ec Merge pull request #732 from Ma27/fix-build
Fix build against latest Nix
2020-04-09 09:02:45 -04:00
6e358189ad Separate the build IDs in the build_finished payload with tabs
hydra-notify splits the payload on tabs so we shouldn't separate the
IDs with spaces.
2020-04-08 12:05:25 +02:00
2f9d422172 Fix build against latest Nix 2020-04-07 13:55:38 +02:00
a055796ef5 Merge branch 'master' into libpqxx_undeprecate 2020-04-01 11:54:41 -07:00
6c0bb909df Merge pull request #704 from basvandijk/sleep-after-catch-exception
hydra-queue-runner: sleep 5s after handling an exception
2020-04-01 13:04:31 +02:00
9727892b61 Don't spam the journal with hydra-queue-runner status dumps
(cherry picked from commit 15ae932488)
2020-03-31 22:19:07 +02:00
ccd046ca3d Keep track of the number of unsupported steps
(cherry picked from commit 45ffe578b6)
2020-03-31 22:19:03 +02:00
4417f9f260 Abort unsupported build steps
If we don't see machine that supports a build step for
'max_unsupported_time' seconds, the step is aborted. The default is 0,
which is appropriate for Hydra installations that don't provision
missing machines dynamically.

(cherry picked from commit f5cdbfe21d)
2020-03-31 22:19:01 +02:00
adf61e5cf8 Fix build
(cherry picked from commit 639c660abf)
2020-02-20 10:26:45 +01:00
e4f5156c41 Build against nix-master
(cherry picked from commit e7f2139e25)
2020-02-20 10:24:04 +01:00
b790a00729 Disable deprecation warnings
(cherry picked from commit 950e8bef6c)
2020-02-20 10:22:21 +01:00
08bfff9d13 hydra-queue-runner: sleep 5s after handling an exception
instead of immediately calling `readMachinesFiles` again which could
immediately throw another exception again.
2020-01-14 13:34:35 +01:00
ec8b2970e0 Remove added strictness to allow multiple query returns. 2020-01-12 10:18:52 -08:00
7bb6b5e206 Update libpqxx usage to move away from deprecated API interactions. 2020-01-11 22:38:40 -08:00
c40c887e50 Fixes for macOS
Building on macOS with the latest nixpkgs master and NixOS/nixpkgs#77147
fails.  It seems some `std::experimental` (optional) for instance are
not available as `experimental`, but are in `std`.  Also `toJSON` is
missing for `atomic< unsigned long long >`.
2020-01-07 12:38:06 +13:00
d4b4255dd2 hydra-queue-runner: Support running in a NixOS container
In a NixOS container, cmdBuildDerivation doesn't work because we're
not privileged. But we also don't need it because the store already
has the derivation.

Also, don't copy from/to the store since this gives errors about
missing signatures.
2019-09-25 17:26:03 +02:00
554bb7d9ce hydra-queue-runner: Don't pass IN_SYSTEMD to child processes
This caused local builds to have journal priority prefixes
(e.g. '<3>').
2019-09-25 17:25:07 +02:00
d08cfa48d7 Add a 'step_started' notification 2019-08-13 18:18:24 +02:00
7c7cc8c059 Fix duplicate step_finished notification 2019-08-13 18:18:24 +02:00
7114d2aceb Separate payload elements using \t 2019-08-13 18:18:24 +02:00
2946899504 Turn hydra-notify into a daemon
It now receives notifications about started/finished builds/steps via
PostgreSQL. This gets rid of the (substantial) overhead of starting
hydra-notify for every event. It also allows other programs (even on
other machines) to listen to Hydra notifications.
2019-08-13 18:18:21 +02:00
3ad091faf3 allow using a shorter context and increase hydra-notify debug
(cherry picked from commit 1c76ad393669af2f728fd519a050f417319412a6)
2019-03-20 15:22:24 -04:00
9a73ec6455 hydra-queue-runner: better error message if nix-store can not be started
The hydra-queue-runner opens a connection to the builder. If the
builder is 'localhost' it starts `nix-store`, otherwise it starts
'ssh'.

Currently, if the hydra-queue-runner can not start `nix-store` (not in
the PATH for instance), the error message is:

  cannot connect to ‘localhost’: error: cannot start ssh: No such file
  or directory

This is not useful since ssh is actually not started:/

With this patch the error message is now:

  cannot connect to ‘localhost’: error: cannot start nix-store: No such file
  or directory
2019-01-23 10:42:47 +01:00
423c0440ea Typo 2018-12-20 12:07:02 +01:00
8d26144121 Fix building against nix master 2018-10-30 14:41:21 +01: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
c0fac52872 Add some debug code 2018-03-07 10:23:43 +01:00
5a1f2a50e5 Handle derivations with system type 'builtin'
Fixes #540.
2018-03-07 10:22:35 +01:00
68afa2bf6f Dump more system info in /queue-runner-status 2018-03-07 10:06:56 +01:00
e9670641ec Distinguish build step states
The web interface now shows whether a build step is connecting,
copying inputs/outputs, building, etc.
2017-12-07 15:35:31 +01:00
457483ba0e Don't lock the BuildSteps table when inserting
Instead, optimistically insert a row and retry if there is a conflict.
2017-12-07 14:41:29 +01:00
eef0d8861b Remove test line 2017-10-19 13:17:29 +02:00
b04dc6c76e Fix root creation when the root already exists but is owned by another user 2017-10-19 12:28:38 +02:00
cc64e51f75 USER -> LOGNAME for consistency
Don't remember why we use LOGNAME. Also ensure that it's set.
2017-10-18 11:23:00 +02:00
c81594f470 hydra-queue-runner: ensure roots directory exists
Fixes #513
2017-10-17 13:04:56 -05:00
45b138373b hydra-queue-runner: Write GC roots for outputs paths
We lost this behaviour somewhere. So build outputs could be GC'ed when
running the collector with --option gc-keep-outputs false.
2017-10-12 18:55:38 +02:00
27103398c9 Make maxLogSize configurable 2017-09-22 15:23:58 +02:00
b828224fee Periodically close RemoteStore connections
This prevents an accumulation of temproots. See
89dc62c174.
2017-09-14 18:16:33 +02:00
6517446c34 Update to latest nixUnstable 2017-09-14 17:22:48 +02:00
4af97c57f5 Acquire the send lock only while actually sending
Thus, we no longer hold the send lock while substituting missing paths
on the build machine. This is a good thing in particular for macOS
builders which have a tendency to hang forever in curl downloads.
2017-09-01 16:28:49 +02:00
50ab80caf2 Don't wait forever to acquire the send lock 2017-09-01 15:29:06 +02:00
7c976d2aec hydra-queue-runner: Make build notification more reliable
Previously, when hydra-queue-runner was restarted, any pending "build
finished" notifications were lost. Now hydra-queue-runner marks
finished but unnotified builds in the database and uses that to run
pending notifications at startup.
2017-07-26 15:17:51 +02:00
719df63190 queue-monitor: never move lastBuildId forward without processing jobs. 2017-07-25 20:05:37 -05:00
e117d85c2a hydra-queue-runner: Set a thread title for the builder threads
This should make debugging slightly easier.
2017-07-25 15:59:41 +02:00
e78b9fd4ee hydra-queue-runner: Allow concurrent notifications
The queue runner can now run up to ‘max-concurrent-notifications’ in
parallel (default is 2). This is useful when some hydra-notify
invocations can take a long time to complete (e.g. because they need
to compress a giant build log) and we don't want this to block all
other notifications.
2017-07-24 16:35:34 +02:00
bba383bf1b hydra-queue-runner: Keep some notification statistics 2017-07-24 16:26:44 +02:00
f46a21e16e Slight cleanup 2017-07-21 17:22:11 +02:00
dc5e0b120a Fix a race that can cause hydra-queue-runner to ignore newly added builds
As @dtzWill discovered, with the concurrent hydra-evaluator, there can
be multiple active transactions adding builds to the database. As a
result, builds can become visible in a non-monotonically increasing
order, breaking the queue monitor's assumption that build IDs only go
up.

The fix is to have hydra-eval-jobset provide the lowest build ID it
just added in the builds_added notification, and have the queue
monitor check from there.

Fixes #496.
2017-07-21 14:34:48 +02:00
6fc851d376 Improve erorr message 2017-07-17 14:10:34 +02:00
66ae66024e Sync with latest Nix 2017-07-17 11:38:58 +02:00