From 5b58e64b60410d3b763915faad484d569da26dea Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Jan 2019 15:06:45 +0200 Subject: Add ability to specify alternative bridge interface to bbot-agent --- bbot/agent/agent.cli | 40 +++++++++++++++++++++++----------------- bbot/agent/agent.cxx | 17 ++++++++--------- 2 files changed, 31 insertions(+), 26 deletions(-) (limited to 'bbot/agent') diff --git a/bbot/agent/agent.cli b/bbot/agent/agent.cli index 89fa9ff..a7a5d4c 100644 --- a/bbot/agent/agent.cli +++ b/bbot/agent/agent.cli @@ -49,23 +49,6 @@ namespace bbot "Run as a simple systemd daemon." } - path --auth-key - { - "", - "Private key for the public key-based agent authentication. If not - specified, then the agent will not be able to request tasks from - controllers that require authentication. - - The file is expected to contain a single PEM-encoded private key - without a password. A suitable key can be generated using the - following command: - - \ - $ openssl genrsa 4096 >key.pem - \ - " - } - string --toolchain-name = "default" { "", @@ -120,6 +103,29 @@ namespace bbot "Amount of RAM (in kB) to use, 1G by default." } + string --bridge = "br1" + { + "", + "Bridge interface to use for machine networking, \cb{br1} by default." + }; + + path --auth-key + { + "", + "Private key for the public key-based agent authentication. If not + specified, then the agent will not be able to request tasks from + controllers that require authentication. + + The file is expected to contain a single PEM-encoded private key + without a password. A suitable key can be generated using the + following command: + + \ + $ openssl genrsa 4096 >key.pem + \ + " + } + strings --trust { "", diff --git a/bbot/agent/agent.cxx b/bbot/agent/agent.cxx index eec6072..67d503d 100644 --- a/bbot/agent/agent.cxx +++ b/bbot/agent/agent.cxx @@ -139,8 +139,6 @@ bootstrap_machine (const dir_path& md, else try { - string br ("br1"); // Using private bridge for now. - // Start the TFTP server (server chroot is --tftp). Map: // // GET requests to .../toolchains//* @@ -178,7 +176,7 @@ bootstrap_machine (const dir_path& md, start_machine (md, mm, obmm ? obmm->machine.mac : nullopt, - br, + ops.bridge (), tftpd.port ())); { @@ -813,8 +811,6 @@ try // const dir_path xp (snapshot_path (md)); - string br ("br1"); // Using private bridge for now. - for (size_t retry (0);; ++retry) { if (retry != 0) @@ -836,7 +832,7 @@ try start_machine (xp, mm.machine, mm.machine.mac, - br, + ops.bridge (), tftpd.port ())); // Note: the machine handling logic is similar to bootstrap. @@ -1108,6 +1104,11 @@ try dr << info << "bbot agent " << BBOT_VERSION_ID; + dr << + info << "cpu(s) " << ops.cpu () << + info << "ram(kB) " << ops.ram () << + info << "bridge " << ops.bridge (); + if (fingerprint) dr << info << "auth key fp " << *fingerprint; @@ -1116,9 +1117,7 @@ try info << "toolchain num " << tc_num << info << "toolchain ver " << tc_ver.string () << info << "toolchain id " << tc_id << - info << "instance num " << inst << - info << "CPU(s) " << ops.cpu () << - info << "RAM(kB) " << ops.ram (); + info << "instance num " << inst; for (const string& u: controllers) dr << info << "controller url " << u; -- cgit v1.1