-
Notifications
You must be signed in to change notification settings - Fork 491
278 lines (263 loc) · 9.2 KB
/
cd_dev.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
# This workflow test deployment of latest dev release
name: CD_Dev
permissions:
contents: read
concurrency:
group: cd_dev
cancel-in-progress: true
on:
# push:
# branches: [master]
# pull_request:
# branches: [master]
repository_dispatch:
types: [ publish-success ]
workflow_dispatch:
inputs:
alt_version:
required: false
description: Provide expected semver for `installer_check` job. If empty `VERSION+<git commit>` in repo will be used
default: ''
env:
USE_VERSION: ${{ github.event.inputs.alt_version }}
K3D_VERSION: v5.4.1
jobs:
setup:
name: Setup inputs
runs-on: ubuntu-latest
outputs:
pub_ref: ${{ steps.out.outputs.pub_ref }}
pub_sha: ${{ steps.out.outputs.pub_sha }}
steps:
- name: Default Info
run: |
echo event_name ${{ github.event_name }}
echo "pub_ref=${{ github.ref }}" >> $GITHUB_ENV
echo "pub_sha=${{ github.sha }}" >> $GITHUB_ENV
- name: Received ci-success event
if: github.event_name == 'repository_dispatch'
id: recv
run: |
echo REF ${{ github.event.client_payload.ref }}
echo SHA ${{ github.event.client_payload.sha }}
echo "pub_ref=${{ github.event.client_payload.ref }}" >> $GITHUB_ENV
echo "pub_sha=${{ github.event.client_payload.sha }}" >> $GITHUB_ENV
- name: Output Setup
# merge optional step output
id: out
run: |
echo REF ${{ env.pub_ref }}
echo SHA ${{ env.pub_sha }}
echo "pub_ref=${{ env.pub_ref }}" >> $GITHUB_OUTPUT
echo "pub_sha=${{ env.pub_sha }}" >> $GITHUB_OUTPUT
# Perform E2E sanity checks
verify_latest_releases:
name: Verify latest run ${{ matrix.run }} (${{ matrix.cluster_type }}) on (${{ matrix.os }})
needs: setup
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
cluster_type: [local,k8]
run: [r1]
env:
SLEEP: 10
TOPIC: foobar
steps:
- name: Checkout ${{ needs.setup.outputs.pub_sha }}
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.pub_sha }}
- name: Set up K3d for Ubuntu
if: ${{ matrix.cluster_type == 'k8' }}
run: |
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=${{ env.K3D_VERSION }} bash
- name: Set up K8 for ubuntu(kind)
if: ${{ matrix.cluster_type == 'k8' }}
run: ./k8-util/cluster/reset-k3d.sh
- name: Setup Fluvio
uses: infinyon/fluvio/.github/actions/setup-fluvio@master
with:
version: latest
- name: Install Local Fluvio cluster
timeout-minutes: 3
if: ${{ matrix.cluster_type == 'local' }}
run: fluvio cluster start --local
- name: Install k8 Fluvio cluster
timeout-minutes: 3
if: ${{ matrix.cluster_type == 'k8' }}
run: |
FLUVIO_IMAGE_TAG_STRATEGY=version-git \
fluvio cluster start --k8 --spu-storage-size 1
- name: Run E2E Test
timeout-minutes: 2
run: |
date +"%Y-%m-%dT%H:%M:%S%z"
fluvio version
fluvio topic create ${{ env.TOPIC }}
# wait for topic to be created
sleep ${{ env.SLEEP }}
date +"%Y-%m-%dT%H:%M:%S%z"
echo foo | fluvio produce ${{ env.TOPIC }}
fluvio consume ${{ env.TOPIC }} --start 0 -d | grep -F -w "foo"
fluvio topic delete "${{ env.TOPIC }}"
- name: Run diagnostics
if: ${{ !success() }}
timeout-minutes: 5
run: fluvio cluster diagnostics
- name: Upload diagnostics
uses: actions/upload-artifact@v3
timeout-minutes: 5
if: ${{ !success() }}
with:
name: cd_failure_${{ matrix.run }}_${{ matrix.cluster_type }}
path: diagnostics*.gz
- name: Slack Notification
uses: 8398a7/action-slack@v3
if: ${{ !success() }}
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}
# Perform upgrade test from previous stable version to latest
k8_cluster_upgrade:
name: Kubernetes cluster upgrade test
needs: setup
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable]
env:
FLV_SOCKET_WAIT: 600
steps:
- name: Checkout ${{ needs.setup.outputs.pub_sha }}
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.pub_sha }}
- name: Setup K3d
run: |
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=${{ env.K3D_VERSION }} bash
./k8-util/cluster/reset-k3d.sh
- name: Run upgrade test
timeout-minutes: 10
env:
TEST_DATA_BYTES: 10000
run: |
export PATH=~/.fluvio/bin:$PATH
USE_LATEST=true make upgrade-test
- name: Run diagnostics
if: ${{ !success() }}
timeout-minutes: 5
run: ~/.fluvio/bin/fluvio cluster diagnostics
- name: Upload diagnostics
uses: actions/upload-artifact@v3
timeout-minutes: 5
if: ${{ !success() }}
with:
name: cluster-upgrade-diag
path: diagnostics*.gz
- name: Slack Notification
uses: 8398a7/action-slack@v3
if: ${{ !success() }}
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}
# Verify latest version of CLI
installer_check:
name: Installer check
needs: setup
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
version: [latest]
steps:
- name: Checkout ${{ needs.setup.outputs.pub_sha }}
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.pub_sha }}
- name: Set the expected fluvio version
run: |
if [[ -z "${{ env.USE_VERSION }}" ]]; then
echo "EXPECTED_VERSION=$(cat VERSION)+$(git rev-parse HEAD)" | tee -a $GITHUB_ENV
else
echo "EXPECTED_VERSION=${{ github.event.inputs.alt_version }}" | tee -a $GITHUB_ENV
fi
echo "EXPECTED_VERSION: $EXPECTED_VERSION"
- name: Curl Install - latest
run: |
curl -fsS https://hub.infinyon.cloud/install/install.sh | \
FLUVIO_VERSION=${{ matrix.version }} bash | \
tee /tmp/installer.version
- name: Verify installer output
run: |
INSTALLER_VERSION=$(cat /tmp/installer.version | grep "fluvio@" | awk '{print $4}' | cut -b 8-)
if [ "$INSTALLER_VERSION" = "$EXPECTED_VERSION" ]; then
echo "✅ Installer version check passed: $EXPECTED_VERSION";
else
echo "❌ Installer version check failed";
echo "Version reported by installer: $INSTALLER_VERSION";
echo "Expected version: $EXPECTED_VERSION";
exit 1;
fi
cli-platform-cross-version-test:
name: CLI (${{ matrix.cli_version }}) x Platform (${{ matrix.cluster_version }}) version test
needs: setup
#if: false
runs-on: ${{ matrix.os }}
env:
FLUVIO_BIN: ~/.fluvio/bin/fluvio
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
cluster_version: [stable, latest]
cli_version: [stable, latest]
steps:
- name: Checkout ${{ needs.setup.outputs.pub_sha }}
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.pub_sha }}
- name: Setup BATS
uses: mig4/setup-bats@v1
with:
bats-version: 1.2.1
- name: Setup bin path
run: echo "~/.fluvio/bin" >> $GITHUB_PATH
- name: Setup Fluvio
uses: infinyon/fluvio/.github/actions/setup-fluvio@master
with:
version: ${{ matrix.cluster_version }}
- name: Start Fluvio Cluster
timeout-minutes: 10
run: fluvio cluster start --local
- name: CLI ${{ matrix.cli_version }} x Cluster ${{ matrix.cluster_version }}
run: |
make FLUVIO_BIN=~/.fluvio/bin/fluvio SKIP_SETUP=true CLI_VERSION=${{ matrix.cli_version }} CLUSTER_VERSION=${{ matrix.cluster_version }} cli-platform-cross-version-test
- name: Run diagnostics
if: ${{ !success() }}
timeout-minutes: 5
run: fluvio cluster diagnostics
- name: Upload diagnostics
uses: actions/upload-artifact@v3
timeout-minutes: 5
if: ${{ !success() }}
with:
name: cli-platform-cross-version-test
path: diagnostics*.gz
- name: Slack Notification
uses: 8398a7/action-slack@v3
if: ${{ !success() }}
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}