Remove the `sendDerivation` logic from the builder
[?]
Feb 23, 2021, 8:50 AM
TJWMCLXXJY7ZZTNCM2B5KAINSQN46NECSXFFF4Y7XIVZKB3TO7SACDependencies
- [2]
J5YPMWCJGet exact build start/stop times from the remote - [3]
FNWNZYKUFix localhost builds - [4]
EFWDY2V7Support testing build determinism - [5]
YVFKZFAPFix build - [6]
EVSK5TBBFix version test - [7]
G7KWXSFMDistinguish build step states - [8]
VZKB5CIEWorkaround for RemoteStore not supporting cmdBuildDerivation yet - [9]
NAYQT2GThydra-queue-runner: Use cmdBuildDerivation - [10]
H46LUUZYhydra-queue-runner: don't try to distribute builds on localhost - [11]
EPWEMRI2Allow determinism checking for entire jobsets - [12]
WV4SSAIYBuild against nix-master - [13]
BG6PEOB2Make the output size limit configurable - [14]
EBJP3MNABuild against nix-master - [15]
BYVRA54QTemporarily disable machines on any exception, not just connection failures - [16]
YSZQ3ORRFix build - [17]
HH3LID6LRe-implement log size limits - [18]
6LA56M37Fix build against current Nix master - [19]
AUMIJSEOFix remote building on Nix 1.10 - [20]
2GRQJZT6hydra-queue-runner: Support running in a NixOS container - [21]
5AIYUMTBBasic remote building
Change contents
- edit in src/hydra-queue-runner/build-remote.cc at line 213
bool sendDerivation = true; - edit in src/hydra-queue-runner/build-remote.cc at line 225
// Always send the derivation to localhost, since it's a// no-op anyway but we might not be privileged to use// cmdBuildDerivation (e.g. if we're running in a NixOS// container).if (GET_PROTOCOL_MINOR(remoteVersion) >= 1 && !machine->isLocalhost())sendDerivation = false; - replacement in src/hydra-queue-runner/build-remote.cc at line 249[4.651]→[4.1703:1731](∅→∅),[4.1731]→[4.860:902](∅→∅),[4.891]→[4.1773:1786](∅→∅),[4.902]→[4.1773:1786](∅→∅),[4.1398]→[4.1773:1786](∅→∅),[4.1773]→[4.1773:1786](∅→∅),[4.1786]→[4.892:942](∅→∅),[4.942]→[4.903:937](∅→∅)
if (sendDerivation)inputs.insert(step->drvPath);elsefor (auto & p : step->drv->inputSrcs)inputs.insert(p);for (auto & p : step->drv->inputSrcs)inputs.insert(p); - replacement in src/hydra-queue-runner/build-remote.cc at line 306[4.355]→[4.2174:2237](∅→∅),[4.2237]→[3.0:79](∅→∅),[3.79]→[4.2309:2475](∅→∅),[4.232]→[4.2309:2475](∅→∅),[4.1108]→[4.2309:2475](∅→∅),[4.2309]→[4.2309:2475](∅→∅)
if (sendDerivation) {to << cmdBuildPaths;worker_proto::write(*localStore, to, StorePathSet{step->drvPath});} else {to << cmdBuildDerivation << localStore->printStorePath(step->drvPath);writeDerivation(to, *localStore, basicDrv);}to << cmdBuildDerivation << localStore->printStorePath(step->drvPath);writeDerivation(to, *localStore, basicDrv); - replacement in src/hydra-queue-runner/build-remote.cc at line 325[4.1154]→[4.3975:4028](∅→∅),[4.4028]→[4.1109:1202](∅→∅),[4.1202]→[4.4136:4551](∅→∅),[4.4136]→[4.4136:4551](∅→∅),[4.4551]→[4.116:130](∅→∅),[4.116]→[4.116:130](∅→∅),[4.130]→[4.4552:4660](∅→∅),[4.4660]→[4.259:427](∅→∅),[4.427]→[2.0:360](∅→∅),[2.360]→[4.427:441](∅→∅),[4.427]→[4.427:441](∅→∅),[4.441]→[4.4660:5695](∅→∅),[4.4660]→[4.4660:5695](∅→∅),[4.5945]→[4.5945:6391](∅→∅),[4.6391]→[4.428:656](∅→∅),[4.656]→[4.6391:6521](∅→∅),[4.6391]→[4.6391:6521](∅→∅)
if (sendDerivation) {if (res) {result.errorMsg = fmt("%s on ‘%s’", readString(from), machine->sshName);if (res == 100) {result.stepStatus = bsFailed;result.canCache = true;}else if (res == 101) {result.stepStatus = bsTimedOut;}else {result.stepStatus = bsAborted;result.canRetry = true;}return;}result.stepStatus = bsSuccess;} else {result.errorMsg = readString(from);if (GET_PROTOCOL_MINOR(remoteVersion) >= 3) {result.timesBuilt = readInt(from);result.isNonDeterministic = readInt(from);auto start = readInt(from);auto stop = readInt(from);if (start && start) {/* Note: this represents the duration of a singleround, rather than all rounds. */result.startTime = start;result.stopTime = stop;}}switch ((BuildResult::Status) res) {case BuildResult::Built:result.stepStatus = bsSuccess;break;case BuildResult::Substituted:case BuildResult::AlreadyValid:result.stepStatus = bsSuccess;result.isCached = true;break;case BuildResult::PermanentFailure:result.stepStatus = bsFailed;result.canCache = true;result.errorMsg = "";break;case BuildResult::InputRejected:case BuildResult::OutputRejected:result.stepStatus = bsFailed;result.canCache = true;break;case BuildResult::TransientFailure:result.stepStatus = bsFailed;result.canRetry = true;result.errorMsg = "";break;case BuildResult::TimedOut:result.stepStatus = bsTimedOut;result.errorMsg = "";break;case BuildResult::MiscFailure:result.stepStatus = bsAborted;result.canRetry = true;break;case BuildResult::LogLimitExceeded:result.stepStatus = bsLogLimitExceeded;break;case BuildResult::NotDeterministic:result.stepStatus = bsNotDeterministic;result.canRetry = false;result.canCache = true;break;default:result.stepStatus = bsAborted;break;result.errorMsg = readString(from);if (GET_PROTOCOL_MINOR(remoteVersion) >= 3) {result.timesBuilt = readInt(from);result.isNonDeterministic = readInt(from);auto start = readInt(from);auto stop = readInt(from);if (start && start) {/* Note: this represents the duration of a singleround, rather than all rounds. */result.startTime = start;result.stopTime = stop; - replacement in src/hydra-queue-runner/build-remote.cc at line 337
if (result.stepStatus != bsSuccess) return;}switch ((BuildResult::Status) res) {case BuildResult::Built:result.stepStatus = bsSuccess;break;case BuildResult::Substituted:case BuildResult::AlreadyValid:result.stepStatus = bsSuccess;result.isCached = true;break;case BuildResult::PermanentFailure:result.stepStatus = bsFailed;result.canCache = true;result.errorMsg = "";break;case BuildResult::InputRejected:case BuildResult::OutputRejected:result.stepStatus = bsFailed;result.canCache = true;break;case BuildResult::TransientFailure:result.stepStatus = bsFailed;result.canRetry = true;result.errorMsg = "";break;case BuildResult::TimedOut:result.stepStatus = bsTimedOut;result.errorMsg = "";break;case BuildResult::MiscFailure:result.stepStatus = bsAborted;result.canRetry = true;break;case BuildResult::LogLimitExceeded:result.stepStatus = bsLogLimitExceeded;break;case BuildResult::NotDeterministic:result.stepStatus = bsNotDeterministic;result.canRetry = false;result.canCache = true;break;default:result.stepStatus = bsAborted;break; - edit in src/hydra-queue-runner/build-remote.cc at line 382
if (result.stepStatus != bsSuccess) return;