Move buildRemote() into State
[?]
Jul 7, 2015, 8:25 AM
N4IROACVZ4MU73J5SM6WXJMKQSFR3VN5SOKENNNZNEGMTGB2Q3HACDependencies
- [2]
HJOEIMLRRefactor - [3]
HHOMBU7Ghydra-queue-runner: Implement timeouts - [4]
5AIYUMTBBasic remote building - [5]
A2GL5FOZMoar stats - [6]
7LB6QBXYKeep track of the number of build steps that are being built - [7]
24BMQDZAStart of single-process hydra-queue-runner - [8]
7VQ4ALFYUpdate "make check" for the new queue runner - [9]
YZAI5GQUImplement a database connection pool - [10]
GS4BE6TBAsynchronously compress build logs - [11]
MB3TISH2Rate-limit the number of threads copying closures at the same time - [12]
RYTQLATYKeep track of failed paths in the Hydra database - [13]
5LBMP7GAFix remote building - [14]
LE4VZIY5More stats - [15]
OCZ4LSGGAutomatically retry aborted builds - [16]
ENXUSMSVMake concurrency more robust
Change contents
- file deletion: build-remote.hh
#pragma once#include "store-api.hh"#include "derivations.hh"struct RemoteResult{enum {rrSuccess = 0,rrPermanentFailure = 1,rrTimedOut = 2,rrMiscFailure = 3} status = rrMiscFailure;std::string errorMsg;time_t startTime = 0, stopTime = 0;};void buildRemote(std::shared_ptr<nix::StoreAPI> store,const std::string & sshName, const std::string & sshKey,const nix::Path & drvPath, const nix::Derivation & drv,const nix::Path & logDir, unsigned int maxSilentTime, unsigned int buildTimeout,TokenServer & copyClosureTokenServer, RemoteResult & result,counter & nrStepsBuilding, counter & nrStepsCopyingTo, counter & nrStepsCopyingFrom,counter & bytesSent, counter & bytesReceived);nix::Path logFile;#include "counter.hh"#include "token-server.hh" - replacement in src/hydra-queue-runner/Makefile.am at line 4
build-remote.hh build-result.hh counter.hh pool.hh sync.hh token-server.hh state.hh db.hhbuild-result.hh counter.hh pool.hh sync.hh token-server.hh state.hh db.hh - edit in src/hydra-queue-runner/build-remote.cc at line 6
#include "build-remote.hh" - edit in src/hydra-queue-runner/build-remote.cc at line 7
#include "util.hh" - edit in src/hydra-queue-runner/build-remote.cc at line 9
#include "state.hh"#include "util.hh" - replacement in src/hydra-queue-runner/build-remote.cc at line 143
void buildRemote(std::shared_ptr<StoreAPI> store,const string & sshName, const string & sshKey,const Path & drvPath, const Derivation & drv,const nix::Path & logDir, unsigned int maxSilentTime, unsigned int buildTimeout,TokenServer & copyClosureTokenServer, RemoteResult & result,counter & nrStepsBuilding, counter & nrStepsCopyingTo, counter & nrStepsCopyingFrom,counter & bytesSent, counter & bytesReceived)void State::buildRemote(std::shared_ptr<StoreAPI> store,Machine::ptr machine, Step::ptr step,unsigned int maxSilentTime, unsigned int buildTimeout,RemoteResult & result) - replacement in src/hydra-queue-runner/build-remote.cc at line 148
string base = baseNameOf(drvPath);string base = baseNameOf(step->drvPath); - replacement in src/hydra-queue-runner/build-remote.cc at line 158
openConnection(sshName, sshKey, logFD, child);openConnection(machine->sshName, machine->sshKey, logFD, child); - replacement in src/hydra-queue-runner/build-remote.cc at line 173
throw Error(format("protocol mismatch with ‘nix-store --serve’ on ‘%1%’") % sshName);throw Error(format("protocol mismatch with ‘nix-store --serve’ on ‘%1%’") % machine->sshName); - replacement in src/hydra-queue-runner/build-remote.cc at line 176
throw Error(format("unsupported ‘nix-store --serve’ protocol version on ‘%1%’") % sshName);throw Error(format("unsupported ‘nix-store --serve’ protocol version on ‘%1%’") % machine->sshName); - replacement in src/hydra-queue-runner/build-remote.cc at line 180
throw Error(format("cannot connect to ‘%1%’: %2%") % sshName % s);throw Error(format("cannot connect to ‘%1%’: %2%") % machine->sshName % s); - replacement in src/hydra-queue-runner/build-remote.cc at line 184
PathSet inputs({drvPath});for (auto & input : drv.inputDrvs) {PathSet inputs({step->drvPath});for (auto & input : step->drv.inputDrvs) { - replacement in src/hydra-queue-runner/build-remote.cc at line 194
if (sshName != "localhost") {printMsg(lvlDebug, format("sending closure of ‘%1%’ to ‘%2%’") % drvPath % sshName);if (machine->sshName != "localhost") {printMsg(lvlDebug, format("sending closure of ‘%1%’ to ‘%2%’") % step->drvPath % machine->sshName); - replacement in src/hydra-queue-runner/build-remote.cc at line 203
printMsg(lvlDebug, format("building ‘%1%’ on ‘%2%’") % drvPath % sshName);printMsg(lvlDebug, format("building ‘%1%’ on ‘%2%’") % step->drvPath % machine->sshName); - replacement in src/hydra-queue-runner/build-remote.cc at line 205
writeStrings(PathSet({drvPath}), to);writeStrings(PathSet({step->drvPath}), to); - replacement in src/hydra-queue-runner/build-remote.cc at line 218
result.errorMsg = (format("%1% on ‘%2%’") % readString(from) % sshName).str();result.errorMsg = (format("%1% on ‘%2%’") % readString(from) % machine->sshName).str(); - replacement in src/hydra-queue-runner/build-remote.cc at line 226
if (sshName != "localhost") {printMsg(lvlDebug, format("copying outputs of ‘%1%’ from ‘%2%’") % drvPath % sshName);if (machine->sshName != "localhost") {printMsg(lvlDebug, format("copying outputs of ‘%1%’ from ‘%2%’") % step->drvPath % machine->sshName); - replacement in src/hydra-queue-runner/build-remote.cc at line 229
for (auto & output : drv.outputs)for (auto & output : step->drv.outputs) - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 11
#include "build-remote.hh" - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 850
buildRemote(store, machine->sshName, machine->sshKey, step->drvPath, step->drv,logDir, build->maxSilentTime, build->buildTimeout, copyClosureTokenServer,result, nrStepsBuilding, nrStepsCopyingTo, nrStepsCopyingFrom,bytesSent, bytesReceived);buildRemote(store, machine, step, build->maxSilentTime, build->buildTimeout, result); - edit in src/hydra-queue-runner/state.hh at line 49
struct RemoteResult{enum {rrSuccess = 0,rrPermanentFailure = 1,rrTimedOut = 2,rrMiscFailure = 3} status = rrMiscFailure;std::string errorMsg;time_t startTime = 0, stopTime = 0;nix::Path logFile;}; - edit in src/hydra-queue-runner/state.hh at line 282
void buildRemote(std::shared_ptr<nix::StoreAPI> store,Machine::ptr machine, Step::ptr step,unsigned int maxSilentTime, unsigned int buildTimeout,RemoteResult & result);