From 4054f8ff748f5add235c33bd3d1c3ae5fc4be0a9 Mon Sep 17 00:00:00 2001 From: nicholaskuechler Date: Mon, 16 Sep 2024 15:48:28 -0500 Subject: [PATCH] feat: Adds ironic IPA image build tools --- .github/workflows/build-ironic-images.yaml | 47 +++++++++++++++++++ ironic-images/README.md | 3 ++ .../install.d/50-sysctl-arp-ignore | 23 +++++++++ ironic-images/ipa-debian-bookworm/README.md | 4 ++ .../ipa-debian-bookworm.sh | 10 ++++ .../ipa-debian-bookworm.yaml | 7 +++ .../ipa-debian-bookworm/package-installs.yaml | 6 +++ ironic-images/requirements.txt | 4 ++ 8 files changed, 104 insertions(+) create mode 100644 .github/workflows/build-ironic-images.yaml create mode 100644 ironic-images/README.md create mode 100755 ironic-images/custom_elements/undercloud-ipa/install.d/50-sysctl-arp-ignore create mode 100644 ironic-images/ipa-debian-bookworm/README.md create mode 100755 ironic-images/ipa-debian-bookworm/ipa-debian-bookworm.sh create mode 100644 ironic-images/ipa-debian-bookworm/ipa-debian-bookworm.yaml create mode 100644 ironic-images/ipa-debian-bookworm/package-installs.yaml create mode 100644 ironic-images/requirements.txt diff --git a/.github/workflows/build-ironic-images.yaml b/.github/workflows/build-ironic-images.yaml new file mode 100644 index 00000000..97d1a7f3 --- /dev/null +++ b/.github/workflows/build-ironic-images.yaml @@ -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' }} diff --git a/ironic-images/README.md b/ironic-images/README.md new file mode 100644 index 00000000..a234fa75 --- /dev/null +++ b/ironic-images/README.md @@ -0,0 +1,3 @@ +# Undercloud Ironic Image Build + +The image build process is in github actions: `.github/workflows/build-ironic-images.yaml` diff --git a/ironic-images/custom_elements/undercloud-ipa/install.d/50-sysctl-arp-ignore b/ironic-images/custom_elements/undercloud-ipa/install.d/50-sysctl-arp-ignore new file mode 100755 index 00000000..e8892844 --- /dev/null +++ b/ironic-images/custom_elements/undercloud-ipa/install.d/50-sysctl-arp-ignore @@ -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 <