-
Notifications
You must be signed in to change notification settings - Fork 33
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
[RFE] docs: Add documentation on how to build Flatcar in the fastest and most energy efficient way possible #1550
Comments
My personal experience with Building FlatcarHardware requirements:
Software requirements:
Workflow:
|
This is good, thank you. Is I don't have much to add. The main things I do to speed up Gentoo are tmpfs and distcc. You've already covered tmpfs. I haven't tried it with Flatcar because my laptop only has 16GB RAM. 😅 distcc might be worth documenting, but I haven't yet tried that with Flatcar either. sys-fs/libeatmydata could possibly help in some places, although I don't think it helps with tmpfs. I've never tried it, but it should be simple enough. |
I have found that a bottleneck of at least a few minutes is downloading one by one a huge amount of Rust crates and Go modules from https://mirror.release.flatcar-linux.net/portage-stable/distfiles/. Anyone has an idea how to maybe download those files in a parallel way? |
Portage downloads files in the background while building, assuming that |
There are 500+ creates in there, all downloaded sequentally. A HTTP connection reuse or bulk download at least (let's say 10 connections or configurable amount), would be great. |
Made a run with
|
Okay, but how much of that time is on packages with more than one file? |
I can check on a clean build with no fetch, at some moment, actually 2 times, the build grinds to a halt in order to download go modules and crates, will report back when I get the information. |
My personal goal in this is for a full build of Flatcar to run within 1 hour of a suitably sized Equinix Metal machine. That device should tick all the boxes for "modern development environment" as described above, probably the m3 or a3 system. Is the build timeline instrumented with something like |
A number of (raw) thoughts:
|
I ran some test builds overnight on my laptop (i9-13900HX, 24 cores / 32 threads), it takes a little less than ~45 minutes to build all packages with the latest nightly (i.e. w/ circular deps already resolved). I did not see any difference when using tmpfs over regular NVME I/O. Load is distributed unevenly over the build. From the build log below we can see multiple bulks of packages being built with load saturating the host (as it should) separated by quiet times (most notably 8:49:14 - 8:53:01, with load staying low 'til 8:56:00) where packages are installed that provide dependencies for successive builds. Based on the build.log I'd say our current bottleneck are build dependencies, and it's tough to get rid off of those. It would be interesting to see what packages exactly take this long to build / install, and then maybe do some clever build re-ordering to maximise host saturation. Is there any way I can get emerge to output package build stats (build times, dependencies, etc) in a meaningful way? |
I haven't tested it with Flatcar, but I've heard of this one. Genlop is a powerful utility for extracting information about emerged packages from Portage log files. It can provide detailed build statistics and more. https://wiki.gentoo.org/wiki/Genlop |
This PR from @krishjainx looks relevant for your review: flatcar/flatcar-website#364 |
Genlop is not the tool for the job, as it only does log crawling.
|
Current situation
Flatcar full build - starting from a clean build environment and to a fully fledged bootable image takes around 2 hours on a modern build environment. On a state of the art build environment, the build time takes 1.5 hours.
Flatcar is a Gentoo derivative, source based operating system. Its immutability is important in this regard too, as one cannot build just one subset of Flatcar packages, all the packages need to be built to create a production image.
Impact
First time Flatcar builders, engineers and community do not have a clear view on build times, hardware needed or software setups for the fastest build.
Ideal future situation
Document the best ways to achieve the fastest possible builds in terms of hardware, software and workflow.
Implementation options
Create a pull request to document the information.
The text was updated successfully, but these errors were encountered: