-
Notifications
You must be signed in to change notification settings - Fork 89
many: drop custom distrodefs and use images library
#1066
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
Conversation
This commits adds a new `bootc-rpm-installer` image type that contains only the rpm packages lists for now so that bootc-image-builder can use the images library to get what rpm package it needs to install to build a bootable ISO. The advantage is that we can retire the code in bib that the YAML loading for the pacakge lists and that we have one central location when we need to update image definitions. This is used by osbuild/bootc-image-builder#1066
This commits adds a new `bootc-rpm-installer` image type that contains only the rpm packages lists and installer config for now so that bootc-image-builder can use the images library to get what rpm package it needs to install to build a bootable ISO. The advantage is that we can retire the code in bib that the YAML loading for the pacakge lists and that we have one central location when we need to update image definitions. Note that this image type is not visible by default because the loader will skip image types that have no filename set. This is used by osbuild/bootc-image-builder#1066
945a411 to
7cd20c3
Compare
This commits adds a new `bootc-rpm-installer` image type that contains only the rpm packages lists and installer config for now so that bootc-image-builder can use the images library to get what rpm package it needs to install to build a bootable ISO. The advantage is that we can retire the code in bib that the YAML loading for the pacakge lists and that we have one central location when we need to update image definitions. The other advantage is that all the syntax for conditions on the exact version works. Note that this image type is not visible by default because the loader will skip image types that have no filename set. This is used by osbuild/bootc-image-builder#1066
a86d875 to
5745939
Compare
This commits adds a new `bootc-rpm-installer` image type that contains only the rpm packages lists and installer config for now so that bootc-image-builder can use the images library to get what rpm package it needs to install to build a bootable ISO. The advantage is that we can retire the code in bib that the YAML loading for the pacakge lists and that we have one central location when we need to update image definitions. The other advantage is that all the syntax for conditions on the exact version works. Note that this image type is not visible by default because the loader will skip image types that have no filename set. This is used by osbuild/bootc-image-builder#1066
This commits adds a new `bootc-rpm-installer` image type that contains only the rpm packages lists and installer config for now so that bootc-image-builder can use the images library to get what rpm package it needs to install to build a bootable ISO. The advantage is that we can retire the code in bib that the YAML loading for the pacakge lists and that we have one central location when we need to update image definitions. The other advantage is that all the syntax for conditions on the exact version works. Note that this image type is not visible by default because the loader will skip image types that have no filename set. This is used by osbuild/bootc-image-builder#1066
distrodefs and use images DistroYAMLdistrodefs and use images library
This commits adds a new `bootc-rpm-installer` image type that contains only the rpm packages lists and installer config for now so that bootc-image-builder can use the images library to get what rpm package it needs to install to build a bootable ISO. The advantage is that we can retire the code in bib that the YAML loading for the pacakge lists and that we have one central location when we need to update image definitions. The other advantage is that all the syntax for conditions on the exact version works. Note that this image type is not visible by default because the loader will skip image types that have no filename set. This is used by osbuild/bootc-image-builder#1066
This commits adds a new `bootc-rpm-installer` image type that contains only the rpm packages lists and installer config for now so that bootc-image-builder can use the images library to get what rpm package it needs to install to build a bootable ISO. The advantage is that we can retire the code in bib that the YAML loading for the pacakge lists and that we have one central location when we need to update image definitions. The other advantage is that all the syntax for conditions on the exact version works. Note that this image type is not visible by default because the loader will skip image types that have no filename set. This is used by osbuild/bootc-image-builder#1066
This commits adds a new `bootc-rpm-installer` image type that contains only the rpm packages lists and installer config for now so that bootc-image-builder can use the images library to get what rpm package it needs to install to build a bootable ISO. The advantage is that we can retire the code in bib that the YAML loading for the pacakge lists and that we have one central location when we need to update image definitions. The other advantage is that all the syntax for conditions on the exact version works. Note that this image type is not visible by default because the loader will skip image types that have no filename set. This is used by osbuild/bootc-image-builder#1066
This commits adds a new `bootc-rpm-installer` image type that contains only the rpm packages lists and installer config for now so that bootc-image-builder can use the images library to get what rpm package it needs to install to build a bootable ISO. The advantage is that we can retire the code in bib that the YAML loading for the pacakge lists and that we have one central location when we need to update image definitions. The other advantage is that all the syntax for conditions on the exact version works. Note that this image type is not visible by default because the loader will skip image types that have no filename set. This is used by osbuild/bootc-image-builder#1066
5ab0689 to
848ef51
Compare
thozza
left a comment
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, nice cleanup 👏
| if err != nil { | ||
| return nil, err | ||
| } | ||
| // XXX: or "bootc-legacy-installer"? |
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.
or bootc-package-installer based on "image mode" vs. "package mode"... I have no preference.
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 prefer bootc-package-installer to bootc-rpm-installer. But I think legacy might be clearer here as something we want people to start moving away from.
848ef51 to
670c994
Compare
|
Sorry, had to force push because of conflicts. |
Also update for the renaming of image.NewAnacondaContainerInstaller to image.NewAnacondaContainerInstallerLegacy
Instead of having a separate implementation of the required packages and the required lorax templates and similar we now reuse the images `data/distrodefs` YAML so that all the packages/definitions are maintained in a central place.
This commit adds a fallback check when no direct match for
the distro ID from the bootc image is found. As long as
the bootc container sets a correct `ID_LIKE` we should
automatically have the same behavior as before when
we used symlinks as aliases.
If needed we might need to reintroduce an explicit
mapping like:
```go
// mapping of distro IDs that are compatible with
var distroCompat = map[string]string{
"almalinux": "rhel",
"aurora": "fedora",
"aurora-helium": "rhel",
"bazzite": "fedora",
"bluefin": "fedora",
"heliumos": "rhel",
"rocky": "rhel",
}
```
but lets hope we don't need this.
Note that these tests use the "real" distros.yaml from the images library
so make sure that if rhel-9 goes away the test is updated for rhel-XY
(only the version needs to change)
Reuse the helpers from the `images` library for to do: - labelForISO() - getDistroAndRunner() This code moved into images as part of osbuild/images#1906 and we can now reuse it here instead of duplicating it.
Workloads are no longer used in the images library. This NullWorkload is also no longer used so drop it.
670c994 to
1de1ad1
Compare
achilleas-k
left a comment
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.
Very cool. LGTM
|
I'm closing this in favor of osbuild/image-builder-cli#374 and #1157 - I think instead of this we can focus on making it a multicall binary directly. If it turns out to be too difficult/too much churn in a single go we can revisit/reopen this PR. |
Pull request was closed
Instead of having a separate implementation of the required
packages and the required lorax templates and similar we
now reuse the images
data/distrodefsYAML so that allthe packages/definitions are maintained in a central place.
The one issue with this is that we no longer support the distrodefs
path concept:
I'm 95% sure this is not used outside of testing but I wanted to call it out.
bib: add support for ID_LIKE when finding the distro YAML
This commit adds a fallback check when no direct match for
the distro ID from the bootc image is found. As long as
the bootc container sets a correct
ID_LIKEwe shouldautomatically have the same behavior as before when
we used symlinks as aliases.
If needed we might need to reintroduce an explicit
mapping like:
but lets hope we don't need this.
Note that these tests use the "real" distros.yaml from the images library
so make sure that if rhel-9 goes away the test is updated for rhel-XY
(only the version needs to change)
bib: use
imageslibrary for shared bootc helpersReuse the helpers from the
imageslibrary for to do:This code moved into images as part of
osbuild/images#1906
and we can now reuse it here instead of duplicating it.
bib: drop no-longer used NullWorkload
Workloads are no longer used in the images library. This
NullWorkload is also no longer used so drop it.