Skip to content

Commit

Permalink
Merge pull request #308 from rackerlabs/build-ipa-image-20240916
Browse files Browse the repository at this point in the history
feat: Adds ironic IPA image build tools
  • Loading branch information
cardoe authored Sep 19, 2024
2 parents 4626a73 + 4054f8f commit 8a4a52d
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-ironic-images.yaml
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' }}
3 changes: 3 additions & 0 deletions ironic-images/README.md
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`
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
4 changes: 4 additions & 0 deletions ironic-images/ipa-debian-bookworm/README.md
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
10 changes: 10 additions & 0 deletions ironic-images/ipa-debian-bookworm/ipa-debian-bookworm.sh
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
7 changes: 7 additions & 0 deletions ironic-images/ipa-debian-bookworm/ipa-debian-bookworm.yaml
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
6 changes: 6 additions & 0 deletions ironic-images/ipa-debian-bookworm/package-installs.yaml
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:
4 changes: 4 additions & 0 deletions ironic-images/requirements.txt
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

0 comments on commit 8a4a52d

Please sign in to comment.