From a997e11c7fa361f388d390a1f77f3dc839244021 Mon Sep 17 00:00:00 2001 From: Scott Little Date: Wed, 22 Jan 2025 15:41:41 -0500 Subject: [PATCH] Make sbuild nice to it's host StarlingX build tools consume excessive cpu and io which can starve non-build services, including kubernetes and calico. This results in timeouts, restarts, and general instability of calico and kubernetes which in turn can the build to fail. This affect is observed on the main StarlingX build server. The major build steps should employ 'nice' and 'ionice' to ensure that critical services on the build host are not starved for cpu or io. Closes-bug: 2095512 Change-Id: Id228c43188812df373a17602336ae7a61c5569a6 Signed-off-by: Scott Little (cherry picked from commit f360849703b54612f497c3516a96f6cef32799ed) --- stx/toCOPY/pkgbuilder/debbuilder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stx/toCOPY/pkgbuilder/debbuilder.py b/stx/toCOPY/pkgbuilder/debbuilder.py index 2952b42f..4e8aedbc 100644 --- a/stx/toCOPY/pkgbuilder/debbuilder.py +++ b/stx/toCOPY/pkgbuilder/debbuilder.py @@ -335,7 +335,8 @@ class Debbuilder(object): response['msg'] = 'fail to create log file' else: chroot_suffix = '--chroot-suffix=-' + user - chroot_cmd = ' '.join(['sbuild-createchroot', chroot_suffix, + chroot_cmd = ' '.join(['nice', '-n', '15', 'ionice', '-c', '3', + 'sbuild-createchroot', chroot_suffix, '--include=apt-transport-https,ca-certificates,eatmydata', '--command-prefix=eatmydata', self.attrs['dist'], parent_chroot_dir]) @@ -817,7 +818,8 @@ class Debbuilder(object): response['msg'] = dsc + ' does not exist' return response - bcommand = ' '.join([BUILD_ENGINE, '-d', self.attrs['dist']]) + bcommand = ' '.join(['nice', '-n', '15', 'ionice', '-c', '3', + BUILD_ENGINE, '-d', self.attrs['dist']]) dsc_build_dir = os.path.dirname(dsc) chroot = self.chroots_pool.acquire(needed_size=size, allow_tmpfs=allow_tmpfs) self.chroots_pool.show()