Allow setting GC_INITIAL_HEAP_SIZE for hydra-eval-jobs

[?]
May 16, 2018, 12:14 PM
ZVSHXE3KY43J5BBDGERORR2FAVDG4ARANUUSGIYDHUN767SQ4GAQC

Dependencies

  • [2] HK2F7SKQ Fix std::stoi exception
  • [3] FHVJYJFE Upload build logs to the binary cache
  • [4] K7IOFWLN Fix build
  • [5] STZE4KKR Fix build against Nix master
  • [6] OCZ4LSGG Automatically retry aborted builds
  • [7] PQFOMNTL hydra-queue-runner: More stats
  • [8] M3A5PZIH hydra: Clarify the dependency on BDW-GC.
  • [9] GJV2J5HX Pool local store connections
  • [10] MB3TISH2 Rate-limit the number of threads copying closures at the same time
  • [11] XCHAKH4D hydra-queue-runner: Bump memory limit to reflect more accurate accounting
  • [12] MHVIT4JY Split hydra-queue-runner.cc more
  • [13] SL3WSRAC hydra-queue-runner: Limit memory usage
  • [14] XCDTFZUY hydra-queue-runner: Fix build
  • [15] RQUAATWB Add status dump facility
  • [16] 74WP3O3F max-output-size -> max_output_size
  • [17] HJOEIMLR Refactor
  • [18] FV2M6MOT hydra: use autoconf/-make
  • [19] PLOZBRTR Add command ‘hydra-queue-runner --status’ to show current status
  • [20] UUN5WH4D Decrease memoryTokens
  • [21] KNLKTCDM Use pkgconfig to find Nix
  • [22] SGFLU2VS USER -> LOGNAME for consistency
  • [23] 24BMQDZA Start of single-process hydra-queue-runner
  • [24] F57YJP5P Build against latest Nix
  • [25] B2L4T3X6 Sync with Nix
  • [26] SJQC2I3N Bump memory limit a bit
  • [27] PIMGMGAF Rename hydra_eval_jobs to hydra-eval-jobs
  • [28] V2UCCYN3 hydra-queue-runner: Get store mode configuration from hydra.conf
  • [29] NSBNNM77 Add hydra.conf option "nar_buffer_size" to configure memoryTokens limit
  • [30] 5AIYUMTB Basic remote building
  • [31] ENXUSMSV Make concurrency more robust
  • [32] CNLNT3T4 Allow only 1 thread to send a closure to a given machine at the same time
  • [33] BG6PEOB2 Make the output size limit configurable
  • [*] 4N5APGRG * Start of a helper tool to evaluate job expressions efficiently.
  • [*] 7GKAIP3V Fix build and handling of string inputs starting with a dash
  • [*] 4YCF3KBG Concurrent hydra-evaluator

Change contents

  • replacement in src/hydra-eval-jobs/Makefile.am at line 5
    [6.152][6.286:287](),[6.318][6.286:287](),[6.286][6.286:287](),[6.287][6.319:347]()
    AM_CXXFLAGS = $(NIX_CFLAGS)
    [6.318]
    hydra_eval_jobs_CXXFLAGS = $(NIX_CFLAGS) -I ../libhydra
  • edit in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 15
    [5.31]
    [35.451]
    #include "hydra-config.hh"
  • edit in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 162
    [36.80]
    [36.80]
    auto config = std::make_unique<::Config>();
    auto initialHeapSize = config->getStrOption("evaluator_initial_heap_size", "");
    if (initialHeapSize != "")
    setenv("GC_INITIAL_HEAP_SIZE", initialHeapSize.c_str(), 1);
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 13
    [6.4993][6.4993:5014]()
    #include "shared.hh"
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 14
    [6.5036]
    [6.736]
    #include "hydra-config.hh"
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 17
    [6.791]
    [6.5036]
    #include "shared.hh"
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 31
    [4.335][6.0:14](),[6.22][6.0:14](),[6.14][6.7501:7503](),[6.64][6.7501:7503](),[6.65][6.7501:7503](),[6.65][6.7501:7503](),[6.617][6.7501:7503](),[6.1126][6.7501:7503](),[6.1419][6.7501:7503](),[6.7501][6.7501:7503](),[6.7503][6.15:63](),[6.63][6.0:1](),[6.7840][6.0:1](),[6.1][6.64:212](),[6.212][6.118:119](),[6.118][6.118:119](),[6.119][6.213:364](),[6.364][6.262:263](),[6.262][6.262:263](),[6.263][6.365:462](),[6.462][6.352:353](),[6.352][6.352:353](),[6.353][6.463:584](),[6.584][6.466:467](),[6.466][6.466:467](),[6.467][6.585:626](),[6.504][6.7840:7841](),[6.626][6.7840:7841](),[6.7840][6.7840:7841](),[6.7841][6.627:679](),[6.679][6.543:560](),[6.543][6.543:560](),[6.560][6.680:764](),[6.764][6.3819:3825](),[6.560][6.3819:3825](),[6.3825][6.765:972](),[6.972][2.0:65](),[2.65][6.1036:1151](),[6.1036][6.1036:1151](),[6.1151][3.598:683](),[3.683][6.3932:3938](),[6.1214][6.3932:3938](),[6.3932][6.3932:3938](),[6.3938][6.1215:1220]()
    struct Config
    {
    std::map<std::string, std::string> options;
    Config()
    {
    /* Read hydra.conf. */
    auto hydraConfigFile = getEnv("HYDRA_CONFIG");
    if (pathExists(hydraConfigFile)) {
    for (auto line : tokenizeString<Strings>(readFile(hydraConfigFile), "\n")) {
    line = trim(string(line, 0, line.find('#')));
    auto eq = line.find('=');
    if (eq == std::string::npos) continue;
    auto key = trim(std::string(line, 0, eq));
    auto value = trim(std::string(line, eq + 1));
    if (key == "") continue;
    options[key] = value;
    }
    }
    }
    std::string getStrOption(const std::string & key, const std::string & def = "")
    {
    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::stoll(i->second);
    }
    bool getBoolOption(const std::string & key, bool def = false)
    {
    auto i = options.find(key);
    return i == options.end() ? def : (i->second == "true" || i->second == "1");
    }
    };
  • file addition: hydra-config.hh (----------)
    [37.9041]
    #pragma once
    #include <map>
    #include "util.hh"
    struct Config
    {
    std::map<std::string, std::string> options;
    Config()
    {
    using namespace nix;
    /* Read hydra.conf. */
    auto hydraConfigFile = getEnv("HYDRA_CONFIG");
    if (pathExists(hydraConfigFile)) {
    for (auto line : tokenizeString<Strings>(readFile(hydraConfigFile), "\n")) {
    line = trim(string(line, 0, line.find('#')));
    auto eq = line.find('=');
    if (eq == std::string::npos) continue;
    auto key = trim(std::string(line, 0, eq));
    auto value = trim(std::string(line, eq + 1));
    if (key == "") continue;
    options[key] = value;
    }
    }
    }
    std::string getStrOption(const std::string & key, const std::string & def = "")
    {
    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::stoll(i->second);
    }
    bool getBoolOption(const std::string & key, bool def = false)
    {
    auto i = options.find(key);
    return i == options.end() ? def : (i->second == "true" || i->second == "1");
    }
    };