Use store-api for binary cache instantiation

[?]
May 12, 2016, 8:15 AM
PDI5YPBYHMU4EQM3D45JEUYI4PBU5KGDIWK5O5YEOCM6R3IEAXUQC

Dependencies

  • [2] E5YNZACS Fix build
  • [3] NJJ7H64S Very basic multi-threaded queue runner
  • [4] GTUZLZRH Add an S3-backed binary cache store
  • [5] MHVIT4JY Split hydra-queue-runner.cc more
  • [6] K5G5GZY7 Guard against concurrent invocations of hydra-queue-runner
  • [7] O64P4XJS Keep per-machine stats
  • [8] PLOZBRTR Add command ‘hydra-queue-runner --status’ to show current status
  • [9] ENXUSMSV Make concurrency more robust
  • [10] SOB276BA Keep some statistics for the binary cache stores
  • [11] N2NKSKHS Refactor local binary cache code into a subclass
  • [12] B2L4T3X6 Sync with Nix
  • [13] V2UCCYN3 hydra-queue-runner: Get store mode configuration from hydra.conf
  • [14] GJV2J5HX Pool local store connections
  • [15] DXFMYCNW Fix build
  • [*] 24BMQDZA Start of single-process hydra-queue-runner

Change contents

  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 10
    [3.1356][3.710:746]()
    #include "s3-binary-cache-store.hh"
    [3.20065]
    [3.19]
    #include "store-api.hh"
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 796
    [3.643][3.4399:4400](),[3.4400][3.561:609]()
    auto storeMode = hydraConfig["store_mode"];
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 799
    [3.4620][3.610:662]()
    if (storeMode == "direct" || storeMode == "") {
    [3.4620]
    [3.860]
    if (hydraConfig["store_uri"] == "") {
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 801
    [3.894][3.696:906](),[3.696][3.696:906](),[3.906][2.0:48](),[2.48][3.895:977](),[3.960][3.895:977](),[3.1034][3.1134:1152](),[3.1134][3.1134:1152]()
    }
    else if (storeMode == "local-binary-cache") {
    auto dir = hydraConfig["binary_cache_dir"];
    if (dir == "")
    throw Error("you must set ‘binary_cache_dir’ in hydra.conf");
    _destStore = openLocalBinaryCacheStore(
    _localStore,
    hydraConfig["binary_cache_secret_key_file"],
    dir);
    [3.894]
    [3.1243]
    } else {
    _destStore = openStoreAt(hydraConfig["store_uri"]);
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 805
    [3.1250][3.1250:1527](),[3.1527][3.1035:1060](),[3.1060][3.1583:1640](),[3.1583][3.1583:1640](),[3.1697][3.1697:1816](),[3.1816][3.643:644](),[3.4896][3.643:644](),[3.643][3.643:644]()
    else if (storeMode == "s3-binary-cache") {
    auto bucketName = hydraConfig["binary_cache_s3_bucket"];
    if (bucketName == "")
    throw Error("you must set ‘binary_cache_s3_bucket’ in hydra.conf");
    auto store = make_ref<S3BinaryCacheStore>(
    _localStore,
    hydraConfig["binary_cache_secret_key_file"],
    bucketName);
    store->init();
    _destStore = std::shared_ptr<S3BinaryCacheStore>(store);
    }