bitbake: toasterui: improvements in data reading

We add improvements in data reading, following
issues discovered in testing.

- elapsed_time is now read from buildstats
- we add safeguards to not fail logging if the build was triggered
with a toaster_brbe configuration, but it's running in
1.6 mode
- added log markups for build finish to let other programs
known when the work is done.

[YOCTO #6833]
[YOCTO #6685]
[YOCTO #6887]

(Bitbake rev: 0b225035cefee3d3713a93f9a432e5e4d4e174f1)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN 2014-10-31 19:17:01 +00:00 committed by Richard Purdie
parent 7105d44d87
commit fc75011506
2 changed files with 17 additions and 11 deletions

View File

@ -67,13 +67,15 @@ class ORMWrapper(object):
if brbe is not None:
from bldcontrol.models import BuildEnvironment, BuildRequest
br, be = brbe.split(":")
buildrequest = BuildRequest.objects.get(pk = br)
buildrequest.build = build
buildrequest.save()
build.project_id = buildrequest.project_id
build.save()
try:
br, be = brbe.split(":")
buildrequest = BuildRequest.objects.get(pk = br)
buildrequest.build = build
buildrequest.save()
build.project_id = buildrequest.project_id
build.save()
except BuildRequest.DoesNotExist:
pass
return build
def create_target_objects(self, target_info):
@ -146,6 +148,8 @@ class ORMWrapper(object):
if 'start_time' in task_information.keys() and 'end_time' in task_information.keys():
duration = task_information['end_time'] - task_information['start_time']
task_object.elapsed_time = duration
del task_information['start_time']
del task_information['end_time']
task_object.save()
return task_object
@ -320,8 +324,7 @@ class ORMWrapper(object):
searchname = pkgpnmap[p]['OPKGN']
packagedict[p]['object'], created = Package.objects.get_or_create( build = build_obj, name = searchname )
if created:
# package was not build in the current build, but
if True: # save the data anyway we can, not just if it was not created here; bug [YOCTO #6887]
# fill in everything we can from the runtime-reverse package data
try:
packagedict[p]['object'].recipe = recipes[pkgpnmap[p]['PN']]
@ -717,6 +720,7 @@ class BuildInfoHelper(object):
task_information['task_name'] = taskname
task_information['cpu_usage'] = taskstats['cpu_usage']
task_information['disk_io'] = taskstats['disk_io']
task_information['elapsed_time'] = taskstats['elapsed_time']
task_obj = self.orm_wrapper.get_update_task_object(task_information, True) # must exist
def update_and_store_task(self, event):

View File

@ -231,14 +231,16 @@ def main(server, eventHandler, params ):
buildinfohelper.update_build_information(event, errors, warnings, taskfailures)
buildinfohelper.close(errorcode)
# mark the log output; controllers may kill the toasterUI after seeing this log
logger.info("ToasterUI build done")
# we start a new build info
if buildinfohelper.brbe is not None:
print "we are under BuildEnvironment management - after the build, we exit"
logger.debug(1, "ToasterUI under BuildEnvironment management - exiting after the build")
server.terminateServer()
else:
print "prepared for new build"
logger.debug(1, "ToasterUI prepared for new build")
errors = 0
warnings = 0
taskfailures = []