-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
Deduplicate code between Hydra and Nix #1164
Comments
Note to fix this, it would be very convenient to use a local build of Nix during Hydra development. I will try to hack that up. edit it is indeed possible! |
https://discourse.nixos.org/t/developing-a-system-that-replaces-nix-remote-build/22388/11 lists a huge number of issues with the current remote building situation that makes using Nix in large institutional contexts difficult. CC @elaforge The immediate goals of this issue are to shrink the amount of the code an increase testing coverage by moving us towards a world where hydra and remote building both battle-test the same code paths. But a further goal would be to, be improving the quality and flexibility of the build scheduling code, make experimentation with the alternative architectures suggested in that that thread easier. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/developing-a-system-that-replaces-nix-remote-build/22388/13 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2022-12-02-nix-team-meeting-minutes-13/23731/1 |
Related: #1200
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-02-10-nix-team-meeting-minutes-31/25438/1 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-03-27-nix-team-meeting-minutes-44/26759/1 |
This is *just* using the fields from that type, and only where the types coincide. (There are two fields with different types, `speedFactor` most interestingly.) No code is reused, so we can be sure that no behavior is changed. Once the types are reconciled on the Nix side, then we can start carefully actually reusing code. Progress on #1164
This is *just* using the fields from that type, and only where the types coincide. (There are two fields with different types, `speedFactor` most interestingly.) No code is reused, so we can be sure that no behavior is changed. Once the types are reconciled on the Nix side, then we can start carefully actually reusing code. Progress on #1164
This is more conceptually correct (the order does not matter), and also matches what Hydra already does. (Nix and Hydra matching is needed for dedup NixOS/hydra#1164)
By moving `host` to the config, we can do a lot further cleanups and dedups. This anticipates a world where we always go `StoreReference` -> `*StoreConfig` -> `Store*` rather than skipping the middle step too. Progress on NixOS#10766 Progress on NixOS/hydra#1164
By moving `host` to the config, we can do a lot further cleanups and dedups. This anticipates a world where we always go `StoreReference` -> `*StoreConfig` -> `Store*` rather than skipping the middle step too. Progress on NixOS#10766 Progress on NixOS/hydra#1164
By moving `host` to the config, we can do a lot further cleanups and dedups. This anticipates a world where we always go `StoreReference` -> `*StoreConfig` -> `Store*` rather than skipping the middle step too. Progress on NixOS#10766 Progress on NixOS/hydra#1164
Currently Hydra duplicates lots of functionality that is in Nix. This is bad because it leads to either the Nix or Hydra versions of a feature being undertested and broken (e.g. remote builds are very finicky), or missing features on one side (Hydra doesn't support
ssh-ng://
).The solution is to dedup, fixing both problems, and lowing our maintenance burden across the board.
I will try to break this down into steps, updating this list accordingly
Easier
Generic SSH logic
src/libstore/ssh.cc
in Nixsrc/hydra-queue-runner/build-remote.cc
Notable differences: Hydra passes a number of extra flags to ssh, evidently based on sysadmin war stories.
Legacy SSH protocol
src/libstore/legacy-ssh-store.cc
in Nixsrc/hydra-queue-runner/build-remote.cc
Notable differences: Hydra doesn't issue builds blocking and synchronously, so it can cancel them and handle logs as they occur. Probably other things, TBD.
Split up logic so subsequent refactors are easier to both write and review Split the
buildRemote
function #1180ServeProto::Command::QueryValidPath
ServeProto::Command::ImportPaths
ServeProto::Command::BuildDerivation
BuildResult
serializer #1318ServeProto::Command::QueryPathInfos
ServeProto::Serialiser<UnkeyedValidPathInfo>
and test nix#9560ServeProto::Command::DumpStorePath
Use
Store
abstraction after previous two are complete. Support arbitrary stores for building #1200Use the same notion of a
Machine
config for remote builders. NixOS/nix@ebc9f36 was a Nix-side refactor to prepare for this, but then the Hydra side was not done.Machine
type in a minimal way #1341 Use Nix'sMachine
typenix::Machine::parseConfig
#1386 Use Nix's Machine parserSee also Why is machine loading rounded? #484
See also Triage and break up the global settings nix#5638, where we would like more of the machine stuff to go in the
Store
config. That ties this to the previous checkbox.Farther off
build/*.cc
vs HydraCC @rickynils @Ma27 @grahamc
The text was updated successfully, but these errors were encountered: