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

[build] make packages installation quieter & faster #13070

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guillaumelambert
Copy link
Contributor

@guillaumelambert guillaumelambert commented Dec 15, 2022

Many apt and pip commands are called inside chroot during SONiC build
process.
Though they are not interactive, they generate a lot of scrolling output
in the console that slows down the whole SONiC installation process.

https://shallowsky.com/blog/linux/performance-of-scrolling-output.html

Most of this output has no added value and makes troubleshooting more
complex.
It can be safely disabled by setting the right environment variables
and/or options. Note they cannot completely prevent underlying
calls to dpkg from displaying a few output. Only a redirection to
/dev/null can prevent the dpdk output from being displayed

Also since there are several wrappers to apt (apt-get/apt/aptitude)
and since almost all of these apt calls are done inside chroot,
it is preferable from a maintenance and efficiency perspective to

  • create a shell function with all these parameters to install packages
  • cascade contiguous chroot and apt or pip commands to avoid mutiple
    context allocations

Which release branch to backport (provide reason below if selected)

all branches are affected

Description for the changelog

[build] make apt packages installation quieter & faster

A picture of a cute animal (not mandatory but encouraged)

//
('>
/rr
*))_

@guillaumelambert
Copy link
Contributor Author

@collivier @odd22
Hello
I pushed it as draft because I think there is still room for a few possible improvements.
and since I have rebased this old work on master, I would appreciate a double check.
Thanks in advance

@guillaumelambert guillaumelambert changed the title [build] make apt installation quieter & faster [build] make apt packages installation quieter & faster Dec 15, 2022
@guillaumelambert guillaumelambert force-pushed the debian_install_scripts branch 2 times, most recently from 9670d59 to f1cc3ff Compare December 16, 2022 07:23
Many apt and pip commands are called inside chroot during SONiC build
process.
Though they are not interactive, they generate a lot of scrolling output
in the console that slows down the whole SONiC installation process.

https://shallowsky.com/blog/linux/performance-of-scrolling-output.html

Most of this output has no added value and makes troubleshooting more
complex.
It can be safely disabled by setting the right environment variables
and/or options. Note they cannot completely prevent underlying
calls to dpkg from displaying a few output. Only a redirection to
/dev/null can prevent the dpdk output from being displayed

Also since there are several wrappers to apt (apt-get/apt/aptitude)
and since almost all of these apt calls are done inside chroot,
it is preferable from a maintenance and efficiency perspective to
- create a shell function with all these parameters to install packages
- cascade contiguous chroot and apt or pip commands to avoid mutiple
  context allocations

Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
@guillaumelambert guillaumelambert changed the title [build] make apt packages installation quieter & faster [build] make packages installation quieter & faster Dec 16, 2022
@guillaumelambert guillaumelambert marked this pull request as ready for review December 16, 2022 19:40
@lguohan lguohan added the Build label Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants