summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: toaster: use force_text instead of force_bytesEd Bartosh2016-05-161-2/+2
| | | | | | | | | | | | | | | | Usage of force_bytes in BuildRequest.__str__ method caused python 3 to throw "__str__ returned non-string (type bytes)" error. Replaced force_bytes with force_text to make the code working on both python 2 and python 3. [YOCTO #9584] (Bitbake rev: 7b89d3781bf0de1e52e8aef5b77d94c7fb462bf4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Update logger.warn() -> logger.warning()Richard Purdie2016-05-111-3/+3
| | | | | | | | | | 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: toaster: runbuilds Clean up runbuildsMichael Wood2016-04-061-29/+52
| | | | | | | | | | | | | - Organise the imports into logical groups - Fix 80 col wrapping - Remove catch all exceptions - Log to the toaster log - Use QuerySet functions such as .first() and Q() (Bitbake rev: c382f550c62437954205c7dd9c7e1891d5d03945) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: runbuilds Make runbuilds aware of the build CANCELLED stateMichael Wood2016-04-061-4/+22
| | | | | | | | | | Add handlers to make sure we remove the BuildEnvironment LOCK when we have cancelled a build. (Bitbake rev: 23d0a7f9664450a09c2610631b38590a09b33744) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: add brbe parameter to triggerBuildEd Bartosh2016-04-061-4/+2
| | | | | | | | | | | Called triggerBuild with brbe parameter instead of adding TOASTER_BRBE variable to the database and fetching it in triggerBuild. (Bitbake rev: 669bb3f6865d8bb89cd94ef9d0eba3346c47d7b2) 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: use force_bytes to display non-ascii project namesSujith H2016-03-091-1/+1
| | | | | | | | | | | | | | | | | When user enters a non-ascii character in the project name of toaster, the build doesn't get triggered. Use force_bytes to fix this. Also deal with non-ascii project names when logging the build request in runbuilds. [YOCTO #9071] (Bitbake rev: b6141c4d170885d3bdf63074afcb1e41fde0a8f0) Signed-off-by: Sujith H <sujith.h@gmail.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: use OneToOneField instead of ForeignKeyEd Bartosh2015-12-141-1/+1
| | | | | | | | | | | | | | | Used OneToOneField to reference BuildRequest in BRBitbake model. Fixed django warning: WARNINGS: Setting unique=True on a ForeignKey has the same effect as using a OneToOneField. (Bitbake rev: aaa4319ebbb06facb77b4ba936cf3aa2068ff238) 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: Update API used to make runbuilds methods run in transactionsElliot Smith2015-12-141-2/+2
| | | | | | | | | | | | | | | runbuilds previously had its methods decorated with transaction.commit_on_success, which is now deprecated. transaction.atomic is an (almost) drop-in replacement for this, so use this instead. [YOCTO #8364] (Bitbake rev: c4804b84eaaef6a81027bae5cf8bfe63d949c293) 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: make runbuilds to loopEd Bartosh2015-12-071-3/+10
| | | | | | | | | | | | | Made runbuilds to loop to avoid having a loop in shell code and initialize heavy Django init machinery every second. Ignored exceptions to prevent exiting a loop. (Bitbake rev: e04da15556ca0936de652b8c085e4199e5551457) 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: store task name in Target objectsEd Bartosh2015-09-231-1/+1
| | | | | | | | | | | | | | | Information about a task is not stored in Target objects. This makes it impossible to correctly operate with the builds where task is specified. Storing taks name is an enabler for other fixes in UI and backend related to restarting builds. (Bitbake rev: 0a69a8a18075c976ed8681d9d75529f8c2f48514) 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: Avoid unnecessary local to local copy of cooker logElliot Smith2015-09-181-22/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cooker log is copied from its original (bitbake) location to an artifact directory chosen by the user (chosen when checksettings.py runs as part of the managed mode; it's one of the annoying questions you're asked at startup). The copy happens as part of the runbuilds script run, which is started in a loop from the toaster startup script in managed mode. When a user requests the log for a build via toaster, they are getting the log which has been copied to the artifact directory, not the original bitbake log. This works for the managed case, where the runbuilds command is running in a loop and copying log files for completed builds to the artifact directory. However, in analysis mode, there are two problems: 1. checksettings isn't run, so the artifacts directory isn't set. toaster is then unable to figure out where the log files should have been copied to. 2. The log files aren't copied to the artifacts directory anyway, as runbuilds isn't running in analysis mode. To fix this, just point the user to the local bitbake log file in its original location. This avoids the copy step, and means we can remove a whole question from the toaster startup sequence, as we no longer need an artifact directory. The only downside to this is that it's not appropriate for remote bitbake servers. We will need to revisit this and possibly reinstate the copy step once we have to reconcile local and remote builds and make their logs available in the same way. [YOCTO #8209] (Bitbake rev: 5697bbcc88edad85891f66d28b8803a9c9d27ff2) 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: fix updates on failed build requestsAlexandru DAMIAN2015-08-191-1/+1
| | | | | | | | | | | | | | The patch to fix the original mistake is wrong, in the sense that a constant from the BuildRequest class is used on the build object. Fixing the patch to bring in the correct constant in. (Bitbake rev: a740c17efc0ccc9f89a428ead08f9739af3c6de4) 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: toaster: runbuilds Fix incorrect variable nameMichael Wood2015-07-021-1/+1
| | | | | | | | | | The recent refactoring moved this enum value to BuildRequests table rather than Build. (Bitbake rev: 4338ab03826df3353e1222f0bd825dfdd04dd933) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: refactor build modelAlexandru DAMIAN2015-06-261-3/+7
| | | | | | | | | | | | | | | | 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: fixes after replacing BuildRequest with BuildAlexandru DAMIAN2015-06-261-3/+4
| | | | | | | | | | | This is a set of fixes that repair the interface after we switched from displaying BuildRequest data to Build data in the formerly "managed" mode. (Bitbake rev: 57f790b0c56297af8c83d5def8461bd5d61fe4af) 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/+31
| | | | | | | | | | | | | | 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: improve the buildenvironment APIAlexandru DAMIAN2015-06-261-23/+7
| | | | | | | | | | | | | | | We improve the buildenvironment API by reducing it to a single command: triggerBuild. This command is specifically implemented in each BE controller type, so the runbuilds management command is only concerned with scheduling the next build, and not with the details of how a build is actually started. (Bitbake rev: 7ee0f1da0a8fcac37419ffdddbe35a9268a1ded4) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: bitbake cooker log saving and downloadingAlexandru DAMIAN2015-02-201-1/+28
| | | | | | | | | | | | | | | | | | | | | This patch brings in cooker log saving and proper download links. * toasterui will now write the cooker log file if running in managed mode * the BuildRequest has a new state, REQ_ARCHIVE, indicating that the build is completed, and the artifacts are ready to be grabbed * the runbuild test execution commands will gather needed artifacts, and save them to a storage directory selected during Toaster setup. * the build dashboard, project builds and all builds pages have permanent links for the cooker log [YOCTO #7220] [YOCTO #7206] (Bitbake rev: fad80e36c9da663b000cdf2cb3c75440c6431d84) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: properly detect failed server startAlexandru DAMIAN2015-02-171-3/+9
| | | | | | | | | | | | | This patch brings in reading the server log if the server fails to start. This is the first step in displaying the errors in a manner that is actionable by the user. [YOCTO #7285] (Bitbake rev: 7f47b67bccff55673a827dbcccc767af4459c933) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: improve logging facilities for toasterAlexandru DAMIAN2015-02-101-1/+1
| | | | | | | | | | | | | | | | | | | This patch improves the logging facilities for toaster in order to help diagnose bugs that happen on user machines. The logs are stored now under "/tmp/toaster_$$" where $$ is a PID-based unique identifier. On shutdown, toaster will automatically erase all logs unless errors are listed in the log file. On error, Toaster provides suggestions on what to do. This patch includes a minor fix found as a result of logging improvements. (Bitbake rev: 8a8248f7b7e30469f592e2f8adbf6ce21e8685c5) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: proper setup for build configurationAlexandru DAMIAN2015-02-021-1/+2
| | | | | | | | | | | | | | | This patch makes sure that all the toaster conf files are actually written from the build enviroment controllers. Additionally, toaster checks that the 'daemon' program, which is used to start the build system, is available (currently for localhost). [YOCTO #7171] (Bitbake rev: 0a1db7d1531f8254955e1152bcd8e6db4ec1d277) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: new layer checkout logicAlexandru DAMIAN2015-01-301-2/+5
| | | | | | | | | | | | | | | | | | | This patch implements a new layer checkout logic that brings more flexibility in getting layers under different commits work with Toaster. The new hibrid logic will checkout separately each layer and commit id; the task execution will be delegated to the checkedout bitbake, but the data logger will be executed from the current toaster version as to bring in enough data to sustain the updates in UI models. [YOCTO #7171] [YOCTO #6892] (Bitbake rev: c6eb0f7f16c59530c2525b2e5629fe86de4e8f0f) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: write pre-read conf file for build variablesAlexandru DAMIAN2015-01-081-4/+1
| | | | | | | | | | | | | | | We change the setting of variables from directly injection into the set-up cooker to writing a conf file that is pre-read on bitbake server startup. This is needed because the injection can only happen after the variable set is parsed, and the variables already inferred, so setting up variables happens too late. [YOCTO #7045] (Bitbake rev: 854f680b5b9d2d0fa796af84cb1218545fbfc55a) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: add extra debug and development infosAlexandru DAMIAN2014-12-181-4/+9
| | | | | | | | | | | | | | | | | | | | | | We update and add logs throughout the code in order to help with development. The extra logging is turned off by default, but it can be enabled by using environment variables. All logging happens through the Python logging facilities. The toaster UI will save a log of all incoming events if the TOASTER_EVENTLOG variable is set. If TOASTER_SQLDEBUG is set all DB queries will be logged. If TOASTER_DEVEL is set and the django-fresh module is available, the module is enabled to allow auto-reload of pages when the source is changed. (Bitbake rev: 10c27450601b4d24bbb273bd0e053498807d1060) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: change startup parameter passing to avoid raceAlexandru DAMIAN2014-10-301-7/+12
| | | | | | | | | | | | | | We avoid a race between the setting the TOASTER_BRBE variable and reading the variable in toaster ui by supplying the variable at server startup time through the toaster.conf post-read file. Additional small changes are included, including marking the build request with the environment id of where the build took place. (Bitbake rev: 7c333350418c4140e6c988c5272940f8057d327d) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: update the bldcontrol to the new orm modelsAlexandru DAMIAN2014-08-291-1/+1
| | | | | | | | | | | | | | | | We update the build controller application to make proper use of the bitbake specification in project settings. Added heuristic to detect when the meta* layers and bitbake are checked out from Yocto Project poky, and use a single git checkout. Building without a proper oe-init-build-env is not yet supported. (Bitbake rev: 9eafe14956013f5af39b68fc93e1b03e7ea1f5c2) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: properly set layers when running a buildAlexandru DAMIAN2014-07-231-9/+14
| | | | | | | | | | | | | | | | | | This patch enables the localhost build controller to properly set the layers before the build runs. It creates the checkout directories under BuildEnvironment sourcedir directory, and runs the build in the buildir directory. Build launch errors are tracked in the newly added BRError table. These are different from build errors, in the sense that the build can't start due to these errors. (Bitbake rev: 1868d5635b517e0fe1b874674ea7a78910b26e2e) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: build control functionalityAlexandru DAMIAN2014-06-131-0/+85
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 <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>