Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add /eval/<id>/builds endpoint #529

Merged
merged 1 commit into from Nov 19, 2018
Merged

Conversation

bennofs
Copy link
Contributor

@bennofs bennofs commented Jan 14, 2018

This endpoint allows efficient retrieval of all the builds in an
evaluation, without making a request for each single build.

This endpoint allows efficient retrieval of all the builds in an
evaluation, without making a request for each single build.
@bennofs
Copy link
Contributor Author

bennofs commented Feb 1, 2018

Any feedback on this one? I am happy to pursue a different approach if this change is not wanted / should be implemented in a different way.

@dtzWill
Copy link
Member

dtzWill commented Feb 20, 2018

I like this!

Can this produce JSON like api in #440? If not, do you know how difficult it would be to support that?

Hardly a barrier for entry but such an endpoint seems especially compelling when talking about thousands of builds -- many more than a human would ever issue requests for individually.

@bennofs
Copy link
Contributor Author

bennofs commented Feb 20, 2018

@dtzWill yes the format should be the same as that API. It should return exactly the same as querying the builds of the evaluation and then getting the build details for each build with the JSON api. This new endpoint is only necessary to avoid making 40k requests to get the info for a single evaluation.

@bennofs
Copy link
Contributor Author

bennofs commented May 21, 2018

If this would result in too much load on the hydra server, we could also provide a cached version of this is part of a channel (just like store-paths)

@Mic92
Copy link
Member

Mic92 commented Nov 19, 2018

cc @edolstra

@Mic92
Copy link
Member

Mic92 commented Nov 19, 2018

@bennofs mhm, if we cannot get this in, maybe a travis cron job in nix-index would do.

Uploading built index files to the github release tab is not too hard: https://github.com/Mic92/cntr/blob/master/.travis.yml#L39

@edolstra edolstra merged commit cd234f6 into NixOS:master Nov 19, 2018
@grahamc
Copy link
Member

grahamc commented Dec 19, 2018

The way this works right now is not wonderful for hydra.nixos.org, taking almost 9 minutes and producing 80M of data:

[grahamc@Morbo:~]$ curl --header "Accept:application/json" https://hydra.nixos.org/eval/.../builds > latest-eval-builds
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 75.9M  100 75.9M    0     0   149k      0  0:08:40  0:08:40 --:--:-- 8008k

I'm not sure what to do about that, but just for what its worth.

@grahamc
Copy link
Member

grahamc commented Dec 19, 2018

Also the data includes magic numbers, like build status numbers: https://github.com/NixOS/hydra/blob/master/src/sql/hydra.sql#L202-L215

@Mic92
Copy link
Member

Mic92 commented Dec 21, 2018

What information is actually needed from builds for nix-index to work?
Compression would also save 90%

$ du latest-eval-builds.xz
7.0M    latest-eval-builds.xz

@tomberek
Copy link
Contributor

I'm not sure what to do about that, but just for what its worth.

The information is very similar to other queries that are fast. Running this with debug produces an extremely long and convoluted output. I suspect this can be orders of magnitude faster with a purpose built query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants