Skip to content

Commit 7608449

Browse files
author
Paulo Gomes
committed
Add arm64 test ci tests
Signed-off-by: Paulo Gomes <[email protected]>
1 parent a76cef6 commit 7608449

File tree

3 files changed

+59
-8
lines changed

3 files changed

+59
-8
lines changed

.github/actions/run-tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG GO_VERSION=1.17.5
33
ARG XX_VERSION=1.1.0
44

55
ARG LIBGIT2_IMG=ghcr.io/fluxcd/golang-with-libgit2
6-
ARG LIBGIT2_TAG=libgit2-1.1.1-1
6+
ARG LIBGIT2_TAG=sha-a926b575d640a7f99876f0d1768179f6b586d816
77

88
FROM tonistiigi/xx:${XX_VERSION} AS xx
99
FROM ${LIBGIT2_IMG}:${LIBGIT2_TAG} as libgit2

.github/workflows/e2e.yaml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ on:
77
- main
88

99
jobs:
10-
kind:
10+
11+
kind-linux-amd64:
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Checkout
@@ -48,3 +49,35 @@ jobs:
4849
MINIO_VER: ${{ 'v6.3.1' }}
4950
CREATE_CLUSTER: false
5051
run: make e2e
52+
53+
kind-linux-arm64:
54+
# Hosted on Equinix
55+
# Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
56+
runs-on: [self-hosted, Linux, ARM64, equinix]
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v2
60+
- name: Setup Go
61+
uses: actions/setup-go@v2
62+
with:
63+
go-version: 1.16.x
64+
- name: Prepare
65+
id: prep
66+
run: |
67+
echo ::set-output name=CLUSTER::arm64-${GITHUB_SHA:0:7}-$(date +%s)
68+
echo ::set-output name=CONTEXT::kind-arm64-${GITHUB_SHA:0:7}-$(date +%s)
69+
- name: Setup Kubernetes Kind
70+
run: |
71+
kind create cluster --name ${{ steps.prep.outputs.CLUSTER }} --kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }}
72+
- name: Run e2e tests
73+
env:
74+
KIND_CLUSTER_NAME: ${{ steps.prep.outputs.CLUSTER }}
75+
KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }}
76+
CREATE_CLUSTER: false
77+
BUILD_PLATFORM: linux/arm64
78+
run: make e2e
79+
- name: Cleanup
80+
if: always()
81+
run: |
82+
kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }}
83+
rm /tmp/${{ steps.prep.outputs.CLUSTER }}

hack/ci/e2e.sh

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ set -eoux pipefail
55
MINIO_VER="${MINIO_VER:-v6.3.1}"
66
CREATE_CLUSTER="${CREATE_CLUSTER:-true}"
77
KIND_CLUSTER_NAME="${KIND_CLUSTER_NAME:-kind}"
8+
LOAD_IMG_INTO_KIND="${LOAD_IMG_INTO_KIND:-true}"
9+
BUILD_PLATFORM="${BUILD_PLATFORM:-linux/amd64}"
810

911
IMG=test/source-controller
1012
TAG=latest
11-
MC_RELEASE=mc.RELEASE.2021-12-10T00-14-28Z
12-
MC_SHA256=01ec33b51ad208634deb8d701d52ac8f6be088e72563a92475ba6e6470653b73
13+
MC_RELEASE=mc.RELEASE.2021-12-16T23-38-39Z
14+
MC_AMD64_SHA256=d14302bbdaa180a073c1627ff9fbf55243221e33d47e32df61a950f635810978
15+
MC_ARM64_SHA256=00791995bf8d102e3159e23b3af2f5e6f4c784fafd88c60161dcf3f0169aa217
1316

1417
ROOT_DIR="$(git rev-parse --show-toplevel)"
1518
BUILD_DIR="${ROOT_DIR}/build"
@@ -35,6 +38,7 @@ function cleanup(){
3538
kubectl -n source-system get all
3639
kubectl -n source-system logs deploy/source-controller
3740
kubectl -n minio get all
41+
kubectl -n minio logs -l app=minio
3842
else
3943
echo "All E2E tests passed!"
4044
fi
@@ -50,8 +54,12 @@ trap cleanup EXIT
5054
kubectl wait node "${KIND_CLUSTER_NAME}-control-plane" --for=condition=ready --timeout=2m
5155

5256
echo "Build, load image into kind and deploy controller"
53-
make docker-build IMG="${IMG}" TAG="${TAG}" BUILD_PLATFORMS=linux/amd64 BUILD_ARGS=--load
54-
kind load docker-image --name "${KIND_CLUSTER_NAME}" "${IMG}":"${TAG}"
57+
make docker-build IMG="${IMG}" TAG="${TAG}" BUILD_PLATFORMS="${BUILD_PLATFORM}" BUILD_ARGS=--load
58+
59+
if "${LOAD_IMG_INTO_KIND}"; then
60+
kind load docker-image --name "${KIND_CLUSTER_NAME}" "${IMG}":"${TAG}"
61+
fi
62+
5563
make dev-deploy IMG="${IMG}" TAG="${TAG}"
5664

5765
echo "Run smoke tests"
@@ -71,20 +79,30 @@ kubectl -n source-system delete -f "${ROOT_DIR}/config/testdata/helmchart-values
7179
echo "Setup Minio"
7280
kubectl create ns minio
7381
helm repo add minio https://helm.min.io/
82+
83+
# minio seems to hang on arm64 with 128Mi
84+
# hence the increase to 192Mi
7485
helm upgrade --wait -i minio minio/minio \
7586
--version "${MINIO_VER}" \
7687
--namespace minio \
7788
--set accessKey=myaccesskey \
7889
--set secretKey=mysecretkey \
79-
--set resources.requests.memory=128Mi \
90+
--set resources.requests.memory=192Mi \
8091
--set persistence.enable=false
8192
kubectl -n minio port-forward svc/minio 9000:9000 &>/dev/null &
8293

8394
sleep 2
8495

8596
if [ ! -f "${BUILD_DIR}/mc" ]; then
97+
MC_SHA256="${MC_AMD64_SHA256}"
98+
ARCH="amd64"
99+
if [ "${BUILD_PLATFORM}" = "linux/arm64" ]; then
100+
MC_SHA256="${MC_ARM64_SHA256}"
101+
ARCH="arm64"
102+
fi
103+
86104
mkdir -p "${BUILD_DIR}"
87-
curl -o "${BUILD_DIR}/mc" -LO "https://dl.min.io/client/mc/release/linux-amd64/archive/${MC_RELEASE}"
105+
curl -o "${BUILD_DIR}/mc" -LO "https://dl.min.io/client/mc/release/linux-${ARCH}/archive/${MC_RELEASE}"
88106
if ! echo "${MC_SHA256} ${BUILD_DIR}/mc" | sha256sum --check; then
89107
echo "Checksum failed for mc."
90108
rm "${BUILD_DIR}/mc"

0 commit comments

Comments
 (0)