Skip to contentSkip to conversation

Pass BRBE to buildinfohelper as soon as it's set

PATCH In review Ed Bartosh 3 participants 6 messages Dec 8, 2015 – Dec 9, 2015

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

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

Hi,

This patchset is a replacement of 3 patches that were rejected yesterday by upstream.

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

The following changes since commit befaceb2873ff8c8cc791d48f0324442c15cbcdc:

toaster: return back 'New project' button (2015-12-08 13:10:33 +0200)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib ed/toaster/trigger-metadata-event
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

 bitbake/lib/bb/ui/toasterui.py                          | 2 ++
 bitbake/lib/toaster/bldcontrol/bbcontroller.py          | 3 +++
 bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 3 +++
 3 files changed, 8 insertions(+)

--
Regards,
Ed

author
#1 lore raw

PATCH 1/3 toaster: implement BitbakeController.triggerEvent

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

---
 bitbake/lib/toaster/bldcontrol/bbcontroller.py | 3 +++
 1 file changed, 3 insertions(+)
bitbake/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
author
#2 lore raw

PATCH 2/3 toaster: trigger SetBRBE event

In reply to Ed Bartosh

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.

---
 bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 3 +++
 1 file changed, 3 insertions(+)
bitbake/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
author
#3 lore raw

PATCH 3/3 toasterui: process SetBRBE event

In reply to Ed Bartosh

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.

---
 bitbake/lib/bb/ui/toasterui.py | 2 ++
 1 file changed, 2 insertions(+)
bitbake/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
#4 lore raw
In reply to Ed Bartosh
Quoted 14 lines · Ed Bartosh

Hi,

This patchset is a replacement of 3 patches that were rejected yesterday by upstream.

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

The following changes since commit befaceb2873ff8c8cc791d48f0324442c15cbcdc:

toaster: return back 'New project' button (2015-12-08 13:10:33 +0200)

are available in the git repository at:

Quoted 7 lines

git://git.yoctoproject.org/poky-contrib ed/toaster/trigger-metadata-event
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

This looks much better, thanks!

Cheers,

Richard

#5 lore raw
Quoted 22 lines · Richard Purdie
Quoted 14 lines · Ed Bartosh

Hi,

This patchset is a replacement of 3 patches that were rejected yesterday by upstream.

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

The following changes since commit befaceb2873ff8c8cc791d48f0324442c15cbcdc:

toaster: return back 'New project' button (2015-12-08 13:10:33 +0200)

are available in the git repository at:

Quoted 7 lines

git://git.yoctoproject.org/poky-contrib ed/toaster/trigger-metadata-event
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

Quoted 6 lines

This looks much better, thanks!

Cheers,

Richard

Submitted to bitbake and committed to toaster-next

Thanks,

Michael