Use a single BinaryCacheStore for all threads

[?]
Feb 18, 2016, 4:31 PM
EOO4EFWD2BJCGF3ZKS2QR3XDW4WHUGH2EHSOFVK6GMI5BUBZW6QQC

Dependencies

  • [2] GTUZLZRH Add an S3-backed binary cache store
  • [3] 5AIYUMTB Basic remote building
  • [4] ZM34T2NW Typo
  • [5] 73YR46NJ hydra-queue-runner: Write directly to a binary cache
  • [6] W2AOTSS6 Rename class
  • [7] N2NKSKHS Refactor local binary cache code into a subclass
  • [8] 32HHP5CW hydra-queue-runner: Support generating a signed binary cache
  • [9] 24BMQDZA Start of single-process hydra-queue-runner
  • [*] HJOEIMLR Refactor

Change contents

  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 14
    [3.2032][3.105:163]()
    BinaryCacheStore::BinaryCacheStore(ref<Store> localStore,
    [3.2032]
    [3.307]
    BinaryCacheStore::BinaryCacheStore(const StoreFactory & storeFactory,
  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 16
    [3.367][3.367:396]()
    : localStore(localStore)
    [3.367]
    [3.2180]
    : storeFactory(storeFactory)
  • edit in src/hydra-queue-runner/binary-cache-store.cc at line 194
    [3.8015]
    [3.8015]
    auto localStore = storeFactory();
  • edit in src/hydra-queue-runner/binary-cache-store.cc at line 215
    [3.8569]
    [3.8569]
    auto localStore = storeFactory();
  • edit in src/hydra-queue-runner/binary-cache-store.hh at line 9
    [3.2138]
    [3.9309]
    /* While BinaryCacheStore is thread-safe, LocalStore and RemoteStore
    aren't. Until they are, use a factory to produce a thread-local
    local store. */
    typedef std::function<ref<Store>()> StoreFactory;
  • edit in src/hydra-queue-runner/binary-cache-store.hh at line 19
    [3.955][3.9364:9391](),[3.9364][3.9364:9391](),[3.9416][3.2139:2140]()
    ref<Store> localStore;
  • edit in src/hydra-queue-runner/binary-cache-store.hh at line 22
    [3.9417]
    [3.956]
    StoreFactory storeFactory;
  • replacement in src/hydra-queue-runner/binary-cache-store.hh at line 26
    [3.9426][3.968:1012]()
    BinaryCacheStore(ref<Store> localStore,
    [3.9426]
    [3.2300]
    BinaryCacheStore(const StoreFactory & storeFactory,
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 26
    [3.7892]
    [3.1542]
    #if 0
    auto store = make_ref<LocalBinaryCacheStore>(getLocalStore(),
    "/home/eelco/Misc/Keys/test.nixos.org/secret",
    "/home/eelco/Misc/Keys/test.nixos.org/public",
    "/tmp/binary-cache");
    #endif
    auto store = std::make_shared<S3BinaryCacheStore>(
    []() { return openStore(); },
    "/home/eelco/Misc/Keys/test.nixos.org/secret",
    "/home/eelco/Misc/Keys/test.nixos.org/public",
    "nix-test-cache-3");;
    store->init();
    _destStore = store;
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 52
    [3.1660][2.747:753](),[2.753][3.1357:1423](),[3.1660][3.1357:1423](),[3.1423][2.754:964](),[2.964][3.84:139](),[3.84][3.84:139](),[3.139][2.965:1049](),[2.1049][3.1424:1461](),[3.195][3.1424:1461]()
    #if 0
    auto store = make_ref<LocalBinaryCacheStore>(getLocalStore(),
    "/home/eelco/Misc/Keys/test.nixos.org/secret",
    "/home/eelco/Misc/Keys/test.nixos.org/public",
    "/tmp/binary-cache");
    #endif
    auto store = make_ref<S3BinaryCacheStore>(getLocalStore(),
    "/home/eelco/Misc/Keys/test.nixos.org/secret",
    "/home/eelco/Misc/Keys/test.nixos.org/public",
    "nix-test-cache-3");
    store->init();
    return store;
    [3.1660]
    [3.7503]
    return ref<Store>(_destStore);
  • replacement in src/hydra-queue-runner/local-binary-cache-store.cc at line 5
    [3.1521][3.1521:1589]()
    LocalBinaryCacheStore::LocalBinaryCacheStore(ref<Store> localStore,
    [3.1521]
    [2.1050]
    LocalBinaryCacheStore::LocalBinaryCacheStore(const StoreFactory & storeFactory,
  • replacement in src/hydra-queue-runner/local-binary-cache-store.cc at line 8
    [2.1143][3.1679:1744](),[3.1679][3.1679:1744]()
    : BinaryCacheStore(localStore, secretKeyFile, publicKeyFile)
    [2.1143]
    [3.1744]
    : BinaryCacheStore(storeFactory, secretKeyFile, publicKeyFile)
  • replacement in src/hydra-queue-runner/local-binary-cache-store.hh at line 15
    [3.2839][2.1144:1193]()
    LocalBinaryCacheStore(ref<Store> localStore,
    [3.2839]
    [2.1193]
    LocalBinaryCacheStore(const StoreFactory & storeFactory,
  • replacement in src/hydra-queue-runner/s3-binary-cache-store.cc at line 23
    [2.2017][2.2017:2079]()
    S3BinaryCacheStore::S3BinaryCacheStore(ref<Store> localStore,
    [2.2017]
    [2.2079]
    S3BinaryCacheStore::S3BinaryCacheStore(const StoreFactory & storeFactory,
  • replacement in src/hydra-queue-runner/s3-binary-cache-store.cc at line 26
    [2.2175][2.2175:2240]()
    : BinaryCacheStore(localStore, secretKeyFile, publicKeyFile)
    [2.2175]
    [2.2240]
    : BinaryCacheStore(storeFactory, secretKeyFile, publicKeyFile)
  • replacement in src/hydra-queue-runner/s3-binary-cache-store.hh at line 21
    [2.5890][2.5890:5936]()
    S3BinaryCacheStore(ref<Store> localStore,
    [2.5890]
    [2.5936]
    S3BinaryCacheStore(const StoreFactory & storeFactory,
  • edit in src/hydra-queue-runner/state.hh at line 349
    [11.6778]
    [11.6778]
    /* Destination store. */
    std::shared_ptr<nix::Store> _destStore;