Compare commits

..
14 Commits
Author SHA1 Message Date
djpbessems da7448d814 build: Debug existing resources
build-image / Semantic Release (Dry-run) (push) Successful in 27s
build-image / Build image (push) Successful in 13m14s
2026-09-17 21:37:56 +10:00
djpbessems 7f612f8233 build: Configure newly uploaded repository file share link
build-image / Semantic Release (Dry-run) (push) Successful in 33s
build-image / Build image (push) Successful in 12m37s
2026-09-15 23:35:15 +10:00
djpbessems 94755aa890 build: Different upload path fieldname
build-image / Semantic Release (Dry-run) (push) Successful in 31s
build-image / Build image (push) Successful in 13m16s
2026-09-15 22:17:53 +10:00
djpbessems e05c079858 build: Add actual upload POST method
build-image / Semantic Release (Dry-run) (push) Successful in 28s
build-image / Build image (push) Failing after 12m20s
2026-09-15 21:05:41 +10:00
djpbessems 286e79ddab build: Revert tmp dir during sparsify
build-image / Semantic Release (Dry-run) (push) Successful in 1m6s
build-image / Build image (push) Failing after 12m36s
2026-09-15 14:32:40 +10:00
djpbessems 4a88c9568a build: Ignore virt-sparsify tmpdir check
build-image / Semantic Release (Dry-run) (push) Successful in 24s
build-image / Build image (push) Failing after 22m9s
2026-09-15 13:57:01 +10:00
djpbessems d329080765 build: Use generic kernel module without uname lookup
build-image / Semantic Release (Dry-run) (push) Successful in 23s
build-image / Build image (push) Failing after 8m8s
2026-09-15 13:38:16 +10:00
djpbessems 021b9851bd feat: Upgrade to 26.04 LTS
build-image / Semantic Release (Dry-run) (push) Successful in 1m2s
build-image / Build image (push) Failing after 36s
2026-09-15 13:27:24 +10:00
djpbessems b58831ea56 Update .gitea/workflows/actions.yaml
build-image / Semantic Release (Dry-run) (push) Successful in 31s
build-image / Build image (push) Successful in 11m25s
2025-11-15 02:17:38 +00:00
djpbessems 77c5a633ed Update cloud-init/user-data.template
build-image / Semantic Release (Dry-run) (push) Successful in 1m9s
build-image / Build image (push) Has been cancelled
2025-11-15 02:09:22 +00:00
djpbessems f3571105e8 chore: Test API call method
build-image / Semantic Release (Dry-run) (push) Successful in 2m0s
build-image / Build image (push) Successful in 15m40s
2025-09-05 07:29:17 +10:00
djpbessems 4312ac55fe build: Rebase act-runner container image
build-image / Semantic Release (Dry-run) (push) Successful in 50s
build-image / Build image (push) Successful in 26m13s
2025-08-20 10:05:01 +10:00
djpbessems 1d9e7c912a Update cloud-init/user-data.template
build-image / Semantic Release (Dry-run) (push) Successful in 2m41s
build-image / Build image (push) Successful in 20m30s
2025-08-07 07:50:49 +00:00
djpbessems f04226c147 build: Upload image artifact to repository/hypervisor
build-image / Semantic Release (Dry-run) (push) Successful in 38s
build-image / Build image (push) Successful in 16m33s
2025-07-30 21:07:19 +10:00
2 changed files with 65 additions and 28 deletions
+62 -27
View File
@@ -1,6 +1,10 @@
name: build-image
on: [push]
env:
UBUNTU_VERSION: '26.04' # Resolute
UBUNTU_SOURCE_IMAGE: https://st.itch.fyi/api/share/olYwWjZ17e?mode=download
jobs:
semrel_dryrun:
name: Semantic Release (Dry-run)
@@ -29,8 +33,6 @@ jobs:
--analyzeCommits @semantic-release/commit-analyzer \
--verifyRelease @semantic-release/exec \
--verifyReleaseCmd 'echo "version=${nextRelease.version}" >> $GITHUB_OUTPUT'
# env:
# GIT_CREDENTIALS: ${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_APIKEY }}
- name: Assert semantic release output
run: |
[[ -z "${{ steps.sem_rel.outputs.version }}" ]] && {
@@ -41,6 +43,7 @@ jobs:
build_image:
name: Build image
container: code.spamasaurus.com/djpbessems/act-runner-extended:1.0.0-cth20250815
runs-on: ubuntu-latest
needs: semrel_dryrun
steps:
@@ -50,15 +53,8 @@ jobs:
run: |
apt-get update && \
apt-get install -y \
gettext \
genisoimage \
libguestfs-tools \
linux-image-generic \
linux-modules-extra-$(uname -r) \
linux-headers-generic \
qemu-system-x86 \
qemu-utils \
supermin
linux-generic
# linux-modules-extra-$(uname -r) \
mkdir -p \
$PWD/ubuntu-vm \
@@ -66,11 +62,10 @@ jobs:
- name: Retrieve source Ubuntu image
run: |
curl -L \
https://sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2024.04/ubuntu-24.04-server-cloudimg-amd64.img \
-o ubuntu-vm/ubuntu_rke2_${{ needs.semrel_dryrun.outputs.version }}.img \
-u ${{ secrets.REPO_USERNAME }}:${{ secrets.REPO_PASSWORD }}
${{ env.UBUNTU_SOURCE_IMAGE }} \
-o ubuntu-vm/ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img
qemu-img resize ubuntu-vm/ubuntu_rke2_${{ needs.semrel_dryrun.outputs.version }}.img +5G
qemu-img resize ubuntu-vm/ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img +5G
- name: Generate seed ISO
run: |
envsubst < cloud-init/user-data.template > cloud-init/user-data
@@ -93,7 +88,7 @@ jobs:
-m 3072 \
-smp 2 \
-cpu host \
-drive file=ubuntu-vm/ubuntu_rke2_${{ needs.semrel_dryrun.outputs.version }}.img,if=virtio,format=qcow2 \
-drive file=ubuntu-vm/ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img,if=virtio,format=qcow2 \
-drive file=ubuntu-vm/seed.iso,format=raw,media=cdrom \
-nographic \
-net nic \
@@ -102,31 +97,71 @@ jobs:
-chardev socket,path=qga.sock,server=on,wait=off,id=qga0 \
-device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0
if ! guestfish --ro -a ubuntu-vm/ubuntu_rke2_${{ needs.semrel_dryrun.outputs.version }}.img -i stat /var/log/template-generation-success; then
if ! guestfish --ro -a ubuntu-vm/ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img -i stat /var/log/template-generation-success; then
echo "VM provisioning encountered errors - exiting"
exit 1
fi
- name: Upload template
- name: Compress image file
id: compress_image
run: |
curl -sS -X POST "https://lab-hv-vip.bessems.lan/v1/harvesterhci.io.virtualmachinetemplates" \
-H "Authorization: Bearer ${{ secrets.HV_TOKEN }}" \
-H "Content-Type: application/json" \
-d @- <<EOF
virt-sparsify --compress \
--check-tmpdir ignore \
ubuntu-vm/ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img \
ubuntu-vm/ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}-compacted.img
rm ubuntu-vm/ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img
echo "image_path=ubuntu-vm/ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}-compacted.img" | tee -a "$GITHUB_OUTPUT"
- name: Check for existing resources
run: |
curl -fsSL -X GET \
http://nextexplorer.nextexplorer.svc.cluster.local:3000/api/browse/Storage/Repository/rel/ || true
curl -ksS -X GET \
https://lab-hv-vip.bessems.lan/v1/harvesterhci.io.virtualmachineimages || true
- name: Upload image file
run: |
set -x
REPO_TOKEN=$(curl -fsiSL -X POST \
http://nextexplorer.nextexplorer.svc.cluster.local:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "${{ secrets.REPO_USERNAME }}", "password": "${{ secrets.REPO_PASSWORD }}"}' | \
grep -oP 'connect\.sid=[^;]+' | head -n 1
)
FILE_PATH="${{ steps.compress_image.outputs.image_path }}"
FILE_NAME="$(basename "$FILE_PATH" | sed 's/-compacted//')"
curl -fsSL -X POST \
http://nextexplorer.nextexplorer.svc.cluster.local:3000/api/upload \
--header "Cookie: $REPO_TOKEN" \
--form "uploadTo=/Storage/Repository/rel" \
--form "filedata=@${FILE_PATH};filename=${FILE_NAME}"
SHARE_URL=$(curl -fsSL -X POST \
http://nextexplorer.nextexplorer.svc.cluster.local:3000/api/shares \
--header "Content-Type: application/json" \
--header "Cookie: $REPO_TOKEN" \
-d '{"sourcePath":"Storage/Repository/rel/${FILE_NAME}"}' | \
jq -r '.directFileUrl'
)
curl -ksS -X POST \
https://lab-hv-vip.bessems.lan/v1/harvesterhci.io.virtualmachineimages \
--header "Authorization: Bearer ${{ secrets.HV_TOKEN }}" \
--header "Content-Type: application/json" \
-d @- <<EOF
{
"type": "harvesterhci.io.virtualmachineimage",
"metadata": {
"name": "ubuntu_rke2_${{ needs.semrel_dryrun.outputs.version }}",
"namespace": "default"
},
"spec": {
"displayName": "ubuntu_rke2_${{ needs.semrel_dryrun.outputs.version }}",
"sourceType": "upload"
"displayName": "$FILE_NAME",
"sourceType": "download",
"url": "$SHARE_URL?mode=download"
}
}
EOF
sleep 7200
# semrel:
# name: Semantic Release
# runs-on: ubuntu-latest
+3 -1
View File
@@ -6,12 +6,14 @@ snap:
00: snap refresh --hold=forever
package_reboot_if_required: true
packages:
- cifs-utils
- linux-generic
- qemu-guest-agent
- yq
- cifs-utils
runcmd:
- apt-get install -y linux-modules-extra-$(uname -r)
- sed -i '/"${distro_id}:${distro_codename}-updates"/s|^//||' /etc/apt/apt.conf.d/50unattended-upgrades
- sysctl -w net.ipv6.conf.all.disable_ipv6=1
- systemctl enable --now qemu-guest-agent.service
- cloud-init clean --logs