Skip to content

Merge pull request #280 from swatisehgal/e2e-test-explicit-address #68

Merge pull request #280 from swatisehgal/e2e-test-explicit-address

Merge pull request #280 from swatisehgal/e2e-test-explicit-address #68

Workflow file for this run

name: Release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
release:
runs-on: ubuntu-22.04
env:
RTE_CONTAINER_IMAGE: quay.io/k8stopologyawareschedwg/resource-topology-exporter
E2E_TOPOLOGY_MANAGER_POLICY: single-numa-node
E2E_TOPOLOGY_MANAGER_SCOPE: container
steps:
- name: checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup golang
uses: actions/setup-go@v4
id: go
with:
go-version: 1.21.7
- name: verify modules
run: go mod verify
- name: set release version env var
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: build test binary
run: |
make build-e2e
- name: build image
run: |
RTE_CONTAINER_IMAGE=${{ env.RTE_CONTAINER_IMAGE }}:${{ env.RELEASE_VERSION }} RUNTIME=docker make image
- name: generate manifests
run: |
mkdir _dist
RTE_CONTAINER_IMAGE=${{ env.RTE_CONTAINER_IMAGE }}:${{ env.RELEASE_VERSION }} RTE_POLL_INTERVAL=10s make gen-manifests | tee _dist/resource-topology-exporter-${{ env.RELEASE_VERSION }}.yaml
- name: create K8S kind cluster
run: |
# kind is part of 20.04 image, see: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
# see image listing in https://github.com/kubernetes-sigs/kind/releases/tag/v0.20.0
kind create cluster --config=hack/kind-config-e2e.yaml --image kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72
kind load docker-image ${{ env.RTE_CONTAINER_IMAGE }}:${{ env.RELEASE_VERSION }}
- name: deploy RTE
run: |
# TODO: what about the other workers (if any)?
kubectl label node kind-worker node-role.kubernetes.io/worker=''
kubectl create -f _dist/resource-topology-exporter-${{ env.RELEASE_VERSION }}.yaml
- name: cluster info
run: |
kubectl get nodes
kubectl get pods -A
kubectl describe pod -l name=resource-topology || :
kubectl logs -l name=resource-topology -c resource-topology-exporter-container || :
- name: cluster ready
run: |
hack/check-ds.sh
kubectl logs -l name=resource-topology -c resource-topology-exporter-container || :
kubectl get noderesourcetopologies.topology.node.k8s.io -A -o yaml
- name: run E2E tests
run: |
export KUBECONFIG=${HOME}/.kube/config
export E2E_DEVICE_NAME=
_out/rte-e2e.test -ginkgo.focus='\[release\]'
- name: compute signature
run: |
pushd _dist && sha256sum * >> ../SHA256SUMS && mv ../SHA256SUMS . && popd
- name: upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: _dist/*
- name: create release
uses: ncipollo/release-action@v1
with:
artifacts: "_dist/*"
token: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
- name: login to quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_ROBOTOKEN }}
- name: publish image
run: |
docker push ${{ env.RTE_CONTAINER_IMAGE }}:${{ env.RELEASE_VERSION }}
- name: export kind logs
if: ${{ failure() }}
run: |
kind export logs /tmp/kind-logs
- name: archive kind logs
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: kind-logs
path: /tmp/kind-logs