Commit graph

39 commits

Author SHA1 Message Date
Eelco Dolstra 285754aff6
hydra-evaluator improvements
* The "Jobset" page now shows when evaluations are in progress (rather
  than just pending).

* Restored the ability to do a single evaluation from the command line
  by doing "hydra-evaluator <project> <jobset>".

* Fix some consistency issues between jobset status in PostgreSQL and
  in hydra-evaluator. In particular, "lastCheckedTime" was never
  updated internally.
2017-03-15 16:59:57 +01: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 4d26546d3c Add support for tracking custom metrics
Builds can now emit metrics that Hydra will store in its database and
render as time series via flot charts. Typical applications are to
keep track of performance indicators, coverage percentages, artifact
sizes, and so on.

For example, a coverage build can emit the coverage percentage as
follows:

  echo "lineCoverage $pct %" > $out/nix-support/hydra-metrics

Graphs of all metrics for a job can be seen at

  http://.../job/<project>/<jobset>/<job>#tabs-charts

Specific metrics are also visible at

  http://.../job/<project>/<jobset>/<job>/metric/<metric>

The latter URL also allows getting the data in JSON format (e.g. via
"curl -H 'Accept: application/json'").
2015-07-31 00:57:30 +02:00
Eelco Dolstra 3f51ac6603 Partially revert 1c20cfdf24
Not clear why update-dbix messed up the Jobsets and Projects
classes. This will probably happen again in the future...
2014-10-01 15:28:18 +02:00
Eelco Dolstra 1c20cfdf24 Drop the errorMsg column in the Jobs table
We're not using it anywhere.
2014-09-29 19:46:11 +02:00
Eelco Dolstra 5e0d10a392 When renaming a jobset, add a redirect from the old name 2014-04-23 23:15:22 +02:00
Rob Vermaas ac177d0984 Add nixexprpath/nixexprinput to GET of jobset (API). 2014-01-23 12:44:02 +01:00
Shea Levy 4eef090a45 Flesh out the API a bit
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-10-29 13:54:11 -04:00
Shea Levy 917660442e Add eager fetching of relations and enable that for jobset->jobsetinputs
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-10-25 11:09:11 -04:00
Shea Levy 04d8adaad3 Cleanup Jobset serialization
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-10-24 11:39:40 -04:00
Eelco Dolstra 2127d133cd Add a dashboard
Currently the dashboard allows users to get a quick overview of the
status of jobs they're interested in, but more will be added,
e.g. viewing all your jobsets or all jobs of which you're a
maintainer.
2013-10-14 20:07:26 +02:00
Eelco Dolstra d46ebeea99 Distinguish between permanent evaluation errors and transient input errors
Fixes #112.
2013-09-25 16:21:16 +02:00
Eelco Dolstra 4ed877360b hydra-queue-runner: Improved scheduling
Each jobset now has a "scheduling share" that determines how much of
the build farm's time it is entitled to.  For instance, if a jobset
has 100 shares and the total number of shares of all jobsets is 1000,
it's entitled to 10% of the build farm's time.  When there is a free
build slot for a given system type, the queue runner will select the
jobset that is furthest below its scheduling share over a certain time
window (currently, the last day).  Withing that jobset, it will pick
the build with the highest priority.

So meta.schedulingPriority now only determines the order of builds
within a jobset, not between jobsets.  This makes it much easier to
prioritise one jobset over another (e.g. nixpkgs:trunk over
nixpkgs:stdenv).
2013-09-21 14:57:01 +00:00
Shea Levy 002ac9ef63 Merge in the first bits of the API work
The catalyst-action-rest branch from shlevy/hydra was an exploration of
using Catalyst::Action::REST to create a JSON API for hydra. This commit
merges in the best bits from that experiment, with the goal that further
API endpoints can be added incrementally.

In addition to migrating more endpoints, there is potential for
improvement in what's already been done:
* The web interface can be updated to use the same non-GET endpoints as
  the JSON interface (using x-tunneled-method) instead of having a
  separate endpoint
* The web rendering should use the $c->stash->{resource} data structure
  where applicable rather than putting the same data in two places in
  the stash
* Which columns to render for each endpoint is a completely debatable
  question
* Hydra::Component::ToJSON should turn has_many relations that have
  strings as their primary keys into objects instead of arrays

Fixes NixOS/hydra#98

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-02 14:00:46 -04:00
Eelco Dolstra e96916533f Allow a per-jobset check interval
This allows checking a jobset (say) at most once a day.  It's also
possible to disable polling by setting the interval to 0.  This is
useful for jobsets that use push notification or are manually
evaluated.
2013-05-02 17:55:47 +02:00
Eelco Dolstra 42d2015357 Support push notification of repository changes
External machines can now notify Hydra that it should check a
repository by sending a GET or PUSH request to /api/push, providing a
list of jobsets to be checked and/or a list of repository URLs.  In
the latter case, all jobsets that have any of the specified
repositories as an input will be checked.

For instance, you can configure GitHub or BitBucket to send a request
to the URL

  http://hydra.example.org/api/push?repos=git://github.com/NixOS/nixpkgs.git

to trigger evaluation of all jobsets that have
git://github.com/NixOS/nixpkgs.git as an input, or to the URL

  http://hydra.example.org/api/push?jobsets=patchelf:trunk,nixpkgs:trunk

to trigger evaluation of just the specified jobsets.
2013-02-25 21:10:32 +01:00
Eelco Dolstra 30e5185acf Remove the logfile and logSize columns from the database
It's pointless to store these, since Nix knows where the logs are.
Also handle (in fact require) Nix's new log storage scheme.  Also some
cleanups in the build page.
2013-01-22 22:48:02 +01:00
Eelco Dolstra 9032c55aa6 Keep track of the database schema version
The singleton table SchemaVersion contains the current version
of the Hydra database schema.  This can be used to upgrade the
schema on the fly.

Also reran the DBIx::Class schema loader.
2011-12-05 14:29:29 +01:00
Rob Vermaas 9d9bf8b264 hydra: make nr of build to keep configurable per jobset 2010-08-10 06:48:45 +00:00
Rob Vermaas 5f7ebaad37 added hide feature for project/jobset 2010-06-04 14:43:28 +00:00
Eelco Dolstra 7daca03e78 * Store jobset evaluations in the database explicitly. This includes
recording the builds that are part of a jobset evaluation.  We need
  this to be able to answer queries such as "return the latest NixOS
  ISO for which the installation test succeeded".  This wasn't previously
  possible because the database didn't record which builds of (say)
  the `isoMinimal' job and the `tests.installer.simple' job came from
  the same evaluation of the nixos:trunk jobset.

  Keeping a record of evaluations is also useful for logging purposes.
2010-03-05 15:41:10 +00:00
Rob Vermaas 4dccd3c620 generated schema with new dbix class schema loader, grrrrrr 2010-02-25 09:50:04 +00:00
Rob Vermaas 8a01999220 hydra
* remove trailing spaces from email notification
 * option to disable email notification for jobset
2010-01-06 13:07:59 +00:00
Rob Vermaas 2fb05b34bf add support for git as jobinput 2009-11-17 15:16:41 +00:00
Eelco Dolstra 7eda090e74 * Prevent repeated evaluation of a jobset with the same inputs. This
should make the Hydra scheduler a lot less CPU-intensive, since it
  won't run hydra_eval_jobs all the time.
2009-11-17 13:55:22 +00:00
Eelco Dolstra a515c5fef2 2009-10-23 15:05:16 +00:00
Eelco Dolstra 929cbe7b7c * Adding persistant releases. A release is a named set of builds. 2009-10-21 15:44:17 +00:00
Eelco Dolstra 686b6271d2 * Cleaned up the foreign key constraints.
* Generate SQLite and PostgreSQL schemas from hydra.sql.
2009-10-21 12:25:43 +00:00
Eelco Dolstra cec3201720 * Renaming "release sets" to "views" (not finished yet). Having
releases as a dynamic view on the database was misguided, since
  doing thing like adding a new job to a release set will invalidate
  all old releases.  So we rename release sets to views, and we'll
  reintroduce releases as separate, static entities in the database.
2009-10-15 21:35:19 +00:00
Eelco Dolstra 6cedee5476 * Allow jobsets to be disabled. 2009-10-08 11:39:16 +00:00
Eelco Dolstra e9cf409d80 * Mark the "current" builds in a jobset, i.e. those corresponding to
the derivations that the jobset currently contains.  This is
  necessary to allow the "latest" channel to contain the correct
  builds when the sources of a jobset are reverted.
2009-10-02 16:06:28 +00:00
Eelco Dolstra 5bdd5e7152 * Added a maintainers field to the Builds table.
* Regenerated the schema bindings with the latest DBIx::Class.
2009-07-07 13:59:59 +00:00
Eelco Dolstra ae364b9e5f * Represent jobs explicitly in the DB. 2009-03-13 14:49:25 +00:00
Eelco Dolstra f2f586d842 * Disambiguate jobs by jobset name. I.e. jobs with the same name in
different jobsets are not considered the same job.
2009-03-12 23:46:17 +00:00
Eelco Dolstra a623ad157e * Add the name of the jobset to ReleaseSetJobs, otherwise we can't
distinguish between jobs with the same name in different jobsets
  (e.g. "trunk" vs "stdenv-branch" for Nixpkgs).
* Renamed the "attrName" field of Builds to "job".
* Renamed the "id" field of BuildSteps to "build".
2009-03-12 14:18:30 +00:00
Eelco Dolstra fec08462ee * In Sqlite "release" is now a keyword, so use "release_" instead.
Note: to upgrade old databases, do a dump with an old Sqlite first;
  dumping with a new Sqlite will silently discard (!) the contents of
  the ReleaseSetJobs table.
2009-03-12 13:42:44 +00:00
Eelco Dolstra fca7fb20c4 * Negative caching: don't perform a build if a dependency already
failed in a previous build.  This is essential for Nixpkgs: we don't
  want to keep doing the same failed dependency (say, Glibc) over and
  over again for a few hundred jobs.
2009-03-09 17:21:10 +00:00
Eelco Dolstra 36fdd7f37f * For products that are directories (like manuals), allow a default
suffix other than index.html to be declared.  E.g. if a build does

    echo "doc manual $out manual.html" >> $out/nix-support/hydra-build-products

  the default link for the product is

    http://localhost:3000/build/417/download/1/manual.html

  but other files are also accessible, e.g.
    
    http://localhost:3000/build/417/download/1/style.css
2009-03-06 13:34:53 +00:00
Eelco Dolstra 97ed2052ba * Move everything up one directory. 2009-03-05 13:41:57 +00:00
Renamed from src/Hydra/lib/Hydra/Schema/Jobsets.pm (Browse further)