[Toaster] [review-request][PATCH] toaster: Read correct cooker log path from toasterui
Smith, Elliot
elliot.smith at intel.com
Sat Sep 12 05:00:40 PDT 2015
Thanks Brian.
Elliot
On 11 September 2015 at 21:56, Brian Avery <avery.brian at gmail.com> wrote:
> the new branch worked for me (both ways) and is nicely simpler.
> submitted upstream.
> -b
>
> On Thu, Sep 10, 2015 at 8:31 PM, Brian Avery <avery.brian at gmail.com>
> wrote:
> > Hi,
> >
> > This fixed it for the managed build case but it failed for the
> > analysis mode case :(
> >
> > Environment:
> >
> >
> > Request Method: GET
> > Request URL:
> http://192.168.168.66:8000/toastergui/build/1/artifact/cookerlog/id/1
> >
> > Django Version: 1.6
> > Python Version: 2.7.6
> > Installed Applications:
> > ('django.contrib.auth',
> > 'django.contrib.contenttypes',
> > 'django.contrib.messages',
> > 'django.contrib.sessions',
> > 'django.contrib.admin',
> > 'django.contrib.staticfiles',
> > 'django.contrib.humanize',
> > 'bldcollector',
> > 'toastermain',
> > 'south',
> > 'toastergui',
> > 'bldcontrol',
> > 'orm')
> > Installed Middleware:
> > ('django.middleware.common.CommonMiddleware',
> > 'django.contrib.sessions.middleware.SessionMiddleware',
> > 'django.middleware.csrf.CsrfViewMiddleware',
> > 'django.contrib.auth.middleware.AuthenticationMiddleware',
> > 'django.contrib.messages.middleware.MessageMiddleware')
> >
> >
> > Traceback:
> > File
> "/big/src/intel/yocto-builds/TOASTER/myBugs/t-myBugs/local/lib/python2.7/site-packages/django/core/handlers/base.py"
> > in get_response
> > 114. response = wrapped_callback(request,
> > *callback_args, **callback_kwargs)
> > File "/big/src/intel/myBugs/poky/bitbake/lib/toaster/toastergui/views.py"
> > in build_artifact
> > 2745. build_artifact_storage_dir =
> >
> os.path.join(ToasterSetting.objects.get(name="ARTIFACTS_STORAGE_DIR").value,
> > "%d" % int(build_id))
> > File
> "/big/src/intel/yocto-builds/TOASTER/myBugs/t-myBugs/local/lib/python2.7/site-packages/django/db/models/manager.py"
> > in get
> > 151. return self.get_queryset().get(*args, **kwargs)
> > File
> "/big/src/intel/yocto-builds/TOASTER/myBugs/t-myBugs/local/lib/python2.7/site-packages/django/db/models/query.py"
> > in get
> > 307. self.model._meta.object_name)
> >
> > Exception Type: DoesNotExist at
> /toastergui/build/1/artifact/cookerlog/id/1
> > Exception Value: ToasterSetting matching query does not exist.
> >
> >
> > -b
> >
> > On Thu, Sep 10, 2015 at 3:50 AM, Elliot Smith <elliot.smith at intel.com>
> wrote:
> >> The BB_CONSOLELOG variable changes by the time we read it in
> >> BuildInfoHelper. This means that the log file location we
> >> are using is incorrect, so the links to the cooker logs don't
> >> work.
> >>
> >> Instead, read it at the point when the BuildStarted event occurs
> >> in toasterui. The BB_CONSOLELOG variable has the correct value
> >> here, so pass that to BuildInfoHelper.
> >>
> >> [YOCTO #8209]
> >>
> >> Signed-off-by: Elliot Smith <elliot.smith at intel.com>
> >> ---
> >> bitbake/lib/bb/ui/buildinfohelper.py | 8 ++++----
> >> bitbake/lib/bb/ui/toasterui.py | 2 +-
> >> 2 files changed, 5 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
> b/bitbake/lib/bb/ui/buildinfohelper.py
> >> index 2d1ed51..6e313fe 100644
> >> --- a/bitbake/lib/bb/ui/buildinfohelper.py
> >> +++ b/bitbake/lib/bb/ui/buildinfohelper.py
> >> @@ -704,7 +704,7 @@ class BuildInfoHelper(object):
> >> ## methods to convert event/external info into objects that the
> ORM layer uses
> >>
> >>
> >> - def _get_build_information(self):
> >> + def _get_build_information(self, consolelogfile):
> >> build_info = {}
> >> # Generate an identifier for each new build
> >>
> >> @@ -713,7 +713,7 @@ class BuildInfoHelper(object):
> >> build_info['distro_version'] =
> self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0]
> >> build_info['started_on'] = timezone.now()
> >> build_info['completed_on'] = timezone.now()
> >> - build_info['cooker_log_path'] =
> self.server.runCommand(["getVariable", "BB_CONSOLELOG"])[0]
> >> + build_info['cooker_log_path'] = consolelogfile
> >> build_info['build_name'] =
> self.server.runCommand(["getVariable", "BUILDNAME"])[0]
> >> build_info['bitbake_version'] =
> self.server.runCommand(["getVariable", "BB_VERSION"])[0]
> >>
> >> @@ -847,9 +847,9 @@ class BuildInfoHelper(object):
> >> logger.warn("buildinfohelper: cannot identify layer
> exception:%s ", nee)
> >>
> >>
> >> - def store_started_build(self, event):
> >> + def store_started_build(self, event, consolelogfile):
> >> assert '_pkgs' in vars(event)
> >> - build_information = self._get_build_information()
> >> + build_information = self._get_build_information(consolelogfile)
> >>
> >> build_obj =
> self.orm_wrapper.create_build_object(build_information, self.brbe,
> self.project)
> >>
> >> diff --git a/bitbake/lib/bb/ui/toasterui.py
> b/bitbake/lib/bb/ui/toasterui.py
> >> index 9c7e87d..e0c278b 100644
> >> --- a/bitbake/lib/bb/ui/toasterui.py
> >> +++ b/bitbake/lib/bb/ui/toasterui.py
> >> @@ -126,7 +126,7 @@ def main(server, eventHandler, params ):
> >> # the code will look into the protected variables of the
> event; no easy way around this
> >>
> >> if isinstance(event, bb.event.BuildStarted):
> >> - buildinfohelper.store_started_build(event)
> >> + buildinfohelper.store_started_build(event,
> consolelogfile)
> >>
> >> if isinstance(event, (bb.build.TaskStarted,
> bb.build.TaskSucceeded, bb.build.TaskFailedSilent)):
> >> buildinfohelper.update_and_store_task(event)
> >> --
> >> Elliot Smith
> >> Software Engineer
> >> Intel OTC
> >>
> >> ---------------------------------------------------------------------
> >> Intel Corporation (UK) Limited
> >> Registered No. 1134945 (England)
> >> Registered Office: Pipers Way, Swindon SN3 1RJ
> >> VAT No: 860 2173 47
> >>
> >> This e-mail and any attachments may contain confidential material for
> >> the sole use of the intended recipient(s). Any review or distribution
> >> by others is strictly prohibited. If you are not the intended
> >> recipient, please contact the sender and delete all copies.
> >>
> >> --
> >> _______________________________________________
> >> toaster mailing list
> >> toaster at yoctoproject.org
> >> https://lists.yoctoproject.org/listinfo/toaster
>
--
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/toaster/attachments/20150912/396afaea/attachment.html>
More information about the toaster
mailing list