refactor(images): compose AZL4 images from hierarchical KIWI profiles - #18530
refactor(images): compose AZL4 images from hierarchical KIWI profiles#18530binujp wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Introduces a shared KIWI hierarchy for Azure Linux 4 image profiles.
Changes:
- Centralizes profile inheritance, configuration, repositories, and packages.
- Registers 22 image profiles against one KIWI entry point.
- Adds hierarchy documentation and an interactive HTML viewer.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
base/images/AzureLinux.kiwi |
Adds shared KIWI entry point. |
base/images/images.toml |
Registers images against shared profiles. |
base/images/profiles/profiles.xml |
Defines profile inheritance. |
base/images/profiles/config.xml |
Defines profile-specific image settings. |
base/images/profiles/packages.xml |
Defines shared package groups. |
base/images/README.md |
Documents hierarchy composition. |
base/images/image-profile-matrix.md |
Maps images to profiles. |
base/images/profile-package-tables.md |
Documents package membership. |
base/images/image-hierarchy.html |
Adds interactive hierarchy viewer. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Suppressed comments (2)
base/images/teams/installer.xml:48
- The shared installer package block drops all seven
<file>declarations from the existing definition. As a result, the image lacks its network config, Anaconda config/launcher, kickstarts, and post-install scripts; the installer hook also expects/usr/local/bin/anaconda-launcher.sh. Restore these declarations using paths relative to the new shared description directory.
<package name="vim-minimal" />
</packages>
base/images/repositories/core.xml:7
- These profiles use PMC beta as their local build-time source, contrary to the registry comment and the established image definitions, which use azl4-dev locally and rely on Koji to override the repository (for example
base/images/vm-base/vm-base.kiwi:82-92andbase/images/container-base/container-base.kiwi:110-120). Local 1P/Marketplace builds would therefore consume older published packages rather than the current development set.
<repository type="rpm-md" alias="azurelinux-base" profiles="1p-vm-base-gen1,1p-vm-base-gen1-fips,1p-vm-base-gen2-fips,marketplace-gen2,marketplace-gen2-cvm,marketplace-gen2-fips">
<source path="https://packages.microsoft.com/azurelinux/4.0/beta/base/$basearch" />
Dan Streetman (ddstreetmicrosoft)
left a comment
There was a problem hiding this comment.
I left several review notes, and stopped before reviewing all of it since I think I'll need to re-review after some changes.
In addition to the review notes, I'm not clear on the specific image types getting built. It seems like you are creating marketplace images only for gen2? And then creating 1p images only for gen1? But that's not at all correct, both 1p and 3p images should be available for gen1 and gen2, unless I am completely misunderstanding things?
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Suppressed comments (5)
base/images/AzureLinux.kiwi:17
- Because this shared file is now the primary KIWI description, KIWI only auto-discovers sidecar hooks beside
base/images/AzureLinux.kiwi. The existing hooks remain atcontainer-base/config.shandvm-iso-installer/config.sh; XML includes do not import them. Consequently the distroless profiles no longer strip the package manager/RPM database, and the installer no longer creates its offline repository or kickstarts. Add a root hook that dispatches these profile-specific steps (or retain family entry points).
<include from="this://./teams/installer.xml" />
<include from="this://./teams/wsl.xml" />
<include from="this://./teams/container.xml" />
base/images/teams/installer.xml:22
- This relative template is now resolved from the shared description directory (
base/images), but the file exists only atbase/images/vm-iso-installer/grub_template.cfg. Point to that location so the installer build can load its GRUB template.
<bootloader name="grub2" timeout="5" grub_template="grub_template.cfg" />
base/images/images.toml:7
- The registry rewrite removes the
vm-base-dev,container-base-dev,wsl-dev, andvm-iso-installer-devimages without updating consumers. In particular,scripts/build-vm-images.sh:12andscripts/demo-build.sh:27still invoke removed names, and this also eliminates the supported way to produce images carryingazurelinux-repos-dev. Retain equivalent dev leaf profiles/entries or update those workflows deliberately.
# Every image selects one leaf profile from the shared AzureLinux.kiwi
# hierarchy. Images with runtime package management ship azurelinux-repos.
# Distroless images intentionally omit repository packages.
base/images/image-hierarchy.html:233
- The first cell in each body row is the row label (for example, a profile name), but it is exposed as an ordinary data cell. Screen readers therefore cannot associate that label with the remaining cells. Mark the first cell as a row header (or render it as
<th scope="row">).
const td = tr.insertCell();
const value = row[column] || "";
appendInline(td, value);
if (value === "X") td.className = "selected";
base/images/images.toml:17
- This switches every existing image to a new build definition, so schema/profile resolution alone does not satisfy the repository's mandatory image validation: it does not execute hooks, create artifacts, or verify boot/runtime behavior. Build and run the configured test suites for the affected images before merging; the PR description explicitly says no full image builds were run.
definition = { type = "kiwi", path = "AzureLinux.kiwi", profile = "vm-base" }
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 33 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
base/images/images.toml:33
- Removing the
-devregistrations leaves repository callers broken:scripts/build-vm-images.sh:12still buildsvm-base-dev, whilescripts/demo-build.sh:27-31builds and loadscontainer-base-dev;scripts/common.sh:31also hard-codes the former output path. Those commands now fail because the image names no longer exist. Update these callers in this PR or retain compatible registry entries.
[images.container-base]
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 33 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
base/images/images.toml:7
- The new registry removes the existing
vm-base-dev,container-base-dev,wsl-dev, andvm-iso-installer-devimage IDs rather than registering all existing images as the summary states. Existingazldev image build <name>-devautomation will now fail and there is no profile that preserves the dev runtime-repository behavior; retain compatibility entries/profiles or document this breaking migration explicitly.
# Every image selects one leaf profile from the shared AzureLinux.kiwi
# hierarchy. Images with runtime package management ship azurelinux-repos.
# Distroless images intentionally omit repository packages.
| <?xml version="1.0" encoding="utf-8"?> | ||
| <image> | ||
| <repository type="rpm-md" alias="azurelinux-base"> | ||
| <source path="https://packages.microsoft.com/azurelinux/4.0/beta/base/$basearch" /> |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 33 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/build-vm-images.sh:8
- The glob is inside the quotes, so the shell treats
*literally and this cleanup silently leaves the previousvm-basework tree in place. Quote only the directory prefix so each stale entry is removed before rebuilding.
| <keytable>us</keytable> | ||
| <timezone>UTC</timezone> | ||
| <release-version>4.0</release-version> | ||
| <type image="iso" flags="dmsquash" filesystem="ext4" kernelcmdline="console=ttyAMA0,115200 console=tty0 enforcing=0 audit=0 inst.text inst.lang=en_US.UTF-8 inst.nokill" firmware="uefi" hybridpersistent="false" mediacheck="true"> |
ca992e0 to
3189de3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 30 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
base/images/teams/installer.xml:32
- The new aarch64 installer profile uses
ttyAMA0only for the live ISO, whileazl-install*.ks.in,post-install.ks.sh, and the generated targetgrub.cfgall hard-codeconsole=ttyS0. An aarch64 installation therefore loses its expected serial boot console after reboot. Select the target console by architecture in all generated bootloader settings.
<type image="iso" flags="dmsquash" filesystem="ext4" kernelcmdline="console=ttyAMA0,115200 console=tty0 enforcing=0 audit=0 inst.text inst.lang=en_US.UTF-8 inst.nokill" firmware="uefi" hybridpersistent="false" mediacheck="true">
|
|
||
| [images.minimal-os] | ||
| description = "Minimal OS Image" | ||
| definition = { type = "kiwi", path = "AzureLinux.kiwi", profile = "minimal-os" } |
|
Dan Streetman (@ddstreet) this change is the hierarchical implementation of building images the squad is supposed to deliver this cycle. That includes only the 6 images being added and the already added minimal-os image. There are only container images pending. Other variants will have to be added later. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 30 changed files in this pull request and generated no new comments.
Suppressed comments (1)
base/images/images.toml:105
- This redirects
minimal-osto the shared hierarchy, butbase/images/minimal-os/minimal-os.kiwiremains tracked and is now unreferenced. It is the only obsolete standalone definition left, contrary to the PR's cleanup goal, and creates a second definition that can silently drift. Delete the stale standalone file as part of this migration.
definition = { type = "kiwi", path = "AzureLinux.kiwi", profile = "minimal-os" }
520cc7d to
2e87f42
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 30 changed files in this pull request and generated no new comments.
Suppressed comments (1)
base/images/images.toml:105
- This registry switch leaves
base/images/minimal-os/minimal-os.kiwias the only obsolete standalone definition in the tree. It is now unreferenced and still advertises the removedminimal-os-dev/azl4-dev behavior, so it can mislead maintainers and drift from this shared profile. Delete that legacy file as part of the stated standalone-definition cleanup.
definition = { type = "kiwi", path = "AzureLinux.kiwi", profile = "minimal-os" }
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f65ba2f2-0893-43c2-8276-a692c8d1514f
2e87f42 to
2d41489
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 30 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
base/images/images.toml:105
- This switches
minimal-osto the shared hierarchy, butbase/images/minimal-os/minimal-os.kiwiis still tracked even though the PR says obsolete standalone definitions are removed. It is now an unused second definition that can drift fromteams/minimal-os.xml; delete the standalone file as part of this migration.
[images.minimal-os]
description = "Minimal OS Image"
definition = { type = "kiwi", path = "AzureLinux.kiwi", profile = "minimal-os" }
| Images with runtime package management ship `azurelinux-repos`, so the | ||
| resulting OS points at PMC's `azurelinux/4.0/beta` repository. Distroless | ||
| container images strip the package manager and do not ship a repository | ||
| package. |
Dan Streetman (ddstreetmicrosoft)
left a comment
There was a problem hiding this comment.
I left a few more review comments; additionally, having all of this in one single commit makes it really hard to review all the individual changes. I suggest that you break it up into smaller, more reviewable individual commits.
| <requires profile="BootableCore" /> | ||
| </profile> | ||
| <profile name="RuntimeRepos" description="Canonical runtime repository configuration" import="false" /> | ||
| <profile name="BootstrapRepos" description="Canonical bootstrap repository configuration" import="false" /> |
There was a problem hiding this comment.
question(blocking): aren't we done with the 'stage 1' and 'stage 2' bootstrapping? Shouldn't we just include the azurelinux-repos rpm into some common/core profile instead of having these separate profiles?
| </type> | ||
| </preferences> | ||
| <packages type="bootstrap" profiles="MarketplaceBase"> | ||
| <package name="azurelinux-release-identity-cloud" /> |
There was a problem hiding this comment.
issue(blocking): this needs to be azurelinux-release-cloud, not azurelinux-release-identity-cloud.
| <profile name="OnePBase" description="First-party Azure VM packages" import="false"> | ||
| <requires profile="CloudCore" /> | ||
| </profile> | ||
| <profile name="1p-vm-base-gen1" description="1P VM Base Gen1 Image (BIOS)" import="false"> |
There was a problem hiding this comment.
issue(blocking):
This defines only three 1p images (gen1, gen1-fips, and gen2-fips) but the PRD defines five (gen1, gen1-fips, gen2, gen2-fips, gen2-cvm). Am I looking at the wrong PRD?
| <profile name="VmBaseCore" description="VM base packages" import="false"> | ||
| <requires profile="CloudCore" /> | ||
| </profile> | ||
| <profile name="vm-base" description="Ships azurelinux-repos (runtime → PMC)" import="false"> |
There was a problem hiding this comment.
question(blocking): I thought vm-base was getting replaced by the images defined in the (marketplace) PRD? Probably by the marketplace-gen2 image?
| <profile name="InstallerCore" description="Installer ISO packages" import="false"> | ||
| <requires profile="BootableCore" /> | ||
| </profile> | ||
| <profile name="vm-iso-installer" description="Ships azurelinux-repos (runtime → PMC)" import="false"> |
There was a problem hiding this comment.
issue(blocking): the description here, and probably in other places, doesn't seem like it is correct?
| <?xml version="1.0" encoding="utf-8"?> | ||
| <image> | ||
| <profiles> | ||
| <profile name="InstallerCore" description="Installer ISO packages" import="false"> |
There was a problem hiding this comment.
issue(blocking):
I think the iso installer image is sufficiently complex and separated from all of our other images that I'd personally prefer it remain totally separate. Other than a few boot-time packages, it gains basically nothing from being part of our hierarchy of images, and it has a lot of custom scripts and config that I'd prefer stay totally separate from our other images.
Summary
AzureLinux.kiwientry point for 14 Azure Linux 4 image profilesValidation