generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 27
281 lines (217 loc) · 8.28 KB
/
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
name: e2e
on: [pull_request]
env:
GO_VERSION: '1.22'
jobs:
build-operator-image:
runs-on: ubuntu-20.04
name: Build the KMMO container image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make docker-build IMG=kmm:local
- name: Export the image
run: docker save -o kmm_local.tar kmm:local
- name: Upload the image
uses: actions/upload-artifact@v4
with:
name: ci-image-kmm
if-no-files-found: error
path: kmm_local.tar
retention-days: 1
build-operator-hub-image:
runs-on: ubuntu-20.04
name: Build the KMMO-hub container image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make docker-build-hub HUB_IMG=kmm-hub:local
- name: Export the image
run: docker save -o kmm-hub_local.tar kmm-hub:local
- name: Upload the image
uses: actions/upload-artifact@v4
with:
name: ci-image-kmm-hub
if-no-files-found: error
path: kmm-hub_local.tar
retention-days: 1
build-signing-image:
runs-on: ubuntu-20.04
name: Build the signing image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make signimage-build SIGNER_IMG=kmm-signimage:local
- name: Export the image
run: docker save -o kmm-signimage_local.tar kmm-signimage:local
- name: Upload the image
uses: actions/upload-artifact@v4
with:
name: ci-image-signer
if-no-files-found: error
path: kmm-signimage_local.tar
retention-days: 1
build-worker-image:
runs-on: ubuntu-20.04
name: Build the worker image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make workerimage-build WORKER_IMG=kmm-worker:local
- name: Export the image
run: docker save -o kmm-worker_local.tar kmm-worker:local
- name: Upload the image
uses: actions/upload-artifact@v4
with:
name: ci-image-worker
if-no-files-found: error
path: kmm-worker_local.tar
retention-days: 1
build-webhook-image:
runs-on: ubuntu-20.04
name: Build the webhook server image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the image
run: make webhookimage-build WEBHOOK_IMG=kmm-webhook-server:local
- name: Export the image
run: docker save -o kmm-webhook-server_local.tar kmm-webhook-server:local
- name: Upload the image
uses: actions/upload-artifact@v4
with:
name: ci-image-webhook-server
if-no-files-found: error
path: kmm-webhook-server_local.tar
retention-days: 1
e2e:
strategy:
matrix:
include:
- name: e2e
env:
KUSTOMIZE_CONFIG_DEFAULT: ci/install-ci
script: ./ci/prow/e2e-incluster-build
- name: e2e-hub
env:
KUSTOMIZE_CONFIG_HUB_DEFAULT: ci/install-ci-hub
KUSTOMIZE_CONFIG_DEFAULT: ci/install-ci-spoke
import_hub_image: true
script: ./ci/prow/e2e-hub-spoke-incluster-build
runs-on: ubuntu-20.04
name: ${{ matrix.name }}
needs: [build-operator-image, build-operator-hub-image, build-signing-image, build-webhook-image, build-worker-image]
services:
registry:
image: registry:2
ports: ['5000:5000/tcp']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create the minikube cluster
uses: ./.github/actions/create-minikube-cluster
with:
start-args: --insecure-registry=host.minikube.internal:5000
- name: Download container images
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Import the KMM operator, webhook server and worker images into minikube
run: |
minikube image load artifacts/ci-image-kmm/kmm_local.tar
minikube image load artifacts/ci-image-webhook-server/kmm-webhook-server_local.tar
minikube image load artifacts/ci-image-worker/kmm-worker_local.tar
- name: Import the KMM-hub operator image into minikube
run: minikube image load artifacts/ci-image-kmm-hub/kmm-hub_local.tar
if: ${{ matrix.import_hub_image }}
# This image is pulled by the signing pod, so it needs to be stored externally - not in the minikube container runtime.
- name: Copy the signing image into the registry
run: |
docker load -i artifacts/ci-image-signer/kmm-signimage_local.tar
docker tag kmm-signimage:local localhost:5000/kmm/signimage:local
docker push localhost:5000/kmm/signimage:local
- name: Set some Ubuntu environment variables
run: |
grep 'ID=' /etc/os-release >> "$GITHUB_ENV"
grep 'VERSION_ID=' /etc/os-release >> "$GITHUB_ENV"
- name: Cache binaries needed by Makefile
uses: actions/cache@v4
with:
path: ./bin
key: ${{ runner.os }}-${{ env.ID }}-${{ env.VERSION_ID }}-bin-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Run test
run: ${{ matrix.script }}
env:
${{ matrix.env }}
- name: Collect troubleshooting data
uses: ./.github/actions/collect-troubleshooting
if: ${{ always() }}
with:
artifact-name: ${{ matrix.name }}
operator-upgrade:
runs-on: ubuntu-20.04
name: operator-upgrade
needs: [build-operator-image, build-signing-image, build-webhook-image, build-worker-image]
services:
registry:
image: registry:2
ports: ['5000:5000/tcp']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create the minikube cluster
uses: ./.github/actions/create-minikube-cluster
with:
start-args: --insecure-registry=host.minikube.internal:5000
- name: Download container images
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Copy kmm, signing and worker images to the registry
run: |
# KMM is pulled by operator-sdk in the cluster and not by minikube
docker load -i artifacts/ci-image-kmm/kmm_local.tar
docker load -i artifacts/ci-image-signer/kmm-signimage_local.tar
docker load -i artifacts/ci-image-webhook-server/kmm-webhook-server_local.tar
docker load -i artifacts/ci-image-worker/kmm-worker_local.tar
docker tag kmm:local localhost:5000/kmm/kmm:local
docker tag kmm-signimage:local localhost:5000/kmm/signimage:local
docker tag kmm-webhook-server:local localhost:5000/kmm/webhook-server:local
docker tag kmm-worker:local localhost:5000/kmm/worker:local
docker push localhost:5000/kmm/kmm:local
docker push localhost:5000/kmm/signimage:local
docker push localhost:5000/kmm/webhook-server:local
docker push localhost:5000/kmm/worker:local
- name: Set some Ubuntu environment variables
run: |
grep 'ID=' /etc/os-release >> "$GITHUB_ENV"
grep 'VERSION_ID=' /etc/os-release >> "$GITHUB_ENV"
- name: Cache binaries needed by Makefile
uses: actions/cache@v4
with:
path: ./bin
key: ${{ runner.os }}-${{ env.ID }}-${{ env.VERSION_ID }}-bin-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install grpcurl
run: |
curl -LO https://github.com/fullstorydev/grpcurl/releases/download/v1.8.9/grpcurl_1.8.9_linux_x86_64.tar.gz
tar -xvzf grpcurl_1.8.9_linux_x86_64.tar.gz -C /tmp/
chmod +x /tmp/grpcurl
mv /tmp/grpcurl /usr/local/bin/
rm grpcurl_1.8.9_linux_x86_64.tar.gz
- name: Run test
run: ./ci/prow/operator-upgrade
- name: Collect troubleshooting data
uses: ./.github/actions/collect-troubleshooting
if: ${{ always() }}
with:
artifact-name: ${{ github.job }}