This repository was archived by the owner on Jan 27, 2019. It is now read-only.
POC: running python functions asynchronously #191
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is mostly a proof-of-concept people can play with. The reason I'm not proposing this for immediate inclusion is that I'm not entirely convinced that we don't have some python function relying on being able to modify the task's metadata, with those changes then being visible to some postfunc or some entirely different task. So I wrote this in a way that doing each of the five tasks asynchronously is entirely opt-in and controlled by setting e.g. __ASYNC_SPLIT = True in local.conf.
I've tried an "oe bake world -t fetch" with empty ingredients. Without this, it takes 65 min, while with __ASYNC_FETCH = True it finished in 15 min (it takes that long partly because some ingredients currently fail to fetch, but the wget PR should hopefully fix that). But of course usually one has most ingredients, and even if not, the fetch time will be partly hidden behind the tasks that already run asynchronously.