From 578413a1f8781f03c2ddccb4d3c5d441c9579a3b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 4 Apr 2017 14:58:08 +0200 Subject: Add --cpu and --ram options --- NEWS | 3 +++ bbot/agent.cli | 12 ++++++++++++ bbot/agent.cxx | 10 ++++++++++ bbot/bbot-agent@.service | 4 +++- build/bootstrap.build | 5 +++-- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index e69de29..b96445c 100644 --- a/NEWS +++ b/NEWS @@ -0,0 +1,3 @@ +Version 0.5.0 + + * First public release. diff --git a/bbot/agent.cli b/bbot/agent.cli index a52579f..761580c 100644 --- a/bbot/agent.cli +++ b/bbot/agent.cli @@ -30,6 +30,18 @@ namespace bbot { "\h|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." + }; + bool --help {"Print usage information and exit."} bool --version {"Print version and exit."} }; diff --git a/bbot/agent.cxx b/bbot/agent.cxx index 26b0073..8c281fe 100644 --- a/bbot/agent.cxx +++ b/bbot/agent.cxx @@ -99,6 +99,16 @@ try return p.wait () ? 0 : 1; } + if (argc != 2) + fail << "toolchain name excected" << + info << "run " << argv[0] << " --help for details"; + + string tc (argv[1]); + + info << "starting bbot agent for toolchain " << tc << + info << ops.cpu () << " CPU(s)" << + info << ops.ram () << " RAM(kB)"; + for (;;) { error << "sleeping" << diff --git a/bbot/bbot-agent@.service b/bbot/bbot-agent@.service index 8b3b7a3..64e07d2 100644 --- a/bbot/bbot-agent@.service +++ b/bbot/bbot-agent@.service @@ -4,7 +4,9 @@ After=default.target [Service] Type=simple -ExecStart=/build/toolchains/%i/bin/bbot-agent %i +Environment=CPU=1 +Environment=RAM=1048576 +ExecStart=/build/bbot/%i/bin/bbot-agent --cpu ${CPU} --ram ${RAM} %i User=build Group=build WorkingDirectory=~ diff --git a/build/bootstrap.build b/build/bootstrap.build index 26f9872..8bc749f 100644 --- a/build/bootstrap.build +++ b/build/bootstrap.build @@ -9,12 +9,13 @@ using build@0.4.0 version = 0.5.0-a1 revision = 0 +using config +using dist + dist.package = $project-$version if ($revision != 0) dist.package += +$revision -using config -using dist using test using install -- cgit v1.1