From e0805007423244218514b6dfec74b89067c7c468 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Mar 2024 11:11:04 +0200 Subject: Rename --ram agent option to --build-ram, add --auxiliary-ram --- bbot/agent/agent.cli | 18 ++++++++++++++++-- bbot/agent/agent.cxx | 3 ++- bbot/agent/machine.cxx | 2 +- bbot/bbot-agent@.service | 6 ++++-- 4 files changed, 23 insertions(+), 6 deletions(-) (limited to 'bbot') diff --git a/bbot/agent/agent.cli b/bbot/agent/agent.cli index eb3553d..060cba0 100644 --- a/bbot/agent/agent.cli +++ b/bbot/agent/agent.cli @@ -189,10 +189,24 @@ namespace bbot "Number of CPUs (threads) to use, 1 by default." } - size_t --ram (1024 * 1024) // 1G + size_t --build-ram (4 * 1024 * 1024) // 4GiB { "", - "Amount of RAM (in kB) to use, 1G by default." + "Amount of RAM (in KiB) to use for the build machine, 4GiB by default." + } + + size_t --auxiliary-ram + { + "", + "Amount of RAM (in KiB) to use for auxiliary machines. To disable + running auxiliary machines, specify \cb{0}. If unspecified, then + currently the behavior is the same as specifying \cb{0} but this + may change in the future (for example, to support a more dynamic + allocation strategy)." + + // Note: it's not going to be easy to set it to unspecified in + // bbot-agent@.service so we may have to invent some special value, + // like `auto`. } string --bridge = "br1" diff --git a/bbot/agent/agent.cxx b/bbot/agent/agent.cxx index 062fd68..74f461c 100644 --- a/bbot/agent/agent.cxx +++ b/bbot/agent/agent.cxx @@ -1863,7 +1863,8 @@ try dr << info << "cpu(s) " << ops.cpu () << - info << "ram(kB) " << ops.ram () << + info << "build ram(KiB) " << ops.build_ram () << + info << "auxil ram(KiB) " << ops.auxiliary_ram () << info << "bridge " << ops.bridge (); if (fingerprint) diff --git a/bbot/agent/machine.cxx b/bbot/agent/machine.cxx index 84916f6..2d9ad4f 100644 --- a/bbot/agent/machine.cxx +++ b/bbot/agent/machine.cxx @@ -278,7 +278,7 @@ namespace bbot else ram += (ops.ram () - ram) / 2; #else - size_t ram (ops.ram ()); + size_t ram (ops.build_ram ()); #endif // If we have options, use that instead of the default network and diff --git a/bbot/bbot-agent@.service b/bbot/bbot-agent@.service index 18b7c9e..d379b3c 100644 --- a/bbot/bbot-agent@.service +++ b/bbot/bbot-agent@.service @@ -14,7 +14,8 @@ Type=simple Environment=VERBOSE=3 Environment=CPU=1 -Environment=RAM=1048576 +Environment=RAM_BUILD=4194304 +Environment=RAM_AUXIL=0 Environment=BRIDGE=br1 Environment=AUTH_KEY= @@ -49,7 +50,8 @@ ExecStart=/build/bots/default/bin/bbot-agent \ --systemd-daemon \ --verbose ${VERBOSE} \ --cpu ${CPU} \ - --ram ${RAM} \ + --build-ram ${RAM_BUILD} \ + --auxiliary-ram ${RAM_AUXIL} \ --bridge ${BRIDGE} \ --auth-key ${AUTH_KEY} \ --interactive ${INTERACTIVE} \ -- cgit v1.1