Skip to content

refactor(images): compose AZL4 images from hierarchical KIWI profiles - #18530

Open
binujp wants to merge 2 commits into
4.0from
bphilip/kiwi-image-hierarchy
Open

refactor(images): compose AZL4 images from hierarchical KIWI profiles#18530
binujp wants to merge 2 commits into
4.0from
bphilip/kiwi-image-hierarchy

Conversation

@binujp

@binujp binujp commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a shared AzureLinux.kiwi entry point for 14 Azure Linux 4 image profiles
  • compose images from reusable core, base, repository, boot, security, and leaf profiles
  • register existing and proposed images against the shared hierarchy
  • centralize shared KIWI hooks and installer payloads at the description root
  • remove obsolete standalone image definitions

Validation

  • validated the combined description with the KIWI schema parser
  • resolved all 14 leaf profiles through KIWI
  • compared resolved package sets and core preferences with their source definitions
  • validated the image registry, XML structure, scripts, and profile-scoped payloads
  • built all eight images shared with the 4.0 branch on both x86_64 and aarch64
  • compared normalized filesystem contents, package inventories, OCI runtime configuration, installer ISO contents, and custom installer payloads on both architectures
  • confirmed remaining cross-build differences are generated metadata such as timestamps, random IDs, caches, package databases, initramfs output, and content-addressed repository metadata

Copilot AI balanced review requested due to automatic review settings August 20, 2026 05:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread base/images/AzureLinux.kiwi Outdated
Comment thread base/images/profiles/config.xml Outdated
Comment thread base/images/profiles/packages.xml Outdated
Comment thread base/images/profiles/config.xml Outdated
Copilot AI review requested due to automatic review settings August 20, 2026 17:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-92 and base/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" />

Comment thread base/images/teams/installer.xml
Comment thread base/images/images.toml
Comment thread base/images/AzureLinux.kiwi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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?

Comment thread base/images/components/boot.xml Outdated
Comment thread base/images/repositories/core.xml Outdated
Comment thread base/images/repositories/core.xml
<packages type="bootstrap" profiles="MarketplaceBase">
<package name="azurelinux-release-identity-cloud" />
</packages>
<packages type="image" profiles="MarketplaceBase">

Choose a reason for hiding this comment

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

question(blocking):

i feel like this package list is significantly more than what we currently have in our azure image? Where did this list come from?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This driven mostly from the PRD for 3P images. The composition is a discussion I am not holding sacred. My understanding is 3P image should be as functional for majority of the customers as we can reasonably make it. That means, unlike with 1P the question is why should we not include if it serves one more customer.

Comment thread base/images/teams/cloud/marketplace.xml Outdated
Comment thread base/images/docs/image-profile-matrix.md Outdated
Comment thread base/images/image-hierarchy.html Outdated
Comment thread base/images/repositories/core.xml
Comment thread base/images/teams/cloud/vm-base.xml Outdated
Comment thread base/images/teams/cloud/marketplace.xml Outdated
Copilot AI review requested due to automatic review settings August 20, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 at container-base/config.sh and vm-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 at base/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, and vm-iso-installer-dev images without updating consumers. In particular, scripts/build-vm-images.sh:12 and scripts/demo-build.sh:27 still invoke removed names, and this also eliminates the supported way to produce images carrying azurelinux-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" }

Comment thread base/images/AzureLinux.kiwi
Comment thread base/images/teams/installer.xml
Copilot AI review requested due to automatic review settings August 21, 2026 16:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 -dev registrations leaves repository callers broken: scripts/build-vm-images.sh:12 still builds vm-base-dev, while scripts/demo-build.sh:27-31 builds and loads container-base-dev; scripts/common.sh:31 also 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]

Comment thread base/images/docs/image-hierarchy.html Outdated
@binujp binujp changed the title Prototype shared KIWI image hierarchy AZL4 images from hierarchical definitions and profile-based composition Aug 21, 2026
Copilot AI review requested due to automatic review settings August 21, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 29 changed files in this pull request and generated 1 comment.

Comment thread base/images/teams/installer.xml
@binujp binujp changed the title AZL4 images from hierarchical definitions and profile-based composition refactor(images): compose AZL4 images from hierarchical KIWI profiles Aug 21, 2026
Copilot AI review requested due to automatic review settings August 21, 2026 19:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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, and vm-iso-installer-dev image IDs rather than registering all existing images as the summary states. Existing azldev image build <name>-dev automation 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" />
Copilot AI review requested due to automatic review settings August 21, 2026 19:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 previous vm-base work 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">
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f65ba2f2-0893-43c2-8276-a692c8d1514f
@binujp
binujp force-pushed the bphilip/kiwi-image-hierarchy branch from ca992e0 to 3189de3 Compare August 21, 2026 20:27
Copilot AI review requested due to automatic review settings August 21, 2026 20:27
@binujp
binujp marked this pull request as ready for review August 21, 2026 20:30
@binujp
binujp requested a review from a team as a code owner August 21, 2026 20:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 ttyAMA0 only for the live ISO, while azl-install*.ks.in, post-install.ks.sh, and the generated target grub.cfg all hard-code console=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">

Comment thread base/images/images.toml

[images.minimal-os]
description = "Minimal OS Image"
definition = { type = "kiwi", path = "AzureLinux.kiwi", profile = "minimal-os" }
@binujp

binujp commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

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.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f65ba2f2-0893-43c2-8276-a692c8d1514f
Copilot AI review requested due to automatic review settings August 22, 2026 00:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-os to the shared hierarchy, but base/images/minimal-os/minimal-os.kiwi remains 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" }

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.

3 participants