summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-03-08 12:28:54 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-03-27 11:53:02 +0000
commit67dfff1a343a5337b831eaa9dc55c0b8908b7fb8 (patch)
tree65064469116f755f55f5e3a0ffe28c54926ba7c3
parent210625c3986a659f9d6053af0b8655279c6417a1 (diff)
downloadmorph-67dfff1a343a5337b831eaa9dc55c0b8908b7fb8.tar.gz
Add debug code for build-graph failures
Change-Id: I72977b36a03b11120a2230a48e86fce356f7e3b2
-rw-r--r--gear/client.py10
-rw-r--r--gear/worker.py4
2 files changed, 11 insertions, 3 deletions
diff --git a/gear/client.py b/gear/client.py
index e9d818a6..63067f2d 100644
--- a/gear/client.py
+++ b/gear/client.py
@@ -28,9 +28,12 @@ class theController():
self.artifact = None
self.build_started = False
- def _process_build_graph(self, packet):
+ def _process_build_graph(self, build_graph):
+ print "====="
+ print build_graph
+ print "====="
print "Decoding artifact received"
- self.artifact = distbuild.decode_artifact_reference(job.data[-1])
+ self.artifact = distbuild.decode_artifact_reference(build_graph)
print "Decoding artifact received done"
# Mark everything as unbuilt to begin with. We'll query the actua
# state from the cache in self._query_cache_state().
@@ -76,6 +79,7 @@ class theController():
'''
def is_ready_to_build(artifact):
+ # Just in case the state is not set yet.
try:
is_ready = (artifact.state == UNBUILT and
all(a.state == BUILT
@@ -160,7 +164,7 @@ class BuildGraphClient(gear.Client):
def handleWorkComplete(self, packet):
job = super(BuildGraphClient, self).handleWorkComplete(packet)
print "workcomplete"
- self.controller._process_build_graph(packet)
+ self.controller._process_build_graph(job.data[-1])
return job
def handleWorkData(self, packet):
diff --git a/gear/worker.py b/gear/worker.py
index 0b46a221..35281ca3 100644
--- a/gear/worker.py
+++ b/gear/worker.py
@@ -27,6 +27,10 @@ while True:
cmd = ['morph', 'calculate-build-graph', '--quiet', bg_request['repo'], bg_request['ref'], bg_request['system']]
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
output = p.stdout.read()
+ # TODO: catch errors calculating build-graph here instead of sending the error as build-graph :)
+ print "====="
+ print output
+ print "====="
print "DEBUG: finished computing build graph"
job.sendWorkComplete(output)