aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-04 14:58:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-04 14:58:08 +0200
commit578413a1f8781f03c2ddccb4d3c5d441c9579a3b (patch)
treee09764195dbf2027f6bd3f9be3b0d280c99b9340
parent1af66bf90d14ec32ec0df5fe266674bd08ecf5e1 (diff)
Add --cpu and --ram options
-rw-r--r--NEWS3
-rw-r--r--bbot/agent.cli12
-rw-r--r--bbot/agent.cxx10
-rw-r--r--bbot/bbot-agent@.service4
-rw-r--r--build/bootstrap.build5
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
+ {
+ "<num>",
+ "Number of CPUs (threads) to use, 1 by default."
+ };
+
+ size_t --ram (1024 * 1024) // 1G
+ {
+ "<num>",
+ "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