commit 4caedfbd6f52aed405ea5bf530f4eed50df0eb23
parent 8ee1572f28ef229713b2a17c910c1322cedad966
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date: Wed, 17 Apr 2019 15:15:59 +0200
Tune auditor reports BB.
Diffstat:
2 files changed, 34 insertions(+), 7 deletions(-)
diff --git a/buildbot/make_auditor_reports.sh b/buildbot/make_auditor_reports.sh
@@ -45,4 +45,5 @@ rm "${REPORT_FILE_NOEXT}.aux"
chmod g+r "${REPORT_FILE_NOEXT}.pdf"
mv "${REPORT_FILE_NOEXT}.pdf" "${REPORTS_DIRECTORY}"
-echo "The file ${REPORT_FILE_NOEXT}.pdf" has been correctly generated.
+echo "The file ${REPORTS_DIRECTORY}/${REPORT_FILE_NOEXT}.pdf" \
+ "has been correctly generated."
diff --git a/buildbot/master.cfg b/buildbot/master.cfg
@@ -36,6 +36,10 @@ c["workers"] = [
worker.Worker("wallet-worker", "wallet-pass"),
worker.Worker("auditor-worker", "auditor-pass")]
+# Maps unix users (typically found on Gv) to worker names.
+NAMEMAP = {"test-green": "builder-worker-green",
+ "test-blue": "builder-worker-blue"}
+
# 'protocols' contains information about protocols which master
# will use for communicating with workers. You must define at
# least 'port' option that workers could connect to your master
@@ -76,7 +80,7 @@ NIGHTLY_SCHEDULER = schedulers.Nightly(
name="nightly-scheduler",
builderNames=["lcov-builder",
"auditor-builder"],
- branch="master", # why mandatory?
+ branch="master",
hour=6,
minute=0)
@@ -387,8 +391,33 @@ LCOV_BUILDER = util.BuilderConfig(
workernames=["lcov-worker"],
factory=LCOV_FACTORY)
+##
+# Helper function that picks the active deployment between
+# blue and green and schedules it as the next worker for producing
+# auditor reports.
+def pick_active_color(builder, workers_list, build_request):
+ f = open("/home/test/active", "r")
+ if not f:
+ print("'test' doesn't specify the active color, abort")
+ f.close()
+ return None
+ active = f.readline().rstrip()
+ print("Found active color: %s" % str(nonactive))
+
+ for worker in workers_list:
+ if NAMEMAP.get(active) == worker.worker.workername:
+ f.close()
+ print("Scheduling worker: %s" % str(worker))
+ return worker
+
+ print("Couldn't find the active worker, aborting.")
+ f.close()
+ return None
+
+
AUDITOR_BUILDER = util.BuilderConfig(
name="auditor-builder",
+ nextWorker=pick_active_color,
workernames=["auditor-worker"],
factory=AUDITOR_FACTORY)
@@ -416,16 +445,13 @@ def pick_inactive_color(builder, workers_list, build_request):
nonactive = f.readline().rstrip()
print("Found nonactive color: %s" % str(nonactive))
- namemap = {"test-green": "builder-worker-green",
- "test-blue": "builder-worker-blue"}
-
for worker in workers_list:
- if namemap.get(nonactive) == worker.worker.workername:
+ if NAMEMAP.get(nonactive) == worker.worker.workername:
f.close()
print("Scheduling worker: %s" % str(worker))
return worker
- print("Couldn't find the right worker, aborting.")
+ print("Couldn't find the inactive worker, aborting.")
f.close()
return None