Skip to content

Commit

Permalink
Run conformance tests for Arm images in this repo
Browse files Browse the repository at this point in the history
This is a follow-up to #6486, which added support for building Antrea
Arm images in the antrea-io/antrea repo, using Github-hosted Arm
runners.

With this change, we will also be testing Arm images in this repo,
hence finishing to remove our dependency on a private reposiotry, with
self-hosted runners (vmware-tanzu/antrea-build-infra).

This change is very small, as we re-use the existing conformance.yml
workflow, and add a dispatch step to the build.yml and build_tag.yml
workflows (same repo dispatch, instead of dispatching to
vmware-tanzu/antrea-build-infra, as was the case previously). Using
Sonobuoy, we run the conformance test suite every time the main branch
is updated, as well as for every release. Unfortunately, we have to
re-build the image before running the tests, but thanks to caching it
only represents a small amount of time.

We also remove some deprecated maintainer documentation.

Fixes #6453

Signed-off-by: Antonin Bas <[email protected]>
  • Loading branch information
antoninbas committed Nov 20, 2024
1 parent ef1507b commit 580f7ab
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 56 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ jobs:
docker tag antrea/antrea-agent-ubuntu:"${DOCKER_TAG}" antrea/antrea-agent-ubuntu-${{ matrix.suffix }}:"${DOCKER_TAG}"
docker push antrea/antrea-controller-ubuntu-${{ matrix.suffix }}:"${DOCKER_TAG}"
docker push antrea/antrea-agent-ubuntu-${{ matrix.suffix }}:"${DOCKER_TAG}"
# Same repository workflow dispatch to run conformance tests
- name: Run conformance tests
if: ${{ needs.check-env.outputs.push_needed == 'true' }}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: .github/workflows/conformance.yml
inputs: ${{ format('{{ "antrea-version":"{0}", "antrea-image-distro":"ubuntu", "test-suite":"conformance", "runner":"{1}", "antrea-image-platform":"{2}" }}', github.sha, matrix.runner, matrix.platform) }}

push-manifest:
needs: [check-env, build]
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/build_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,12 @@ jobs:
antrea/antrea-agent-ubuntu-arm:"${DOCKER_TAG}" \
antrea/antrea-agent-ubuntu-amd64:"${DOCKER_TAG}"
docker manifest push --purge antrea/antrea-agent-ubuntu:"${DOCKER_TAG}"
- name: Trigger Antrea arm tests
# Same repository workflow dispatch to run conformance tests
- name: Run conformance tests
uses: benc-uk/workflow-dispatch@v1
with:
repo: vmware-tanzu/antrea-build-infra
ref: refs/heads/main
workflow: Test Antrea ARM images
token: ${{ secrets.ANTREA_BUILD_INFRA_WORKFLOW_DISPATCH_PAT }}
inputs: ${{ format('{{ "antrea-repository":"antrea-io/antrea", "antrea-ref":"{0}", "docker-tag":"{1}" }}', github.ref, env.DOCKER_TAG) }}
workflow: .github/workflows/conformance.yml
inputs: ${{ format('{{ "antrea-version":"{0}", "antrea-image-distro":"ubuntu", "test-suite":"conformance", "runner":"{1}", "antrea-image-platform":"{2}", "always-upload-logs":true }}', github.ref, matrix.runner, matrix.platform) }}

build-ubi:
runs-on: [ubuntu-latest]
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ on:
description: Always upload logs regardless of the test result.
type: boolean
default: false
runner:
description: The Github runner to use for the workflow
default: ubuntu-latest
antrea-image-platform:
description: Platform argument to provide when building the Antrea images
default: "linux/amd64"


jobs:
test:
name: Run tests
runs-on: [ubuntu-latest]
runs-on: ${{ inputs.runner }}
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
Expand Down Expand Up @@ -70,13 +76,17 @@ jobs:
- name: Build Antrea image if required
if: ${{ steps.check-release.outputs.released == 'false' }}
run: |
./hack/build-antrea-linux-all.sh --pull --distro ${{ inputs.antrea-image-distro }}
- name: Install Kind
./hack/build-antrea-linux-all.sh --pull --distro ${{ inputs.antrea-image-distro }} --platform ${{ inputs.antrea-image-platform }}
- name: Get Kind version
id: get_kind_version
run: |
KIND_VERSION=$(head -n1 ./ci/kind/version || echo v0.23.0)
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
echo "kind_version=${KIND_VERSION}" >> $GITHUB_OUTPUT
- name: Install Kind
uses: helm/kind-action@v1
with:
version: ${{ steps.get_kind_version.outputs.kind_version }}
install_only: true
- name: Build local image for conformance test
if: ${{ inputs.k8s-version != '' }}
run: |
Expand Down
44 changes: 0 additions & 44 deletions docs/maintainers/antrea-docker-image.md

This file was deleted.

0 comments on commit 580f7ab

Please sign in to comment.