Skip to contentSkip to conversation

Pass BRBE to buildinfohelper as soon as it's set

PATCH New Michael Wood 1 participant 4 messages Dec 9, 2015

lore
Share & tools
lore
#0 lore raw

cover Pass BRBE to buildinfohelper as soon as it's set

This fixes 'hanging' builds in UI when build is failed on early stages (recipe parsing or processing configuration).

See also https://lists.yoctoproject.org/pipermail/toaster/2015-December/003464.html

http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/toaster/trigger-metadata-event

Ed Bartosh (3):
toaster: implement BitbakeController.triggerEvent
toaster: trigger SetBRBE event
toasterui: process SetBRBE event

 lib/bb/ui/toasterui.py                          | 2 ++
 lib/toaster/bldcontrol/bbcontroller.py          | 3 +++
 lib/toaster/bldcontrol/localhostbecontroller.py | 3 +++
 3 files changed, 8 insertions(+)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/3 toaster: implement BitbakeController.triggerEvent

From: Ed Bartosh <[email protected]>

This API will be used to pass data from Toaster to toaster_ui and buildinfohelper.

---
 lib/toaster/bldcontrol/bbcontroller.py | 3 +++
 1 file changed, 3 insertions(+)
lib/toaster/bldcontrol/bbcontroller.py +3 -0
index 8b99318..781ff73 100644
@@ -55,6 +55,9 @@ class BitbakeController(object):
     def getVariable(self, name):
         return self._runCommand(["getVariable", name])
 
+    def triggerEvent(self, event):
+        return self._runCommand(["triggerEvent", event])
+
     def build(self, targets, task = None):
         if task is None:
             task = "build"
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/3 toaster: trigger SetBRBE event

In reply to Michael Wood

From: Ed Bartosh <[email protected]>

Triggered MetadataEvent "SetBRBE" when TOASTER_BRBE variable is set on bitbake server. This should make buildinfohelper aware of the build request id, which is used to properly report build status and failures back to Toaster.

---
 lib/toaster/bldcontrol/localhostbecontroller.py | 3 +++
 1 file changed, 3 insertions(+)
lib/toaster/bldcontrol/localhostbecontroller.py +3 -0
index 92d9ac5..00228e9 100644
@@ -287,6 +287,9 @@ class LocalhostBEController(BuildEnvironmentController):
         # set variables
         for var in variables:
             bbctrl.setVariable(var.name, var.value)
+            if var.name == 'TOASTER_BRBE':
+                bbctrl.triggerEvent('bb.event.MetadataEvent("SetBRBE", "%s")' \
+                                     % var.value)
 
         # Add 'toaster' and 'buildhistory' to INHERIT variable
         inherit = {item.strip() for item in bbctrl.getVariable('INHERIT').split()}
Signature · 1 line
2.1.4
#3 lore raw

PATCH 3/3 toasterui: process SetBRBE event

In reply to Michael Wood

From: Ed Bartosh <[email protected]>

Currently BRBE is known to toasterui only when build is started. It's passed to it with BuildStarted event. This is too late as if build fails earilier than build starts toasterui can not inform Toaster about the failure.

Set BRBE as soon as it's provided by Toaster.
This should make toasterui to be able to inform Toaster about early build failures, e.g. failures during recipe parsing.

---
 lib/bb/ui/toasterui.py | 2 ++
 1 file changed, 2 insertions(+)
lib/bb/ui/toasterui.py +2 -0
index 435cc2b..0265df7 100644
@@ -363,6 +363,8 @@ def main(server, eventHandler, params):
                     buildinfohelper.update_artifact_image_file(event)
                 elif event.type == "LicenseManifestPath":
                     buildinfohelper.store_license_manifest_path(event)
+                elif event.type == "SetBRBE":
+                    buildinfohelper.brbe = buildinfohelper._get_data_from_event(event)
                 else:
                     logger.error("Unprocessed MetadataEvent %s ", str(event))
                 continue
Signature · 1 line
2.1.4