Skip to content

Commit

Permalink
ci: use correct os_distro
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaser committed Sep 29, 2023
1 parent c7dbb34 commit 5f7c715
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,16 @@ jobs:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-2204
os_distro:
- ubuntu
- flatcar
kube:
- v1.24.16
- v1.25.12
- v1.26.7
- v1.27.4
concurrency:
group: build-images-${{ github.ref }}-${{ matrix.kube }}-${{ matrix.os }}
group: build-images-${{ github.ref }}-${{ matrix.kube }}-${{ matrix.os_distro }}
cancel-in-progress: true
steps:
- name: Checkout project
Expand All @@ -172,23 +172,23 @@ jobs:
timeout-minutes: 30
run: |
magnum-cluster-api-image-builder \
--operating-system ${{ matrix.os }} \
--operating-system ${{ matrix.os_distro }} \
--version ${{ matrix.kube }}
env:
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload built image
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-kube-${{ matrix.kube }}.qcow2
path: ${{ matrix.os }}-kube-${{ matrix.kube }}.qcow2
name: ${{ matrix.os_distro }}-kube-${{ matrix.kube }}.qcow2
path: ${{ matrix.os_distro }}-kube-${{ matrix.kube }}.qcow2

functional:
runs-on: ubuntu-latest-16-cores
strategy:
fail-fast: false
matrix:
os:
os_distro:
# - ubuntu-2204
- flatcar
kube:
Expand All @@ -197,7 +197,7 @@ jobs:
# - v1.26.7
- v1.27.4
concurrency:
group: functional-${{ github.ref }}-${{ matrix.kube }}-${{ matrix.os }}
group: functional-${{ github.ref }}-${{ matrix.kube }}-${{ matrix.os_distro }}
cancel-in-progress: true
steps:
- name: Checkout project
Expand All @@ -223,22 +223,22 @@ jobs:
uses: lewagon/wait-on-check-action@v1.3.1
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: "build-images (${{ matrix.os }}, ${{ matrix.kube }})"
check-name: "build-images (${{ matrix.os_distro }}, ${{ matrix.kube }})"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

- name: Download built image
if: contains(github.event.pull_request.body, '/build-new-image')
uses: actions/download-artifact@v3
with:
name: ${{ matrix.os }}-kube-${{ matrix.kube }}.qcow2
name: ${{ matrix.os_distro }}-kube-${{ matrix.kube }}.qcow2

- name: Run functional tests
run: |
./hack/run-functional-tests.sh
env:
BUILD_NEW_IMAGE: "${{ contains(github.event.pull_request.body, '/build-new-image') }}"
OS: "${{ matrix.os }}"
OS_DISTRO: "${{ matrix.os_distro }}"
KUBE_TAG: "${{ matrix.kube }}"
NODE_COUNT: 2

Expand Down
10 changes: 6 additions & 4 deletions hack/run-functional-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@

source /opt/stack/openrc

OS=${OS:-ubuntu-2204}
OS_DISTRO=${OS_DISTRO:-ubuntu}
NODE_COUNT=${NODE_COUNT:-2}
SONOBUOY_VERSION=${SONOBUOY_VERSION:-0.56.16}
SONOBUOY_ARCH=${SONOBUOY_ARCH:-amd64}
DNS_NAMESERVER=${DNS_NAMESERVER:-1.1.1.1}

# Determine image name
[[ "${OS_DISTRO}" == "ubuntu" ]] && IMAGE_NAME="ubuntu-2204-kube-${version}" || IMAGE_NAME="flatcar-kube-${version}";

# If running inside GitHub Actions, use Azure's "168.63.129.16" for DNS
if [[ -n "${GITHUB_ACTIONS}" ]]; then
DNS_NAMESERVER=168.63.129.16
Expand All @@ -34,15 +37,14 @@ fi
# If `BUILD_NEW_IMAGE` is true, then we use the provided artifact, otherwise
# we download the latest promoted image.
if [[ "${BUILD_NEW_IMAGE}" != "true" ]]; then
curl -LO https://object-storage.public.mtl1.vexxhost.net/swift/v1/a91f106f55e64246babde7402c21b87a/magnum-capi/${OS}-kube-${KUBE_TAG}.qcow2
curl -LO https://object-storage.public.mtl1.vexxhost.net/swift/v1/a91f106f55e64246babde7402c21b87a/magnum-capi/${IMAGE_NAME}.qcow2
fi

# Upload image to Glance
IMAGE_NAME=${OS}-kube-${KUBE_TAG}
openstack image create \
--disk-format=qcow2 \
--container-format=bare \
--property os_distro=ubuntu \
--property os_distro=${OS_DISTRO} \
--file=${IMAGE_NAME}.qcow2 \
${IMAGE_NAME}

Expand Down

0 comments on commit 5f7c715

Please sign in to comment.