Repository navigation
tests/images with tailor [2]: add parallel tailor image configs #843
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
Draft
bfjelds (bfjelds)
wants to merge
26
commits into
user/bfjelds/tailor-fixes
from
user/bfjelds/tailor-image-configs
Draft
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
0ac5222
tests: add standalone tailor image workspace
bfjelds 6bd26b3
tests: point tailor workspace docs at tests/tailor-images
bfjelds ba41b72
tests/tailor-images: deduplicate files shared across image families
bfjelds 17ded0e
tests/tailor-images: share the by-arch/arm64.yaml base override
bfjelds d1466cf
tests/tailor-images: add qcow2/vhd-fixed outputs for VM scenarios tha…
bfjelds ecabc7e
tests: name tailor outputs for legacy artifacts
bfjelds 4b4261d
fix: split qemu grub-verity base and update layouts
bfjelds ed8a6ae
fix: restore executable bit on shell scripts lost during tailor migra…
bfjelds 4fcb3e7
tests: fix tailor image-config review findings
bfjelds 7958462
tests: fix additional tailor image-config review findings
bfjelds d1770fc
tests: drop outputs[].name overrides; fix arm64 qcow2, azure hostname…
bfjelds d9258ed
tests: restore legacy Azure disk layout, fix stale README paths
bfjelds 5e69754
tests: add ./base to trident-testimage extraDependencies
bfjelds abd08d3
tests: restore missing trident.service override, fix README output paths
bfjelds 1d53cf6
tests: explicitly disable trident-install on direct-streaming images
bfjelds 3385f24
tests: restore missing root-verity qcow2 base-image output
bfjelds da2fb6f
tests: restore netplan on Azure update image, drop trident-service fr…
bfjelds 97d6a08
tests: migrate trident-mos to the Tailor workspace
bfjelds a27f8cb
tests: fix trident-mos cache fingerprint, document it in the workspac…
bfjelds 3cccd4b
docs: fix acl-agent-base.yaml comment about per-root paths
bfjelds 2274099
docs: fix overlay-partition comment in trident-acl-agent-cert-install…
bfjelds 85870e7
docs: fix stale README removal claim
bfjelds 43af2c5
fix: restore executable bit on 3 IC postCustomization scripts
bfjelds 4b7b0fa
fix: restore the Azure update image's 7G disk-size cap
bfjelds 6e40419
tests: declare artifacts/rpm-overrides as an RPM source
bfjelds b6a3908
tests: declare artifacts/rpm-overrides for azurelinux-direct-streamin…
bfjelds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Test images with tailor | ||
|
|
||
| `tests/tailor-images/` is a [tailor](../../tools/tailor/README.md) workspace. | ||
| It replaces the legacy `testimages.py` / `builder/` flow, which runs alongside it | ||
| for now and is removed in a follow-up cleanup PR. | ||
|
|
||
| ## Build from the repo root | ||
|
|
||
| Use the in-tree tailor binary via Cargo: | ||
|
|
||
| ```bash | ||
| cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml matrix trident-installer --format json | ||
| ``` | ||
|
|
||
| Build examples: | ||
|
|
||
| ```bash | ||
| # trident-testimage | ||
| cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-testimage -s arch=amd64 --output-dir ./artifacts | ||
|
|
||
| # trident-testimage-arm64 | ||
| cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-testimage -s arch=arm64 --output-dir ./artifacts | ||
|
|
||
| # trident-direct-streaming-installer-arm64 | ||
| cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-installer -s arch=arm64 -s variant=direct-streaming --output-dir ./artifacts | ||
|
|
||
| # trident-container-usrverity-testimage (signed) | ||
| cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml build trident-verity-testimage -s deployment=container -s mode=usr --output-dir ./artifacts | ||
| ``` | ||
|
|
||
| ## Base images | ||
|
|
||
| The workspace uses a `baseImages:` catalogue in `tests/tailor-images/tailor.yaml`. | ||
| For the Azure Linux base slots you can materialize the defaults locally with: | ||
|
|
||
| ```bash | ||
| cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml bases download baremetal core_arm64 core_selinux qemu_guest | ||
| ``` | ||
|
|
||
| Verify that every referenced base file exists: | ||
|
|
||
| ```bash | ||
| cargo run --manifest-path tools/tailor/Cargo.toml -- --manifest tests/tailor-images/tailor.yaml bases verify | ||
| ``` | ||
|
|
||
| Ubuntu / GB200 direct-streaming inputs still come from the pipeline-managed blob | ||
| staging flow; those slots are intentionally catalogued without an in-workspace | ||
| remote source. | ||
|
|
||
| ## Image families | ||
|
|
||
| The current families are: | ||
|
|
||
| - `azl-installer` | ||
| - `azurelinux-direct-streaming-testimage` | ||
| - `foreign-direct-streaming-testimage` | ||
| - `trident-container-installer` | ||
| - `trident-container-testimage` | ||
| - `trident-functest` | ||
| - `trident-installer` | ||
| - `trident-mos` | ||
| - `trident-testimage` | ||
| - `trident-verity-testimage` | ||
| - `trident-vm-testimage` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: azl-installer | ||
|
|
||
| base: | ||
| ref: baremetal | ||
|
|
||
| outputs: | ||
| - format: iso | ||
|
|
||
| rpmSources: | ||
| - ../../../bin/RPMS | ||
| - ../../../artifacts/rpm-overrides | ||
|
|
||
| extraDependencies: | ||
| - ./installer-iso.yaml | ||
| - ./mos | ||
| - ./iso | ||
| - ../common | ||
|
|
||
| config: | ||
| $include: ./installer-iso.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| storage: | ||
| bootType: efi | ||
|
|
||
| disks: | ||
| - partitionTableType: gpt | ||
| maxSize: 4G | ||
| partitions: | ||
| - id: esp | ||
| type: esp | ||
| size: 8M | ||
|
|
||
| - id: rootfs | ||
| size: grow | ||
|
|
||
| filesystems: | ||
| - deviceId: esp | ||
| type: fat32 | ||
| mountPoint: | ||
| path: /boot/efi | ||
| options: umask=0077 | ||
|
|
||
| - deviceId: rootfs | ||
| type: ext4 | ||
| mountPoint: | ||
| path: / | ||
|
|
||
| os: | ||
| hostname: azl-installer | ||
| bootloader: | ||
| resetType: hard-reset | ||
|
|
||
| selinux: | ||
| mode: disabled | ||
|
|
||
| kernelCommandLine: | ||
| extraCommandLine: | ||
| - console=tty0 | ||
| - console=ttyS0 | ||
| - rd.info | ||
| - log_buf_len=1M | ||
|
|
||
| packages: | ||
| install: | ||
| - curl | ||
| - device-mapper | ||
| - dnf | ||
| - dosfstools | ||
| - efibootmgr | ||
| - iproute | ||
| - iptables | ||
| - jq | ||
| - lsof | ||
| - mdadm | ||
| - nano | ||
| - netplan | ||
| - openssh-server | ||
| - squashfs-tools | ||
| - tar | ||
| - tpm2-tools | ||
| - trident-provisioning | ||
| - vim | ||
| - veritysetup | ||
| # Accessibility packages | ||
| - pcaudiolib | ||
|
|
||
| additionalFiles: | ||
| # Getty service files for root autologin | ||
| - source: ../common/files/getty@.service | ||
| destination: /usr/lib/systemd/system/getty@.service | ||
| - source: ../common/files/serial-getty@.service | ||
| destination: /usr/lib/systemd/system/serial-getty@.service | ||
| - source: mos/scripts/installation.sh | ||
| destination: /root/installer/installation.sh | ||
|
|
||
| iso: | ||
| initramfsType: full-os | ||
|
|
||
| additionalFiles: | ||
| - source: iso/images/trident-testimage.cosi | ||
| destination: /images/azure-linux-core.cosi | ||
| - source: iso/bin/liveinstaller | ||
| destination: /installer/liveinstaller | ||
| - source: iso/files/config-placeholder.yaml | ||
| destination: /installer/trident-config.yaml.tmpl | ||
|
|
||
| kernelCommandLine: | ||
| extraCommandLine: | ||
| - console=tty0 | ||
| - console=tty1 | ||
| - console=ttyS0 | ||
| - loglevel=6 | ||
|
|
||
| scripts: | ||
| postCustomization: | ||
| - path: mos/scripts/startup-command.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| /images/ | ||
| /bin/ |
1 change: 1 addition & 0 deletions
1
tests/tailor-images/azl-installer/iso/files/config-placeholder.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| #8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d:/installer/trident-config.yaml.tmpl:############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################## |
51 changes: 51 additions & 0 deletions
51
tests/tailor-images/azl-installer/mos/scripts/installation.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #!/bin/bash | ||
| set -ex | ||
| trap '/bin/bash' ERR | ||
|
|
||
| CDROM_MOUNT="/mnt/cdrom" | ||
| WORKING_DIR="/root/installer" | ||
| MAGIC_PLACEHOLDER="8505c8ab802dd717290331acd0592804c4e413b030150c53f5018ac998b7831d" | ||
|
|
||
| # Mount CD-ROM using symlink | ||
| mkdir -p "$CDROM_MOUNT" | ||
| mount /dev/cdrom "$CDROM_MOUNT" | ||
|
|
||
| # CD-ROM paths | ||
| LIVEINSTALLER_PATH="$CDROM_MOUNT/installer/liveinstaller" | ||
| POSSIBLE_HC_TEMPLATE="$CDROM_MOUNT/installer/trident-config.yaml.tmpl" | ||
| IMAGES_DIR="$CDROM_MOUNT/images/" | ||
|
|
||
| # WORKING_DIR paths | ||
| LIVEINSTALLER_BIN="$WORKING_DIR/liveinstaller" | ||
| TRIDENT_CONFIG_DESTINATION="/etc/trident/config.yaml" | ||
| LOG_FILE="$WORKING_DIR/liveinstaller.log" | ||
| OUTPUT_LOG="$WORKING_DIR/output_liveinstaller.log" | ||
|
|
||
| # Copy to WORKING_DIR to execute liveinstaller | ||
| cp "$LIVEINSTALLER_PATH" "$LIVEINSTALLER_BIN" | ||
|
|
||
| # Check if placeholder magic string is present (ISO not patched) | ||
| if grep -q "^#${MAGIC_PLACEHOLDER}:" "$POSSIBLE_HC_TEMPLATE"; then | ||
| # Placeholder found - execute attended installation (interactive UI) | ||
| cd "$WORKING_DIR" | ||
| "$LIVEINSTALLER_BIN" \ | ||
| --images-dir="$IMAGES_DIR" \ | ||
| --host-config-output="$TRIDENT_CONFIG_DESTINATION" \ | ||
| --log-level=trace \ | ||
| --log-file="$LOG_FILE" 2>&1 | tee "$OUTPUT_LOG" | ||
| else | ||
| # Placeholder was replaced by a Host Configuration - execute unattended installation | ||
| echo "Pre-configured Host Configuration found. Starting unattended installation..." | ||
| # Save template in WORKING_DIR in case of failure | ||
| TEMPLATE_FILE="$WORKING_DIR/template.yaml" | ||
| cp "$POSSIBLE_HC_TEMPLATE" "$TEMPLATE_FILE" | ||
| # Execute liveinstaller (unattended) | ||
| cd "$WORKING_DIR" | ||
| "$LIVEINSTALLER_BIN" \ | ||
| --unattended \ | ||
| --template-file="$TEMPLATE_FILE" \ | ||
| --log-level=trace \ | ||
| --log-file="$LOG_FILE" 2>&1 | tee "$OUTPUT_LOG" | ||
| fi | ||
|
|
||
| /bin/bash |
5 changes: 5 additions & 0 deletions
5
tests/tailor-images/azl-installer/mos/scripts/startup-command.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/bash | ||
| INSTALLATION="/root/installer/installation.sh" | ||
| chmod +x "$INSTALLATION" | ||
|
|
||
| chsh -s "$INSTALLATION" root |
2 changes: 2 additions & 0 deletions
2
tests/tailor-images/azurelinux-direct-streaming-testimage/by-arch/arm64.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| base: | ||
| $include: ../common/matrix/base-core-arm64.yaml |
20 changes: 20 additions & 0 deletions
20
tests/tailor-images/azurelinux-direct-streaming-testimage/image.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: azurelinux-direct-streaming-testimage | ||
|
|
||
| matrix: | ||
| arch: [amd64, arm64] | ||
|
|
||
| base: | ||
| ref: baremetal | ||
|
|
||
| outputs: | ||
| - format: baremetal-image | ||
|
|
||
| rpmSources: | ||
| - ../../../bin/RPMS | ||
| - ../../../artifacts/rpm-overrides | ||
|
|
||
| extraDependencies: | ||
| - ../common | ||
|
|
||
| config: | ||
| $include: ./tailor/baseimg.yaml |
68 changes: 68 additions & 0 deletions
68
tests/tailor-images/azurelinux-direct-streaming-testimage/tailor/baseimg.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| storage: | ||
| bootType: efi | ||
| disks: | ||
| - partitionTableType: gpt | ||
| maxSize: 15G | ||
| partitions: | ||
| - id: esp | ||
| type: esp | ||
| size: 50M | ||
| label: esp | ||
| - id: root-a | ||
| size: 4G | ||
| type: root | ||
| label: root-a | ||
| - id: root-b | ||
| size: 4G | ||
| type: root | ||
| label: root-b | ||
| - id: swap | ||
| size: 2G | ||
| type: swap | ||
| label: swap | ||
| filesystems: | ||
| - deviceId: esp | ||
| type: fat32 | ||
| mountPoint: | ||
| path: /boot/efi | ||
| options: umask=0077 | ||
| - deviceId: root-a | ||
| type: ext4 | ||
| mountPoint: | ||
| path: / | ||
| os: | ||
| bootloader: | ||
| resetType: hard-reset | ||
| hostname: trident-rawcosi-testimage | ||
| selinux: | ||
| mode: permissive | ||
| kernelCommandLine: | ||
| extraCommandLine: | ||
| - console=tty0 | ||
| - console=ttyS0 | ||
| - rd.info | ||
| - log_buf_len=1M | ||
| packages: | ||
| install: | ||
| - curl | ||
| - dnf | ||
| - efibootmgr | ||
| - iproute | ||
| - iptables | ||
| - lsof | ||
| - mdadm | ||
| - netplan | ||
| - openssh-server | ||
| - tpm2-tools | ||
| - vim | ||
| - audit | ||
| - device-mapper | ||
| - dosfstools | ||
| - lvm2 | ||
| - veritysetup | ||
| - ntfs-3g | ||
| - ntfsprogs | ||
| - selinux-policy | ||
| services: | ||
| enable: | ||
| - sshd |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ; Fix for containerd 2.2+ MountManager plugin SELinux denial. | ||
| ; containerd 2.2 introduces a MountManager that opens a bbolt DB under | ||
| ; /run/containerd/ using mmap(). The base refpolicy (RELEASE_2_20240226) | ||
| ; grants manage_file_perms on container_runtime_t:file but that set does | ||
| ; not include 'map'. Upstream fixed this in commit 7876e51510 (May 2024). | ||
| ; This module backports the missing permission. | ||
| (allow container_engine_system_domain container_runtime_t (file (map))) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.