Commit graph

135 commits

Author SHA1 Message Date
Eelco Dolstra d676c91bd5
Return Builds.drvpath in the JSON API
E.g.

  curl -H 'Accept: application/json' http://127.0.0.4/build/3772858 | jq -r .drvpath
  /nix/store/97vla79lavlcsk8milskr06rfm34bskx-patchelf-0.8pre843_f4522f4.drv
2017-09-12 18:42:18 +02:00
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 f6081668dc
Allow determinism checking for entire jobsets
Setting

  xxx-jobset-repeats = patchelf:master:2

will cause Hydra to perform every build step in the specified jobset 2
additional times (i.e. 3 times in total). Non-determinism is not fatal
unless the derivation has the attribute "isDeterministic = true"; we
just note the lack of determinism in the Hydra database. This will
allow us to get stats about the (lack of) reproducibility of all of
Nixpkgs.
2016-12-07 15:57:13 +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 f70946efca Allow public dashboards
Dashboards can now be marked as publically visible in the user
preferences. The dashboard URL has changed from /user/<name>/dashboard
to /dashboard/<name> because /user/<name> requires being logged in as
<name> or as an admin.
2016-05-27 14:35:32 +02:00
Shea Levy 4392d3e21d Enable declarative projects.
This allows fully declarative project specifications. This is best
illustrated by example:

* I create a new project, setting the declarative spec file to
  "spec.json" and the declarative input to a git repo pointing
  at git://github.com/shlevy/declarative-hydra-example.git
* hydra creates a special ".jobsets" jobset alongside the project
* Just before evaluating the ".jobsets" jobset, hydra fetches
  declarative-hydra-example.git, reads spec.json as a jobset spec,
  and updates the jobset's configuration accordingly:
{
    "enabled": 1,
    "hidden": false,
    "description": "Jobsets",
    "nixexprinput": "src",
    "nixexprpath": "default.nix",
    "checkinterval": 300,
    "schedulingshares": 100,
    "enableemail": false,
    "emailoverride": "",
    "keepnr": 3,
    "inputs": {
        "src": { "type": "git", "value": "git://github.com/shlevy/declarative-hydra-example.git", "emailresponsible": false },
        "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs.git release-16.03", "emailresponsible": false }
    }
}
* When the "jobsets" job of the ".jobsets" jobset completes, hydra
  reads its output as a JSON representation of a dictionary of
  jobset specs and creates a jobset named "master" configured
  accordingly (In this example, this is the same configuration as
  .jobsets itself, except using release.nix instead of default.nix):
{
    "enabled": 1,
    "hidden": false,
    "description": "js",
    "nixexprinput": "src",
    "nixexprpath": "release.nix",
    "checkinterval": 300,
    "schedulingshares": 100,
    "enableemail": false,
    "emailoverride": "",
    "keepnr": 3,
    "inputs": {
        "src": { "type": "git", "value": "git://github.com/shlevy/declarative-hydra-example.git", "emailresponsible": false },
        "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs.git release-16.03", "emailresponsible": false }
    }
}
2016-05-09 08:54:27 -04:00
Eelco Dolstra b2b978eda0 Fix JSON output for builds 2016-04-18 11:44:59 +02:00
Eelco Dolstra a7755678fe Drop unused BuildProducts.description column 2016-04-13 16:30:52 +02:00
Eelco Dolstra d7a123fcd4 Keep track of the time we spend copying to/from build machines 2016-02-17 10:30:23 +01:00
Eelco Dolstra e46acbf05b Remove the errorMsg column from the Builds table
The queue runner no longer uses this field, and it doesn't provide
very interesting historical data (mostly SSH failures), but it takes
up a lot of space. Also, it contained some bad UTF-8 which was
preventing an upgrade to Postgres 9.5, so a good occasion to get rid
of it.
2016-02-12 17:21:55 +01:00
Eelco Dolstra 4d1816b152 Remove obsolete Builds columns and provide accurate "Running builds"
This removes the "busy", "locker" and "logfile" columns, which are no
longer used by the queue runner. The "Running builds" page now only
shows builds that have an active build step.
2015-10-27 15:37:17 +01:00
aszlig 06b76ab275
Add isChannel column and meta attribute.
This is to properly separate channels from regular jobs and also make
sure that we can always iterate on them, no matter whether the build has
failed. The reason why we were not able to do this until now was because
we were iterating on the build products, and whenever some constituent
of a channel job has failed, we didn't get a build output.

So whenever there is a meta.isHydraChannel, we can now properly
distinguish it from the other jobs.

I still don't have any clue, why "make -C src/sql update-dbix" without
*any* modifications tries to create additional schema definitions. But
I've checked the md5sums of the existing schema definitions and they
don't seem to match, so it seems that they already have been tampered
with.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-09-10 17:36:38 +02:00
Eelco Dolstra 4f018b0612 Include the eval IDs in the JSON /build result 2015-09-02 12:57:58 +02:00
Eelco Dolstra eb13007fe6 Allow build to be bumped to the front of the queue via the web interface
Builds now have a "Bump up" action. This will cause the queue runner
to prioritise the steps of the build above all other steps.
2015-08-10 16:19:47 +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 9afaf322b3 Use latest DBIx::Class::Schema::Loader 2015-07-30 16:55:11 +02:00
Eelco Dolstra 6d738a31bf Keep track of failed paths in the Hydra database
I.e. don't use Nix's failed paths feature anymore. Easier to keep
everything in one place.
2015-06-10 14:57:16 +02:00
Eelco Dolstra adc72d2409 Record which build a failed build step was propagated from 2015-02-25 16:42:32 +01: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 9b38b5f134 Remove the longDescription field
It's not useful and takes up a lot of space.
2014-09-30 15:44:09 +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
Rob Vermaas 268f273a3e Add value and dependency fields to eval json output. 2014-05-08 17:08:31 +02:00
Eelco Dolstra da73eb5f8a Include dependency column in JSON output 2014-05-08 16:36:15 +02:00
Eelco Dolstra affec8881d Remove support for views
They're replaced by aggregates, which are declarative, faster, and
have a better interface.
2014-04-23 23:22:44 +02:00
Eelco Dolstra 5e0d10a392 When renaming a jobset, add a redirect from the old name 2014-04-23 23:15:22 +02:00
Hydra d4d9896f9f Re-add the history tab (store size and build time), now as lazy-loaded tab on build page. 2014-01-28 11:55:19 +01:00
Rob Vermaas ac177d0984 Add nixexprpath/nixexprinput to GET of jobset (API). 2014-01-23 12:44:02 +01:00
Eelco Dolstra 63100b0ee8 Merge branch 'master' into persona 2013-11-06 12:35:36 +01:00
Shea Levy f1c187198c Stupid capitalization scheme
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-11-05 12:39:55 -05:00
Shea Levy 2e1c07c5f7 Argh
ALWAYS RUN THE TESTS

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-11-05 12:31:36 -05:00
Shea Levy d5574230e4 typo
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-11-05 09:57:15 -05:00
Shea Levy 217ba725a3 Restore accidentally-removed fields to the Builds API
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-11-05 09:43:32 -05:00
Shea Levy 385ceaff4d Show buildinput and buildproduct information in the Builds API
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-11-05 09:42:05 -05:00
Eelco Dolstra 36c961a376 Store the account type ("hydra" or "persona") explicitly in the database 2013-11-05 11:46:05 +01:00
Shea Levy 5da3dcfd57 Make the outputs' outpaths available via the Build JSON API
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-10-29 14:41:48 -04: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 a89096ec5e Clean up root controller
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-10-25 11:09:11 -04:00
Shea Levy 5d3df69a0b Cleanup build serialization
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-10-25 11:09:11 -04:00
Shea Levy e04477003e Cleanup eval serialization
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-10-25 11:09: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
Shea Levy 78dcd3e619 Cleanup Project model
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-10-24 11:39:40 -04:00
Shea Levy ee8275cfdb Start api cleanup with the User model
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-10-24 11:39:40 -04:00
Shea Levy 0db950931a Merge remote-tracking branch 'upstream/who-broke-builds' into upstream-master
Include information about who changed the build status in notification
emails, and enable optional per-input notification of said committers.

Conflicts due to two branches modifying the database schema.

Signed-off-by: Shea Levy <shea@shealevy.com>

Conflicts:
	src/lib/Hydra/Schema/Jobsets.pm
	src/sql/upgrade-23.sql
2013-10-15 09:49:20 -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
Shea Levy 26470f1656 Check all inputs for blame but only email selected inputs
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-10-08 14:47:24 -04:00
Shea Levy 07157f8125 Update Schema classes
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-10-08 13:24:49 -04:00
Eelco Dolstra ed132cf1fc Remove obsolete JobStatus source 2013-10-03 15:05:53 +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