Haiqing Bai e5affdf346 Debian: pkgbuilder: Support parallel build with multiple chroots
Multiple chroots are created based on the client's request.
The maximum number of chroots are defined in the client's request.
If the chroots count the client required exceeds the maximum of
chroots, it must wait for some tasks to complete and at least
one chroot is released. The client decides how many parallel
build requests initiated.
'schrootspool' is used to manage all the created chroots and
is responsible for chroots applying and releasing.

The local repository 'deb-local-build' in '/etc/sbuild/sbuild.conf'
which is used to resolve dependency is removed for race condition:
Aptly does not support parallel accessing, when package A is built
done and the deb binaries are uploaded to 'deb-local-build', the
meta file of the repository like 'Release' will disappear for
a while until the new one is generated after Aptly publishing.
During the time, package B is fetching the repository to get the
depended packages, it fails to run 'apt-get' command on
'deb-local-build', to resolve this race condition, the config item
'deb http://stx-stx-repomgr:80/deb-local-build bullseye main' is
removed from '/etc/sbuild/sbuild.conf' and the snapshot mirror
'deb-local-build-<x>' is added to each sbuild command.

Story: 2008846
Task: 45665

Test Plan:
Pass: build-pkgs -c -a
pass: build-pkgs -c -l compiler,distro --parallel
pass: build-pkgs -c -a --parallel

Signed-off-by: Haiqing Bai <haiqing.bai@windriver.com>
Change-Id: I8deae43d7923beb6916e977313ad05bb57e10cca
2022-07-27 13:23:34 +08:00
..
2022-04-20 15:07:26 -04:00