mcurlej / module-build

A library and cli tool for building module streams
MIT License
5 stars 5 forks source link

Add multprocess queue #11

Closed mkulik-rh closed 2 years ago

mkulik-rh commented 2 years ago

New CLI options:

Here is minimal stdout information in multiprocess mode: mock

Pool with workers is spawn at the beginning of each batch. Some data are not properly utilized in this mode like curr_comp_state because of multi process communication. Those are not needed though.

Artifacts (list or built rpms) are transferred to main process via Proxylist which is slow because serialization/de-serialization but this should not cause delays in our scenario (should be avoided still though). Standard mode works in old way.

Queue is spawn per batch.

When component fails another component in batch in queue will continue building. Error will be thrown at the end of batch build.

TODO after check:

mkulik-rh commented 2 years ago

I cannot measure performance because perl-bootstrap cannot be build. File in tests directory contain invalid spec file for perl package. In newer stream 5.34 some "next" packages contain invalid source file and build fails.

mkulik-rh commented 2 years ago

Building only 45 first components for perl:5.32 using SRPM with one worker:

5014.24s user 638.56s system 211% cpu 44:28.30 total

with 3 workers:

3990.59s user 635.27s system 285% cpu 26:59.95 total

It's quite the improvement. It would be much better because first batch contains only one component perl that's taking long time to build.

mcurlej commented 2 years ago

This looks good. If you did not add them, please try to write a test to run the build with multiple workers.

mkulik-rh commented 2 years ago

Added multiprocess marker for previous tests. Added test to cover new exceptions. Multi thread queue workers are mocked because pytest just hangs waiting for spawn processes. I'm not sure why..

mcurlej commented 2 years ago

+1