hydra-queue-runner: Use cmdBuildDerivation
[?]
Jul 20, 2015, 11:45 PM
NAYQT2GTCJPBFRSK7CBFX655F2NGTBPICJSCYG2CSCQ5NRDHZG6QCDependencies
- [2]
UFUAO7NDImprove logging for aborts - [3]
N4IROACVMove buildRemote() into State - [4]
7LB6QBXYKeep track of the number of build steps that are being built - [5]
6TY4LNHHFinish copyClosure - [6]
HJOEIMLRRefactor - [7]
OG3Z3QGCNamespace cleanup - [8]
A2GL5FOZMoar stats - [9]
5LBMP7GAFix remote building - [10]
7I7XHQAEFix sending notifications in the successful case - [11]
WHULPA6SHandle failure with output - [12]
HHOMBU7Ghydra-queue-runner: Implement timeouts - [13]
62MQPRXCPass null values to libpqxx properly - [14]
YHP5DSOOImprove parsing of hydra-build-products - [15]
63W4T5PUhydra-queue-runner: More stats - [16]
E7WP35SFCreate build step for non-top-level cached failures - [17]
LE4VZIY5More stats - [18]
24BMQDZAStart of single-process hydra-queue-runner - [19]
ENXUSMSVMake concurrency more robust - [20]
RYTQLATYKeep track of failed paths in the Hydra database - [21]
OCZ4LSGGAutomatically retry aborted builds - [22]
5AIYUMTBBasic remote building - [23]
MB3TISH2Rate-limit the number of threads copying closures at the same time - [24]
QJRDO2B4Simplify retry handling - [25]
YZAI5GQUImplement a database connection pool - [26]
GKZN4UV7Make the queue monitor more robust, and better debug output - [27]
HUUZFPPKFix race between the queue monitor and the builder threads - [28]
HPJKBFZ4Handle concurrent finishing of the same build - [29]
GS4BE6TBAsynchronously compress build logs - [30]
NJJ7H64SVery basic multi-threaded queue runner
Change contents
- replacement in src/hydra-queue-runner/build-remote.cc at line 84
writeInt(cmdQueryValidPaths, to);writeInt(1, to); // == lock pathswriteInt(useSubstitutes, to);writeStrings(closure, to);to << cmdQueryValidPaths << 1 << useSubstitutes << closure; - replacement in src/hydra-queue-runner/build-remote.cc at line 104
writeInt(cmdImportPaths, to);to << cmdImportPaths; - replacement in src/hydra-queue-runner/build-remote.cc at line 116
writeInt(cmdExportPaths, to);writeInt(0, to); // == don't signwriteStrings(paths, to);to << cmdExportPaths << 0 << paths; - edit in src/hydra-queue-runner/build-remote.cc at line 148
bool sendDerivation = true; - replacement in src/hydra-queue-runner/build-remote.cc at line 150
writeInt(SERVE_MAGIC_1, to);writeInt(SERVE_PROTOCOL_VERSION, to);to << SERVE_MAGIC_1 << SERVE_PROTOCOL_VERSION; - edit in src/hydra-queue-runner/build-remote.cc at line 159
if (GET_PROTOCOL_MINOR(version) >= 1)sendDerivation = false; - replacement in src/hydra-queue-runner/build-remote.cc at line 167
/* Gather the inputs. */PathSet inputs({step->drvPath});/* Gather the inputs. If the remote side is Nix <= 1.9, we have tocopy the entire closure of ‘drvPath’, as well the requiredoutputs of the input derivations. On Nix > 1.9, we only need tocopy the immediate sources of the derivation and the requiredoutputs of the input derivations. */PathSet inputs;if (sendDerivation)inputs.insert(step->drvPath);elsefor (auto & p : step->drv.inputSrcs)inputs.insert(p); - replacement in src/hydra-queue-runner/build-remote.cc at line 184
if (i != drv2.outputs.end()) inputs.insert(i->second.path);if (i == drv2.outputs.end()) continue;inputs.insert(i->second.path); - replacement in src/hydra-queue-runner/build-remote.cc at line 203[4.941]→[4.4176:4209](∅→∅),[3.1092]→[4.4176:4209](∅→∅),[4.4176]→[4.4176:4209](∅→∅),[4.4209]→[3.1093:1141](∅→∅),[3.1141]→[4.113:209](∅→∅),[4.4251]→[4.113:209](∅→∅)
writeInt(cmdBuildPaths, to);writeStrings(PathSet({step->drvPath}), to);writeInt(maxSilentTime, to);writeInt(buildTimeout, to);// FIXME: send maxLogSize.if (sendDerivation)to << cmdBuildPaths << PathSet({step->drvPath}) << maxSilentTime << buildTimeout;elseto << cmdBuildDerivation << step->drvPath << step->drv << maxSilentTime << buildTimeout;// FIXME: send maxLogSize. - edit in src/hydra-queue-runner/build-remote.cc at line 210
- replacement in src/hydra-queue-runner/build-remote.cc at line 218[4.4460]→[4.4460:4475](∅→∅),[4.4475]→[3.1142:1242](∅→∅),[3.1242]→[4.4566:4785](∅→∅),[4.4566]→[4.4566:4785](∅→∅)
if (res) {result.errorMsg = (format("%1% on ‘%2%’") % readString(from) % machine->sshName).str();if (res == 100) result.status = RemoteResult::rrPermanentFailure;else if (res == 101) result.status = RemoteResult::rrTimedOut;else result.status = RemoteResult::rrMiscFailure;return;if (sendDerivation) {if (res) {result.errorMsg = (format("%1% on ‘%2%’") % readString(from) % machine->sshName).str();if (res == 100) result.status = BuildResult::PermanentFailure;else if (res == 101) result.status = BuildResult::TimedOut;else result.status = BuildResult::MiscFailure;return;}result.status = BuildResult::Built;} else {result.status = (BuildResult::Status) res;result.errorMsg = readString(from);if (!result.success()) return; - edit in src/hydra-queue-runner/build-remote.cc at line 234
/* If the path was substituted or already valid, then we didn'tget a build log. */if (result.status == BuildResult::Substituted || result.status == BuildResult::AlreadyValid) {unlink(result.logFile.c_str());result.logFile = "";} - edit in src/hydra-queue-runner/build-remote.cc at line 255
result.status = RemoteResult::rrSuccess; - replacement in src/hydra-queue-runner/build-result.cc at line 10
BuildResult getBuildResult(std::shared_ptr<StoreAPI> store, const Derivation & drv)BuildOutput getBuildOutput(std::shared_ptr<StoreAPI> store, const Derivation & drv) - replacement in src/hydra-queue-runner/build-result.cc at line 12
BuildResult res;BuildOutput res; - replacement in src/hydra-queue-runner/build-result.hh at line 18
struct BuildResultstruct BuildOutput - replacement in src/hydra-queue-runner/build-result.hh at line 32
BuildResult getBuildResult(std::shared_ptr<nix::StoreAPI> store, const nix::Derivation & drv);[4.4741]BuildOutput getBuildOutput(std::shared_ptr<nix::StoreAPI> store, const nix::Derivation & drv); - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 317
BuildResult res = getBuildResult(store, drv);BuildOutput res = getBuildOutput(store, drv); - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 825
BuildResult res;BuildOutput res; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 835
result.status = RemoteResult::rrPermanentFailure;result.status = BuildResult::CachedFailure; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 852
result.status = RemoteResult::rrMiscFailure;result.status = BuildResult::MiscFailure; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 856
if (result.status == RemoteResult::rrSuccess) res = getBuildResult(store, step->drv);if (result.success()) res = getBuildOutput(store, step->drv); - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 873
if (result.status == RemoteResult::rrMiscFailure) {printMsg(lvlError, format("irregular failure building ‘%1%’ on ‘%2%’: %3%")if (result.canRetry()) {printMsg(lvlError, format("possibly transient failure building ‘%1%’ on ‘%2%’: %3%") - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 891
if (result.status == RemoteResult::rrSuccess) {if (result.success()) { - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 935
markSucceededBuild(txn, b, res, build != b,markSucceededBuild(txn, b, res, build != b || result.status != BuildResult::Built, - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 1018
result.status == RemoteResult::rrPermanentFailure ? bsFailed :result.status == RemoteResult::rrTimedOut ? bsTimedOut :bsAborted;result.status == BuildResult::TimedOut ? bsTimedOut :result.canRetry() ? bsAborted :bsFailed; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 1022
result.status == RemoteResult::rrPermanentFailure ? bssFailed :result.status == RemoteResult::rrTimedOut ? bssTimedOut :bssAborted;result.status == BuildResult::TimedOut ? bssTimedOut :result.canRetry() ? bssAborted :bssFailed; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 1026
/* For regular failures, we don't care about the error/* For standard failures, we don't care about the error - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 1028
if (buildStatus != bsAborted) result.errorMsg = "";if (result.status == BuildResult::PermanentFailure ||result.status == BuildResult::TransientFailure ||result.status == BuildResult::CachedFailure ||result.status == BuildResult::TimedOut)result.errorMsg = ""; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 1068
if (!cachedFailure && result.status == RemoteResult::rrPermanentFailure)if (!cachedFailure && result.status == BuildResult::PermanentFailure) - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 1110
const BuildResult & res, bool isCachedBuild, time_t startTime, time_t stopTime)const BuildOutput & res, bool isCachedBuild, time_t startTime, time_t stopTime) - replacement in src/hydra-queue-runner/state.hh at line 46
struct RemoteResultstruct RemoteResult : nix::BuildResult - edit in src/hydra-queue-runner/state.hh at line 48
enum {rrSuccess = 0,rrPermanentFailure = 1,rrTimedOut = 2,rrMiscFailure = 3} status = rrMiscFailure;std::string errorMsg; - edit in src/hydra-queue-runner/state.hh at line 50
bool canRetry(){return status == TransientFailure || status == MiscFailure;} - replacement in src/hydra-queue-runner/state.hh at line 59
struct BuildResult;struct BuildOutput; - replacement in src/hydra-queue-runner/state.hh at line 284
const BuildResult & res, bool isCachedBuild, time_t startTime, time_t stopTime);const BuildOutput & res, bool isCachedBuild, time_t startTime, time_t stopTime);