Skip to content

Commit af8745a

Browse files
committed
update for azl
1 parent dc7e687 commit af8745a

File tree

12 files changed

+868
-4
lines changed

12 files changed

+868
-4
lines changed

.github/workflows/arm-local-build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ jobs:
5858
5959
- name: Run Ubuntu24 Raw Image Build
6060
env:
61-
#RUN_QEMU_TEST: ${{ github.event.push }}
62-
RUN_QEMU_TEST: true
61+
RUN_QEMU_TEST: ${{ github.event.push }}
6362
run: |
6463
echo "Starting Ubuntu24 raw image build..."
6564
# Ensure script has access to docker group for Earthly
@@ -84,6 +83,11 @@ jobs:
8483
# Run the Ubuntu24 raw image build script
8584
./scripts/build_ubuntu24_arm_raw.sh $ARGS
8685
echo "Ubuntu24 raw image build completed."
86+
- name: Upload Binary
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: ARM-BINARY # The name for your artifact
90+
path: path/to/artifact/
8791

8892
- name: Notify on failure
8993
if: ${{ failure() && github.event_name == 'pull_request' }}
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: ARM - Build Ubuntu24 Raw Image
2+
on:
3+
workflow_dispatch: # Manual runs
4+
inputs:
5+
ref:
6+
description: "Branch or SHA to test (e.g. feature/x or a1b2c3)"
7+
required: false
8+
run_qemu_test:
9+
description: "Run QEMU boot test after build"
10+
required: false
11+
default: "false"
12+
type: choice
13+
options:
14+
- "true"
15+
- "false"
16+
push:
17+
branches:
18+
- srmungar_armlocal_dev_branch
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
build-ubuntu24-arm-raw:
25+
runs-on: ubuntu-24.04-arm
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
with:
30+
persist-credentials: false
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v3
34+
35+
- name: Install Earthly
36+
uses: earthly/actions-setup@v1
37+
with:
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
version: "latest"
40+
41+
- name: Install system deps
42+
run: |
43+
sudo apt-get update
44+
sudo apt-get install -y qemu-system-aarch64 ovmf tree jq systemd-ukify mmdebstrap systemd-boot qemu-efi-aarch64
45+
46+
- name: Set up Go
47+
uses: actions/setup-go@v5
48+
with:
49+
go-version: stable
50+
51+
- name: Prepare build script
52+
run: |
53+
if [ ! -f scripts/build_azl3_arm_raw.sh ]; then
54+
echo "scripts/build_azl3_arm_raw.sh not found!"
55+
exit 1
56+
fi
57+
chmod +x scripts/build_azl3_arm_raw.sh
58+
59+
- name: Run Ubuntu24 Raw Image Build
60+
env:
61+
#RUN_QEMU_TEST: ${{ github.event.push }}
62+
RUN_QEMU_TEST: true
63+
run: |
64+
echo "Starting Ubuntu24 raw image build..."
65+
# Ensure script has access to docker group for Earthly
66+
sudo usermod -aG docker $USER
67+
68+
# Prepare arguments with input validation
69+
ARGS=""
70+
case "${RUN_QEMU_TEST}" in
71+
"true")
72+
ARGS="--qemu-test"
73+
echo "QEMU boot test will be run after build"
74+
;;
75+
"false"|"")
76+
echo "QEMU boot test will be skipped"
77+
;;
78+
*)
79+
echo "Invalid input for run_qemu_test: ${RUN_QEMU_TEST}"
80+
exit 1
81+
;;
82+
esac
83+
84+
# Run the Ubuntu24 raw image build script
85+
./scripts/build_azl3_arm_raw.sh $ARGS
86+
echo "Ubuntu24 raw image build completed."
87+
- name: Upload Binary
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: ARM-BINARY # The name for your artifact
91+
path: path/to/artifact/
92+
93+
- name: Notify on failure
94+
if: ${{ failure() && github.event_name == 'pull_request' }}
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
REVIEWER_ID: srmungar
98+
run: |
99+
PR_AUTHOR=$(jq --raw-output 'try .pull_request.user.login // empty' "$GITHUB_EVENT_PATH")
100+
if [ -z "$PR_AUTHOR" ]; then
101+
echo "PR_AUTHOR not found in event payload. Skipping notification."
102+
exit 0
103+
fi
104+
COMMENT_BODY="Hey @$PR_AUTHOR and @$REVIEWER_ID — the Ubuntu24 raw image build has failed. Please check the logs."
105+
curl -s -X POST \
106+
-H "Authorization: Bearer $GITHUB_TOKEN" \
107+
-H "Accept: application/vnd.github.v3+json" \
108+
--data "{\"body\": \"$COMMENT_BODY\"}" \
109+
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
image:
2+
name: azl3-default-x86_64
3+
version: "1.0.0"
4+
5+
target:
6+
os: azure-linux # Target OS name
7+
dist: azl3 # Target OS distribution
8+
arch: aarch64 # Target OS architecture
9+
imageType: raw # Image type, valid value: [raw, iso].
10+
11+
disk:
12+
name: Default_Raw # 1:1 mapping to the systemConfigs name
13+
artifacts:
14+
-
15+
type: raw # image file format
16+
compression: gz # image compression format (optional)
17+
size: 4GiB # 4G, 4GB, 4096 MiB also valid. (Required for raw)
18+
partitionTableType: gpt # Partition table type, valid value: [gpt, mbr]
19+
partitions: # Required for raw, optional for ISO, not needed for rootfs.
20+
- id: boot
21+
type: esp
22+
flags:
23+
- esp
24+
- boot
25+
start: 1MiB
26+
end: 513MiB
27+
fsType: fat32
28+
mountPoint: /boot/efi
29+
mountOptions: umask=0077
30+
31+
- id: rootfs
32+
type: linux-root-amd64
33+
start: 513MiB
34+
end: 2561MiB # 513MiB + 2GiB (2048MiB) = 2561MiB
35+
fsType: ext4
36+
mountPoint: /
37+
mountOptions: defaults, ro
38+
39+
- id: roothashmap
40+
type: linux
41+
start: 2561MiB
42+
end: 3061MiB # 2561MiB + 500MiB = 3061MiB
43+
fsType: ext4
44+
mountPoint: none
45+
46+
- id: userdata
47+
type: linux
48+
start: 3061MiB
49+
end: "0" # 2561MiB + 2GiB (2048MiB) = 4609MiB
50+
fsType: ext4
51+
mountPoint: /opt
52+
53+
systemConfig:
54+
name: Default_Raw
55+
description: Default yml configuration for raw image
56+
57+
bootloader:
58+
bootType: efi # (efi or legacy)
59+
provider: systemd-boot # (grub for efi and legacy mode, or systemd-boot for efi mode)
60+
61+
immutability:
62+
enabled: true # default is true
63+
64+
packages:
65+
- filesystem
66+
- kernel
67+
- azurelinux-release
68+
# hyperv packages
69+
- dracut-hyperv
70+
- hyperv-daemons
71+
# core image packages
72+
- shim
73+
- systemd-boot
74+
- systemd-ukify
75+
- ca-certificates
76+
- cronie-anacron
77+
- logrotate
78+
- core-packages-base-image
79+
- dracut-hostonly
80+
- dracut-vrf
81+
- initramfs
82+
- shadow-utils
83+
# ssh-server
84+
- openssh-server
85+
# cloud-init packages
86+
- cloud-init
87+
- cloud-utils-growpart
88+
# virt guest packages
89+
- dracut-virtio
90+
- dracut-xen
91+
- veritysetup
92+
93+
additionalFiles:
94+
- local: ../additionalfiles/99-dhcp-en.network
95+
final: /etc/systemd/network/99-dhcp-en.network
96+
97+
kernel:
98+
name: kernel
99+
cmdline: "console=ttyS0,115200 console=tty0 loglevel=7"
100+
enableExtraModules: "usbcore usb-common"
101+
packages:
102+
- kernel
103+
uki: true
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Azure Linux 3.0 Repository Configuration
2+
name: "Azure Linux 3.0"
3+
type: "rpm" # Repository type: rpm or deb
4+
baseURL: "https://packages.microsoft.com/azurelinux/3.0/prod/base/{arch}"
5+
component: "azl3.0-base" # Repository component/section identifier
6+
gpgCheck: true # Re-enabled with correct GPG key
7+
repoGPGCheck: true # Re-enabled with correct GPG key
8+
enabled: true
9+
gpgKey: "repodata/repomd.xml.key" # Relative path from resolved repository URL
10+
# For RPM-based repositories, we use the baseURL pattern
11+
# The actual repository URL is constructed as: {baseURL}/{arch}/
12+
# Repodata is accessed at: {baseURL}/{arch}/repodata/repomd.xml
13+
buildPath: "./builds/azl3" # Will be replaced with temp_dir/builds/azl3 at runtime
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Azure Linux 3.0 Repository Configuration
2+
name: "Azure Linux 3.0"
3+
type: "rpm" # Repository type: rpm or deb
4+
baseURL: "https://packages.microsoft.com/azurelinux/3.0/prod/base/{arch}"
5+
component: "azl3.0-base" # Repository component/section identifier
6+
gpgCheck: true # Re-enabled with correct GPG key
7+
repoGPGCheck: true # Re-enabled with correct GPG key
8+
enabled: true
9+
gpgKey: "repodata/repomd.xml.key" # Relative path from resolved repository URL
10+
# For RPM-based repositories, we use the baseURL pattern
11+
# The actual repository URL is constructed as: {baseURL}/{arch}/
12+
# Repodata is accessed at: {baseURL}/{arch}/repodata/repomd.xml
13+
buildPath: "./builds/azl3" # Will be replaced with temp_dir/builds/azl3 at runtime
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
packages:
2+
- core-packages-container
3+
- createrepo_c

0 commit comments

Comments
 (0)