Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-s3-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install build dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y podman podman-compose bmap-tools pigz
sudo apt-get install -y podman podman-compose bmap-tools pigz qemu-utils

- name: Make image generator executable
run: chmod +x .release/generate_images.sh
Expand Down
28 changes: 26 additions & 2 deletions .github/workflows/ci-build13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install build dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y podman podman-compose bmap-tools pigz
sudo apt-get install -y podman podman-compose bmap-tools pigz qemu-utils

- name: Make ci_build.sh executable (if needed)
run: chmod +x .release/generate_images.sh
Expand All @@ -37,6 +37,22 @@ jobs:
.release/generate_images.sh --tag ci
shell: bash

- name: Upload hypervisor image artifact
uses: actions/upload-artifact@v7
with:
name: hypervisor-image
path: release-files/*virtual-cluster*.qcow2
if-no-files-found: error
retention-days: 1

- name: Upload VM image artifact
uses: actions/upload-artifact@v7
with:
name: vm-image
path: release-files/*guest*.qcow2
if-no-files-found: error
retention-days: 1

- name: Collect FAI logs on failure
if: failure()
run: |
Expand All @@ -45,11 +61,19 @@ jobs:

- name: Upload FAI logs
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: fai-logs-${{ github.run_id }}
path: fai-logs.tar.gz
if-no-files-found: ignore

- name: Check exit code
run: echo "Script exited successfully!"
test-virtual-cluster:
needs: CI-build
uses: paullgk/virtual-cluster/.github/workflows/debian-setup.yml@main
with:
hypervisor_image_url: /tmp/images/hypervisor.qcow2
hypervisor_image_filename: seapath-ci-generic-virtual-cluster.rootfs.raw.qcow2
vm_image_url: /tmp/images/vm.qcow2
vm_image_filename: seapath-ci-guest.qcow2
22 changes: 15 additions & 7 deletions .release/generate_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,34 @@ QCOW="seapath-${VERSION}-guest.qcow2"
STANDALONE="seapath-${VERSION}-generic-standalone.rootfs"
CLUSTER="seapath-${VERSION}-generic-cluster.rootfs"
OBSERVER="seapath-${VERSION}-generic-observer.rootfs"
VIRTUAL_HYPERVISOR="seapath-${VERSION}-generic-virtual-cluster.rootfs"

build_role() {
local role="$1"
local base="$2"
shift 2
./generate_seapath_image.sh "$role" "$@"
mv -f seapath.raw.gz "${base}.raw.gz"
mv -f seapath.raw.bmap "${base}.raw.bmap"

if [ "$role" == "virtual-hypervisor" ]; then
mv -f seapath.raw.qcow2 "${base}.raw.qcow2"
else
mv -f seapath.raw.gz "${base}.raw.gz"
mv -f seapath.raw.bmap "${base}.raw.bmap"
fi
}

mkdir -p release-files/

./build_iso.sh
mv -f seapath.iso release-files/"$ISO"
# ./build_iso.sh
# mv -f seapath.iso release-files/"$ISO"

./build_qcow2.sh
mv -f seapath-vm.qcow2 release-files/"$QCOW"

build_role standalone release-files/"$STANDALONE" -c
build_role cluster release-files/"$CLUSTER" -c --ceph-disk
build_role observer release-files/"$OBSERVER" -c
# build_role standalone release-files/"$STANDALONE" -c
# build_role cluster release-files/"$CLUSTER" -c --ceph-disk
# build_role observer release-files/"$OBSERVER" -c
build_role virtual-hypervisor release-files/"$VIRTUAL_HYPERVISOR" -c --ceph-disk

if $PUBLISH; then
gh release upload "$TAG" \
Expand All @@ -116,5 +123,6 @@ if $PUBLISH; then
release-files/"${CLUSTER}.raw.bmap" \
release-files/"${OBSERVER}.raw.gz" \
release-files/"${OBSERVER}.raw.bmap" \
release-files/"$VIRTUAL_HYPERVISOR" \
--clobber
fi
35 changes: 22 additions & 13 deletions generate_seapath_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ print_usage() {
echo " standalone Generate a standalone hypervisor image"
echo " cluster Generate a hypervisor image for cluster deployment"
echo " observer Generate a cluster observer node image"
echo " virtual-hypervisor Generate a qcow2 virtual hypervisor image "
echo ""
echo "Options:"
echo " -h, --help Display this help message"
Expand Down Expand Up @@ -141,10 +142,10 @@ while true; do
fi
;;
--ceph-disk)
if [ "$ROLE" == "cluster" ]; then
if [ "$ROLE" == "cluster" ] || [ "$ROLE" == "virtual-hypervisor" ]; then
CEPH_DISK=true
else
echo "Warning: --ceph-disk option is only applicable for 'cluster' role. Ignoring." >&2
echo "Warning: --ceph-disk option is only applicable for 'cluster' and 'virtual-hypervisor' roles. Ignoring." >&2
fi
shift
;;
Expand Down Expand Up @@ -174,17 +175,17 @@ while true; do
esac
done

if [[ "$ROLE" != "standalone" && "$ROLE" != "cluster" && "$ROLE" != "observer" ]]; then
if [[ "$ROLE" != "standalone" && "$ROLE" != "cluster" && "$ROLE" != "observer" && "$ROLE" != "virtual-hypervisor" ]]; then
echo "Error: Invalid role specified: $ROLE" >&2
exit 1
fi

IFS=','
CLASSES=(FAIBASE DEBIAN GRUB_EFI SEAPATH_COMMON)
if [ "$ROLE" == "standalone" ] || [ "$ROLE" == "cluster" ]; then
if [ "$ROLE" == "standalone" ] || [ "$ROLE" == "cluster" ] || [ "$ROLE" == "virtual-hypervisor" ]; then
CLASSES+=("SEAPATH_HOST")
fi
if [ "$ROLE" == "cluster" ] || [ "$ROLE" == "observer" ]; then
if [ "$ROLE" == "cluster" ] || [ "$ROLE" == "observer" ] || [ "$ROLE" == "virtual-hypervisor" ]; then
CLASSES+=("SEAPATH_CLUSTER")
fi
if [ "$COCKPIT" = true ]; then
Expand Down Expand Up @@ -323,16 +324,24 @@ sudo chown -R "$(id -u):$(id -g)" "$output_dir/"*
# Clean the build directory
sudo rm -rf "$ext_dir"

if command -v bmaptool >/dev/null ; then
if [ "$ROLE" == "virtual-hypervisor" ]; then
qemu-img convert \
-f raw -O qcow2 \
-S 4k \
-o preallocation=off,lazy_refcounts=on,compat=1.1 \
"$output_dir/${OUTPUT}" "$output_dir/${OUTPUT}.qcow2"

bmaptool create -o "$output_dir/${OUTPUT}.bmap" "$output_dir/${OUTPUT}"
else
if command -v bmaptool >/dev/null ; then

bmaptool create -o "$output_dir/${OUTPUT}.bmap" "$output_dir/${OUTPUT}"

if command -v pigz >/dev/null ; then
pigz "$output_dir/${OUTPUT}"
else
gzip "$output_dir/${OUTPUT}"
if command -v pigz >/dev/null ; then
pigz "$output_dir/${OUTPUT}"
else
gzip "$output_dir/${OUTPUT}"
fi
generate_seapath_metadata
fi
generate_seapath_metadata
fi

echo "SEAPATH image generation completed."
Loading