* [RFC] build to toaster fixes
@ 2015-09-18 19:01 Michael Wood
2015-09-18 19:05 ` [PATCH 1/4] toaster: Special case the openembedded-core layer to avoid duplicates Michael Wood
2015-09-20 22:39 ` [RFC] build to toaster fixes Brian Avery
0 siblings, 2 replies; 7+ messages in thread
From: Michael Wood @ 2015-09-18 19:01 UTC (permalink / raw)
To: toaster@yoctoproject.org
I've been working on a number of fixes to make sure that the build and
layer information is stored correctly in toaster.
There is quite a bit of stuff needed to fix this more fully and
definitely scope for refactoring - I've left in old code paths as I
don't think the full extent of how the information is handled can be
fully tested without a large suite of unit tests.
Branch is at 'michaelw/toaster/build-recognition-fixes' on poky-contrib.
I've had good results in testing building core-image-* on the fido release.
Michael
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] toaster: Special case the openembedded-core layer to avoid duplicates
2015-09-18 19:01 [RFC] build to toaster fixes Michael Wood
@ 2015-09-18 19:05 ` Michael Wood
2015-09-18 19:05 ` [PATCH 2/4] toaster: Create a relationship between build information and toaster layers Michael Wood
` (2 more replies)
2015-09-20 22:39 ` [RFC] build to toaster fixes Brian Avery
1 sibling, 3 replies; 7+ messages in thread
From: Michael Wood @ 2015-09-18 19:05 UTC (permalink / raw)
To: toaster
If the openembedded-core layer is specified in the toasterconf we need
to treat it differently because we may also get this layer either from
the layerindex source or I can also be provided locally.
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
bitbake/lib/toaster/orm/models.py | 21 +++++++++++++++++++++
meta-yocto/conf/toasterconf.json | 2 +-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index e4d2e87..bdb1124 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -828,6 +828,7 @@ class LayerIndexLayerSource(LayerSource):
import urllib2, urlparse, json
import os
proxy_settings = os.environ.get("http_proxy", None)
+ oe_core_layer = 'openembedded-core'
def _get_json_response(apiurl = self.apiurl):
_parsedurl = urlparse.urlparse(apiurl)
@@ -872,6 +873,25 @@ class LayerIndexLayerSource(LayerSource):
if not connection.features.autocommits_when_autocommit_is_off:
transaction.set_autocommit(False)
for li in layers_info:
+ # Special case for the openembedded-core layer
+ if li['name'] == oe_core_layer:
+ try:
+ # If we have an existing openembedded-core for example
+ # from the toasterconf.json augment the info using the
+ # layerindex rather than duplicate it
+ oe_core_l = Layer.objects.get(name=oe_core_layer)
+ # Take ownership of the layer as now coming from the
+ # layerindex
+ oe_core_l.layer_source = self
+ oe_core_l.up_id = li['id']
+ oe_core_l.summary = li['summary']
+ oe_core_l.description = li['description']
+ oe_core_l.save()
+ continue
+
+ except DoesNotExist:
+ pass
+
l, created = Layer.objects.get_or_create(layer_source = self, name = li['name'])
l.up_id = li['id']
l.up_date = li['updated']
@@ -882,6 +902,7 @@ class LayerIndexLayerSource(LayerSource):
l.summary = li['summary']
l.description = li['description']
l.save()
+
if not connection.features.autocommits_when_autocommit_is_off:
transaction.set_autocommit(True)
diff --git a/meta-yocto/conf/toasterconf.json b/meta-yocto/conf/toasterconf.json
index c455276..9e45ff0 100644
--- a/meta-yocto/conf/toasterconf.json
+++ b/meta-yocto/conf/toasterconf.json
@@ -12,7 +12,7 @@
"name": "Local Yocto Project",
"sourcetype": "local",
"apiurl": "../../",
- "branches": ["HEAD", "master", "fido", "dizzy"],
+ "branches": ["HEAD" ],
"layers": [
{
"name": "openembedded-core",
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] toaster: Create a relationship between build information and toaster layers
2015-09-18 19:05 ` [PATCH 1/4] toaster: Special case the openembedded-core layer to avoid duplicates Michael Wood
@ 2015-09-18 19:05 ` Michael Wood
2015-09-18 19:05 ` [PATCH 3/4] toaster: Prioroitise the layer more generic vcs reference over the sha Michael Wood
2015-09-18 19:05 ` [PATCH 4/4] toaser: Add a urls to the layer table in the build configuration Michael Wood
2 siblings, 0 replies; 7+ messages in thread
From: Michael Wood @ 2015-09-18 19:05 UTC (permalink / raw)
To: toaster
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.
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
bitbake/lib/bb/ui/buildinfohelper.py | 30 +++-
.../0009_auto__add_field_brlayer_layer_version.py | 180 +++++++++++++++++++++
bitbake/lib/toaster/bldcontrol/models.py | 3 +-
bitbake/lib/toaster/orm/models.py | 2 +-
4 files changed, 211 insertions(+), 4 deletions(-)
create mode 100644 bitbake/lib/toaster/bldcontrol/migrations/0009_auto__add_field_brlayer_layer_version.py
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 6e313fe..a7afb99 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -94,8 +94,8 @@ class ORMWrapper(object):
created = False
if not key in vars(self)[dictname].keys():
- vars(self)[dictname][key] = clazz.objects.create(**kwargs)
- created = True
+ vars(self)[dictname][key], created = \
+ clazz.objects.get_or_create(**kwargs)
return (vars(self)[dictname][key], created)
@@ -286,6 +286,17 @@ class ORMWrapper(object):
return recipe_object
def get_update_layer_version_object(self, build_obj, layer_obj, layer_version_information):
+ if isinstance(layer_obj, Layer_Version):
+ # We already found our layer version for this build so just
+ # update it with the new build information
+ logger.debug("We found our layer from toaster")
+ layer_obj.build = build_obj
+ layer_obj.local_path = layer_version_information['local_path']
+ layer_obj.commit = layer_version_information['commit']
+ layer_obj.save()
+ self.layer_version_objects.append(layer_obj)
+ return layer_obj
+
assert isinstance(build_obj, Build)
assert isinstance(layer_obj, Layer)
assert 'branch' in layer_version_information
@@ -335,8 +346,15 @@ class ORMWrapper(object):
localdirname = os.path.join(bc.be.sourcedir, localdirname)
#logger.debug(1, "Localdirname %s lcal_path %s" % (localdirname, layer_information['local_path']))
if localdirname.startswith(layer_information['local_path']):
+ # If the build request came from toaster this field
+ # should contain the information from the layer_version
+ # That created this build request.
+ if brl.layer_version:
+ return brl.layer_version
+
# we matched the BRLayer, but we need the layer_version that generated this BR; reverse of the Project.schedule_build()
#logger.debug(1, "Matched %s to BRlayer %s" % (pformat(layer_information["local_path"]), localdirname))
+
for pl in buildrequest.project.projectlayer_set.filter(layercommit__layer__name = brl.name):
if pl.layercommit.layer.vcs_url == brl.giturl :
layer = pl.layercommit.layer
@@ -686,6 +704,7 @@ class BuildInfoHelper(object):
def __init__(self, server, has_build_history = False):
self.internal_state = {}
self.internal_state['taskdata'] = {}
+ self.internal_state['targets'] = []
self.task_order = 0
self.autocommit_step = 1
self.server = server
@@ -764,8 +783,15 @@ class BuildInfoHelper(object):
if not localdirname.startswith("/"):
localdirname = os.path.join(bc.be.sourcedir, localdirname)
if path.startswith(localdirname):
+ # If the build request came from toaster this field
+ # should contain the information from the layer_version
+ # That created this build request.
+ if brl.layer_version:
+ return brl.layer_version
+
#logger.warn("-- managed: matched path %s with layer %s " % (path, localdirname))
# we matched the BRLayer, but we need the layer_version that generated this br
+
for lvo in self.orm_wrapper.layer_version_objects:
if brl.name == lvo.layer.name:
return lvo
diff --git a/bitbake/lib/toaster/bldcontrol/migrations/0009_auto__add_field_brlayer_layer_version.py b/bitbake/lib/toaster/bldcontrol/migrations/0009_auto__add_field_brlayer_layer_version.py
new file mode 100644
index 0000000..9b50bc1
--- /dev/null
+++ b/bitbake/lib/toaster/bldcontrol/migrations/0009_auto__add_field_brlayer_layer_version.py
@@ -0,0 +1,180 @@
+# -*- coding: utf-8 -*-
+from south.utils import datetime_utils as datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+ # Adding field 'BRLayer.layer_version'
+ db.add_column(u'bldcontrol_brlayer', 'layer_version',
+ self.gf('django.db.models.fields.related.ForeignKey')(to=orm['orm.Layer_Version'], null=True),
+ keep_default=False)
+
+
+ def backwards(self, orm):
+ # Deleting field 'BRLayer.layer_version'
+ db.delete_column(u'bldcontrol_brlayer', 'layer_version_id')
+
+
+ models = {
+ u'bldcontrol.brbitbake': {
+ 'Meta': {'object_name': 'BRBitbake'},
+ 'commit': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
+ 'dirpath': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
+ 'giturl': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'req': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildRequest']", 'unique': 'True'})
+ },
+ u'bldcontrol.brerror': {
+ 'Meta': {'object_name': 'BRError'},
+ 'errmsg': ('django.db.models.fields.TextField', [], {}),
+ 'errtype': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'req': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildRequest']"}),
+ 'traceback': ('django.db.models.fields.TextField', [], {})
+ },
+ u'bldcontrol.brlayer': {
+ 'Meta': {'object_name': 'BRLayer'},
+ 'commit': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
+ 'dirpath': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
+ 'giturl': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'layer_version': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Layer_Version']", 'null': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'req': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildRequest']"})
+ },
+ u'bldcontrol.brtarget': {
+ 'Meta': {'object_name': 'BRTarget'},
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'req': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildRequest']"}),
+ 'target': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'task': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
+ },
+ u'bldcontrol.brvariable': {
+ 'Meta': {'object_name': 'BRVariable'},
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'req': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildRequest']"}),
+ 'value': ('django.db.models.fields.TextField', [], {'blank': 'True'})
+ },
+ u'bldcontrol.buildenvironment': {
+ 'Meta': {'object_name': 'BuildEnvironment'},
+ 'address': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
+ 'bbaddress': ('django.db.models.fields.CharField', [], {'max_length': '254', 'blank': 'True'}),
+ 'bbport': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
+ 'bbstate': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'bbtoken': ('django.db.models.fields.CharField', [], {'max_length': '126', 'blank': 'True'}),
+ 'betype': ('django.db.models.fields.IntegerField', [], {}),
+ 'builddir': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'lock': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'sourcedir': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}),
+ 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
+ },
+ u'bldcontrol.buildrequest': {
+ 'Meta': {'object_name': 'BuildRequest'},
+ 'build': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['orm.Build']", 'unique': 'True', 'null': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'environment': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildEnvironment']", 'null': 'True'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']"}),
+ 'state': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
+ },
+ u'orm.bitbakeversion': {
+ 'Meta': {'object_name': 'BitbakeVersion'},
+ 'branch': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+ 'dirpath': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'giturl': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'})
+ },
+ u'orm.branch': {
+ 'Meta': {'unique_together': "(('layer_source', 'name'), ('layer_source', 'up_id'))", 'object_name': 'Branch'},
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'layer_source': ('django.db.models.fields.related.ForeignKey', [], {'default': 'True', 'to': u"orm['orm.LayerSource']", 'null': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'short_description': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
+ 'up_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
+ 'up_id': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True'})
+ },
+ u'orm.build': {
+ 'Meta': {'object_name': 'Build'},
+ 'bitbake_version': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'build_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'completed_on': ('django.db.models.fields.DateTimeField', [], {}),
+ 'cooker_log_path': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
+ 'distro': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'distro_version': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'machine': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '2'}),
+ 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']"}),
+ 'started_on': ('django.db.models.fields.DateTimeField', [], {})
+ },
+ u'orm.layer': {
+ 'Meta': {'unique_together': "(('layer_source', 'up_id'), ('layer_source', 'name'))", 'object_name': 'Layer'},
+ 'description': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'layer_index_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
+ 'layer_source': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['orm.LayerSource']", 'null': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'summary': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
+ 'up_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
+ 'up_id': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True'}),
+ 'vcs_url': ('django.db.models.fields.URLField', [], {'default': 'None', 'max_length': '200', 'null': 'True'}),
+ 'vcs_web_file_base_url': ('django.db.models.fields.URLField', [], {'default': 'None', 'max_length': '200', 'null': 'True'}),
+ 'vcs_web_tree_base_url': ('django.db.models.fields.URLField', [], {'default': 'None', 'max_length': '200', 'null': 'True'}),
+ 'vcs_web_url': ('django.db.models.fields.URLField', [], {'default': 'None', 'max_length': '200', 'null': 'True'})
+ },
+ u'orm.layer_version': {
+ 'Meta': {'unique_together': "(('layer_source', 'up_id'),)", 'object_name': 'Layer_Version'},
+ 'branch': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
+ 'build': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'layer_version_build'", 'null': 'True', 'to': u"orm['orm.Build']"}),
+ 'commit': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'dirpath': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'layer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_layer'", 'to': u"orm['orm.Layer']"}),
+ 'layer_source': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['orm.LayerSource']", 'null': 'True'}),
+ 'local_path': ('django.db.models.fields.FilePathField', [], {'default': "'/'", 'max_length': '1024'}),
+ 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'project': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['orm.Project']", 'null': 'True'}),
+ 'up_branch': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['orm.Branch']", 'null': 'True'}),
+ 'up_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
+ 'up_id': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True'})
+ },
+ u'orm.layersource': {
+ 'Meta': {'unique_together': "(('sourcetype', 'apiurl'),)", 'object_name': 'LayerSource'},
+ 'apiurl': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '63'}),
+ 'sourcetype': ('django.db.models.fields.IntegerField', [], {})
+ },
+ u'orm.project': {
+ 'Meta': {'object_name': 'Project'},
+ 'bitbake_version': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.BitbakeVersion']", 'null': 'True'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'release': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Release']", 'null': 'True'}),
+ 'short_description': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
+ 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'user_id': ('django.db.models.fields.IntegerField', [], {'null': 'True'})
+ },
+ u'orm.release': {
+ 'Meta': {'object_name': 'Release'},
+ 'bitbake_version': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.BitbakeVersion']"}),
+ 'branch_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50'}),
+ 'description': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'helptext': ('django.db.models.fields.TextField', [], {'null': 'True'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'})
+ }
+ }
+
+ complete_apps = ['bldcontrol']
\ No newline at end of file
diff --git a/bitbake/lib/toaster/bldcontrol/models.py b/bitbake/lib/toaster/bldcontrol/models.py
index b61de58..f2493a8 100644
--- a/bitbake/lib/toaster/bldcontrol/models.py
+++ b/bitbake/lib/toaster/bldcontrol/models.py
@@ -1,6 +1,6 @@
from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
-from orm.models import Project, ProjectLayer, ProjectVariable, ProjectTarget, Build
+from orm.models import Project, ProjectLayer, ProjectVariable, ProjectTarget, Build, Layer_Version
# a BuildEnvironment is the equivalent of the "build/" directory on the localhost
class BuildEnvironment(models.Model):
@@ -137,6 +137,7 @@ class BRLayer(models.Model):
giturl = models.CharField(max_length = 254)
commit = models.CharField(max_length = 254)
dirpath = models.CharField(max_length = 254)
+ layer_version = models.ForeignKey(Layer_Version, null=True)
class BRBitbake(models.Model):
req = models.ForeignKey(BuildRequest, unique = True) # only one bitbake for a request
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index bdb1124..5240ea5 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -260,7 +260,7 @@ class Project(models.Model):
for l in self.projectlayer_set.all().order_by("pk"):
commit = l.layercommit.get_vcs_reference()
print("ii Building layer ", l.layercommit.layer.name, " at vcs point ", commit)
- BRLayer.objects.create(req = br, name = l.layercommit.layer.name, giturl = l.layercommit.layer.vcs_url, commit = commit, dirpath = l.layercommit.dirpath)
+ BRLayer.objects.create(req = br, name = l.layercommit.layer.name, giturl = l.layercommit.layer.vcs_url, commit = commit, dirpath = l.layercommit.dirpath, layer_version=l.layercommit)
br.state = BuildRequest.REQ_QUEUED
now = timezone.now()
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] toaster: Prioroitise the layer more generic vcs reference over the sha
2015-09-18 19:05 ` [PATCH 1/4] toaster: Special case the openembedded-core layer to avoid duplicates Michael Wood
2015-09-18 19:05 ` [PATCH 2/4] toaster: Create a relationship between build information and toaster layers Michael Wood
@ 2015-09-18 19:05 ` Michael Wood
2015-09-18 19:05 ` [PATCH 4/4] toaser: Add a urls to the layer table in the build configuration Michael Wood
2 siblings, 0 replies; 7+ messages in thread
From: Michael Wood @ 2015-09-18 19:05 UTC (permalink / raw)
To: toaster
When we do a build we update the last commit value that the layer was built
at. However in future builds we do want to use the named reference rather
than the commit sha, e.g. master/fido
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
bitbake/lib/toaster/orm/models.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 5240ea5..44bbc97 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1153,12 +1153,12 @@ class Layer_Version(models.Model):
return project.compatible_layerversions(layer_name = self.layer.name)
def get_vcs_reference(self):
- if self.commit is not None and len(self.commit) > 0:
- return self.commit
if self.branch is not None and len(self.branch) > 0:
return self.branch
if self.up_branch is not None:
return self.up_branch.name
+ if self.commit is not None and len(self.commit) > 0:
+ return self.commit
return ("Cannot determine the vcs_reference for layer version %s" % vars(self))
def get_detailspage_url(self, project_id):
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] toaser: Add a urls to the layer table in the build configuration
2015-09-18 19:05 ` [PATCH 1/4] toaster: Special case the openembedded-core layer to avoid duplicates Michael Wood
2015-09-18 19:05 ` [PATCH 2/4] toaster: Create a relationship between build information and toaster layers Michael Wood
2015-09-18 19:05 ` [PATCH 3/4] toaster: Prioroitise the layer more generic vcs reference over the sha Michael Wood
@ 2015-09-18 19:05 ` Michael Wood
2 siblings, 0 replies; 7+ messages in thread
From: Michael Wood @ 2015-09-18 19:05 UTC (permalink / raw)
To: toaster
Allow you click through to the layer details page of a layer that has just
been used in a build.
Also rename 'layer branch' to layer revision for clarity.
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
bitbake/lib/toaster/toastergui/templates/configuration.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bitbake/lib/toaster/toastergui/templates/configuration.html b/bitbake/lib/toaster/toastergui/templates/configuration.html
index 3e48991..6239e99 100644
--- a/bitbake/lib/toaster/toastergui/templates/configuration.html
+++ b/bitbake/lib/toaster/toastergui/templates/configuration.html
@@ -48,14 +48,14 @@
<thead>
<tr>
<th>Layer</th>
- <th>Layer branch</th>
+ <th>Layer revision</th>
<th>Layer commit</th>
</tr>
</thead>
<tbody>{% for lv in build.layer_version_build.all|dictsort:"layer.name" %}
<tr>
- <td>{{lv.layer.name}}</td>
- <td>{{lv.branch}}</td>
+ <td><a href="{% url 'layerdetails' build.project.pk lv.pk %}">{{lv.layer.name}}</a></td>
+ <td>{{lv.get_vcs_reference}}</td>
<td> <a class="btn" data-content="<ul class='unstyled'>
<li>{{lv.commit}}</li> </ul>">
{{lv.commit|truncatechars:13}}
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [RFC] build to toaster fixes
2015-09-18 19:01 [RFC] build to toaster fixes Michael Wood
2015-09-18 19:05 ` [PATCH 1/4] toaster: Special case the openembedded-core layer to avoid duplicates Michael Wood
@ 2015-09-20 22:39 ` Brian Avery
2015-09-23 14:02 ` Michael Wood
1 sibling, 1 reply; 7+ messages in thread
From: Brian Avery @ 2015-09-20 22:39 UTC (permalink / raw)
To: Michael Wood; +Cc: toaster@yoctoproject.org
Hi,
I tried this branch on master and it worked fine for a
core-image-minimal. Could you give an example of what used to fail
that this fixes? I tried it with sujith's local layer loading and
(for me) that still spews out ton's of errors about :
Cannot determine the vcs_reference for layer version {'build_id': 2,
'_layer_cache': <Layer: __FIXME__unidentified_layer / None >,
'layer_id': 10, '_state': <django.db.models.base.ModelState object at
0x7fd03ed98710>, 'up_branch_id': None, 'priority': 7, 'up_date': None,
'local_path': u'/', '_up_branch_cache': None, '_build_cache': <Build:
2 p1-suj (Release local (HEAD), BBV HEAD (Branch: HEAD))
core-image-minimal>, 'branch': u'', 'dirpath': None, 'commit': u'',
'project_id': None, 'up_id': None, 'id': 28, 'layer_source_id': None},
Project p1-suj (Release local (HEAD), BBV HEAD (Branch: HEAD)))>,
<Layer_Version: 28 __FIXME__unidentified_layer / None (VCS Cannot
determine the vcs_reference for layer version {'build_id': 2,
'_layer_cache': <Layer: __FIXME__unidentified_layer / None >,
'layer_id': 10, '_state': <django.db.models.base.ModelState object at
0x7fd03ed60d90>, 'up_branch_id': None, 'priority': 7, 'up_date': None,
'local_path': u'/', '_up_branch_cache': None, '_build_cache': <Build:
2 p1-suj (Release local (HEAD), BBV HEAD (Branch: HEAD))
core-image-minimal>, 'branch': u'', 'dirpath': None, 'commit': u'',
'project_
so, sadly this patch doesn't fix that problem :(
-b
On Fri, Sep 18, 2015 at 12:01 PM, Michael Wood <michael.g.wood@intel.com> wrote:
> I've been working on a number of fixes to make sure that the build and layer
> information is stored correctly in toaster.
>
> There is quite a bit of stuff needed to fix this more fully and definitely
> scope for refactoring - I've left in old code paths as I don't think the
> full extent of how the information is handled can be fully tested without a
> large suite of unit tests.
>
> Branch is at 'michaelw/toaster/build-recognition-fixes' on poky-contrib.
> I've had good results in testing building core-image-* on the fido release.
>
> Michael
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC] build to toaster fixes
2015-09-20 22:39 ` [RFC] build to toaster fixes Brian Avery
@ 2015-09-23 14:02 ` Michael Wood
0 siblings, 0 replies; 7+ messages in thread
From: Michael Wood @ 2015-09-23 14:02 UTC (permalink / raw)
To: Brian Avery; +Cc: toaster@yoctoproject.org
New branch: michaelw/toaster/ic-4-and-buildinfo-matching
This is based ontop of the image customisation branch to make sure we
use the latest schema
Michael
On 20/09/15 23:39, Brian Avery wrote:
> Hi,
>
> I tried this branch on master and it worked fine for a
> core-image-minimal. Could you give an example of what used to fail
> that this fixes? I tried it with sujith's local layer loading and
> (for me) that still spews out ton's of errors about :
>
> Cannot determine the vcs_reference for layer version {'build_id': 2,
> '_layer_cache': <Layer: __FIXME__unidentified_layer / None >,
> 'layer_id': 10, '_state': <django.db.models.base.ModelState object at
> 0x7fd03ed98710>, 'up_branch_id': None, 'priority': 7, 'up_date': None,
> 'local_path': u'/', '_up_branch_cache': None, '_build_cache': <Build:
> 2 p1-suj (Release local (HEAD), BBV HEAD (Branch: HEAD))
> core-image-minimal>, 'branch': u'', 'dirpath': None, 'commit': u'',
> 'project_id': None, 'up_id': None, 'id': 28, 'layer_source_id': None},
> Project p1-suj (Release local (HEAD), BBV HEAD (Branch: HEAD)))>,
> <Layer_Version: 28 __FIXME__unidentified_layer / None (VCS Cannot
> determine the vcs_reference for layer version {'build_id': 2,
> '_layer_cache': <Layer: __FIXME__unidentified_layer / None >,
> 'layer_id': 10, '_state': <django.db.models.base.ModelState object at
> 0x7fd03ed60d90>, 'up_branch_id': None, 'priority': 7, 'up_date': None,
> 'local_path': u'/', '_up_branch_cache': None, '_build_cache': <Build:
> 2 p1-suj (Release local (HEAD), BBV HEAD (Branch: HEAD))
> core-image-minimal>, 'branch': u'', 'dirpath': None, 'commit': u'',
> 'project_
>
>
> so, sadly this patch doesn't fix that problem :(
>
> -b
>
> On Fri, Sep 18, 2015 at 12:01 PM, Michael Wood <michael.g.wood@intel.com> wrote:
>> I've been working on a number of fixes to make sure that the build and layer
>> information is stored correctly in toaster.
>>
>> There is quite a bit of stuff needed to fix this more fully and definitely
>> scope for refactoring - I've left in old code paths as I don't think the
>> full extent of how the information is handled can be fully tested without a
>> large suite of unit tests.
>>
>> Branch is at 'michaelw/toaster/build-recognition-fixes' on poky-contrib.
>> I've had good results in testing building core-image-* on the fido release.
>>
>> Michael
>> --
>> _______________________________________________
>> toaster mailing list
>> toaster@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/toaster
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-09-23 14:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-18 19:01 [RFC] build to toaster fixes Michael Wood
2015-09-18 19:05 ` [PATCH 1/4] toaster: Special case the openembedded-core layer to avoid duplicates Michael Wood
2015-09-18 19:05 ` [PATCH 2/4] toaster: Create a relationship between build information and toaster layers Michael Wood
2015-09-18 19:05 ` [PATCH 3/4] toaster: Prioroitise the layer more generic vcs reference over the sha Michael Wood
2015-09-18 19:05 ` [PATCH 4/4] toaser: Add a urls to the layer table in the build configuration Michael Wood
2015-09-20 22:39 ` [RFC] build to toaster fixes Brian Avery
2015-09-23 14:02 ` Michael Wood
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.