summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/bitbake-worker
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-23 22:51:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-06 11:21:31 +0100
commit7df31ff36892c2f9c65326b06b4c7093b1462f54 (patch)
tree7992a608c29625c40fc1701537bf185dd93f8aec /bitbake/bin/bitbake-worker
parent40eb5b344b4de5310a89e36024b826fc99484747 (diff)
downloadpoky-7df31ff36892c2f9c65326b06b4c7093b1462f54.tar.gz
bitbake: runqueue: Enable dynamic task adjustment to hash equivalency
There is a compelling usecase for tasks being able to notify runqueue that their "unihash" has changed. When this is recieved, the hashes of all subsequent tasks should be recomputed and their new hashes checked against existing setscene validity. Any newly available setscene tasks should then be executed. Making this work effectively needs several pieces. An event is added which the cooker listen for. If a new hash becomes available it can send an event to notify of this. When such an event is seen, hash recomputations are made. A setscene task can't be run until all the tasks it "covers" are stopped. The notion of "holdoff" tasks is therefore added, these are removed from the buildable list with the assumption that some setscene task will run and cover them. The workers need to be notified when taskhashes change to update their own internal siggen data stores. A new worker command is added to do this which will affect all newly spawned worker processes from that worker. An example workflow which tests this code is: Configuration: BB_SIGNATURE_HANDLER = "OEEquivHash" SSTATE_HASHEQUIV_SERVER = "http://localhost:8686" $ bitbake-hashserv & $ bitbake automake-native $ bitbake autoconf-native automake-native -c clean $ bitbake m4-native -c install -f $ bitbake automake-native with the test being whether automake-native is installed from sstate. (Bitbake rev: 1f630fdf0260db08541d3ca9f25f852931c19905) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin/bitbake-worker')
-rwxr-xr-xbitbake/bin/bitbake-worker6
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index f63f060c57..3e502d5ca9 100755
--- a/bitbake/bin/bitbake-worker
+++ b/bitbake/bin/bitbake-worker
@@ -234,6 +234,8 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha
234 the_data.setVar(varname, value) 234 the_data.setVar(varname, value)
235 235
236 bb.parse.siggen.set_taskdata(workerdata["sigdata"]) 236 bb.parse.siggen.set_taskdata(workerdata["sigdata"])
237 if "newhashes" in workerdata:
238 bb.parse.siggen.set_taskhashes(workerdata["newhashes"])
237 ret = 0 239 ret = 0
238 240
239 the_data = bb_cache.loadDataFull(fn, appends) 241 the_data = bb_cache.loadDataFull(fn, appends)
@@ -377,6 +379,7 @@ class BitbakeWorker(object):
377 self.handle_item(b"cookerconfig", self.handle_cookercfg) 379 self.handle_item(b"cookerconfig", self.handle_cookercfg)
378 self.handle_item(b"extraconfigdata", self.handle_extraconfigdata) 380 self.handle_item(b"extraconfigdata", self.handle_extraconfigdata)
379 self.handle_item(b"workerdata", self.handle_workerdata) 381 self.handle_item(b"workerdata", self.handle_workerdata)
382 self.handle_item(b"newtaskhashes", self.handle_newtaskhashes)
380 self.handle_item(b"runtask", self.handle_runtask) 383 self.handle_item(b"runtask", self.handle_runtask)
381 self.handle_item(b"finishnow", self.handle_finishnow) 384 self.handle_item(b"finishnow", self.handle_finishnow)
382 self.handle_item(b"ping", self.handle_ping) 385 self.handle_item(b"ping", self.handle_ping)
@@ -416,6 +419,9 @@ class BitbakeWorker(object):
416 for mc in self.databuilder.mcdata: 419 for mc in self.databuilder.mcdata:
417 self.databuilder.mcdata[mc].setVar("PRSERV_HOST", self.workerdata["prhost"]) 420 self.databuilder.mcdata[mc].setVar("PRSERV_HOST", self.workerdata["prhost"])
418 421
422 def handle_newtaskhashes(self, data):
423 self.workerdata["newhashes"] = pickle.loads(data)
424
419 def handle_ping(self, _): 425 def handle_ping(self, _):
420 workerlog_write("Handling ping\n") 426 workerlog_write("Handling ping\n")
421 427