Files
diskless-workstation/.gitea/workflows/spdk-image.yaml
T
2026-06-14 05:58:55 +00:00

78 lines
2.4 KiB
YAML

#
# .gitea/workflows/spdk-image.yaml
#
# Builds the SPDK NVMe/TCP target image (serving stack) from serving/spdk and
# pushes it to the registry, so serving hosts just `docker compose pull` it.
# There is no official spdk/spdk image to pull, so we compile a pinned release
# once here (slow: ~10-20 min, needs a runner with enough CPU/RAM/disk).
#
# Runs only when the SPDK image inputs change (path filter) or on demand — not
# on every commit. Bump SPDK_VERSION (or use the manual run input) to roll SPDK.
#
# Required Gitea repo secrets: PACKAGE_USER, PACKAGE_TOKEN (registry creds).
#
name: Build SPDK NVMe-oF image
run-name: ${{ gitea.actor }} builds the SPDK NVMe/TCP target image
on:
push:
branches:
- "main"
paths:
- "serving/spdk/**"
- ".gitea/workflows/spdk-image.yaml"
workflow_dispatch:
inputs:
spdk_version:
description: "SPDK release tag (https://github.com/spdk/spdk/releases)"
required: false
default: "v24.09"
env:
SPDK_IMAGE: "git.bitasylum.org/audiobuzz/spdk-nvmf"
SPDK_VERSION: "v24.09" # default tag for push-triggered builds
jobs:
spdk-build:
name: Build & push SPDK image
runs-on: ubuntu-latest
container:
image: git.bitasylum.org/audiobuzz/ubuntu-act-runner-qemu:main
steps:
-
name: Checkout
uses: actions/checkout@v6
-
name: Install buildah
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends buildah
-
name: Registry login
run: |
buildah login \
--username "${{ secrets.PACKAGE_USER }}" \
--password "${{ secrets.PACKAGE_TOKEN }}" \
git.bitasylum.org
-
name: Build & push
# vfs storage (overlay-on-overlayfs is unsupported in-container) and
# chroot isolation (so the Dockerfile's RUN/compile steps work without
# nested user namespaces).
env:
STORAGE_DRIVER: vfs
BUILDAH_ISOLATION: chroot
run: |
VER="${{ inputs.spdk_version || env.SPDK_VERSION }}"
echo "Building ${SPDK_IMAGE}:${VER}"
buildah bud \
--build-arg SPDK_VERSION="$VER" \
-t "${SPDK_IMAGE}:${VER}" \
-t "${SPDK_IMAGE}:latest" \
serving/spdk
buildah push "${SPDK_IMAGE}:${VER}"
buildah push "${SPDK_IMAGE}:latest"