Skip to content

Commit

Permalink
Add workflows to test kube-burner on ppc64le (kube-burner#697)
Browse files Browse the repository at this point in the history
## Type of change

- [ ] Refactor
- [ ] New feature
- [ ] Bug fix
- [ ] Optimization
- [ ] Documentation Update

## Description

<!--- Describe your changes in detail -->
This PR adds workflow to test the kube-burner binary on the ppc64le
architecture, as a part of CI/release testing.
A dedicated VM for the project is available, I can work with @krishvoor
for the access and details for the broader team's usage.

## Related Tickets & Documents

- Closes kube-burner#646

Signed-off-by: Kishen V <[email protected]>
  • Loading branch information
kishen-v authored Sep 18, 2024
1 parent a5d87ba commit c7cf872
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 7 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/test-k8s-ppc64le.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Execute tests on k8s - PowerPC
on:
workflow_dispatch:

env:
K8S_VERSION: "v1.31.0"

jobs:
ocp-e2e-ci:
runs-on: PPC64LE

steps:
- name: Checkout the kube-burner repository
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
architecture: 'ppc64le'
# Disable caching to avoid error : Cannot open: File exists
# https://github.com/actions/setup-go/issues/314
cache: false


- name: Install bats
uses: bats-core/[email protected]
with:
bats-version: 1.11.0
support-install: false
assert-install: false
detik-install: false
file-install: false

- name: Install dependencies
run: sudo yum install git podman make wget jq -y

- name: Download kubectl binary
run: |
wget https://dl.k8s.io/${K8S_VERSION}/bin/linux/ppc64le/kubectl -O /tmp/kubectl --no-verbose
chmod +x /tmp/kubectl
- name: Build and install kube-burner binary.
run: |
make build
cp bin/ppc64le/kube-burner /tmp
- name: Build container images
run: make images
env:
VERSION: snapshot

- name: Execute tests
run: |
export PATH=${PATH}:/tmp/
make test-k8s
env:
TERM: linux

- name: Clean up
run: |
rm -rf ${{ github.workspace }}/*
rm -rf /tmp/tmp*
rm /tmp/kube-burner
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.PHONY: build lint clean test help images push manifest manifest-build all


ARCH ?= amd64
ARCH ?= $(shell uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)
BIN_NAME = kube-burner
BIN_DIR = bin
BIN_PATH = $(BIN_DIR)/$(ARCH)/$(BIN_NAME)
Expand Down
22 changes: 16 additions & 6 deletions test/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,35 @@
KIND_VERSION=${KIND_VERSION:-v0.19.0}
K8S_VERSION=${K8S_VERSION:-v1.27.0}
OCI_BIN=${OCI_BIN:-podman}
ARCH=$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)

setup-kind() {
KIND_FOLDER=$(mktemp -d)
echo "Downloading kind"
curl -LsS https://github.com/kubernetes-sigs/kind/releases/download/"${KIND_VERSION}"/kind-linux-amd64 -o ${KIND_FOLDER}/kind-linux-amd64
chmod +x ${KIND_FOLDER}/kind-linux-amd64
# Kind is currently unavailable for ppc64le architecture, it is required that the binary is built for usage.
if [[ "$ARCH" == "ppc64le" ]]
then
git clone --single-branch --filter=tree:0 --branch ${KIND_VERSION} https://github.com/kubernetes-sigs/kind.git
make -C kind/ install INSTALL_DIR="${KIND_FOLDER}" KIND_BINARY_NAME="kind-linux-${ARCH}"
IMAGE=quay.io/powercloud/kind-node:"${K8S_VERSION}"
else
curl -LsS https://github.com/kubernetes-sigs/kind/releases/download/"${KIND_VERSION}/kind-linux-${ARCH}" -o ${KIND_FOLDER}/kind-linux-${ARCH}
chmod +x ${KIND_FOLDER}/kind-linux-${ARCH}
IMAGE=kindest/node:"${K8S_VERSION}"
fi
echo "Deploying cluster"
${KIND_FOLDER}/kind-linux-amd64 create cluster --config kind.yml --image kindest/node:"${K8S_VERSION}" --name kind --wait 300s -v=1
"${KIND_FOLDER}/kind-linux-${ARCH}" create cluster --config kind.yml --image ${IMAGE} --name kind --wait 300s -v=1
}

create_test_kubeconfig() {
echo "Creating another kubeconfig"
"${KIND_FOLDER}"/kind-linux-amd64 export kubeconfig --kubeconfig "${TEST_KUBECONFIG}"
"${KIND_FOLDER}/kind-linux-${ARCH}" export kubeconfig --kubeconfig "${TEST_KUBECONFIG}"
kubectl config rename-context kind-kind "${TEST_KUBECONTEXT}" --kubeconfig "${TEST_KUBECONFIG}"
}

destroy-kind() {
echo "Destroying kind server"
"${KIND_FOLDER}"/kind-linux-amd64 delete cluster
echo "Destroying kind cluster"
"${KIND_FOLDER}/kind-linux-${ARCH}" delete cluster
}

setup-prometheus() {
Expand Down

0 comments on commit c7cf872

Please sign in to comment.