summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-09-18 10:47:38 +0000
committerBaserock Gerrit <gerrit@baserock.org>2015-10-07 00:06:09 +0000
commit3c59628c80ffe47992bf7347268ca587fc6d368d (patch)
treefba278b5fb0eff894f6b1f60514dfee6c6377ded
parent50dd4970f61db4ba203f1aea067ab20ef944fe73 (diff)
downloadmorph-3c59628c80ffe47992bf7347268ca587fc6d368d.tar.gz
distbuild: When a build finishes, say which worker it was built on
Change-Id: I493fced8cf2664283923f6f41097ca991d3fc3de
-rw-r--r--distbuild/build_controller.py5
-rw-r--r--distbuild/initiator.py4
-rw-r--r--distbuild/initiator_connection.py3
-rw-r--r--distbuild/protocol.py1
-rw-r--r--distbuild/worker_build_scheduler.py7
5 files changed, 14 insertions, 6 deletions
diff --git a/distbuild/build_controller.py b/distbuild/build_controller.py
index bfd910b2..a65fd243 100644
--- a/distbuild/build_controller.py
+++ b/distbuild/build_controller.py
@@ -121,9 +121,10 @@ class BuildOutput(object):
class BuildStepFinished(object):
- def __init__(self, request_id, step_name):
+ def __init__(self, request_id, step_name, worker_name):
self.id = request_id
self.step_name = step_name
+ self.worker_name = worker_name
class BuildStepFailed(object):
@@ -810,7 +811,7 @@ class BuildController(distbuild.StateMachine):
'Got build result for %s: %s', artifact.name, repr(event.msg))
finished = BuildStepFinished(
- self._request['id'], build_step_name(artifact))
+ self._request['id'], build_step_name(artifact), event.worker_name)
self.mainloop.queue_event(BuildController, finished)
artifact.state = BUILT
diff --git a/distbuild/initiator.py b/distbuild/initiator.py
index 84a1f27f..f2cb77e9 100644
--- a/distbuild/initiator.py
+++ b/distbuild/initiator.py
@@ -239,6 +239,10 @@ class Initiator(distbuild.StateMachine):
step_name = msg['step_name']
if step_name in self._step_outputs:
status = 'Finished building %s' % step_name
+
+ if 'worker_name' in msg:
+ status += ' on %s' % msg['worker_name']
+
self._app.status(msg=status)
self._write_status_to_build_log(self._get_output(msg), status)
diff --git a/distbuild/initiator_connection.py b/distbuild/initiator_connection.py
index d48ad214..29f830a5 100644
--- a/distbuild/initiator_connection.py
+++ b/distbuild/initiator_connection.py
@@ -368,7 +368,8 @@ class InitiatorConnection(distbuild.StateMachine):
if event.id in self.our_ids:
msg = distbuild.message('step-finished',
id=self._route_map.get_incoming_id(event.id),
- step_name=event.step_name)
+ step_name=event.step_name,
+ worker_name=event.worker_name)
self.jm.send(msg)
self._log_send(msg)
diff --git a/distbuild/protocol.py b/distbuild/protocol.py
index 44552ae1..d569079b 100644
--- a/distbuild/protocol.py
+++ b/distbuild/protocol.py
@@ -61,6 +61,7 @@ _required_fields = {
'step-finished': [
'id',
'step_name',
+ 'worker_name',
],
'step-failed': [
'id',
diff --git a/distbuild/worker_build_scheduler.py b/distbuild/worker_build_scheduler.py
index e5548ad4..b6042a6a 100644
--- a/distbuild/worker_build_scheduler.py
+++ b/distbuild/worker_build_scheduler.py
@@ -70,10 +70,11 @@ class WorkerBuildCaching(object):
class WorkerBuildFinished(object):
- def __init__(self, msg, cache_key):
+ def __init__(self, msg, cache_key, worker_name):
self.msg = msg
self.artifact_cache_key = cache_key
-
+ self.worker_name = worker_name
+
class WorkerBuildFailed(object):
def __init__(self, msg, cache_key):
@@ -688,7 +689,7 @@ class WorkerConnection(distbuild.StateMachine):
logging.debug('Shared artifact cache population done')
finished_event = WorkerBuildFinished(
- job._exec_response, job.artifact.cache_key)
+ job._exec_response, job.artifact.cache_key, job.who.name())
self.mainloop.queue_event(WorkerConnection, finished_event)
self.mainloop.queue_event(self, _Cached())