-
Notifications
You must be signed in to change notification settings - Fork 54
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
Minimal image builds #182
Minimal image builds #182
Conversation
We don't do blueprint versioning in images. This is an osbuild-composer blueprint feature and it's all defined in that project.
Minimal will be used to create a minimal version of an image. Add Minimal to utility command blueprints in cmd to enable the direct conversion.
New environment, KVM, is meant for guest virtualisation (qcow2).
Return all the cloud-init related service names to enable for EC2.
Add the cloud-init package and services to the Azure environment, now that the explicit services on the qcow2 (and its derivatives) have been removed.
Add the KVM environment to the qcow2 struct and remove the explicit services.
Support specifying the InstallWeakDeps option through the DiskImage ImageKind, so that distros creating an image of that type can control the weak dependency selection. The option is a pointer to a boolean so that the nil value can fall back to the default internal value defined by the pipeline (which can vary).
Don't send just the customizations but instead pass in the whole Blueprint to the image functions. This change is made only on Fedora for now to enable the 'minimal' feature, which is considered experimental.
If a build request sets the 'minimal' option, disable weak dependencies for the whole payload pipeline.
On first sight this is a great addition to the possibilities and will make any future Fedora editions-as-blueprints likely much easier as we can always start from a 'minimal' image type variant. What I dislike is that this expands the combinations matrix we already have for our images with another dimension. I'm going to generate a few manifests and see what comes out of that because I feel that some image types with minimal turned on might produce the same manifest with perhaps only a different output format. I'll go over it :) |
I'd be curious to see how many of them boot. We're pretty good with the definitions in Fedora I think, maybe not for IoT, but RHEL package sets are still not properly segmented so removing the static sets will likely make them unbootable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, nice work and interesting experimental feature. 🚀 I added few comments, but nothing serious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to approve this; it's a good lead-in to splitting out stuff in the image definitions later on.
This PR adds a new feature to the build configuration called
minimal
which affects payload packages in two ways:ImageType.packageSets
).The option therefore creates a minimal image where the packages installed are only the ones required to boot the image and provide basic functionality according to Platform (for firmware and bootloader configuration for example) and the Environment (
cloud-init
for cloud environment for example), removing any packages from an image type that are added purely by policy.For the qcow2 (and its derivatives), the enabled services have been removed from the base image type configuration and moved to the respective environments: EC2 (ami), Azure (vhd), and KVM (new env for qcow2).
THIS IS AN EXPERIMENTAL FEATURE
I don't intend for this to be exposed in osbuild-composer just yet. It's currently enabled only in Fedora. I tested locally a minimal build of Fedora 38 x86_64 qcow2 and it works. It shrinks the image from 500 MiB to 300 MiB, and reduces the package count from 453 to 215.
I'd like to get this in even if untested to have it as a proof of concept.
I intend for this to address a very common feature request which is the removal of base packages from image types. Instead of allowing package exclusion, a minimal image with weak dependencies disabled should allow users to add just the packages they want while the platform and environment define the packages they need. This will become even more powerful when we let users define the platform and environment directly. If (when) we introduce a null environment, and make it user-configurable, a user would be able to build a minimal qcow2 (as enabled in this PR) and also remove
cloud-init
, which is defined in the new KVM environment.