diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2013-09-18 13:15:47 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-22 12:19:43 +0100 |
commit | ba83eb315d1462e096e2d6682d246cbbe260b4c0 (patch) | |
tree | 7b0bf6ac84989275df250d76e1d1097fdd9bd0aa /bitbake/lib/bb/server/process.py | |
parent | 87e86d4fd3a22627bf5a7eff20d8551cb1e67452 (diff) | |
download | openembedded-core-contrib-ba83eb315d1462e096e2d6682d246cbbe260b4c0.tar.gz |
bitbake: bitbake: cooker,xmlrpc,servers: implement CookerFeatures
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>
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r-- | bitbake/lib/bb/server/process.py | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index e45e0c2f6d..aa072020af 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py @@ -31,7 +31,7 @@ import sys import time import select from Queue import Empty -from multiprocessing import Event, Process, util, Queue, Pipe, queues +from multiprocessing import Event, Process, util, Queue, Pipe, queues, Manager from . import BitBakeBaseServer, BitBakeBaseServerConnection, BaseImplServer @@ -78,12 +78,13 @@ class ProcessServer(Process, BaseImplServer): profile_filename = "profile.log" profile_processed_filename = "profile.log.processed" - def __init__(self, command_channel, event_queue): + def __init__(self, command_channel, event_queue, featurelist): BaseImplServer.__init__(self) - Process.__init__(self) + Process.__init__(self, args=(featurelist)) self.command_channel = command_channel self.event_queue = event_queue self.event = EventAdapter(event_queue) + self.featurelist = featurelist self.quit = False self.keep_running = Event() @@ -94,6 +95,14 @@ class ProcessServer(Process, BaseImplServer): for event in bb.event.ui_queue: self.event_queue.put(event) self.event_handle.value = bb.event.register_UIHhandler(self) + + # process any feature changes based on what UI requested + original_featureset = list(self.cooker.featureset) + while len(self.featurelist)> 0: + self.cooker.featureset.setFeature(self.featurelist.pop()) + if (original_featureset != list(self.cooker.featureset)): + self.cooker.reset() + bb.cooker.server_main(self.cooker, self.main) def main(self): @@ -198,13 +207,17 @@ class BitBakeServer(BitBakeBaseServer): # self.ui_channel, self.server_channel = Pipe() self.event_queue = ProcessEventQueue(0) - self.serverImpl = ProcessServer(self.server_channel, self.event_queue) + manager = Manager() + self.featurelist = manager.list() + self.serverImpl = ProcessServer(self.server_channel, self.event_queue, self.featurelist) def detach(self): self.serverImpl.start() return - def establishConnection(self): + def establishConnection(self, featureset): + for f in featureset: + self.featurelist.append(f) self.connection = BitBakeProcessServerConnection(self.serverImpl, self.ui_channel, self.event_queue) signal.signal(signal.SIGTERM, lambda i, s: self.connection.terminate()) return self.connection |