Allow the machines file to specify host public keys

[?]
Aug 26, 2015, 11:43 AM
4VYY2ADPFENPAC36FJCSEMEHOPL6E2T4RPXJKYVF47DFKAO6PLIAC

Dependencies

  • [2] WJTP6VZI Fix building against the latest Nix
  • [3] N4IROACV Move buildRemote() into State
  • [4] 7VQ4ALFY Update "make check" for the new queue runner
  • [5] FV2M6MOT hydra: use autoconf/-make
  • [6] GS4BE6TB Asynchronously compress build logs
  • [7] 24BMQDZA Start of single-process hydra-queue-runner
  • [8] SODOV2CM Automatically reload $NIX_REMOTE_SYSTEMS when it changes
  • [9] NAYQT2GT hydra-queue-runner: Use cmdBuildDerivation
  • [10] 5AIYUMTB Basic remote building
  • [11] SK6WHODM Support preferLocalBuild
  • [12] WKJFPR77 hydra-queue-runner: Maintain count of active build steps
  • [13] 5Q7X5FPJ hydra-queue-runner: Improve SSH flags
  • [14] LE4VZIY5 More stats
  • [15] ZSBPKI2P Pass ssh key
  • [*] HJOEIMLR Refactor

Change contents

  • replacement in configure.ac at line 13
    [2.1][2.1:25]()
    CXXFLAGS+=" -std=c++0x"
    [2.1]
    [4.16096]
    CXXFLAGS+=" -std=c++11"
  • replacement in src/hydra-queue-runner/build-remote.cc at line 29
    [4.381][4.381:488]()
    static void openConnection(const string & sshName, const string & sshKey,
    int stderrFD, Child & child)
    [4.381]
    [4.488]
    static void openConnection(Machine::ptr machine, Path tmpDir, int stderrFD, Child & child)
  • replacement in src/hydra-queue-runner/build-remote.cc at line 47
    [4.297][4.297:333]()
    if (sshName == "localhost")
    [4.297]
    [4.333]
    if (machine->sshName == "localhost")
  • replacement in src/hydra-queue-runner/build-remote.cc at line 50
    [4.404][4.404:518]()
    argv = {"ssh", sshName};
    if (sshKey != "" && sshKey != "-") append(argv, {"-i", sshKey});
    [4.404]
    [4.518]
    argv = {"ssh", machine->sshName};
    if (machine->sshKey != "") append(argv, {"-i", machine->sshKey});
    if (machine->sshPublicHostKey != "") {
    Path fileName = tmpDir + "/host-key";
    auto p = machine->sshName.find("@");
    string host = p != string::npos ? string(machine->sshName, p + 1) : machine->sshName;
    writeFile(fileName, host + " " + machine->sshPublicHostKey + "\n");
    append(argv, {"-oUserKnownHostsFile=" + fileName});
    }
  • edit in src/hydra-queue-runner/build-remote.cc at line 145
    [4.3247]
    [4.3247]
    nix::Path tmpDir = createTempDir();
    AutoDelete tmpDirDel(tmpDir, true);
  • replacement in src/hydra-queue-runner/build-remote.cc at line 149
    [4.3264][3.348:417]()
    openConnection(machine->sshName, machine->sshKey, logFD, child);
    [4.3264]
    [4.3315]
    openConnection(machine, tmpDir, logFD, child);
  • edit in src/hydra-queue-runner/build-remote.cc at line 289
    [4.5159][4.5159:5160]()
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 43
    [4.1936][4.1936:1962]()
    tokens.resize(7);
    [4.1936]
    [4.7732]
    tokens.resize(8);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 48
    [4.2075][4.2075:2112]()
    machine->sshKey = tokens[2];
    [4.2075]
    [4.2112]
    machine->sshKey = tokens[2] == "-" ? string("") : tokens[2];
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 60
    [4.2559]
    [4.2559]
    if (tokens[7] != "" && tokens[7] != "-")
    machine->sshPublicHostKey = base64Decode(tokens[7]);
  • edit in src/hydra-queue-runner/state.hh at line 208
    [17.3495]
    [17.3495]
    std::string sshPublicHostKey;