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
Farther off
CC @rickynils @Ma27 @grahamc
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.ccin Nixsrc/hydra-queue-runner/build-remote.ccNotable differences: Hydra passes a number of extra flags to ssh, evidently based on sysadmin war stories.
Legacy SSH protocol
src/libstore/legacy-ssh-store.ccin Nixsrc/hydra-queue-runner/build-remote.ccNotable 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
buildRemotefunction #1180ServeProto::Command::QueryValidPathServeProto::Command::ImportPathsServeProto::Command::BuildDerivationBuildResultserializer #1318ServeProto::Command::QueryPathInfosServeProto::Serialiser<UnkeyedValidPathInfo>and test nix#9560ServeProto::Command::DumpStorePathUse
Storeabstraction after previous two are complete. Support arbitrary stores for building #1200Use the same notion of a
Machineconfig for remote builders. NixOS/nix@ebc9f36 was a Nix-side refactor to prepare for this, but then the Hydra side was not done.Machinetype in a minimal way #1341 Use Nix'sMachinetypenix::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
Storeconfig. That ties this to the previous checkbox.Farther off
build/*.ccvs HydraCC @rickynils @Ma27 @grahamc