summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/buildinfohelper.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: bitbake: Update logger.warn() -> logger.warning()Richard Purdie2016-05-111-10/+10
| | | | | | | | | | python deprecated logger.warn() in favour of logger.warning(). This is only used in bitbake code so we may as well just translate everything to avoid warnings under python 3. Its safe for python 2.7. (Bitbake rev: 676a5f592e8507e81b8f748d58acfea7572f8796) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: work around unicode exceptionsJoshua Lock2016-04-061-4/+6
| | | | | | | | | | | | | | | | | | | We have been seeing UnicodeDecodeErrors when handling the ImagePkgList MetadataEvent in ORMWrapper's save_target_file_information() if the event includes filenames that include non-ASCII characters. In the short term work around this by converting paths to the unicode type when passing them to Django's ORM. This is a bit of a hack but it's too late in the cycle to do anything more invasive. [YOCTO #9142] (Bitbake rev: f50fff03b3de02e73a3cc2eb9935f7c345dbddc4) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: update build in internal stateEd Bartosh2016-04-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | buildinfohelper stores current Build object in its internal state. Any changes to Build object will be lost if internal state is not updated as current buildinfohelper code saves Build object from internal state when build is completed. This bug causes incorrect build state when build is cancelled. Updating internal state should fix it. Note, that this commit updates internal state after status of the build is changed to Build.CANCELLED. There are several other places in the code where Build object is updated without updating internal state. They should be carefully analyzed and fixed. (Bitbake rev: d056cf40fc55530cb1736aedfb9a3c355884991e) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: fix KeyErrorEd Bartosh2016-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | When bitbake doesn't need to build anything it still sends ImagePkgList event with empty 'pkgdata', 'imgdata' and 'filedata' fields. This causes crash in buildinfohelper code as it's assumed that above mentioned fields always have data keyed by build target: ERROR: u'core-image-minimal' Traceback (most recent call last): File "toasterui.py", line 423, in main buildinfohelper.store_target_package_data(event) File "buildinfohelper.py", line 1218, in store_target_package_data imgdata = BuildInfoHelper._get_data_from_event(event)['imgdata'][target.target] KeyError: u'core-image-minimal' Fixed this by using dict.get method with empty dictionary as default return value instead of trying to get value without checking if target key is in the data. (Bitbake rev: c39cc463e6d9594bf2c5ac8bb74e834f6f2cf7c8) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: Add handler for cancelling a buildMichael Wood2016-04-061-1/+18
| | | | | | | | | | | When a build is cancelled the build (action) is complete if it has been caused the request being cancelled then update the build outcome accordingly. (Bitbake rev: d94d12914d351bf560b06d6f4e45c294b04ecaa3) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fix jethro buildEd Bartosh2016-04-061-8/+10
| | | | | | | | | | | | | | | The keys 'started', 'ended', 'cpu_time_user', 'disk_io_read' and 'disk_io_write' were added to the event recently, so they don't exist in the events generated by bitbake server from older releases. Checking if task_to_update structure has these keys before using them should fix build of older releases. (Bitbake rev: 79611d0ea742263074fbb0bf5f1e39df75fd9f55) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: improve handling of providermapEd Bartosh2016-04-061-2/+1
| | | | | | | | | | | | | DepTreeGenerated event doesn't contain 'providermap' data in jethro. Modified buildinfohelper to handle events without this data. This should make it possible to handle jethro events coming from jethro bitbake server by the latest buildinfohelper. (Bitbake rev: f6dcb1c9967f042beae024146781cb8235a9e1f2) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: add brbe parameter to buildinfohelperEd Bartosh2016-04-061-2/+2
| | | | | | | | | | | | | | | | | | | In current toaster code BRBE(build request:build environment) value is passed from toaster to buildinfohelper through the 'SetBRBE' event. Passing it through environment variable is easier as it doesn't involve rpc communication between toaster and bitbake server. It also eliminates the need in running bitbake observer process. Added parameter 'brbe' to BuildInfoHelper.__init__ Used environment variable TOASTER_BRBE to set brbe for buildinfohelper object. (Bitbake rev: a0c8e2b309055e5927a8ff729d292ccaa69d0575) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper Add additional metadata to the built layerMichael Wood2016-04-031-11/+23
| | | | | | | | | | | | | | | | | Add additional metadata to the layer created for build history to be able to identify the layer and recipe later on. Specifically this is the branch and release to which the recipe and layer are associated with enabling differentiation of two recipes which are local release and master and 'master' release. [YOCTO #8528] [YOCTO #8545] (Bitbake rev: 3deebd887bddbbd02fd9829a180aab494b1af7c4) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: orm Add a constant for the CustomImageRecipe's layer nameMichael Wood2016-03-231-2/+2
| | | | | | | | | | | Use a constant to define the name for the toaster custom images layer; this constant is then used to identify this layer in various places. (Bitbake rev: 2540969ec71612af7f9041cadcc401513e9b357b) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: rework task buildstats storage and displayElliot Smith2016-03-091-39/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The data available from buildstats is now more fine grained than previously, so take advantage of that to enrich the data we save against tasks: * Store the CPU usage for user and system separately, and display them separately. * Disk IO is now measured in bytes, not ms. Also store the read/write bytes separately. * Store started and ended times, as well as elapsed_time. This will enable future features such as showing which tasks were running at a particular point in the build. There was also a problem with how we were looking up the Task object, which meant that the buildstats were being added to new tasks which weren't correctly associated with the build. Fix how we look up the Task (only looking for tasks which match the build, and the task and recipe names in the build stats data) so the build stats are associated with the correct task. [YOCTO #8842] (Bitbake rev: efa6f915566b979bdbad233ae195b413cef1b8da) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: unset brbe variable when build finishesElliot Smith2016-02-111-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The brbe variable is set on the bitbake server when the Toaster UI starts. This enables Toaster to associate events with the correct build and build environment. However, the brbe variable is also used when a build starts to identify whether a new build needs to be created, or an existing one looked up. This causes a bug for command-line builds which happen after a Toaster-triggered build: because the brbe variable is never unset on the server or the buildinfohelper, the new command-line build events are treated as originating from the previous build. Ensure the brbe variable is reset when the buildinfohelper "closes" a build, so that each build then either sets the brbe variable (Toaster-triggered builds) or leaves it blank (command-line builds). Also modify the localhostbecontroller so that the brbe variable is not set on the server and not looked up from the server. This ensures that it is only set when the triggerBuild() method is called, and that it remains as None for command-line builds. [YOCTO #9021] (Bitbake rev: 4a6a8d0074f62208d843b06344be31ae73d9b745) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper CustomImagePackage update dependency infoMichael Wood2016-02-101-15/+4
| | | | | | | | | | | Instead of keeping the original dependency information for the pool of CustomImagePackage reset it with each new build. (Bitbake rev: a0b97ffc7a468bad081ce3276c74728bf6830250) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper Add the concept of CustomImagePackageMichael Wood2016-02-101-16/+89
| | | | | | | | | | | | | | | | | This adds the concept of CustomImagePackage this is similar to the way layers and recipes work in that we have a set of data which is part of the build history and a set of data which is part of the configuration data that toaster uses to guide people in configuring their project. We create a set of built_packages for every build but only create a package for configuration purposes if we don't already have one, so that the CustomImagePackage only ever contains a unique list of packages that are available to be added and removed from a CustomImageRecipe. (Bitbake rev: f81bb65883baa6c0f8a4d48a4de3291a10543992) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: add provides info to the dbEd Bartosh2016-01-111-3/+8
| | | | | | | | | | | | | | | | Added new entries to Provides model and link them to Recipe_Dependency using 'via' field. This data will be used by Toaster UI to show 'Provides:' information for the recipes. [YOCTO #6169] (Bitbake rev: 336ddc8df611d4c8f1c3d3a06d0a85bb544c38bc) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: use providermapEd Bartosh2016-01-111-8/+16
| | | | | | | | | | | | | | Used providermap in store_dependency_information function to find virtual dependencies. This should fix annoying warnings "stpd: KeyError saving recipe dependency" [YOCTO #6169] (Bitbake rev: 85c416ca338c886db6e79651e44727482df9fb07) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: Update for buildstats layout changeRichard Purdie2015-12-181-5/+3
| | | | | | | | This updates buildinfo helper for the recent buildstats layout change (Bitbake rev: 30311bbe667e9f22de17fae00ff58da06a7c3e23) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Start Django machinery for database accessElliot Smith2015-12-141-0/+3
| | | | | | | | | | | | | | | | | | buildinfohelper, with the new import paths for our Django models and Django 1.8, was not getting an active connection to the database. In buildinfohelper, call django.setup() explicitly to make sure that the database connection is ready and models can be queried and saved. [YOCTO #8364] (Bitbake rev: 671aaab8cb7c494cd5c7621b45a6f41a203d8bb5) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Create default project with get_or_create* methodElliot Smith2015-12-141-2/+7
| | | | | | | | | | | | | | | | Rather than maintain data as part of the migrations (as was done for the default project previously), create the default (cli builds) project on demand as a by-product of getting it from the database. [YOCTO #8364] (Bitbake rev: 5fd8e90ab9b81d1bd0d301bc1c91228ecbbea74b) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Fix references to app pathsEd Bartosh2015-12-141-8/+8
| | | | | | | | | | | | | | | | | | | | | | The buildinfohelper runs outside of Django, but still needs access to our Django app classes. Previously, the imports referenced the toaster.* app, which worked fine. But in Django 1.8, this causes an error about the same module being loaded multiple times from different paths. Change the paths to our Django modules so they don't cause this error to be thrown. We can do this as we've added our application libraries to sys.path in the buildinfohelper anyway. [YOCTO #8364] (Bitbake rev: 070da64cf32c32b5ffc34d611b463c3a3960b419) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: get rid of complicated heuristicsEd Bartosh2015-12-071-38/+9
| | | | | | | | | | | | | | | | | | Removed buildinfohelper code which was trying to guess layer version of the recipe using build request information. The code caused creation of duplicated recipes as it resulted in layer version from layer index instead of returning build layer version. As a result of this Toaster UI was not showing any information about recipes. Default approach used to find layer version seems to work much better as it finds proper layer version. Now toaster will use it as the only way to find layer version. (Bitbake rev: 101690bda7ad55dc0657483233c90c374713755b) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper Broaden the toaster created recipe data caseMichael Wood2015-12-071-4/+3
| | | | | | | | | | | | | | | | When build information is the 'original' source of the information we need to return the recipe that was created rather than the copy of the recipe that is taken for keeping build history. We do this already for command line triggered builds, but we also have this case for custom images. We can simply check if the built_recipe exists instead of special casing this. (Bitbake rev: 9a8653bf602b2111dee7ee6a459682a68a695b22) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: do not create duplicate HelpText objectsEd Bartosh2015-12-071-7/+3
| | | | | | | | | | | | | | | | | buildinfohelper code expects only one HelpText object per build/variable/description. Current code creates more than one such an object, which causes toastergui to crash with this exception: MultipleObjectsReturned: get() returned more than one HelpText -- it returned 2! Used git_or_create API to ensure that only one HelpText object is created. (Bitbake rev: e9b46803eb6f1f4044919abf90c8aeb3536e73ed) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: update brbe and project attributesEd Bartosh2015-12-071-0/+6
| | | | | | | | | | | | Updated attributes of buildinfohelper object as they can be changed for every build. For example brbe is set by runbuilds for every build triggered by Toaster UI. (Bitbake rev: ea3bc8d01704dc64f6cb7b4f5fe66c312a575174) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: Create per-build logsElliot Smith2015-10-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than relying on bug 8411, which is conveniently creating separate log files for each of our builds, create our own log file for each build. The log files are created in the same tmp directories that bitbake users, but are timestamped to the millisecond to avoid name collisions. Each log file is opened on a ParseStarted event (for builds triggered by Toaster) or BuildStarted event (for builds on the command line: Toaster doesn't get the ParseStarted event for command-line builds). The log file is closed on the BuildCompleted event, or if the build fails. Because we start logging on ParseStarted for Toaster builds, we're able to capture the "Build Configuration" section which bitbake writes to output. [YOCTO #8373] (Bitbake rev: 7974203cd8bc66dff1fcc55f8723dedefaf72840) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: add get_or_create_targets APIEd Bartosh2015-10-271-15/+21
| | | | | | | | | | | | | | | | | Target objects are created before the build if build is started from UI in build mode. However, in analysis mode Target objects don't exist and need to be created using information from bitbake events. Added new API call get_or_create_targets to retrive existing target objects or create them if they don't exist yet. (Bitbake rev: ef69be31d133696bde54605f5a18da660099734c) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Record critical errorsElliot Smith2015-10-161-1/+4
| | | | | | | | | | | | | | | | | | | | Critical errors (where a build failed for reasons of misconfiguration, such as a machine being specified which is not in a project's layers) were being ignored (only log records up to ERROR level were being logged to Toaster's db). This meant that the build would fail but would not correctly report why. Add support for CRITICAL error levels to the LogMessage model, include errors at this level in the errors property for a build, and show errors at this level in the build dashboard. [YOCTO #8320] (Bitbake rev: b6eacbca9cacb607de864ab7d093deb296da8226) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper Detect command line buildsMichael Wood2015-10-161-12/+22
| | | | | | | | | | | | When we're building using toaster as just a listener to bitbake (analysis mode) we need to handle the case where the toaster configuration data isn't present so we don't need to try and update the existing information. (Bitbake rev: a22faae2c3a5948356ce3cbc73c34509de65d370) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper Skip packages we have no build info aboutMichael Wood2015-10-111-11/+31
| | | | | | | | | | | | | | | If there are more packages listed as installed than we know about from bitbake, and therefore have insufficient information to be able to create a Toaster Package object then skip it. Also handle the case where a dependency references such a package. Also clarify the error logging. (Bitbake rev: b4ce793685f70cab3f28cb4329aaaf3878cd62e8) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper associate build data with built_recipeMichael Wood2015-10-111-1/+2
| | | | | | | | | | | Make sure we associate build data with the built recipe rather than toaster's configuration copy of the recipe. (Bitbake rev: 34d4ef7289d72d151ad0acdccab8b99c8c31221e) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Revert "bitbake: toaster: don't re-create Target objects"Michael Wood2015-09-291-1/+16
| | | | | | | | | | | | | This delete followed up the foreign keys and deleted things that were not expected to be deleted. This reverts commit 08000eb27eb8413686fb2c8daf14d234a8bff83a. (Bitbake rev: 46b119eb62a5a612fe4c0847862d34f408e556f7) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper Create a copy of the built layer and recipeMichael Wood2015-09-291-13/+41
| | | | | | | | | | | | | Create a copy of the built layer and the recipes associated with it. This is so that the user can view the historical information about a build. i.e. a snapshot of the layer version and artifacts produced at that build. (Bitbake rev: 0683d9a2b15e3234a94437aaebac84bfcca1420b) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Create a relationship between build information and ↵Michael Wood2015-09-291-2/+28
| | | | | | | | | | | | | | toaster layers Previously this layer relationship was done by trying to match path information that came back to the buildinfohelper with trying to query for data in toaster's layers table. This rarely matched due to the lose coupling. (Bitbake rev: 838e77c7c3c4006abd1327343a004590ab652de9) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Add fake entry to Target_File for filesystem rootElliot Smith2015-09-231-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The files-in-image.txt file is produced by bitbake after an image is created, listing all the files in the image. However, this list doesn't include the root directory ('/'). buildinfohelper.py then tries to construct the filesystem tree from this file, assuming that every directory apart from the root directory (which is special-cased) can be assigned a parent. But because the root directory isn't listed in files-in-image.txt, an object for the root directory is never created. The direct subdirectories of the root ('./bin', './usr' etc.) then can't be assigned a parent directory, as the object representing the root directory doesn't exist. This results in a Target_File lookup error and causes the directory listing page to fail. Fix this by creating a fake entry for the root directory in the Target_File table, so that the direct subdirectories of / can be assigned a parent. Note that it doesn't matter that the root is faked, as its properties are never shown in the directory structure tree. [YOCTO #8280] (Bitbake rev: a4015768183e5a3fa39a6c2b4dea0088ca182d80) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: don't re-create Target objectsEd Bartosh2015-09-231-16/+1
| | | | | | | | | | | | | | | Due to re-creating Target objects from bitbake events task information stored in original objects is lost. There is no valid reason to remove existing objects. It's safer to query them instead of re-creating as original object contain more information than events coming from bitbake. (Bitbake rev: aab4aff75eefb31aa53885d7735feee5daa294aa) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Read correct cooker log path from toasteruiElliot Smith2015-09-181-4/+4
| | | | | | | | | | | | | | | | | | | 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] (Bitbake rev: 20609eebee0d2318806cf81913e7ce6dc1005507) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Improve how default project is identified and fetchedElliot Smith2015-09-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Command line builds are associated with a "default project" (as we currently require a build to have a project). This acts as a container for builds initiated outside Toaster. Currently, this project is marked as the default by its ID being 0. However, this doesn't work with MySQL, as MySQL won't allow 0 in a foreign key which references an autoincrement field. Instead, use an is_default field to track the default Project for builds initiated outside Toaster. Add a method to fetch this default project, rather than fetching a project with a magic ID. Add this default project in a migration, rather than as a side effect of a get_or_create() style method. Also ensure that builds always have a project explicitly assigned to avoid any magic with a build's project foreign key defaulting to 0 (as it no longer does). [YOCTO #7932] (Bitbake rev: 71b709a1bbc26d89d61873763b467d21e625b274) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster logger: fix pylint issuesAlexandru DAMIAN2015-08-191-59/+71
| | | | | | | | | | | | | | | | | | | | This patch fixes pylint issues in the toaster build data logger, toasterui. The following types of warnings are touched here: * fixing imports * unused variables are set to _ * logger calls now use lazy evaluation instead of formatting the string * correct whitespace identation * removes unneeded "pass" statements, and extra parantheses * disable specific pylint warnings when decideing to override them (Bitbake rev: 947d47f15048baa967f88e03d80014e88ce152aa) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: verify variable before usageAlexandru DAMIAN2015-06-261-4/+5
| | | | | | | | | | | This patch verifies that BRBE is set before trying to use it to read the checkout paths. This is needed for builds ran outside Toaster control. (Bitbake rev: e04807cd3135c9de96cc7f79245f329c24618b85) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: refactor build modelAlexandru DAMIAN2015-06-261-23/+47
| | | | | | | | | | | | | | | | We remove the "timespent", "errors_no" and "warnings_no" fields in favor of computing the needed values at runtime. This prevents inconsistencies in the UI. Also removeing all references to BuildRequests from the interface - all build details now display in the build dashboard. Minor fixes related to data logging. (Bitbake rev: 44f37394ed3e4ca02f940be172fe4395b0ee0f7d) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fill in build data from buildrequestAlexandru DAMIAN2015-06-261-1/+15
| | | | | | | | | | | | | | This patch adds logic to complete changing the interface from showing BuildRequests to showing Build data. The BuildRequest data is now transformed in Build data with proper Toaster exceptions being recorded instead of listing problems during startup as build errors. (Bitbake rev: 51a41172d0b390370f9a38696b1ac65666ada4d2) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster logger: assign projects to all buildsAlexandru DAMIAN2015-05-291-10/+27
| | | | | | | | | | | | | | | | Bitbake logger now sets a default project if the TOASTER_BRBE or TOASTER_PROJECT Bitbake variables are not set. This a necessary step in getting all builds under a project, as to unify the MANAGED and interactive modes. Other small fixes are included, related to the size of the fields in the database. (Bitbake rev: 5e0bf388f4e5c1cc493ac8264785e631bad2f672) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster logger: refactor recipe and layer file pathsAlexandru DAMIAN2015-05-291-15/+32
| | | | | | | | | | | | | | | | | | | | | | | This refactoring brings the "local_path" of the layer from the Layer object to the Layer_Version object, which is more appropriate as different checkouts of the same Layer may live in different directories. This enables us to store Recipe file paths relative to a Layer_Version at all times, aleviating the need to store full file paths in the database. We also turn the prefix of the path (e.g. virtual:native path name space) into a pathflag field. In turn, this solves the problem of mis-identification of tasks based on the recipe file paths, since we can also match the namespace of the file paths on the recipe files. [YOCTO #7594] (Bitbake rev: ec43dc569e370767c709dec225cbee0c99151c19) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: proper exit code on toaster errorsAlexandru DAMIAN2015-05-081-1/+4
| | | | | | | | | | | | | | | | This patch modifies the toasterui to properly return the exit code based on the errors found in the toaster itself. The upload event file API call will not delete event logs for which toasterui showed an error. This will facilitate debugging. Minor enhancement in the buildinfohelper to reduce the number of lookups on unknown layer objects (prevented testing of the patch). (Bitbake rev: 1ddd6a9e4280a4adf971132ff1fe7ec9b3252905) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: recipe and layer identificationAlexandru DAMIAN2015-03-211-3/+16
| | | | | | | | | | This patch fixes the recipe and layer identification by path when Toaster uses relative paths. (Bitbake rev: a92bb33a3ceacab2bfee9df1c39a202832866970) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: fix error message parameterAlexandru DAMIAN2015-03-211-1/+1
| | | | | | | | | Fix the error message parameter. (Bitbake rev: 64b0867108d03c7e9215b80c59c1bba919e82994) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: improve info in the toaster_ui.logAlexandru DAMIAN2015-03-211-4/+8
| | | | | | | | | | We improve logging and signalling of errors in the toaster_ui.log to facilitate debugging on remote systems. (Bitbake rev: 3cd248f99b90367bd41aab81e255fc1912434890) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: relative recipe pathsAlexandru DAMIAN2015-03-161-1/+7
| | | | | | | | | | | We modify the toasterui to log relative recipe paths in order to maintain consistency with data fetched from the layer sources. (Bitbake rev: 253d69e88fd68729196ad43c15e8733527d76198) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: identify proper layer in build modeAlexandru DAMIAN2015-03-161-5/+18
| | | | | | | | | | | | In build mode, instead of creating our own layer objects, we identify the layer objects that the build system set up. [YOCTO #7378] (Bitbake rev: 22962b540ace6868cb357c0fd13f01ffd24449c4) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: do not use transactions if the database autocommitsAlexandru DAMIAN2015-02-271-8/+12
| | | | | | | | | | | | | | | | | Some databases, notably the SQLite3 adapter, force autocommits even if the autocommit is turned off. The behavious is tracked in this bug: http://bugs.python.org/issue8145#msg109965 Django refuses to work with autocommit off in this case, so we have to take the same precautions when using manual transaction support. [YOCTO #7363] [YOCTO #7365] (Bitbake rev: 90231ab63a129fa344d461c2911898ea0f07f206) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>