Skip to content

Commit

Permalink
Add Ubuntu 24.04 to pipelines
Browse files Browse the repository at this point in the history
And introduce reusable test for uki

Signed-off-by: Mauro Morales <[email protected]>
  • Loading branch information
mauromorales committed Apr 8, 2024
1 parent 27d1c83 commit 23c35a4
Show file tree
Hide file tree
Showing 9 changed files with 207 additions and 325 deletions.
30 changes: 30 additions & 0 deletions .github/flavors.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,36 @@
"arch": "arm64",
"worker": "ubuntu-latest"
},
{
"family": "ubuntu",
"flavor": "ubuntu",
"flavorRelease": "24.04",
"variant": "standard",
"model": "generic",
"baseImage": "ubuntu:24.04",
"arch": "amd64",
"worker": "self-hosted"
},
{
"family": "ubuntu",
"flavor": "ubuntu",
"flavorRelease": "24.04",
"variant": "core",
"model": "generic",
"baseImage": "ubuntu:24.04",
"arch": "amd64",
"worker": "self-hosted"
},
{
"family": "ubuntu",
"flavor": "ubuntu",
"flavorRelease": "24.04",
"variant": "core",
"model": "generic",
"baseImage": "ubuntu:24.04",
"arch": "arm64",
"worker": "ubuntu-latest"
},
{
"family": "alpine",
"flavor": "alpine",
Expand Down
52 changes: 26 additions & 26 deletions .github/workflows/image-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ concurrency:
env:
FORCE_COLOR: 1
jobs:
core:
core-ubuntu-22-lts:
uses: ./.github/workflows/reusable-build-flavor.yaml
with:
flavor: ubuntu
flavor_release: "23.10"
flavor_release: "22.04"
family: ubuntu
base_image: ubuntu:23.10
base_image: ubuntu:22.04
model: generic
variant: core
arch: amd64

core-ubuntu-lts:
core-ubuntu-24-lts:
uses: ./.github/workflows/reusable-build-flavor.yaml
with:
flavor: ubuntu
flavor_release: "22.04"
flavor_release: "24.04"
family: ubuntu
base_image: ubuntu:22.04
base_image: ubuntu:24.04
model: generic
variant: core
arch: amd64
Expand Down Expand Up @@ -58,19 +58,19 @@ jobs:
uses: ./.github/workflows/reusable-install-test.yaml
with:
flavor: ubuntu
flavor_release: "23.10"
flavor_release: "24.04"
secureboot: false
needs:
- core
- core-ubuntu-24-lts

install-secureboot:
uses: ./.github/workflows/reusable-install-test.yaml
with:
flavor: ubuntu
flavor_release: "23.10"
flavor_release: "24.04"
secureboot: true
needs:
- core
- core-ubuntu-24-lts

install-alpine:
uses: ./.github/workflows/reusable-install-test.yaml
Expand All @@ -86,15 +86,15 @@ jobs:
flavor: ubuntu
flavor_release: "22.04"
needs:
- core-ubuntu-lts
- core-ubuntu-22-lts

acceptance:
uses: ./.github/workflows/reusable-qemu-acceptance-test.yaml
with:
flavor: ubuntu
flavor_release: "23.10"
flavor_release: "24.04"
needs:
- core
- core-ubuntu-24-lts

acceptance-alpine:
uses: ./.github/workflows/reusable-qemu-acceptance-test.yaml
Expand All @@ -108,17 +108,17 @@ jobs:
uses: ./.github/workflows/reusable-qemu-bundles-test.yaml
with:
flavor: ubuntu
flavor_release: "23.10"
flavor_release: "24.04"
needs:
- core
- core-ubuntu-24-lts

reset:
uses: ./.github/workflows/reusable-qemu-reset-test.yaml
with:
flavor: ubuntu
flavor_release: "23.10"
flavor_release: "24.04"
needs:
- core
- core-ubuntu-24-lts

reset-alpine:
uses: ./.github/workflows/reusable-qemu-reset-test.yaml
Expand All @@ -132,13 +132,13 @@ jobs:
uses: ./.github/workflows/reusable-qemu-netboot-test.yaml
with:
flavor: ubuntu
flavor_release: "23.10"
flavor_release: "24.04"
family: ubuntu
base_image: ubuntu:23.10
base_image: ubuntu:24.04
model: generic
variant: core
needs:
- core
- core-ubuntu-24-lts

netboot-alpine:
uses: ./.github/workflows/reusable-qemu-netboot-test.yaml
Expand All @@ -156,9 +156,9 @@ jobs:
uses: ./.github/workflows/reusable-upgrade-with-cli-test.yaml
with:
flavor: ubuntu
flavor_release: "23.10"
flavor_release: "24.04"
needs:
- core
- core-ubuntu-24-lts

upgrade-alpine:
uses: ./.github/workflows/reusable-upgrade-with-cli-test.yaml
Expand All @@ -172,11 +172,11 @@ jobs:
uses: ./.github/workflows/reusable-upgrade-latest-test.yaml
with:
flavor: ubuntu
flavor_release: "23.10"
flavor_release: "24.04"
family: "ubuntu"
release_matcher: "23.10" # introduced so tests can be green while we wait for the kairos release with the latest flavor release
needs:
- core
- core-ubuntu-24-lts

# enable once the first alpine only release is out as it currently cannot find the latest alpine release properly
#upgrade-latest-alpine:
Expand All @@ -191,10 +191,10 @@ jobs:
uses: ./.github/workflows/reusable-encryption-test.yaml
with:
flavor: ubuntu
flavor_release: "23.10"
flavor_release: "24.04"
label: ${{ matrix.label }}
needs:
- core
- core-ubuntu-24-lts
strategy:
fail-fast: true
matrix:
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ jobs:
flavorRelease: "22.04"
- flavor: "ubuntu"
flavorRelease: "23.10"
- flavor: "ubuntu"
flavorRelease: "24.04"
- flavor: "fedora"
flavorRelease: "39"
zfs:
Expand Down Expand Up @@ -119,14 +121,16 @@ jobs:
flavorRelease: "leap-15.5"
- flavor: "opensuse"
flavorRelease: "tumbleweed"
- flavor: "ubuntu"
flavorRelease: "23.10"
- flavor: "debian"
flavorRelease: "testing"
- flavor: "ubuntu"
flavorRelease: "20.04"
- flavor: "ubuntu"
flavorRelease: "22.04"
- flavor: "ubuntu"
flavorRelease: "23.10"
- flavor: "ubuntu"
flavorRelease: "24.04"
bundles:
uses: ./.github/workflows/reusable-qemu-bundles-test.yaml
with:
Expand Down Expand Up @@ -196,6 +200,12 @@ jobs:
variant: core
model: generic
baseImage: ubuntu:23.10
- flavor: ubuntu
flavorRelease: "24.04"
family: ubuntu
variant: core
model: generic
baseImage: ubuntu:24.04
upgrade:
uses: ./.github/workflows/reusable-upgrade-with-cli-test.yaml
with:
Expand Down Expand Up @@ -277,6 +287,10 @@ jobs:
flavorRelease: "23.10"
family: ubuntu
baseImage: ubuntu:23.10
- flavor: ubuntu
flavorRelease: "24.04"
family: ubuntu
baseImage: ubuntu:24.04
various:
uses: ./.github/workflows/reusable-provider-tests.yaml
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
sudo apt update && sudo apt install -y jq
- id: set-matrix
run: |
content=`cat ./.github/flavors.json | jq -r 'map(select(.arch == "amd64" and .variant == "core" and (.flavor == "fedora" or (.flavor == "ubuntu" and .flavorRelease == "23.10"))))'`
content=`cat ./.github/flavors.json | jq -r 'map(select(.arch == "amd64" and .variant == "core" and (.flavor == "fedora" or (.flavor == "ubuntu" and (.flavorRelease == "23.10" or .flavorRelease == "24.04")))))'`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/reusable-uki-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Reusable UKI test

on:
workflow_call:
inputs:
base_image:
required: true
type: string
family:
required: true
type: string
flavor:
required: true
type: string
flavor_release:
required: true
type: string

jobs:
test-uki:
runs-on: kvm
env:
FLAVOR: ${{ inputs.flavor }}
FLAVOR_RELEASE: ${{ inputs.flavor_release }}
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: tests/go.mod
cache-dependency-path: tests/go.sum
- name: Enable KVM group perms
run: |
sudo apt-get update
sudo apt-get install -y libvirt-clients libvirt-daemon-system libvirt-daemon virtinst bridge-utils qemu qemu-system-x86 qemu-system-x86 qemu-utils qemu-kvm acl udev
# https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
# sudo udevadm control --reload-rules
# sudo udevadm trigger --name-match=kvm
# sudo usermod -a -G kvm,libvirt $USER
#
# TODO: Switch back to the above solution when we switch to the github runners
# https://askubuntu.com/a/1081326
sudo setfacl -m u:runner:rwx /dev/kvm
- name: Install earthly
uses: Luet-lab/[email protected]
with:
repository: quay.io/kairos/packages
packages: utils/earthly
- name: Build base image 🔧
run: | # known flavors to work with uki+encryption: fedora >= 38, ubuntu >= 23.10, anything with systemd 253
earthly +base-image \
--FLAVOR=${{ inputs.flavor }} \
--FLAVOR_RELEASE=${{ inputs.flavor_release }} \
--FAMILY=${{ inputs.family }} \
--MODEL=generic \
--VARIANT=core \
--BASE_IMAGE=${{ inputs.base_image }}
- name: Push image to ttl.sh
env:
TEMP_IMAGE: ttl.sh/${{ inputs.flavor }}-${{ inputs.flavor_release}}-${{ github.head_ref || github.ref }}:24h
run: |
docker tag $(cat build/IMAGE) $TEMP_IMAGE
docker push $TEMP_IMAGE
- name: Build uki ISO 🔧
run: |
earthly +uki-iso \
--BASE_IMAGE=ttl.sh/${{ inputs.flavor }}-${{ inputs.flavor_release }}-${{ github.head_ref || github.ref }}:24h \
--ENKI_CREATE_CI_KEYS=true
- name: Create datasource iso 🔧
run: |
earthly +datasource-iso --CLOUD_CONFIG=tests/assets/uki-install.yaml
- name: Run tests 🔧
env:
USE_QEMU: true
KVM: true
MEMORY: 4000
CPUS: 2
FIRMWARE: /usr/share/OVMF/OVMF_CODE.fd
EMULATE_TPM: true
UKI_TEST: true
run: |
export ISO=$(ls $PWD/build/kairos_*.iso)
export DATASOURCE=${PWD}/build/datasource.iso
cp tests/go.* .
go run github.com/onsi/ginkgo/v2/ginkgo -v --label-filter "uki" --fail-fast -r ./tests/
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ env.FLAVOR }}-${{ env.FLAVOR_RELEASE }}.logs.zip
path: tests/**/logs/*
if-no-files-found: warn
Loading

0 comments on commit 23c35a4

Please sign in to comment.