Add hydra.conf option "nar_buffer_size" to configure memoryTokens limit
[?]
Mar 3, 2017, 11:37 AM
NSBNNM77LKRFLORJOW4NB2WXDWHC3MKRNLGRCLUKKZZXWZK7TJFACDependencies
- [2]
74WP3O3Fmax-output-size -> max_output_size - [3]
A4A5KO5QAdd error/warnings for deprecated store specification - [4]
5CNQUQ77Bump Nix - [5]
EPWEMRI2Allow determinism checking for entire jobsets - [6]
UUN5WH4DDecrease memoryTokens - [7]
SL3WSRAChydra-queue-runner: Limit memory usage - [8]
7VQ4ALFYUpdate "make check" for the new queue runner - [9]
SJQC2I3NBump memory limit a bit - [10]
24BMQDZAStart of single-process hydra-queue-runner - [11]
NJJ7H64SVery basic multi-threaded queue runner - [12]
RQUAATWBAdd status dump facility - [13]
GJV2J5HXPool local store connections - [14]
RGCPOSHYhydra-queue-runner: Ensure regular status dumps - [15]
XCHAKH4Dhydra-queue-runner: Bump memory limit to reflect more accurate accounting - [16]
PQFOMNTLhydra-queue-runner: More stats - [17]
OG3Z3QGCNamespace cleanup - [18]
SOB276BAKeep some statistics for the binary cache stores - [19]
BRAESISHWarn if PostgreSQL appears stalled - [20]
ENXUSMSVMake concurrency more robust - [21]
CNLNT3T4Allow only 1 thread to send a closure to a given machine at the same time - [22]
V2UCCYN3hydra-queue-runner: Get store mode configuration from hydra.conf - [23]
IKJBYIGYUpdate to reflect BinaryCacheStore changes - [24]
OCZ4LSGGAutomatically retry aborted builds - [25]
PDI5YPBYUse store-api for binary cache instantiation - [26]
5AIYUMTBBasic remote building - [27]
BG6PEOB2Make the output size limit configurable - [28]
HJOEIMLRRefactor - [29]
B2L4T3X6Sync with Nix - [30]
EOO4EFWDUse a single BinaryCacheStore for all threads - [31]
PLOZBRTRAdd command ‘hydra-queue-runner --status’ to show current status - [*]
MHVIT4JYSplit hydra-queue-runner.cc more - [*]
MB3TISH2Rate-limit the number of threads copying closures at the same time
Change contents
- replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 20
State::State(): memoryTokens(12ULL << 30) // FIXME: make this configurablestruct Config - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 22
hydraData = getEnv("HYDRA_DATA");if (hydraData == "") throw Error("$HYDRA_DATA must be set");std::map<std::string, std::string> options; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 24
/* Read hydra.conf. */auto hydraConfigFile = getEnv("HYDRA_CONFIG");if (pathExists(hydraConfigFile)) {Config(){/* Read hydra.conf. */auto hydraConfigFile = getEnv("HYDRA_CONFIG");if (pathExists(hydraConfigFile)) { - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 30
for (auto line : tokenizeString<Strings>(readFile(hydraConfigFile), "\n")) {line = trim(string(line, 0, line.find('#')));for (auto line : tokenizeString<Strings>(readFile(hydraConfigFile), "\n")) {line = trim(string(line, 0, line.find('#'))); - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 33
auto eq = line.find('=');if (eq == std::string::npos) continue;auto eq = line.find('=');if (eq == std::string::npos) continue; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 36
auto key = trim(std::string(line, 0, eq));auto value = trim(std::string(line, eq + 1));auto key = trim(std::string(line, 0, eq));auto value = trim(std::string(line, eq + 1)); - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 39
if (key == "") continue;if (key == "") continue; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 41
hydraConfig[key] = value;options[key] = value;} - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 46
std::string getStrOption(const std::string & key, const std::string & def = "") - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 48
std::string s = hydraConfig["max_output_size"];if (s != "") string2Int(s, maxOutputSize);auto i = options.find(key);return i == options.end() ? def : i->second;}uint64_t getIntOption(const std::string & key, uint64_t def = 0){auto i = options.find(key);return i == options.end() ? def : std::stoi(i->second);}bool getBoolOption(const std::string & key, bool def = false){auto i = options.find(key);return i == options.end() ? def : i->second == "true"; - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 63
};static uint64_t getMemSize(){auto pages = sysconf(_SC_PHYS_PAGES);return pages >= 0 ? pages * sysconf(_SC_PAGESIZE) : 4ULL << 30;}State::State(): config(std::make_unique<Config>()), memoryTokens(config->getIntOption("nar_buffer_size", getMemSize() / 2)), maxOutputSize(config->getIntOption("max_output_size", 2ULL << 30)){printInfo("using %d bytes for the NAR buffer", memoryTokens.capacity());hydraData = getEnv("HYDRA_DATA");if (hydraData == "") throw Error("$HYDRA_DATA must be set"); - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 86
if (hydraConfig["store_mode"] != "")if (config->getStrOption("store_mode") != "") - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 88
if (hydraConfig["binary_cache_dir"] != "")if (config->getStrOption("binary_cache_dir") != "") - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 90
if (hydraConfig["binary_cache_s3_bucket"] != "")if (config->getStrOption("binary_cache_s3_bucket") != "") - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 92
if (hydraConfig["binary_cache_secret_key_file"] != "")if (config->getStrOption("binary_cache_secret_key_file") != "") - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 835[7.264]→[7.4619:4620](∅→∅),[7.609]→[7.4619:4620](∅→∅),[7.859]→[7.4619:4620](∅→∅),[7.4619]→[7.4619:4620](∅→∅),[7.4620]→[4.293:409](∅→∅)
_destStore = hydraConfig["store_uri"] == ""? localStore: openStore(hydraConfig["store_uri"]); - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 836
auto isTrue = [](const std::string & s) {return s == "1" || s == "true";};auto storeUri = config->getStrOption("store_uri");_destStore = storeUri == "" ? localStore : openStore(storeUri); - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 839
useSubstitutes = isTrue(hydraConfig["use-substitutes"]);useSubstitutes = config->getBoolOption("use-substitutes", false); - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 842
for (auto & s : tokenizeString<Strings>(hydraConfig["xxx-jobset-repeats"])) {for (auto & s : tokenizeString<Strings>(config->getStrOption("xxx-jobset-repeats"))) { - edit in src/hydra-queue-runner/state.hh at line 251
- edit in src/hydra-queue-runner/state.hh at line 253
class Config; - edit in src/hydra-queue-runner/state.hh at line 255
- edit in src/hydra-queue-runner/state.hh at line 260
std::unique_ptr<Config> config; - edit in src/hydra-queue-runner/state.hh at line 270
std::map<std::string, std::string> hydraConfig; - replacement in src/hydra-queue-runner/state.hh at line 413
size_t maxOutputSize = 2ULL << 30;size_t maxOutputSize; - edit in src/hydra-queue-runner/token-server.hh at line 102[34.3312][34.3312]
size_t capacity(){return maxTokens;}