summaryrefslogtreecommitdiffstats
path: root/lib/bb/server/process.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-09-18 13:15:47 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-18 15:14:13 +0100
commit98e594837aab89ea042cfa9f3740d20a661b14e2 (patch)
treecdacdebc0508f6d056d63ac81703cbff16d993fa /lib/bb/server/process.py
parent8a42d082315bd6ce091d006bf83476db257fa48b (diff)
downloadbitbake-contrib-98e594837aab89ea042cfa9f3740d20a661b14e2.tar.gz
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. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/server/process.py')
-rw-r--r--lib/bb/server/process.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index e45e0c2f6..aa072020a 100644
--- a/lib/bb/server/process.py
+++ b/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