summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/models.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: toaster: Update to Django 4.2David Reyna2023-08-301-2/+2
| | | | | | | | | | | | | | Update Toaster to support Django 4.2, to match current hosts and to address CVEs. [YOCTO #15152] (Bitbake rev: 4f5b1f5bede402295bf4dfc8845fe2f38973e157) Signed-off-by: Kieran McNulty <Kieran.McNulty@windriver.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: migrate to Django-2.2David Reyna2020-03-291-9/+9
| | | | | | | | | | | Toaster migration to Django-2.2. Django-1.x has been deprecated. [YOCTO #13207] (Bitbake rev: 9730f95686b2ac72cf1fa513c555f7c7787e2667) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib: remove unused importsFrazer Clews2020-01-191-2/+1
| | | | | | | | | | removed unused imports which made the code harder to read, and slightly but less efficient (Bitbake rev: 4367692a932ac135c5aa4f9f2a4e4f0150f76697) Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Add initial pass of SPDX license headers to source codeRichard Purdie2019-05-041-0/+4
| | | | | | | | | | | | | | | | | This adds the SPDX-License-Identifier license headers to the majority of our source files to make it clearer exactly which license files are under. The bulk of the files are under GPL v2.0 with one found to be under V2.0 or later, some under MIT and some have dual license. There are some files which are potentially harder to classify where we've imported upstream code and those can be handled specifically in later commits. The COPYING file is replaced with LICENSE.X files which contain the full license texts. (Bitbake rev: ff237c33337f4da2ca06c3a2c49699bc26608a6b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Allow git information to be null for BRLayerMichael Wood2016-09-021-5/+6
| | | | | | | | | | | | We no longer only deal with layers that have their source in a gir repository, we also allow for local directories too so update the BRLayer model to reflect this. (Bitbake rev: a15f61f3ef5a87b87121457f76592c87f0ea5d7f) 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: bldcontrol model BRLayer Add corresponding local_source_dirMichael Wood2016-08-111-0/+1
| | | | | | | | | | | | Sync the BRLayer object with the new field added to the Layer object. The BRLayer (BuildRequest Layers) are snapshots of the layers in the project at build time and therefore need to mirror the required fields of the layer object. (Bitbake rev: a3112c922f036425977abffa0137b9133f61fcd6) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: move most recent builds templating to clientElliot Smith2016-08-111-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most recent builds area of the all builds and project builds table needs to update as a build progresses. It also needs additional functionality to show other states (e.g. recipe parsing, queued) which again needs to update on the client side. Rather than add to the existing mix of server-side templating with client-side DOM updating, translate all of the server-side templates to client-side ones (jsrender), and add logic which updates the most recent builds area as the state of a build changes. Add a JSON API for mostrecentbuilds, which returns the state of all "recent" builds. Fetch this via Ajax from the build dashboard (rather than fetching the ad hoc API as in the previous version). Then, as new states for builds are fetched via Ajax, determine whether the build state has changed completely, or whether the progress has just updated. If the state completely changed, re-render the template on the client side for that build. If only the progress changed, just update the progress bar. (NB this fixes the task progress bar so it works for the project builds and all builds pages.) In cases where the builds table needs to update as the result of a build finishing, reload the whole page. This work highlighted a variety of other issues, such as build requests not being able to change state as necessary. This was one part of the cause of the "cancelling build..." state being fragile and disappearing entirely when the page refreshed. The cancelling state now persists between page reloads, as the logic for determining whether a build is cancelling is now on the Build object itself. Note that jsrender is redistributed as part of Toaster, so a note was added to LICENSE to that effect. [YOCTO #9631] (Bitbake rev: c868ea036aa34b387a72ec5116a66b2cd863995b) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: use force_text instead of force_bytesEd Bartosh2016-06-021-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: 9dd9c1393a84d1110c647e84253af8e0bb6acc45) 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-5/+5
| | | | | | | | | | 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: bldcontrol models Add a cancelling state the BuildRequestMichael Wood2016-04-061-1/+26
| | | | | | | | | | | | | | | | | | | | | | | To accurately reflect the state of a build request we also need a cancelling state. This is set when we've started a build and then for whatever reason cancel it, cancelling is not instantaneous so we have this state to indicate that a cancel is in progress. Also add a state transition guard. As the state of a BuildRequest can currently be modified by three processes; Toastergui, Runbuilds/bldcontrol and the buildinofhelper we cannot say for sure which process will be running at the time of cancellation so in order to avoid one of these processes making an incorrect transition only allow transitions of state to increase. e.g. CREATED -> QUEUED -> INPROGRESS And to ignore such requested changes such as INPROGRESS -> CREATED (Bitbake rev: 449598c8e6be75bd0c9d59e7bdf859d1d6f83858) 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/+3
| | | | | | | | | | | | | | | | | 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: don't use sshbecontrollerEd Bartosh2016-03-071-2/+0
| | | | | | | | | | | Removed usage of sshbecontroller from bbcontroller, models, tests and database schema. (Bitbake rev: 3ee06eb7e96de5dba539ad52201867e77d06a53e) 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: raise NotImplementedErrorEd Bartosh2016-03-071-2/+6
| | | | | | | | | | | | | | | Raised NotImplementedError instead of Exception to be able to catch it. This is a preparation for removing sshbecontroller module. It has to be done as code in bldcontrol/tests.py imports custom NotImplementedException from sshbecontroller. (Bitbake rev: c243ab6c83fe12d84777e4c3a18fd393827b9327) 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: 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: Rationalise mimetype guessing to fix artifact downloadsElliot Smith2015-10-111-34/+0
| | | | | | | | | | | | | | | | | | | | Artifact download links were broken because the function to get the mimetype for the artifact was incorrectly using the underlying mimetype library. The function was also attached to the build environment controller, which was unnecessary, as we only support local controllers anyway. Remove the mimetype getter on the build environment and use the one in the view code instead. This works correctly and prevents the download error from occurring. [YOCTO #8369] (Bitbake rev: 805fb2a9388c728600596e9b845a5c7eeaebd99c) 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: Create a relationship between build information and ↵Michael Wood2015-09-291-1/+2
| | | | | | | | | | | | | | 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: bitbake: toaster: Fix usage of wrong variablesEd Bartosh2015-08-011-4/+4
| | | | | | | | | | | | | Replaced nonexistent variable 'be' with self in models.py/BuildEnvironment methods. Fixed typo: BuildRequest.TYPE_LOCAL -> BuildEnvironment.TYPE_LOCAL (Bitbake rev: ed6094f78c75aab776a82967101d9c57e38e2c4d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> 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-0/+3
| | | | | | | | | | | 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: refactor checksettings commandAlexandru DAMIAN2015-05-291-0/+3
| | | | | | | | | | | | | | This patch refactors the checksetting command to prevent early return from the handle function. It also adds a check that marks IN PROGRESS builds at startup time as FAILED. Minor changes to BuildRequest and Build classes ensure useful string representation for the objects. (Bitbake rev: adf67dd79dbf6b585bf8cd54f99c389409b88ecd) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Revert "toaster: machine not searchable in all builds/projects"Alexandru DAMIAN2015-03-311-1/+1
| | | | | | | | | | | | | This reverts commit 1a86ed8f95649c5f5a3a66984ce36978d93b0e01. Bug [YOCTO #7334] was incompletly fixed, and the proper fix is not straightfoward. Consequently we revert the partial fix, as a incomplete fix is worse than no fix. (Bitbake rev: 3d838ddc2f1f92e2dd940e43c3467f6ba4ba043d) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: machine not searchable in all builds/projectsDavid Reyna2015-03-251-1/+1
| | | | | | | | | | | Add "build__machine" to searchable fields. [YOCTO #7334] (Bitbake rev: 1a86ed8f95649c5f5a3a66984ce36978d93b0e01) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: all projects data and sortsDavid Reyna2015-02-271-1/+1
| | | | | | | | | | | | Implement the 'last build' data methods, enhance variable display, add empty page and empty sort support. [YOCTO #6682] (Bitbake rev: cc6ca17e80844ecb4a777276d5f5177ebbcd93f9) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: bitbake cooker log saving and downloadingAlexandru DAMIAN2015-02-201-0/+2
| | | | | | | | | | | | | | | | | | | | | 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: toastergui: update project build listingAlexandru DAMIAN2015-01-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | We update the build listings in the project mode to enable proper display and selection of build requests that do not have an actual build object because the bitbake process did not start. We add a page to display error details for build requests that did not start a build. Fixing errors and misspelling in build sections. Sorting by "timespent" is disabled for build-listing pages. [YOCTO #7165] [YOCTO #7156] [YOCTO #7196] [YOCTO #7188] (Bitbake rev: ee13bf45cecd6a0132d724b3206a6f4515669496) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: project builds pageAlexandru DAMIAN2015-01-211-0/+2
| | | | | | | | | | | | This is a complete re-write of the "Project builds" page based on the "All builds" page in managed mode. [YOCTO #6589] (Bitbake rev: 0353d49ae934c4595408e1b7a1443769f095f2aa) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: add build artifacts table and other improvementsAlexandru DAMIAN2014-12-181-1/+9
| | | | | | | | | | | | | | | | | | We add a BuildArtifacts class to store data about files discovered during the build process and not stored anywhere else. Small cosmetic changes in the toasterui. Add model methods to return file path display data relative to the build environment instead of absolute file paths. [YOCTO #6834] (Bitbake rev: bbe24d912869312d561be199b2c029b0c898e049) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: Various fixes for projects, layers and targets pageAlexandru DAMIAN2014-11-121-5/+28
| | | | | | | | | | | | | | This is a combined set of fixes for the project, layers and targets pages in the project section of toaster. The fixes correct behaviour and look in various parts of the page, including submitting XHR commands and updating the DOM with the correct info. (Bitbake rev: 96d7738f964784871c928c376cb9fbc9a275cf00) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: update Release model to pinpoint to specific BranchAlexandru DAMIAN2014-11-121-0/+2
| | | | | | | | | | | | | | | We update the release model to pinpoint to specific branch, instead of holding a branch name that needs to be matched. This is needed because we move away from mixing branches on different layer sources. Various minor changes to models file. (Bitbake rev: d58aacc69b1832f99758b941803123329e06082d) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: provide download file capabilityAlexandru DAMIAN2014-10-301-0/+13
| | | | | | | | | | | | | | | | | | | | We add, for the localhost environments, the capability to download build artifacts. This is a pontentially dangerous API, because it gives unrestricted read access to the build environment file system - do not expose the functionality directly to the web layer, but use filtering/translation code, such as exemplified in the build_artifact view. The capability for remote build environments is dependent on bug 6835, as to use the collect storage as intermediary storage for serving files. [YOCTO #6834] (Bitbake rev: 5fce7f6e83c6143244faa9618b7ed20c1106e08f) 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-1/+2
| | | | | | | | | | | | | | 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-0/+5
| | | | | | | | | | | | | | | | 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-1/+7
| | | | | | | | | | | | | | | | | | 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: improved Project modelsAlexandru DAMIAN2014-07-231-0/+2
| | | | | | | | | | | | | | | A layer may live in a subdirectory of a git repository, so we add a field to track this setting in the Project layers. We add the Project schedule_build function, which creates a build request from the current project configuration. We also fix an import problem with Projects in views. (Bitbake rev: 1b5835e5d48cbfb7d38e38437c45d161052dfb37) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: add fields for sourcedir and builddir pathsAlexandru DAMIAN2014-07-231-0/+2
| | | | | | | | | | | | | | | | | | We add explicit absolute paths for a directory where the layer sources will be checked out (sourcedir) and where the build activities will take place. Adding minimal checking when starting the application in order to make sure that BuildEnvironment (BE) settings are usable. This check is ran by the toaster script at startup. Modify the localhost bbcontroller to use the BE settings instead of trying to self-configure on checked out sources. (Bitbake rev: d17500d3f73fdeeef5f11fb3773a65e927be3f02) 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/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: toaster: create models for bldcontrol and enable itAlexandru DAMIAN2014-06-131-1/+79
| | | | | | | | | | | | | | | | | | | We create the model classes that store information about triggering builds, and the available build environments. We add a fixture with a default build environment for build control, using a "build/" directory under the poky checkout directory. We enable the bldcontrol in toaster starting script and in the toaster settings as to allow the actual database to be kept in sync with the source code. (Bitbake rev: d4bfe9059f765f11244b97e324c0131f32f8e400) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: initial bldcontrol applicationAlexandru DAMIAN2014-06-131-0/+3
The build features of Toaster will be contained into a separate application, as to modularize the Toaster project and provide multiple options for deployment. This patch adds the application as a barebone Django application in the Toaster project. (Bitbake rev: 08556b79b7b2af08aaeedf8733b1b8996f387c4e) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>