Skip to content

Commit

Permalink
Make the use of substitutes on builders configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
dasJ committed Mar 8, 2024
1 parent 312cb42 commit e7c853f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions doc/manual/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,28 @@ following:
}
}

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
--------------------

Expand Down
2 changes: 1 addition & 1 deletion src/hydra-queue-runner/build-remote.cc
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ void State::buildRemote(ref<Store> destStore,
destStore->computeFSClosure(inputs, closure);
copyPaths(*destStore, *localStore, closure, NoRepair, NoCheckSigs, NoSubstitute);
} else {
copyClosureTo(machine->state->sendLock, *destStore, from, to, inputs, true);
copyClosureTo(machine->state->sendLock, *destStore, from, to, inputs, useSubstitutesOnRemoteBuilders);
}

auto now2 = std::chrono::steady_clock::now();
Expand Down
1 change: 1 addition & 0 deletions src/hydra-queue-runner/hydra-queue-runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,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<Strings>(config->getStrOption("xxx-jobset-repeats"))) {
Expand Down
1 change: 1 addition & 0 deletions src/hydra-queue-runner/state.hh
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ private:
nix::Path hydraData, logDir;

bool useSubstitutes = false;
bool useSubstitutesOnRemoteBuilders = false;

/* The queued builds. */
typedef std::map<BuildID, Build::ptr> Builds;
Expand Down

0 comments on commit e7c853f

Please sign in to comment.