From 5662e66dcdbf1af13b4ccf7352f3e435c1baf597 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 21 Jan 2019 13:14:19 +0200 Subject: Add support for running multiple instances of agent for same toolchain This allows us to perform multiple bootstraps/builds in parallel. Note that each machine can only be used by a single instance so it doesn't make sense to have more instances than machines. --- bbot/agent/agent.cli | 95 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 38 deletions(-) (limited to 'bbot/agent/agent.cli') diff --git a/bbot/agent/agent.cli b/bbot/agent/agent.cli index 016fbe9..89fa9ff 100644 --- a/bbot/agent/agent.cli +++ b/bbot/agent/agent.cli @@ -24,9 +24,9 @@ namespace bbot \cb{bbot-agent} @@ TODO. - Note that on termination \cb{bbot-agent} may leave a working machine - snapshot behind. It is expected that the caller (normally Build OS - monitor) cleans them up before restarting the agent. + Note that on termination \cb{bbot-agent} may leave behind a machine lock + and working machine snapshot. It is expected that the caller (normally + Build OS monitor) cleans them up before restarting the agent. " } @@ -37,6 +37,13 @@ namespace bbot bool --help {"Print usage information and exit."} bool --version {"Print version and exit."} + uint16_t --verbose = 1 + { + "", + "Set the diagnostics verbosity to between 0 and 6 with level 1 + being the default." + } + bool --systemd-daemon { "Run as a simple systemd daemon." @@ -59,35 +66,6 @@ namespace bbot " } - path --openssl = "openssl" - { - "", - "The openssl program to be used for crypto operations. You can also - specify additional options that should be passed to the openssl program - with \cb{--openssl-option}. If the openssl program is not explicitly - specified, then \cb{bbot-agent} will use \cb{openssl} by default." - } - - strings --openssl-option - { - "", - "Additional option to be passed to the openssl program (see - \cb{--openssl} for details). Repeat this option to specify multiple - openssl options." - } - - size_t --cpu = 1 - { - "", - "Number of CPUs (threads) to use, 1 by default." - } - - size_t --ram (1024 * 1024) // 1G - { - "", - "Amount of RAM (in kB) to use, 1G by default." - } - string --toolchain-name = "default" { "", @@ -97,7 +75,10 @@ namespace bbot uint16_t --toolchain-num = 1 { "", - "Toolchain number, 1 by default." + "Toolchain number, 1 by default. If agents are running for several + toolchains, then each of them should have a unique toolchain number + between 1 and 99. This number is used as an offset for network ports, + interfaces, etc." } standard_version --toolchain-ver @@ -115,6 +96,30 @@ namespace bbot testing)." } + // We reserve 0 in case in the future we want to distinguish a single- + // instance mode or some such. + // + uint16_t --instance = 1 + { + "", + "Instance number, 1 by default. If several instances of an agent are + running for the same toolchain, then each of them should have a unique + instance number between 1 and 99. This number is used as an offset for + network ports, interfaces, etc." + } + + size_t --cpu = 1 + { + "", + "Number of CPUs (threads) to use, 1 by default." + } + + size_t --ram (1024 * 1024) // 1G + { + "", + "Amount of RAM (in kB) to use, 1G by default." + } + strings --trust { "", @@ -133,11 +138,15 @@ namespace bbot "The location of the TFTP server root, \cb{/build/tftp/} by default." } + // Low 23401+, 23501+, 23601+, etc., all look good collision-wise with + // with anything useful. + // uint16_t --tftp-port = 23400 { "", "TFTP server port base, 23400 by default. The actual port is calculated - by adding the toolchain number \c{--toolchain-num} to this value." + by adding an offset calculated based on the toolchain and instance + numbers." } size_t --bootstrap-timeout = 1200 @@ -193,11 +202,21 @@ namespace bbot and took just as long to complete." } - uint16_t --verbose = 1 + path --openssl = "openssl" { - "", - "Set the diagnostics verbosity to between 0 and 6 with level 1 - being the default." + "", + "The openssl program to be used for crypto operations. You can also + specify additional options that should be passed to the openssl program + with \cb{--openssl-option}. If the openssl program is not explicitly + specified, then \cb{bbot-agent} will use \cb{openssl} by default." + } + + strings --openssl-option + { + "", + "Additional option to be passed to the openssl program (see + \cb{--openssl} for details). Repeat this option to specify multiple + openssl options." } // Testing options. -- cgit v1.1