From 70a3f8bb711012002374eb5c61805e14ecebe8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Sun, 13 Feb 2022 18:53:14 +0100 Subject: [PATCH] Make the use of substitutes on builders configurable --- doc/manual/src/configuration.md | 22 ++++++++++++++++++++ src/hydra-queue-runner/build-remote.cc | 2 +- src/hydra-queue-runner/hydra-queue-runner.cc | 1 + src/hydra-queue-runner/state.hh | 1 + 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/manual/src/configuration.md b/doc/manual/src/configuration.md index 4954040c6..5c1d061ac 100644 --- a/doc/manual/src/configuration.md +++ b/doc/manual/src/configuration.md @@ -98,6 +98,28 @@ See [`nix help stores`](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-help-stores.html) for a description of the store URI format. +Queue Runner configuration +-------------------------- + +These configuration options are understood by the Hydra Queue Runner. + +- `max_unsupported_time` (default `0`) How long to keep unsupported builds in the queue before failing them +- `max_db_connections` (default `128`) Size of the database connection pool +- `max_output_size` (default `2<<30`) Maximum size of a build result output before failing the build (only works for remote builds) +- `max_log_size` (default `64<<20`) Maximum log size for remote builds +- `store_uri` (default empty) If set to a non-empty string, the store is used for the Hydra +- `upload_logs_to_binary_cache` (default `false`) Whether to upload logs of finished builds to the store +- `gc_roots_dir` (default `/nix/var/nix/gcroots/per-user/hydra/hydra-roots`) Directory for Hydra gcroots +- `use-substitutes` (default `false`) Whether or not to try to substitute builds results from the configured substituters before building +- `use_substitutes_on_remote_builders` (default `true`) Whether or not to try to substitute builds inputs from the configured substituters on the build machines when copying build inputs +- `xxx-jobset-repeats` (default empty) Configuration of automated rebuilds for determinism checks. Takes colon-separated values of `project:jobset:repeat` (for example `nixos:trunk-combined:2`) + +Deprecated options +- `store_mode` +- `binary_cache_dir` +- `binary_cache_s3_bucket` +- `binary_cache_secret_key_file` + Statsd Configuration -------------------- diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index ad510e1b3..4590492b0 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -197,7 +197,7 @@ static BasicDerivation sendInputs( destStore.computeFSClosure(basicDrv.inputSrcs, closure); copyPaths(destStore, localStore, closure, NoRepair, NoCheckSigs, NoSubstitute); } else { - copyClosureTo(conn, destStore, basicDrv.inputSrcs, Substitute); + copyClosureTo(conn, destStore, basicDrv.inputSrcs, useSubstitutesOnRemoteBuilders ? Substitute : NoSubstitute); } auto now2 = std::chrono::steady_clock::now(); diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index 0ee710cb5..1a0dc84ee 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -853,6 +853,7 @@ void State::run(BuildID buildOne) _destStore = storeUri == "" ? localStore : openStore(storeUri); useSubstitutes = config->getBoolOption("use-substitutes", false); + useSubstitutesOnRemoteBuilders = config->getBoolOption("use_substitutes_on_remote_builders", true); // FIXME: hacky mechanism for configuring determinism checks. for (auto & s : tokenizeString(config->getStrOption("xxx-jobset-repeats"))) { diff --git a/src/hydra-queue-runner/state.hh b/src/hydra-queue-runner/state.hh index cda238ae3..fc2bf4f77 100644 --- a/src/hydra-queue-runner/state.hh +++ b/src/hydra-queue-runner/state.hh @@ -328,6 +328,7 @@ private: nix::Path hydraData, logDir; bool useSubstitutes = false; + bool useSubstitutesOnRemoteBuilders = true; /* The queued builds. */ typedef std::map Builds;