summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2017-07-28 17:14:14 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-30 16:22:43 +0100
commit2aa7ad38f760ec003fb18faa5aa0014cff191a7a (patch)
tree1f374c85aabbedaaa3b40919859ce8fffa341acc
parentd8e79661c69671dd424dca5cc3f7f2f855b0afed (diff)
downloadbitbake-contrib-2aa7ad38f760ec003fb18faa5aa0014cff191a7a.tar.gz
bitbake-contrib-2aa7ad38f760ec003fb18faa5aa0014cff191a7a.tar.bz2
bitbake-contrib-2aa7ad38f760ec003fb18faa5aa0014cff191a7a.zip
toaster: move to new bitbake xmlrpc default
The bitbake option "-t SERVERTYPE" was deprecated and can be removed since the desired XMLRPC listener now the default. The bitbake server port cannot be "-1" anymore and must be explicitly passed. There is a race condition for the bblock file to not only be created but to actually be populated, so a delay test loop is required (usually only one pass). The 'xmlrpcclient' is now the class that allows Toaster to for example kill builds. The events for populating the recipe parsing now either show only the final result or are skipped entiredly, so the progress calculator needs to be changed to not block on the parsing phase. [YOCTO #11851] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/toaster/bldcontrol/bbcontroller.py4
-rw-r--r--lib/toaster/bldcontrol/localhostbecontroller.py19
-rw-r--r--lib/toaster/orm/models.py2
3 files changed, 18 insertions, 7 deletions
diff --git a/lib/toaster/bldcontrol/bbcontroller.py b/lib/toaster/bldcontrol/bbcontroller.py
index 912f67bf8c..5195600d90 100644
--- a/lib/toaster/bldcontrol/bbcontroller.py
+++ b/lib/toaster/bldcontrol/bbcontroller.py
@@ -37,8 +37,8 @@ class BitbakeController(object):
"""
def __init__(self, be):
- import bb.server.xmlrpc
- self.connection = bb.server.xmlrpc._create_server(be.bbaddress,
+ import bb.server.xmlrpcclient
+ self.connection = bb.server.xmlrpcclient._create_server(be.bbaddress,
int(be.bbport))[0]
def _runCommand(self, command):
diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index 291624625b..6142f7e004 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -24,6 +24,7 @@ import os
import sys
import re
import shutil
+import time
from django.db import transaction
from django.db.models import Q
from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake
@@ -331,12 +332,22 @@ class LocalhostBEController(BuildEnvironmentController):
bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake')
toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf")
self._shellcmd('bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s '
- '--server-only -t xmlrpc -B 0.0.0.0:0\"' % (oe_init,
+ '--server-only -B 0.0.0.0:0\"' % (oe_init,
builddir, bitbake, confpath, toasterlayers), self.be.sourcedir)
# read port number from bitbake.lock
self.be.bbport = ""
bblock = os.path.join(builddir, 'bitbake.lock')
+ # allow 10 seconds for bb lock file to appear but also be populated
+ for lock_check in range(10):
+ if not os.path.exists(bblock):
+ logger.debug("localhostbecontroller: waiting for bblock file to appear")
+ time.sleep(1)
+ continue
+ if 10 < os.stat(bblock).st_size:
+ break
+ logger.debug("localhostbecontroller: waiting for bblock content to appear")
+ time.sleep(1)
with open(bblock) as fplock:
for line in fplock:
if ":" in line:
@@ -365,10 +376,10 @@ class LocalhostBEController(BuildEnvironmentController):
log = os.path.join(builddir, 'toaster_ui.log')
local_bitbake = os.path.join(os.path.dirname(os.getenv('BBBASEDIR')),
'bitbake')
- self._shellcmd(['bash -c \"(TOASTER_BRBE="%s" BBSERVER="0.0.0.0:-1" '
+ self._shellcmd(['bash -c \"(TOASTER_BRBE="%s" BBSERVER="0.0.0.0:%s" '
'%s %s -u toasterui --token="" >>%s 2>&1;'
- 'BITBAKE_UI="knotty" BBSERVER=0.0.0.0:-1 %s -m)&\"' \
- % (brbe, local_bitbake, bbtargets, log, bitbake)],
+ 'BITBAKE_UI="knotty" BBSERVER=0.0.0.0:%s %s -m)&\"' \
+ % (brbe, self.be.bbport, local_bitbake, bbtargets, log, self.be.bbport, bitbake)],
builddir, nowait=True)
logger.debug('localhostbecontroller: Build launched, exiting. '
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index 05cc5a83b1..7aaebedc2d 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -451,7 +451,7 @@ class Build(models.Model):
recipes_to_parse = models.IntegerField(default=1)
# number of recipes parsed so far for this build
- recipes_parsed = models.IntegerField(default=0)
+ recipes_parsed = models.IntegerField(default=1)
# number of repos to clone for this build
repos_to_clone = models.IntegerField(default=1)