From e16352220572835ff2185cf992518fb4f3b2de0e Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Thu, 12 Jun 2014 12:57:22 +0100 Subject: bitbake: toaster: build control functionality We add the build control functionality to toaster. * The bldcontrol application gains bbcontroller classes that know how to manage a localhost build environment. * The toaster UI now detects it is running under build environment controller, and update the build controller database and will shut down the bitbake server once the build is complete. * The toaster script can now run in standalone mode, launching the build controller and the web interface instead of just monitoring the build, as in the interactive mode. * A fixture with the default build controller entry for localhost is provided. [YOCTO #5490] [YOCTO #5491] [YOCTO #5492] [YOCTO #5493] [YOCTO #5494] [YOCTO #5537] (Bitbake rev: 10988bd77c8c7cefad3b88744bc5d8a7e3c1f4cf) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/buildinfohelper.py | 10 ++++++++++ bitbake/lib/bb/ui/toasterui.py | 3 +++ 2 files changed, 13 insertions(+) (limited to 'bitbake/lib/bb') diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 58df687ca1..77be7c744c 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py @@ -916,6 +916,16 @@ class BuildInfoHelper(object): self.internal_state['recipes'], ) + def store_build_done(self, br_id, be_id): + from bldcontrol.models import BuildEnvironment, BuildRequest + be = BuildEnvironment.objects.get(pk = be_id) + be.lock = BuildEnvironment.LOCK_LOCK + be.save() + br = BuildRequest.objects.get(pk = br_id) + br.state = BuildRequest.REQ_COMPLETED + br.build = self.internal_state['build'] + br.save() + def _store_log_information(self, level, text): log_information = {} log_information['build'] = self.internal_state['build'] diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py index c1696b2a31..b1c80cc822 100644 --- a/bitbake/lib/bb/ui/toasterui.py +++ b/bitbake/lib/bb/ui/toasterui.py @@ -228,8 +228,11 @@ def main(server, eventHandler, params ): brbe = server.runCommand(["getVariable", "TOASTER_BRBE"])[0] + br_id, be_id = brbe.split(":") # we start a new build info if brbe is not None: + buildinfohelper.store_build_done(br_id, be_id) + print "we are under BuildEnvironment management - after the build, we exit" server.terminateServer() else: -- cgit v1.2.3-54-g00ecf