Commit Graph

580 Commits

Author SHA1 Message Date
2de52d8538 Merge remote-tracking branch 'origin/master' into flake 2019-08-15 13:56:00 +02:00
92d8d6baa5 Avoid fetching Projects/Jobsets just to get the name column
In particular, doing a 'select * from Jobsets where ...' must be
avoided, because the 'errormsg' column can be very big.
2019-08-13 18:18:25 +02:00
a74dec6fb1 Merge remote-tracking branch 'origin/master' into flake 2019-08-09 12:46:52 +02:00
d1e590af1f hydra-server: add limit parameter to the search path
This allows a client to set a limit to the search results it wants to
get:

    http://hydra.nixos.org/search?query=emacs&limit=1

This returns only 1 results (while the default is 500).
2019-06-19 14:30:32 +02:00
cb1fce21ba hydra-server: set a limit on builds and buildoutputs search
This patch adds a limit statement for Postgresql queries on `builds`
and `buildsoutputs` tables.
2019-06-19 14:28:55 +02:00
778fc03570 Allow to search builds by hash
Currently, a full store path has to be provided to search in
builds. This patch permits to search jobs with a output path or
derivation hash.

Usecase: we are building Docker images with Hydra. The tag of the
Docker image is the hash of the image output path. This patch would
allow us to find back the build job from the tag of a running
container image.
2019-06-05 11:56:42 +02:00
f9f595cd21 Add flake configuration to the web interface 2019-05-11 00:11:38 +02:00
215ca5da9c Merge pull request from nlewo/json-search
Add JSON search API endpoint
2019-03-18 15:08:32 -05:00
88a92256e1 Merge pull request from Ma27/serve-json-for-evals-and-machines
Serialize data as JSON with `Accept: application/json`
2019-03-17 17:17:17 -04:00
1cbbc6c52c Serialize data as JSON with Accept: application/json
Similar to . According to the Catalyst[1] docs it's possible to
specify a data structure that is supposed to be serialized when
requesting i.e. a JSON response.

[1] https://metacpan.org/pod/Catalyst::Controller::REST#status_ok
2019-02-14 01:22:48 +01:00
ed85daf2ac User: jobs tab returns its error as a lazy error. 2018-12-01 13:40:41 -05:00
9986053e73 Controllers: allows lazy tabs to return custom errors. 2018-12-01 13:40:41 -05:00
cd234f6a14 Merge pull request from bennofs/feat-all-builds
feat: add /eval/<id>/builds endpoint
2018-11-19 17:36:19 +01:00
0d2a2d8923 Add json output for the search API endpoint
This commit also add a test of this feature.

Note the search JSON output doesn't contain any jobs because they can
not be exported to JSON yet.

The JSON output on a search query matching a build looks like:

```
{
  "builds": [
    {
      "buildoutputs": {
        "out": {
          "path": "/nix/store/wdag3pznrvqk01byk989irg7rq3q2a2c-job"
        }
      },
      "finished": 0,
      "releasename": null,
      "starttime": null,
      "project": "sample",
      "buildproducts": {},
      "timestamp": 1541007629,
      "buildstatus": null,
      "nixname": "job",
      "drvpath": "/nix/store/n9zqndn7j7nyr6gg3bmxvw26cfmdwv2n-job.drv",
      "job": "job",
      "id": 1,
      "stoptime": null,
      "priority": 100,
      "system": "x86_64-linux",
      "jobsetevals": [
        1
      ],
      "jobset": "default",
      "buildmetrics": {}
    }
  ],
  "projects": [],
  "jobsets": [],
  "buildsdrv": []
}
```
2018-11-01 09:31:15 +01:00
63a294d4ca allow users with 'restart-jobs' role to restart individual builds 2018-10-04 21:59:42 +02:00
879333fd3c Make /api/push-github public for private Hydra instances. This makes it possible to use webhooks to trigger evaluations for private Hydra instances. 2018-06-14 17:23:01 +02:00
85524b2d0f Disable jobset deletion
This is a good way to make Hydra hang. (E.g. we had a deletion of
nixos:gcc-7 running for > 12 hours and blocking UPDATE statements from
hydra-queue-runner.) Generally it's better to just disable/hide an old
jobset anyway.
2018-03-13 14:05:55 +01:00
02888105a8 Add a hydra.conf option to enable email notification
Note that it's disabled by default.
2018-03-12 14:04:23 +01:00
fd463ff403 Remove nix-install-package support
'nix-install-package' no longer exists in Nix 1.12.

Closes .
2018-01-15 14:27:58 +01:00
3ab5d299c1 feat: add /eval/<id>/builds endpoint
This endpoint allows efficient retrieval of all the builds in an
evaluation, without making a request for each single build.
2018-01-14 01:29:37 +01:00
83a48d2d4f Add a restart-jobs role
Frequently users want Hydra access just to restart jobs. However,
prior to this commit the only way to grant that access was by giving
them full Admin access which isn't necessarily what we want to do.

By having a restart-jobs role, we can grant this privilege to users
who are known to the community and want to help, but aren't long-time
members.

I haven't tested this commit, but it looks good to me...
2017-12-30 08:28:23 -05:00
7ccec0900b Fix links to steps in the machines page 2017-12-07 16:20:23 +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
7857f83251 Serve directories and symlinks correctly 2017-11-14 17:17:07 +01:00
62c6cca937 Make one-click installs work for binary cache stores
This requires setting binary_cache_public_uri in hydra.conf.
2017-10-18 14:09:28 +02:00
44ef743d84 Hide some things that require a local store 2017-10-18 13:44:41 +02:00
30943dd217 Detect MIME type 2017-10-18 13:38:34 +02:00
42fbde0383 Use "nix cat-store" to serve files from the Nix store
This makes downloading/viewing build results work with binary cache
stores. For good performance, this should be used in conjunction with
ca580bec35,
i.e. you should set store_uri to something like

  s3://my-cache?local-nar-cache=/tmp/nar-cache

to cache NARs between requests.
2017-10-18 12:48:31 +02:00
bc60fccf78 Remove remaining references to store_mode etc. 2017-10-18 12:23:07 +02:00
b645b03536 Fix string comparison 2017-09-25 11:54:55 +00:00
2318baaade Add 'readonly_ips' option, to allow readonly access for certain IPs when 'private' option is enabled. 2017-09-22 11:36:49 +00:00
941665044e /api/scmdiff: Set correct MIME type
It was set to application/json but should be text/plain.
2017-05-05 15:58:38 +02:00
c2c2633e50 Fix link to cached build log
Fixes .
2017-04-11 14:25:48 +02:00
433b94ee68 Fix Mercurial diff
It only showed the log messages of $rev1 and $rev2. Now it shows the
range $rev1::$rev2, excluding $rev1.
2017-04-11 13:39:54 +02:00
fec895a642 hydra-server: Support logs in S3 2017-04-05 17:55:56 +02:00
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
fd754d678e Do not trigger eval on jobset change when check interval is 0 (disabled). 2017-02-23 09:15:26 +00:00
81ac547d2b Move most of AddBuilds to hydra-eval-jobset
Having this stuff in a separate module is a remnant of the time when
hydra-server could add builds to the queue directly. This is no longer
the case.
2017-02-21 17:20:48 +01:00
d0ad3fd806 Revert "Remove the global channel"
This reverts commit 2f6c2f5622.

This unintentionally also removed /all, which is actually somewhat
useful.
2016-12-06 14:25:09 +01:00
2f6c2f5622 Remove the global channel
It's useless and it makes it very easy to kill the server by fetching
/channel/latest/closure.
2016-11-17 18:17:02 +01:00
98e7e37832 hydra-server: Fix and simplify robots.txt 2016-11-17 18:13:57 +01:00
07decd6915 Also hide disabled projects on the overview page by default 2016-11-01 13:15:55 +01:00
ef711ce845 Handle Referer not having a trailing slash
Fixes .
2016-11-01 11:00:59 +01:00
a2be29377e Hide hidden jobsets for project admins by default
This unclutters project pages.

Fixes .
2016-10-31 11:40:36 +01:00
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
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
f7ff7f741b Fix a couple of encoding issues 2016-10-24 16:49:11 +02:00
5d8fbc6ca1 Fix referer check 2016-10-21 17:56:34 +02:00
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
bbe45ed844 Remove Persona support
Persona is no longer supported by Mozilla, so let's remove it.
2016-10-20 14:14:04 +02:00