hydra-queue-runner: Use substitutes
[?]
Oct 5, 2015, 12:57 PM
VQISTKOPNAEUS2K2F73CMNNLGZATWUYIURD5CSVNBNF7Q5ZF4PXQCDependencies
- [2]
OG3Z3QGCNamespace cleanup - [3]
MHVIT4JYSplit hydra-queue-runner.cc more - [4]
KBZHIGLGRecord the machine used for a build step - [5]
5N7LVAJNKeep track of requiredSystemFeatures in the machine stats - [6]
VRDAPUA4Don't lock the CPU - [7]
JFD25IUUhydra-queue-runner: Implement --unlock - [8]
24BMQDZAStart of single-process hydra-queue-runner - [9]
ZK76B5ZZLoad the queue in order of global priority - [10]
IK2UBDAURevive jobset scheduling - [11]
HJOEIMLRRefactor - [12]
FQQRJUO4Mark builds as busy - [13]
WE5Q2NVIAllow build to be bumped to the front of the queue via the web interface - [14]
EJJCY263Account steps with preferLocalBuild as a separate system type - [15]
62MQPRXCPass null values to libpqxx properly - [16]
NJJ7H64SVery basic multi-threaded queue runner - [17]
LJILHOJ7Create BuildSteps race-free - [18]
MSIHMO45Tweak build steps - [*]
HUUZFPPKFix race between the queue monitor and the builder threads
Change contents
- replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 171
int State::createBuildStep(pqxx::work & txn, time_t startTime, Build::ptr build, Step::ptr step,const std::string & machine, BuildStepStatus status, const std::string & errorMsg, BuildID propagatedFrom)int State::allocBuildStep(pqxx::work & txn, Build::ptr build) - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 178
int stepNr = res[0][0].is_null() ? 1 : res[0][0].as<int>() + 1;return res[0][0].is_null() ? 1 : res[0][0].as<int>() + 1;}int State::createBuildStep(pqxx::work & txn, time_t startTime, Build::ptr build, Step::ptr step,const std::string & machine, BuildStepStatus status, const std::string & errorMsg, BuildID propagatedFrom){int stepNr = allocBuildStep(txn, build); - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 189
(build->id)(stepNr)(0)(step->drvPath)(status == bssBusy ? 1 : 0)(build->id)(stepNr)(0) // == build(step->drvPath)(status == bssBusy ? 1 : 0) - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 226[4.13425][20.2306]
int State::createSubstitutionStep(pqxx::work & txn, time_t startTime, time_t stopTime,Build::ptr build, const Path & drvPath, const string & outputName, const Path & storePath){int stepNr = allocBuildStep(txn, build);txn.parameterized("insert into BuildSteps (build, stepnr, type, drvPath, busy, status, startTime, stopTime) values ($1, $2, $3, $4, $5, $6, $7, $8)")(build->id)(stepNr)(1) // == substitution(drvPath)(0)(0)(startTime)(stopTime).exec();txn.parameterized("insert into BuildStepOutputs (build, stepnr, name, path) values ($1, $2, $3, $4)")(build->id)(stepNr)(outputName)(storePath).exec();return stepNr;} - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 724
settings.useSubstitutes = false; - edit in src/hydra-queue-runner/queue-monitor.cc at line 3
#include "globals.hh" - edit in src/hydra-queue-runner/queue-monitor.cc at line 5
- replacement in src/hydra-queue-runner/queue-monitor.cc at line 136
Step::ptr step = createStep(store, build->drvPath, build, 0, finishedDrvs, newSteps, newRunnable);Step::ptr step = createStep(store, conn, build, build->drvPath, build, 0, finishedDrvs, newSteps, newRunnable); - replacement in src/hydra-queue-runner/queue-monitor.cc at line 303
Step::ptr State::createStep(std::shared_ptr<StoreAPI> store, const Path & drvPath,Step::ptr State::createStep(std::shared_ptr<StoreAPI> store,Connection & conn, Build::ptr build, const Path & drvPath, - replacement in src/hydra-queue-runner/queue-monitor.cc at line 382
for (auto & i : step->drv.outputs) {PathSet outputs = outputPaths(step->drv);DerivationOutputs missing;PathSet missingPaths;for (auto & i : step->drv.outputs) - replacement in src/hydra-queue-runner/queue-monitor.cc at line 388
break;missing[i.first] = i.second;missingPaths.insert(i.second.path);}/* Try to substitute the missing paths. Note: can't use the moreefficient querySubstitutablePaths() here because upstream Hydraservers don't allow it (they have "WantMassQuery: 0"). */assert(missing.size() == missingPaths.size());if (!missing.empty() && settings.useSubstitutes) {SubstitutablePathInfos infos;store->querySubstitutablePathInfos(missingPaths, infos);if (infos.size() == missingPaths.size()) {valid = true;for (auto & i : missing) {try {printMsg(lvlInfo, format("substituting output ‘%1%’ of ‘%2%’") % i.second.path % drvPath);time_t startTime = time(0);store->ensurePath(i.second.path);time_t stopTime = time(0);{pqxx::work txn(conn);createSubstitutionStep(txn, startTime, stopTime, build, drvPath, "out", i.second.path);txn.commit();}} catch (Error & e) {valid = false;break;}} - replacement in src/hydra-queue-runner/queue-monitor.cc at line 435
auto dep = createStep(store, i.first, 0, step, finishedDrvs, newSteps, newRunnable);auto dep = createStep(store, conn, build, i.first, 0, step, finishedDrvs, newSteps, newRunnable); - edit in src/hydra-queue-runner/state.hh at line 359
int allocBuildStep(pqxx::work & txn, Build::ptr build); - edit in src/hydra-queue-runner/state.hh at line 369
int createSubstitutionStep(pqxx::work & txn, time_t startTime, time_t stopTime,Build::ptr build, const nix::Path & drvPath, const std::string & outputName, const nix::Path & storePath); - replacement in src/hydra-queue-runner/state.hh at line 385
Step::ptr createStep(std::shared_ptr<nix::StoreAPI> store, const nix::Path & drvPath,Step::ptr createStep(std::shared_ptr<nix::StoreAPI> store,Connection & conn, Build::ptr build, const nix::Path & drvPath,