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 container #2340

Merged
merged 1 commit into from
Sep 23, 2024

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>
Copy link

github-actions bot commented Sep 20, 2024

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

Copy link
Contributor

@chewi chewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully, I can eventually make this unnecessary, but nice in the meantime.

@t-lo
Copy link
Member Author

t-lo commented Sep 23, 2024

Hopefully, I can eventually make this unnecessary, but nice in the meantime.

❤️

I don't like the ~2GB increase in SDK image size either 😞 Hopefully we can do away with this as a stop-gap solution in the future.

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.

2 participants