Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-133067 / 25.04 / Install all apt packages in a single transaction to improve the perfo… #792

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions scale_build/image/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,17 @@ def install_rootfs_packages_impl():
run_in_chroot(['apt', 'update'])

manifest = get_manifest()
packages_to_install = {False: set(), True: set()}
for package_entry in itertools.chain(manifest['base-packages'], manifest['additional-packages']):
log_message = f'Installing {package_entry}'
install_cmd = ['apt', 'install', '-V', '-y', package_entry['name']]
if not package_entry['install_recommends']:
install_cmd.insert(3, '--no-install-recommends')
packages_to_install[package_entry['install_recommends']].add(package_entry['name'])

for install_recommends, packages_names in packages_to_install.items():
log_message = f'Installing {packages_names}'
install_cmd = ['apt', 'install', '-V', '-y']
if not install_recommends:
install_cmd.append('--no-install-recommends')
log_message += ' (no recommends)'
install_cmd += list(packages_names)

logger.debug(log_message)
run_in_chroot(install_cmd)
Expand Down
Loading