-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #308 from rackerlabs/build-ipa-image-20240916
feat: Adds ironic IPA image build tools
- Loading branch information
Showing
8 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,47 @@ | ||
--- | ||
name: build-ironic-images | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- 'ironic-images/**' | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'ironic-images/**' | ||
|
||
jobs: | ||
build-ironic-images: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ironic-images/ipa-debian-bookworm | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
id: setup-python | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
- run: sudo apt update && sudo apt install -y debootstrap qemu-utils | ||
- run: pip install -r requirements.txt | ||
working-directory: ironic-images | ||
- name: Build the IPA image | ||
run: bash ipa-debian-bookworm.sh | ||
env: | ||
ELEMENTS_PATH: ${{ env.pythonLocation }}/share/ironic-python-agent-builder/dib:${{ github.workspace }}/ironic-images/custom_elements | ||
- name: Dynamically set timestamp environment variable | ||
run: echo "TIMESTAMP=$(date +"%Y%m%d%H%M%S")" >> $GITHUB_ENV | ||
- name: Publish IPA Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: undercloud-ironic-ipa | ||
tag_name: undercloud-ironic-ipa-${{ env.TIMESTAMP }} | ||
make_latest: true | ||
fail_on_unmatched_files: true | ||
files: | | ||
ironic-images/ipa-debian-bookworm/ipa-debian-bookworm.initramfs | ||
ironic-images/ipa-debian-bookworm/ipa-debian-bookworm.kernel | ||
if: ${{ github.ref == 'refs/heads/main' }} |
This file contains 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,3 @@ | ||
# Undercloud Ironic Image Build | ||
|
||
The image build process is in github actions: `.github/workflows/build-ironic-images.yaml` |
23 changes: 23 additions & 0 deletions
23
ironic-images/custom_elements/undercloud-ipa/install.d/50-sysctl-arp-ignore
This file contains 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,23 @@ | ||
#!/bin/bash | ||
|
||
# dib-lint: disable=set setu setpipefail indent | ||
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then | ||
set -x | ||
fi | ||
set -e | ||
|
||
cat > /etc/sysctl.d/99-undercloud-ipa-sysctl-arp-ignore.conf <<EOF | ||
# arp_ignore - INTEGER | ||
# Define different modes for sending replies in response to | ||
# received ARP requests that resolve local target IP addresses: | ||
# 0 - (default): reply for any local target IP address, configured | ||
# on any interface | ||
# 1 - reply only if the target IP address is local address | ||
# configured on the incoming interface | ||
# 2 - reply only if the target IP address is local address | ||
# configured on the incoming interface and both with the | ||
# sender's IP address are part from same subnet on this interface | ||
# 3 - do not reply for local addresses configured with scope host, | ||
# only resolutions for global and link addresses are replied | ||
net.ipv4.conf.all.arp_ignore=2 | ||
EOF |
This file contains 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,4 @@ | ||
- Need to install package: debootstrap | ||
- Create virtualenv | ||
- pip install diskimage-builder ironic-python-agent-builder | ||
- ./ipa-debian-bookworm.sh |
This file contains 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,10 @@ | ||
#!/bin/bash | ||
|
||
# elements path - need to include both the ironic-python-agent-builder DIB packages | ||
# and our custom_elements packages | ||
# export ELEMENTS_PATH=/path/to/venv/share/ironic-python-agent-builder/dib:/path/to/custom_elements | ||
|
||
# distro version | ||
export DIB_RELEASE=bookworm | ||
|
||
diskimage-builder ipa-debian-bookworm.yaml |
This file contains 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 @@ | ||
- imagename: ipa-debian-bookworm | ||
elements: | ||
- ironic-python-agent-ramdisk | ||
- debian-minimal | ||
- dynamic-login | ||
- journal-to-console | ||
- undercloud-ipa |
This file contains 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,6 @@ | ||
inetutils-ping: | ||
inetutils-telnet: | ||
mtr-tiny: | ||
tcpdump: | ||
systemd-timesyncd: | ||
bind9-dnsutils: |
This file contains 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,4 @@ | ||
diskimage-builder==3.33.0 | ||
ironic-python-agent-builder==5.3.0 | ||
python-keystoneclient==5.4.0 | ||
python-swiftclient==4.6.0 |