mirror of
https://git.yoctoproject.org/poky
synced 2026-02-05 16:28:43 +01:00
Implementing feature set selection that allows a client to enable specific features in the server at connection time. Only enabling of features is supported, as there is no way to safely remove data loaded into the cooker. Once enabled, a feature will remain enabled for the life of the cooker. Client-server connection now supports specifying the feature set required by the client. This is implemented in the Process server using a managed proxy list, so the server cooker will now load dynamically needed features based on what client connects to it. In the XMLRPC server the feature set is requested by using a parameter for registerUIHandler function. This allows observer-only clients to also specify features for the server. The server code configuration now is completly separated from the client code. All hardcoding of client knowledge is removed from the server. The extra_caches is removed as the client can now specify the caches it needs using the feature. The UI modules now need to specify the desired featureSet. HOB is modified to conform to the featureSet specification. The only feature available is CookerFeatures.HOB_EXTRA_CACHES which forces loading the bb.cache_extra:HobRecipeInfo class. (Bitbake rev: 98e594837aab89ea042cfa9f3740d20a661b14e2) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
97 lines
2.9 KiB
Python
97 lines
2.9 KiB
Python
#
|
|
# BitBake Base Server Code
|
|
#
|
|
# Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer
|
|
# Copyright (C) 2006 - 2008 Richard Purdie
|
|
# Copyright (C) 2013 Alexandru Damian
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License version 2 as
|
|
# published by the Free Software Foundation.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License along
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
""" Base code for Bitbake server process
|
|
|
|
Have a common base for that all Bitbake server classes ensures a consistent
|
|
approach to the interface, and minimize risks associated with code duplication.
|
|
|
|
"""
|
|
|
|
""" BaseImplServer() the base class for all XXServer() implementations.
|
|
|
|
These classes contain the actual code that runs the server side, i.e.
|
|
listens for the commands and executes them. Although these implementations
|
|
contain all the data of the original bitbake command, i.e the cooker instance,
|
|
they may well run on a different process or even machine.
|
|
|
|
"""
|
|
|
|
class BaseImplServer():
|
|
def __init__(self):
|
|
self._idlefuns = {}
|
|
|
|
def addcooker(self, cooker):
|
|
self.cooker = cooker
|
|
|
|
def register_idle_function(self, function, data):
|
|
"""Register a function to be called while the server is idle"""
|
|
assert hasattr(function, '__call__')
|
|
self._idlefuns[function] = data
|
|
|
|
|
|
|
|
""" BitBakeBaseServerConnection class is the common ancestor to all
|
|
BitBakeServerConnection classes.
|
|
|
|
These classes control the remote server. The only command currently
|
|
implemented is the terminate() command.
|
|
|
|
"""
|
|
|
|
class BitBakeBaseServerConnection():
|
|
def __init__(self, serverImpl):
|
|
pass
|
|
|
|
def terminate(self):
|
|
pass
|
|
|
|
|
|
""" BitBakeBaseServer class is the common ancestor to all Bitbake servers
|
|
|
|
Derive this class in order to implement a BitBakeServer which is the
|
|
controlling stub for the actual server implementation
|
|
|
|
"""
|
|
class BitBakeBaseServer(object):
|
|
def initServer(self):
|
|
self.serverImpl = None # we ensure a runtime crash if not overloaded
|
|
self.connection = None
|
|
return
|
|
|
|
def addcooker(self, cooker):
|
|
self.cooker = cooker
|
|
self.serverImpl.addcooker(cooker)
|
|
|
|
def getServerIdleCB(self):
|
|
return self.serverImpl.register_idle_function
|
|
|
|
def saveConnectionDetails(self):
|
|
return
|
|
|
|
def detach(self):
|
|
return
|
|
|
|
def establishConnection(self, featureset):
|
|
raise "Must redefine the %s.establishConnection()" % self.__class__.__name__
|
|
|
|
def endSession(self):
|
|
self.connection.terminate()
|