Skip to content

Shrink the current installer images a bit - #1423

Merged
ochosi merged 3 commits into
osbuild:mainfrom
bcl:main-smaller-anaconda
Apr 28, 2025
Merged

ochosi merged 3 commits into
osbuild:mainfrom
bcl:main-smaller-anaconda

Conversation

@bcl

@bcl bcl commented Apr 11, 2025

Copy link
Copy Markdown

While working on adding a new netboot image type I came across a few things.

  • dracut setup was totally different from lorax/livemedia-creator (see commit and comments)
  • installer images don't need docs or weak deps
  • lz4 compression of the image isn't as good as xz and the bcj filter

So these commits change those things, hopefully not breaking anything, leading up to a netboot (a large one) next.

For the existing Fedora 42 image-installer these changes shrink it by 938MiB

Currently a draft to see what CI thinks of it.

@supakeen
supakeen self-requested a review April 12, 2025 07:24
@bcl
bcl force-pushed the main-smaller-anaconda branch from 4cff5f9 to f428d59 Compare April 15, 2025 00:47
@bcl
bcl force-pushed the main-smaller-anaconda branch from f428d59 to f687cdf Compare April 22, 2025 21:44
@bcl
bcl marked this pull request as ready for review April 22, 2025 22:05
@bcl
bcl requested a review from a team as a code owner April 22, 2025 22:05
@bcl
bcl requested review from ondrejbudai and thozza April 22, 2025 22:05
@bcl bcl mentioned this pull request Apr 22, 2025
supakeen
supakeen previously approved these changes Apr 23, 2025

@supakeen supakeen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, I like the single-dracutOptions :)

Comment thread pkg/distro/fedora/images.go Resolved
@bcl

bcl commented Apr 23, 2025

Copy link
Copy Markdown
Author

Hm, anyone know why the manifest checksums are failing? I ran the generate script and the new checksums are in the last commit.

@supakeen

Copy link
Copy Markdown
Member

Hm, anyone know why the manifest checksums are failing? I ran the generate script and the new checksums are in the last commit.

It runs it on every commit, so if you have the checksums as a separate commit it'll fail on the previous ones. I learned this yesterday as well, @achilleas-k told me to do:

git rebase -i origin/main --exec ./tools/gen-manifest-checksums.sh

Which opens every commit in your branch for amending and runs the gen-manifest-checksums after which you can add and continue. Probably drop the separate checksum commit first.

@achilleas-k

Copy link
Copy Markdown
Member

Also it's not a required check. I made the test check every commit as a bit of an experiment to see how annoying it would be. The idea is that it helps reviewers or git history readers know when a commit had an effect on generated manifests, without needing to have whole manifests checked in like we used to.

So if it's really annoying, I'm open to discussing its usefulness.

@bcl

bcl commented Apr 24, 2025

Copy link
Copy Markdown
Author

Ick. Yeah, I strongly dislike that it is forcing me to change it on every commit. It makes the commits harder to read, imposes more overhead in my workflow, makes me nervous I'm going to screw up my tree while manually doing this... Can we just make it check the final PR instead? I'm also not a fan of the 'every commit must pass everything' style, that makes it harder to make multiple readable commits leading to a final solution, so for things like this which are extra steps it makes more sense to have one commit that is 'update all the stuff the tests use' instead of putting it into every single one.

dracut should be in charge of the modules installed in the inird. This
ensures that changes needed to enable new hardware support don't need to
chase down every project that uses it. We do this by using --no-hostonly
mode which creates an initrd that will boot on any hardware we support.
Note that we don't need to pass this to it, the osbuild stage always
includes it when calling dracut.

Image creation tools like lorax and osbuild should only added modules
needed to support the boot environment (eg. anaconda or dmsquash-live).

This commit refactors things to accomplish this, removing the large
hard-coded list of dracut modules and building a dracut stage that
matches how it is used when building the boot.iso
This results in smaller images and uses the bcj filter on x86, arm, and
ppc64le.
This saves a bit of space on non-live installer images, and follows how
Lorax builds the boot.iso
@bcl
bcl force-pushed the main-smaller-anaconda branch from eb50680 to 186c814 Compare April 25, 2025 19:01
@ondrejbudai
ondrejbudai requested review from achilleas-k and mvo5 April 28, 2025 07:55

@achilleas-k achilleas-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great cleanup. Thank you!!
LGTM

@achilleas-k

achilleas-k commented Apr 28, 2025 •

Copy link
Copy Markdown
Member

I'm also not a fan of the 'every commit must pass everything' style

I did take this into consideration for the checksum check. If the code fails to compile for a given commit, it will skip the check for that commit without complaining. I personally like to make all commits compile (if not necessarily pass tests), but I understand that there are scenarios where that might lead to larger, uglier commits that are harder to read and so it's okay to avoid.

As for the general idea of having the checksum file change in every commit though, this PR is a perfect example of why I like the idea and would argue for it. It was very useful for me, while reviewing this, to see exactly which image types changed with every patch. Sometimes it's obvious, but often it's not, because it's hard to keep in mind which image types use a specific pipeline (it was useful to see which patch also affects edge installers, for example, because it crossed my mind that it might or might not, and I would have to checkout the PR myself to verify otherwise).
I admit that perhaps it is enough to just have it for the final commit though, that it might not be entirely necessary, in most cases, to tie each commit to a set of image definition changes. But I can image there would be cases where a final all-encompassing "update checksums" commit would squash a number of changes for multiple image definitions that would be more informative if done separately (e.g. in a scenario where a commit that changes a base package set for a specific cloud is in the same PR as a commit that changes something for an entire distro, it is useful to know that only the specific cloud images are affected by the first commit without any unwanted side effects on other cloud images and the whole distro is affected by the second).

@achilleas-k
achilleas-k added this pull request to the merge queue Apr 28, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 28, 2025

@thozza thozza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ochosi
ochosi added this pull request to the merge queue Apr 28, 2025
Merged via the queue into osbuild:main with commit ea4cd85 Apr 28, 2025
achilleas-k added a commit to achilleas-k/osbuild-composer that referenced this pull request Apr 29, 2025
tag v0.140.0
Tagger: imagebuilder-bot <[email protected]>

Changes with 0.140.0

----------------
  * Loader part override followups (osbuild/image-builder#1466)
    * Author: Michael Vogt, Reviewers: Tomáš Hozza
  * RHEL-10/gce: install cloud-utils-growpart by default (osbuild/image-builder#1463)
    * Author: Tomáš Hozza, Reviewers: Michael Vogt, Simon de Vlieger
  * base-host-check: expand to cover more (COMPOSER-2498) (osbuild/image-builder#1432)
    * Author: Simon de Vlieger, Reviewers: Tomáš Hozza
  * rhel8,9: move partitioning into YAML (osbuild/image-builder#1390)
    * Author: Michael Vogt, Reviewers: Tomáš Hozza

— Somewhere on the Internet, 2025-04-28

---

tag v0.141.0
Tagger: imagebuilder-bot <[email protected]>

Changes with 0.141.0

----------------
  * Shrink the current installer images a bit (osbuild/image-builder#1423)
    * Author: Brian C. Lane, Reviewers: Achilleas Koutsou, Simon de Vlieger, Tomáš Hozza
  * Update EL10 Azure images with changes made in RHEL 9.6 (osbuild/image-builder#1472)
    * Author: Achilleas Koutsou, Reviewers: Michael Vogt, Tomáš Hozza
  * distro: add DNFSetReleaseVerVar to ImageConfig (osbuild/image-builder#1465)
    * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Tomáš Hozza
  * test/base-host-check.sh: fix disabled firewall services check (osbuild/image-builder#1471)
    * Author: Sanne Raymaekers, Reviewers: Achilleas Koutsou, Tomáš Hozza

— Somewhere on the Internet, 2025-04-29

---
thozza pushed a commit to osbuild/osbuild-composer that referenced this pull request Apr 29, 2025
tag v0.140.0
Tagger: imagebuilder-bot <[email protected]>

Changes with 0.140.0

----------------
  * Loader part override followups (osbuild/image-builder#1466)
    * Author: Michael Vogt, Reviewers: Tomáš Hozza
  * RHEL-10/gce: install cloud-utils-growpart by default (osbuild/image-builder#1463)
    * Author: Tomáš Hozza, Reviewers: Michael Vogt, Simon de Vlieger
  * base-host-check: expand to cover more (COMPOSER-2498) (osbuild/image-builder#1432)
    * Author: Simon de Vlieger, Reviewers: Tomáš Hozza
  * rhel8,9: move partitioning into YAML (osbuild/image-builder#1390)
    * Author: Michael Vogt, Reviewers: Tomáš Hozza

— Somewhere on the Internet, 2025-04-28

---

tag v0.141.0
Tagger: imagebuilder-bot <[email protected]>

Changes with 0.141.0

----------------
  * Shrink the current installer images a bit (osbuild/image-builder#1423)
    * Author: Brian C. Lane, Reviewers: Achilleas Koutsou, Simon de Vlieger, Tomáš Hozza
  * Update EL10 Azure images with changes made in RHEL 9.6 (osbuild/image-builder#1472)
    * Author: Achilleas Koutsou, Reviewers: Michael Vogt, Tomáš Hozza
  * distro: add DNFSetReleaseVerVar to ImageConfig (osbuild/image-builder#1465)
    * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Tomáš Hozza
  * test/base-host-check.sh: fix disabled firewall services check (osbuild/image-builder#1471)
    * Author: Sanne Raymaekers, Reviewers: Achilleas Koutsou, Tomáš Hozza

— Somewhere on the Internet, 2025-04-29

---
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.

6 participants