-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
Use nix-eval-jobs
and delete hydra-eval-jobs
#1421
base: master
Are you sure you want to change the base?
Conversation
src/script/hydra-eval-jobset
Outdated
"--flake", $flakeRef, | ||
"--gc-roots-dir", getGCRootsDir, | ||
"--max-jobs", 1); | ||
@cmd = ("nix-eval-jobs", "--flake", $flakeRef . '#hydraJobs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uses hydraJobs
here and the original hydra-eval-jobs
has hydraJobs
and checks
:
hydra/src/hydra-eval-jobs/hydra-eval-jobs.cc
Lines 148 to 152 in f974891
auto aHydraJobs = vOutputs->attrs()->get(state.symbols.create("hydraJobs")); | |
if (!aHydraJobs) | |
aHydraJobs = vOutputs->attrs()->get(state.symbols.create("checks")); | |
if (!aHydraJobs) | |
throw Error("flake '%s' does not provide any Hydra jobs or checks", flakeRef); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah found more commits that are relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Lix commits don't address this issue, they only have support for hydraJobs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be important to keep the checks
supports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mic92 Do you have a preference for how we do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add an nix eval
before that to figure out which one exists?
nix eval --raw --impure --expr "let f = builtins.getFlake \"$flakeRef\"; in if f ? hydraJobs then \"hydraJobs\" else \"checks\""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative is fixing: nix-community/nix-eval-jobs#332
Than we can just pass in what we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK added a commit that ought to do this, but we should have some tests.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
A relevant thing to consider here is whether we want an official NixOS project to be dependant on a Nix Community project. As of now (afaik), the NixOS GitHub namespace is mostly self-contained. I see these solutions:
I personally prefer the latter two options over the first one since it would get rid of code duplication and remove a component from Hydra that only a few people are proficient in and that gets a lot less maintenance than nix-eval-jobs. Maybe that's a question for the new SC? |
Happy to move the project to the NixOS org if I can keep maintaining it there. We would loose aarch64-linux builds because those runners are currently sponsored by namespace in nix-community. I can attach my buildbot-nix installation to this org to compensate. |
That's more a technical question for the Hydra/Nix team, unless we feel to overwhelmed what to do and need to escalate. |
498b283
to
d0cfbed
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
d0cfbed
to
8a49ecb
Compare
OK undrafting because we're back on @dasJ I am fine resolving the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The perl bits look generally ok to me but not my expertise. Maybe put somewhere a bit clearer that the constituents are not supported anymore. That's not used on hydra.nixos.org, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated before, I do find this move to be a good idea. Here are some things I noticed while reading the code
src/script/hydra-eval-jobset
Outdated
"--flake", $flakeRef, | ||
"--gc-roots-dir", getGCRootsDir, | ||
"--max-jobs", 1); | ||
@cmd = ("nix-eval-jobs", "--flake", $flakeRef . '#hydraJobs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be important to keep the checks
supports
@@ -709,36 +744,20 @@ sub checkJobsetWrapped { | |||
return; | |||
} | |||
|
|||
die "Jobset contains a job with an empty name. Make sure the jobset evaluates to an attrset of jobs.\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a relevant check? Kind of surprising to see it gone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ma27 Do you know about this? Maybe this is something that should be restored in the new streaming version? Or maybe its fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I had to guess, this probably just got removed since $jobs
got replaced by an iterator?
But yeah, seems reasonalbe to add it back.
@@ -8,14 +8,20 @@ | |||
inputs.nix.inputs.nixpkgs.follows = "nixpkgs"; | |||
inputs.nix.inputs.libgit2.follows = "libgit2"; | |||
|
|||
inputs.nix-eval-jobs.url = "github:nix-community/nix-eval-jobs"; | |||
inputs.nix-eval-jobs.inputs.nixpkgs.follows = "nixpkgs"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something I forgot in the last review: I think we should also force the nix version of hydra into the package, otherwise we might depend on 2 nix versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually a good one and could be a problem if hydra or nix-eval-jobs doesn't keep up with nix releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can maintain release branches for different nix versions again if this is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the literal Nix derivation is forced to be the same, but the version is the same now.
This comment was marked as resolved.
This comment was marked as resolved.
a3e3fe9
to
d2227af
Compare
d2227af
to
d97956d
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
(cherry picked from commit 684cc50)
d97956d
to
cc5f805
Compare
OK thanks to the fix in |
incrementally ingest eval results nix-eval-jobs streams output, unlike hydra-eval-jobs. Now that we've migrated, we can use this to: 1. Use less RAM by avoiding buffering a whole eval's worth of metadata into a Perl string and an array of JSON objects. 2. Make evals latency a bit lower by allowing the queue runner to start ingesting builds faster. Also use the newly-restored constituents support in `nix-eval-jobs` Note, we pass --workers and --max-memory-size to n-e-j Lost in the h-e-j -> n-e-j migration, causing evaluation to always be single threaded and limited to 4GiB RAM. Follow the config settings like h-e-j used to do (via C++ code). (cherry picked from commit 6d4ccff) (cherry picked from commit b0e9b4b) (cherry picked from commit cdfc5c81e8037d3e4818a3e459d0804b2c157ea9) (cherry picked from commit 4b107e6) Co-Authored-By: Maximilian Bosch <[email protected]>
(cherry picked from commit ed7c587)
cc5f805
to
890e693
Compare
"or flake.checks" . | ||
"or throw \"flake '$flakeRef' does not provide any Hydra jobs or checks\""; | ||
|
||
@cmd = ("nix-eval-jobs", "--flake", "--expr", $nix_expr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are mutual exclusive afaik.
@cmd = ("nix-eval-jobs", "--flake", "--expr", $nix_expr); | |
@cmd = ("nix-eval-jobs", "--expr", $nix_expr); |
"--max-jobs", 1); | ||
my $nix_expr = | ||
"let " . | ||
"flake = builtins.getFlake (toString \"$flakeRef\"); " . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afaik builtins.getFlake
will be impure doing this. Also we would need to think about escaping "$flakeRef" than more.
There is a work around... https://github.com/nix-community/nixos-anywhere/blob/9ba099b2ead073e0801b863c880be03a981f2dd1/terraform/nix-build/nix-build.sh#L38
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-12-09-nix-team-meeting-minutes-201/57280/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-12-13-nix-team-meeting-minutes-202/57281/1 |
nix-eval-jobs
was forked fromhydra-eval-jobs
originally, for others to use. That's great! But maintaining two copies is no good. But we use that.Original author is @delroth, for Lix's Hydra, thank you!
Draft because some tests fail. I am not sure why. Maybe there are fixes on the Lix branch that can be cherry-picked to fix? Not sure!