-
Notifications
You must be signed in to change notification settings - Fork 202
164 lines (151 loc) · 5.63 KB
/
upgrade_e2e.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# ------------------------------------------------------------
# Copyright 2021 The Dapr Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------
name: E2E - Upgrade path tests - KinD
on:
push:
branches:
- master
- release-*
paths-ignore:
- '**.md'
schedule:
- cron: '0 */3 * * *'
- cron: '0 */6 * * *'
pull_request:
branches:
- master
- 'release-*'
paths-ignore:
- '**.md'
defaults:
run:
shell: bash
working-directory: ./src/github.com/dapr/cli
jobs:
# This workflow runs our e2e tests in a local KinD cluster. Since it
# does not required a paid cluster and special credentials, it does
# not require /ok-to-test. That allows contributors to run E2E tests
# in their Draft PRs without explicit approval from Dapr
# maintainers.
#
# One other benefit of a fully-localized workflow is that tests are
# running on a fresh cluster everytime, thus being decoupled from
# shared resource issues.
#
kubernetes-e2e:
name: Upgrade path tests (KinD)
runs-on: ubuntu-latest
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.23.12
- v1.24.6
- v1.25.2
mode:
- ha
- non-ha
# Map between K8s and KinD versions.
# This is attempting to make it a bit clearer what's being tested.
# See: https://github.com/kubernetes-sigs/kind/releases/tag/v0.16.0
include:
- k8s-version: v1.23.12
kind-version: v0.16.0
kind-image-sha: sha256:9402cf1330bbd3a0d097d2033fa489b2abe40d479cc5ef47d0b6a6960613148a
- k8s-version: v1.24.6
kind-version: v0.16.0
kind-image-sha: sha256:97e8d00bc37a7598a0b32d1fabd155a96355c49fa0d4d4790aab0f161bf31be1
- k8s-version: v1.25.2
kind-version: v0.16.0
kind-image-sha: sha256:9be91e9e9cdf116809841fc77ebdb8845443c4c72fe5218f3ae9eb57fdb4bace
steps:
- name: Check out code onto GOPATH
uses: actions/checkout@v3
with:
path: ./src/github.com/dapr/cli
- name: Set up Go
uses: actions/setup-go@v3
id: setup-go
with:
go-version-file: './src/github.com/dapr/cli/go.mod'
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ matrix.k8s-version }}-${{ matrix.kind-version }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ matrix.k8s-version }}-${{ matrix.kind-version }}-go-${{ steps.setup-go.outputs.go-version }}-
- name: Configure KinD
# Generate a KinD configuration file that uses:
# (a) a couple of worker nodes: this is needed to run both
# ZooKeeper + Kakfa, and
# (b) a local registry: Due to `kind load` performance
# https://github.com/kubernetes-sigs/kind/issues/1165, using
# a local repository speeds up the image pushes into KinD
# significantly.
working-directory: ./
run: |
cat > kind.yaml <<EOF
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
image: kindest/node:${{ matrix.k8s-version }}@${{ matrix.kind-image-sha }}
- role: worker
image: kindest/node:${{ matrix.k8s-version }}@${{ matrix.kind-image-sha }}
- role: worker
image: kindest/node:${{ matrix.k8s-version }}@${{ matrix.kind-image-sha }}
- role: worker
image: kindest/node:${{ matrix.k8s-version }}@${{ matrix.kind-image-sha }}
EOF
# Log the generated kind.yaml for easy reference.
cat kind.yaml
- name: Create KinD Cluster
uses: helm/[email protected]
with:
config: kind.yaml
cluster_name: kind
version: ${{ matrix.kind-version }}
- name: Get KinD info
run: |
kubectl cluster-info --context kind-kind
NODE_IP=$(kubectl get nodes \
-lkubernetes.io/hostname!=kind-control-plane \
-ojsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}')
echo "MINIKUBE_NODE_IP=$NODE_IP" >> $GITHUB_ENV
- name: Free up some diskspace
run: |
docker image prune -a -f
- name: Run tests with GHCR
# runs every 6hrs
if: github.event.schedule == '0 */6 * * *'
env:
DAPR_DEFAULT_IMAGE_REGISTRY: ghcr
run: |
export TEST_OUTPUT_FILE=$GITHUB_WORKSPACE/test-e2e-upgrade-kind.json
echo "TEST_OUTPUT_FILE=$TEST_OUTPUT_FILE" >> $GITHUB_ENV
make e2e-build-run-upgrade
- name: Run tests with Docker hub
if: github.event.schedule != '0 */6 * * *'
run: |
export TEST_OUTPUT_FILE=$GITHUB_WORKSPACE/test-e2e-upgrade-kind.json
echo "TEST_OUTPUT_FILE=$TEST_OUTPUT_FILE" >> $GITHUB_ENV
make e2e-build-run-upgrade
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.k8s-version }}_${{ matrix.mode }}_e2e_upgrade_k8s.json
path: ${{ env.TEST_OUTPUT_FILE }}