Commit graph

2557 commits

Author SHA1 Message Date
Eelco Dolstra 98e7e37832
hydra-server: Fix and simplify robots.txt 2016-11-17 18:13:57 +01:00
Eelco Dolstra aef048b3cb
Bump Nix dependency 2016-11-16 17:52:26 +01:00
Eelco Dolstra afb8765ae4
hydra-queue-runner: Bump memory limit to reflect more accurate accounting 2016-11-16 17:51:18 +01:00
Eelco Dolstra b4d32a3085
hydra-queue-runner: More accurate memory accounting
We now take into account the memory necessary for compressing the NAR
being exported to the binary cache, plus xz compression overhead.

Also, we now release the memory tokens for the NAR accessor *after*
releasing the NAR accessor. Previously the memory for the NAR accessor
might still be in use while another thread does an allocation, causing
the maximum to be exceeded temporarily.

Also, use notify_all instead of notify_one to wake up memory token
waiters. This is not very nice, but not every waiter is requesting the
same number of tokens, so some might be able to proceed.
2016-11-16 17:48:50 +01:00
Eelco Dolstra cb5e438a08 Bump Nix
Fixes #398.
2016-11-09 19:15:13 +01:00
Eelco Dolstra e2a012de8c hydra-evaluator: Set jobset error if hydra-eval-jobset dies 2016-11-08 17:08:54 +01:00
Eelco Dolstra 4576b3d35b hydra-evaluator: Show friendlier exit status 2016-11-08 17:00:17 +01:00
Eelco Dolstra 1ecc8a4f40 hydra-queue-runner: Fix a race keeping cancelled steps alive
If a step is cancelled just as its builder step is starting,
doBuildStep() will return sRetry. This causes builder() to make the
step runnable again, since the queue monitor may have added new builds
referencing it. The idea is that if the latter condition is not true,
the step's reference count will drop to zero and it will be
deleted. However, if the dispatcher thread sees and locks the step
before the reference count can drop to zero in the builder thread, the
dispatcher thread will start a new builder thread for the step. Thus
the step can be kept alive for an indefinite amount of time.

The fix is for State::builder() to use a weak pointer to the step, to
ensure that the step's reference count can drop to zero *before* it's
added to the runnable queue.
2016-11-08 11:47:49 +01:00
Eelco Dolstra de9d7bcf25 hydra-queue-runner: Handle exceptions in the dispatcher thread
E.g. "resource unavailable" when creating new threads.
2016-11-08 11:25:43 +01:00
Eelco Dolstra 7863d2e1da Step cancellation: Don't use pthread_cancel()
This was a bad idea because pthread_cancel() is unsalvageable broken
in C++. Destructors are not allowed to throw exceptions (especially in
C++11), but pthread_cancel() can cause a __cxxabiv1::__forced_unwind
exception inside any destructor that invokes a cancellation
point. (This exception can be caught but *must* be rethrown.) So let's
just kill the builder process instead.
2016-11-07 19:38:24 +01:00
Eelco Dolstra 95aa1f0590 Merge pull request #407 from grahamc/images
Update build images to be more friendly to users with color blindness.
2016-11-07 14:20:17 +01:00
Graham Christensen 6f6562bc5f
Update build images to be more friendly to users with color blindness.
Closes #406
2016-11-07 06:53:27 -05:00
Eelco Dolstra d7453bd8be hydra-queue-runner: Fix message 2016-11-02 12:44:18 +01:00
Eelco Dolstra 4f08c85c69 hydra-queue-runner: Fix assertion failure
It was hitting

    assert(reservation.unique());

Since we do want the machine reservation to be released before calling
wakeDispatcher(), let's use a different object for keeping track of
active steps.
2016-11-02 12:41:00 +01:00
Eelco Dolstra 07decd6915 Also hide disabled projects on the overview page by default 2016-11-01 13:15:55 +01:00
Eelco Dolstra 9072adece8 Fix broken logic for showing/hiding jobsets 2016-11-01 13:03:14 +01:00
Eelco Dolstra ef711ce845 Handle Referer not having a trailing slash
Fixes #415.
2016-11-01 11:00:59 +01:00
Shea Levy d6ccbeedbd doc: add basic docs about declarative projects
Conversion of Shea's *.md, added as a subsection.  Shea is left as author.
I made this new bit a separate file, though it might be questionable.
2016-10-31 18:33:17 +01:00
Eelco Dolstra b3169ce438 Kill active build steps when builds are cancelled
We now kill active build steps when there are no more referring
builds. This is useful e.g. for preventing cancelled multi-hour TPC-H
benchmark runs from hogging build machines.
2016-10-31 14:58:29 +01:00
Eelco Dolstra a816ef873d Warn against empty machines file 2016-10-31 11:40:36 +01:00
Eelco Dolstra a2be29377e Hide hidden jobsets for project admins by default
This unclutters project pages.

Fixes #390.
2016-10-31 11:40:36 +01:00
Graham Christensen 3c8f00c76f Clean up unused images (#404)
* Drop information_{32,64,128,256}.png because it appears to be unused.

* Delete unused images
2016-10-30 17:06:44 +01:00
Eelco Dolstra 2b790ceefa Remove the pretty-printed log
It didn't work anymore due to the removal of nix-log2xml. And in any
case XSL is the work of the devil.
2016-10-27 14:43:17 +02:00
Eelco Dolstra 41a020e323 Fix typo 2016-10-27 13:43:05 +02:00
Eelco Dolstra cc866bff1e Fix API tests
POST requests require a referrer now.

http://hydra.nixos.org/build/42775011
2016-10-27 13:15:09 +02:00
Eelco Dolstra 3b84d4711b Bump Nix 2016-10-26 15:10:56 +02:00
Eelco Dolstra a0c8e2b055 Merge pull request #410 from LumiGuide/fix-hydra-eval-jobset-not-found
Allow hydra-eval-jobset to be found by the hydra-evaluator
2016-10-26 15:10:44 +02:00
Eelco Dolstra 0b00d51baf Prevent orphaned build steps
If two active steps of the same build failed, then the first would be
marked as "failed", but the second would end up as "orphaned", causing
it to be marked as "aborted" later on. Now it's correctly marked as
"failed".
2016-10-26 14:42:28 +02:00
Eelco Dolstra 8e1d791d0c Truncate the log just before starting the remote build
This gets rid of all those remote substitution messages that were
polluting the build logs.
2016-10-26 13:41:51 +02:00
Bas van Dijk cba7e7e0e2 Allow hydra-eval-jobset to be found by the hydra-evaluator
Without this I got the following error in my journal:

  Oct 25 22:42:29 mymachine hydra-evaluator[4085]: starting evaluation of jobset ‘myproject:.jobsets’
  Oct 25 22:42:29 mymachine hydra-evaluator[4085]: timeout: failed to run command ‘hydra-eval-jobset’: No such file or directory
  Oct 25 22:42:29 mymachine hydra-evaluator[4085]: evaluation of jobset ‘myproject:.jobsets’ finished with status 32512
2016-10-25 22:55:32 +02:00
Eelco Dolstra a12e9478e7 When manually scheduling an eval, force re-instantiation of store derivations
Without this, if (failed or aborted) derivations have been
garbage-collected, there is no way to restart them, which is very
annoying. Now we set a forceEval flag in the jobset to cause it to be
re-evaluated even if none of the inputs have changed.
2016-10-24 20:20:20 +02:00
Eelco Dolstra 140cbe9302 Set utf-8 charset for raw logs
Also fix incorrect use of Content-Encoding header in View::Plain.
2016-10-24 17:14:33 +02:00
Eelco Dolstra 3fcfa20d1a Fix regression caused by ee2e9f53
‘basicDrv.inputSrcs’ also contains the outputs of inputDrvs. These
don't necessarily exist in the local store, so copying them may cause
an exception. We should only copy the real inputSrcs.
2016-10-24 16:49:11 +02:00
Eelco Dolstra f7ff7f741b Fix a couple of encoding issues 2016-10-24 16:49:11 +02:00
Graham Christensen 3586bf28e4 Build status: copy the alt attribute to the title attribute for on-hover tool tips. (#405) 2016-10-23 13:21:21 +02:00
Eelco Dolstra 881d3bc017 Bump Nix 2016-10-21 19:19:28 +02:00
Eelco Dolstra a3efdcdfd9 Use std::regex 2016-10-21 18:06:26 +02:00
Eelco Dolstra 5d8fbc6ca1 Fix referer check 2016-10-21 17:56:34 +02:00
Eelco Dolstra c928c41ee1 Add XSRF protection for POST requests
Some Hydra API requests were vulnerable to XSRF attacks, e.g. you
could have a form on another website using http://hydra/logout as the
form action. So we now require POST requests to come from the same
origin.

Reported by Hans-Christian Esperer.
2016-10-20 16:11:33 +02:00
Eelco Dolstra bbe45ed844 Remove Persona support
Persona is no longer supported by Mozilla, so let's remove it.
2016-10-20 14:14:04 +02:00
Eelco Dolstra e0b2921ff2 Concurrent hydra-evaluator
This rewrites the top-level loop of hydra-evaluator in C++. The Perl
stuff is moved into hydra-eval-jobset. (Rewriting the entire evaluator
would be nice but is a bit too much work.) The new version has some
advantages:

* It can run multiple jobset evaluations in parallel.

* It uses PostgreSQL notifications so it doesn't have to poll the
  database. So if a jobset is triggered via the web interface or from
  a GitHub / Bitbucket webhook, evaluation of the jobset will start
  almost instantaneously (assuming the evaluator is not at its
  concurrency limit).

* It imposes a timeout on evaluations. So if e.g. hydra-eval-jobset
  hangs connecting to a Mercurial server, it will eventually be
  killed.
2016-10-14 14:22:12 +02:00
Eelco Dolstra 16feddd5d4 Drop obsolete -laws-cpp-sdk-s3 2016-10-14 14:22:12 +02:00
Eelco Dolstra dd5af7637d Remove finally.hh 2016-10-14 14:22:12 +02:00
Domen Kožar 386a972244 README: fix manual links, fixes #401 2016-10-13 13:36:09 +02:00
Domen Kožar 607eeda9bb svn.nixos.org -> github.com 2016-10-12 18:00:34 +02:00
Eelco Dolstra 7221bd7e5a manual: Add index.html 2016-10-10 15:52:11 +02:00
Eelco Dolstra 303718dbd6 Doh 2016-10-10 15:26:50 +02:00
Eelco Dolstra 0b5a7472be Add a job for the manual 2016-10-10 15:26:18 +02:00
Eelco Dolstra 633724cc8a services.hydra -> services.hydra-dev
Since Nixpkgs 16.09 contains a Hydra module, we were getting a
conflict. I guess we should have a way to override modules in
Nixpkgs...
2016-10-10 11:29:15 +02:00
Eelco Dolstra 2f0d2f8d91 Bump Nix 2016-10-10 11:18:17 +02:00