Skip to content

Commit 2e1fe24

Browse files
authored
Merge pull request #450 from rackerlabs/PUC-652-20241107-1
feat: adds github workflow to create an ironic esp image
2 parents f3a1937 + cb3b379 commit 2e1fe24

File tree

2 files changed

+78
-4
lines changed

2 files changed

+78
-4
lines changed

.github/workflows/build-ironic-images.yaml

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ on:
1414
merge_group:
1515
types: [checks_requested]
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
1721
jobs:
1822
discover:
1923
runs-on: ubuntu-latest
@@ -30,9 +34,47 @@ jobs:
3034
echo "yaml-files=${yaml_files}" >> $GITHUB_OUTPUT
3135
working-directory: ironic-images
3236

33-
build:
37+
build-esp-image:
38+
runs-on: ubuntu-latest
39+
defaults:
40+
run:
41+
working-directory: ironic-images
42+
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
46+
47+
- name: Install Dependencies
48+
run: sudo apt update && sudo apt install -y grub-efi-amd64-signed shim-signed mtools ipxe
49+
50+
- name: Create esp image
51+
run: |
52+
cp /usr/lib/shim/shimx64.efi.signed /tmp/bootx64.efi
53+
cp /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed /tmp/grubx64.efi
54+
dd if=/dev/zero of=/tmp/esp.img bs=4096 count=1024
55+
mkfs.msdos -F 12 -n ESP_IMAGE /tmp/esp.img
56+
mmd -i /tmp/esp.img EFI EFI/BOOT
57+
mcopy -i /tmp/esp.img -v /tmp/bootx64.efi ::EFI/BOOT/BOOTX64.efi
58+
mcopy -i /tmp/esp.img -v /tmp/grubx64.efi ::EFI/BOOT/GRUBX64.efi
59+
mdir -i /tmp/esp.img ::EFI/BOOT
60+
mkdir artifacts
61+
cp /tmp/esp.img artifacts
62+
63+
- name: Copy ipxe images
64+
run: cp /usr/lib/ipxe/{undionly.kpxe,ipxe.efi,snponly.efi} artifacts
65+
66+
- name: Show artifacts
67+
run: ls -la artifacts
68+
69+
- name: Save artifacts for next job
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: image-artifacts
73+
path: ironic-images/artifacts/
74+
75+
build-tenant-images:
3476
runs-on: ubuntu-latest
35-
needs: discover
77+
needs: [discover, build-esp-image]
3678
defaults:
3779
run:
3880
working-directory: ironic-images
@@ -76,6 +118,15 @@ jobs:
76118
- name: Set timestamp environment variable
77119
run: echo "TIMESTAMP=$(git show --no-patch --no-notes --pretty='%cd' --date=format:'%Y%m%d%H%M%S' ${{ github.sha }})" >> $GITHUB_ENV
78120

121+
- name: Download artifacts from previous job
122+
uses: actions/download-artifact@v4
123+
with:
124+
name: image-artifacts
125+
path: ironic-images/artifacts
126+
127+
- name: Copy image artifacts from previous job in to uploads directory
128+
run: ls -la artifacts && cp -R artifacts/* upload/
129+
79130
- name: Publish Release
80131
id: create_release
81132
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2
@@ -86,3 +137,13 @@ jobs:
86137
fail_on_unmatched_files: true
87138
files: ironic-images/upload/*
88139
if: ${{ github.ref == 'refs/heads/main' }}
140+
141+
cleanup:
142+
runs-on: ubuntu-latest
143+
needs: build-tenant-images
144+
145+
steps:
146+
- name: Clean up artifacts
147+
uses: geekyeggo/delete-artifact@v5
148+
with:
149+
name: image-artifacts

ironic-images/README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
# Undercloud Ironic Image Build
1+
# Undercloud OpenStack Ironic Image Build
22

3-
The image build process is in github actions: `.github/workflows/build-ironic-images.yaml`
3+
Tools for building OpenStack Ironic images
4+
5+
## Ironic tenant image build
6+
7+
The tenant images build process is in github actions: `.github/workflows/build-ironic-images.yaml`
8+
9+
## Ironic ESP image build
10+
11+
The ESP image build process is in github actions: `.github/workflows/build-ironic-images.yaml`
12+
13+
ESP image documentation:
14+
15+
* <https://docs.openstack.org/ironic/latest/install/configure-esp.html>
16+
* <https://docs.openstack.org/ironic/latest/install/configure-pxe.html#uefi-pxe-grub>

0 commit comments

Comments
 (0)