WIP: Bring back constituents to Hydra #17
No reviewers
Labels
No labels
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/nix-eval-jobs#17
Loading…
Reference in a new issue
No description provided.
Delete branch "ma27/nix-eval-jobs:bring-back-constituents"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change is part of an ongoing discussion (lix-project/hydra#11) on whether or not to bring back constituents to Hydra. This needs support from the evaluator (previously hydra-eval-jobs, now nix-eval-jobs), hence this PR. I'll do my best to explain the current state and implications, my intent so far is to gather some more opinions on that topic.
Note: yes, the code is pretty ugly atm, I mostly hacked it together to have a proof of concept and to have the feature back working on my Hydra. Obviously, this will be revised if the decision is to bring it back.
Constituents are right now used for e.g. release jobs[1] where you specify other jobs as dependencies. Either as derivations or as strings being the job names, the evaluator will then rewrite the derivation of the release job to depend on the derivations the job names point to. This is a nasty hack, but brings a big performance boost[2]. Given that this is for jobs in general, it might even be useful for other CI systems.
In fact, the CppNix Hydra is also unsure how to proceed[5] and I also haven't gotten a definitive answer in the #hydra channel on Matrix.
This patch adds the feature back behind a CLI flag. It keeps the streaming nature of nix-eval-jobs for everything except those aggregates[3] which potentially need a rewrite at the end.
The behavior still has its problems that I started to fix as part of my dayjob[4]: if you have aggregate jobs depending on other aggregate jobs, the rewrites may happen in the wrong order and thus it's not guaranteed that aggregates only pass if their (transitive) constituents do. Also, having strings for a lot of stuff may be a little hairy, for that I implemented globbing. We may want to consider porting that or parts of that here as well.
So, my questions are:
cc @vriska @raito @lheckemann @delroth @jade (I probably forgot other people, feel free to chime in regardless)
[1]
cc6e93a617/nixos/release-small.nix (L100)
[2] This - among higher parallelization with lower memory thresholds for each jobs - reduced the jobset eval time on my employer's Hydra from 15min to ~50s.
[3] I think this is fine given that jobsets usually have many constituents and very few aggregates.
[4] https://github.com/flyingcircusio/hydra/pull/1
[5] https://github.com/NixOS/hydra/pull/1421#discussion_r1844974067
Personally I am pretty hard in the "the ends justify the means" on this one, since it exposes surface that only people using Hydra (cough and thus accepting breakage risk because hydra is jank) care about, and does not introduce new bad API that has not yet been invented. That said, this code is pretty bad and probably could use a cleanup and maybe some light description of what a constituent is even for above the code for it.
It would be helpful if the n-e-j tests were easier to run; our main stability strategy for it seems to be of exercising the code pretty hard in production and not editing it often.
It absolutely is! This will be revised before I consider this acceptable to be merged. This was mostly a proof of concept to get the feature back working on my end and to start the discussion.
Cursory check of the code; LGTM. It doesn't shock me that we are bringing back this feature.
(but I +1 Jade remark, I guess I'm just too engrossed in all of these terms of what is a constituent, etc.)
9c5c88d57b
toac27a3f9d5
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.