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

SDK container: include circular dependency breaking packages in SDK #2339

Closed
wants to merge 1 commit into from

Conversation

t-lo
Copy link
Member

@t-lo t-lo commented Sep 20, 2024

This change builds all packages required to break circular dependencies in the "build SDK container" stage and includes these in the SDK image. This way, emerge- can be used right away and build_packages only builds packages with production USE flags.

The change significantly reduces the build time at the cost of a larger SDK image and longer SDK container build time. Uncompressed:

Size before Size after
all arches 7.75GB 9.29GB
arm64 5.7GB 6.58GB
amd64 5.64GB 6.45GB

How to use

  • Clone the repo, check out this branch
  • Fetch a recent SDK tarball to build the container image from, e.g. https://bincache.flatcar-linux.net/sdk/amd64/4098.0.0+nightly-20240919-2100/flatcar-sdk-amd64-4098.0.0+nightly-20240919-2100.tar.bz2
  • Build an SDK container from the tarball, e.g. ./build_sdk_container_image -k flatcar-sdk-amd64-4098.0.0+nightly-20240919-2100.tar.bz2 (NOTE: this must run outside the SDK container, on your host)
  • Emerge systemd in the new container image, which should fail if the circular dependencies were not included: ./run_sdk_container -t -C ghcr.io/flatcar/flatcar-sdk-amd64:4098.0.0-nightly-20240919-2100 emerge-amd64-usr systemd

Testing done

Ran the above, successfully emerged systemd for both amd64 and arm64.

Github actions

/update-sdk

This change builds all packages required to break circular dependencies
and includes these in the SDK image. This way, emerge-<arch> can be used
right away and build_packages only builds packages with production USE
flags.

The change significantly reduces the build time at the cost of a larger
SDK image and longer SDK container build time. Uncompressed:
               Size before       Size after
all arches       7.75GB             9.29GB
arm64            5.7GB              6.58GB
amd64            5.64GB             6.45GB

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
@chewi
Copy link
Contributor

chewi commented Sep 20, 2024

Closed?

Copy link

github-actions bot commented Sep 20, 2024

Build action triggered: https://github.com/flatcar/scripts/actions/runs/10964980395

@ader1990
Copy link
Contributor

We have some issues sometimes with multiple kernel versions builds one after the other in the same environment, there is a btrfs loop that happens because of bpf (still no idea why, but some bad clean up / cache most likely). Let's see how it goes, I have not seen that issue in the last builds.

@t-lo t-lo deleted the t-lo/sdk-include-circular-deps branch September 23, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants