Skip to content

Build Arm images from this repo using Github-hosted Arm runners #9

Build Arm images from this repo using Github-hosted Arm runners

Build Arm images from this repo using Github-hosted Arm runners #9

Workflow file for this run

name: Build and push a release image
on:
push:
tags:
- v*
jobs:
get-version:
runs-on: [ubuntu-latest]
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Extract version from Github ref
id: get-version
env:
TAG: ${{ github.ref }}
run: |
version=${TAG:10}
echo "version=$version" >> $GITHUB_OUTPUT
build:
needs: get-version
strategy:
include:
- platform: linux/amd64
runner: ubuntu-latest
suffix: amd64
- platform: linux/arm64
runner: github-arm64-2c-8gb
suffix: arm64
- platform: linux/arm/v7
runner: github-arm64-2c-8gb
suffix: arm
runs-on: ${{ matrix.runner }}
env:
DOCKER_TAG: ${{ needs.get-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Build and push Antrea Ubuntu Docker image to registry
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
./hack/build-antrea-linux-all.sh --platform ${{ matrix.platform }} --pull
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker tag antrea/antrea-agent-ubuntu:"${DOCKER_TAG}" antrea/antrea-agent-ubuntu-${{ matrix.suffix }}:"${DOCKER_TAG}"
docker tag antrea/antrea-controller-ubuntu:"${DOCKER_TAG}" antrea/antrea-controller-ubuntu-${{ matrix.suffix }}:"${DOCKER_TAG}"
docker push antrea/antrea-agent-ubuntu-${{ matrix.suffix }}:"${DOCKER_TAG}"
docker push antrea/antrea-controller-ubuntu-${{ matrix.suffix }}:"${DOCKER_TAG}"
push-manifest:
needs: build
runs-on: ubuntu-latest
env:
DOCKER_TAG: ${{ needs.get-version.outputs.version }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker login
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- name: Create and push manifest for controller image
run: |
docker manifest create antrea/antrea-controller-ubuntu:"${DOCKER_TAG}" \
antrea/antrea-controller-ubuntu-arm64:"${DOCKER_TAG}" \
antrea/antrea-controller-ubuntu-arm:"${DOCKER_TAG}" \
antrea/antrea-controller-ubuntu-amd64:"${DOCKER_TAG}"
docker manifest push --purge antrea/antrea-controller-ubuntu:"${DOCKER_TAG}"
- name: Create and push manifest for agent image
docker manifest create antrea/antrea-agent-ubuntu:"${DOCKER_TAG}" \
antrea/antrea-agent-ubuntu-arm64:"${DOCKER_TAG}" \
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
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, needs.get-version.outputs.version) }}
build-ubi:
runs-on: [ubuntu-latest]
needs: get-version
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Antrea UBI9 amd64 Docker image to registry
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
VERSION: ${{ needs.get-version.outputs.version }}
run: |
./hack/build-antrea-linux-all.sh --pull --distro ubi
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push antrea/antrea-agent-ubi:"${VERSION}"
docker push antrea/antrea-controller-ubi:"${VERSION}"
build-windows:
runs-on: [ubuntu-latest]
needs: get-version
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Build Antrea Windows Docker image and push to registry
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
VERSION: ${{ needs.get-version.outputs.version }}
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
./hack/build-antrea-windows-all.sh --pull --push
shell: bash
build-antrea-mc-controller:
runs-on: [ubuntu-latest]
needs: get-version
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Build antrea-mc-controller Docker image and push to registry
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
VERSION: ${{ needs.get-version.outputs.version }}
run: |
make build-antrea-mc-controller
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push antrea/antrea-mc-controller:"${VERSION}"
build-flow-aggregator:
runs-on: [ubuntu-latest]
needs: get-version
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Build flow-aggregator Docker image and push to registry
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
VERSION: ${{ needs.get-version.outputs.version }}
run: |
make flow-aggregator-image
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push antrea/flow-aggregator:"${VERSION}"