-
Notifications
You must be signed in to change notification settings - Fork 491
242 lines (216 loc) · 7.87 KB
/
hourly.yml
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
name: Hourly tests
permissions:
contents: read
concurrency:
group: hourly-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: "0 */2 * * *"
# pull_request:
# branches: [master]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
K3D_VERSION: v5.4.1
FLV_CLUSTER_PROVISION_TIMEOUT: 600
jobs:
build_long_binaries:
name: Test build for ${{ matrix.binary }} on (${{ matrix.os }})
if: ${{ false }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust-target:
- x86_64-unknown-linux-musl
rust: [stable]
binary: [fluvio-test]
os: [ubuntu-latest]
env:
RUST_BACKTRACE: full
RUSTV: ${{ matrix.rust }}
TARGET: ${{ matrix.rust-target }}
RUST_BIN_DIR: target/${{ matrix.rust-target }}/release
RELEASE_NAME: release
RELEASE: true
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ matrix.rust }} Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Install zig
run: ./actions/zig-install.sh ${{ matrix.os }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}-${{ matrix.binary }}
- name: Build fluvio
if: matrix.binary == 'fluvio'
run: make build-cli
- name: Build fluvio-run
if: matrix.binary == 'fluvio-run'
run: make build-cluster
- name: Build fluvio-test
if: matrix.binary == 'fluvio-test'
run: make build-test
# Upload artifacts
- name: Upload artifact - ${{ matrix.binary }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.binary }}-${{ matrix.rust-target }}
path: ${{ env.RUST_BIN_DIR }}/${{ matrix.binary }}
longevity:
name: Hourly Longevity test
runs-on: ${{ matrix.os }}
# needs:
# - build_long_binaries
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust-target: [x86_64-unknown-linux-musl]
run: [r1]
# run: [r1,r2,r3,r4,r5,r6,r7,r8,r9]
binary: [dev]
test_run_time: [30m]
producer: [1, 25]
producer_record_bytes: [2000] # 2KB
producer_batch_bytes: [10000] # 10KB
producer_linger_ms: [10]
consumer: [1, 25]
topic: [1, 10]
topic_segment_bytes: [500000] # 500KB
topic_retention: [15s]
cluster_type: [local,k8]
env:
TEST_BINARY: fluvio-test-x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v4
- name: Login GH CLI
# if: ${{ false }}
run: gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }})
- name: Download dev release
# if: ${{ false }}
run: gh release download dev -R infinyon/fluvio -D /tmp/release
- name: Unpack fluvio-test from dev release
# if: ${{ false }}
run: |
cd /tmp/release; unzip ${{ env.TEST_BINARY }}.zip; chmod +x fluvio-test
echo "/tmp/release" >> $GITHUB_PATH
- name: Download build artifact - fluvio-test
if: ${{ false }}
uses: actions/download-artifact@v4
with:
name: fluvio-test-${{ matrix.rust-target }}
path: ~/bin
- name: Set up Fluvio binaries from build
if: ${{ false }}
run: |
chmod +x ~/bin/fluvio-test
echo "~/bin" >> $GITHUB_PATH
## DEBUG: Don't forget to remove this
## TODO: Figure out how to add this to the hourly test
#- name: Delete Artifact by Name
# uses: jimschubert/delete-artifacts-action@v1
# with:
# log_level: 'debug'
# artifact_name: longevity-data
# dry_run: false
# TODO: Test optimization
# We want to check for certain conditions for when to run this test
# Check if the cached git commit matches the current git commit
# If the match, then we've already run a test on this build. Skip this run
# If they don't match, then let's run the test
- name: Setup K3d
if: ${{ matrix.cluster_type == 'k8' }}
run: curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=${{ env.K3D_VERSION }} bash
- name: Create K3d cluster
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: Start Fluvio Cluster
# --image-version is only used in the k8 cluster_type
run: |
fluvio version
fluvio cluster start --${{ matrix.cluster_type}} --image-version latest
# Disabled for now bc data load is unstable in CI
#- name: Look for longevity data
# run: |
# set -e
# if gh run download -n longevity-data -D /tmp ; then
# echo "Longevity data exists"
# cd /tmp
# tar -xvf longevity-data.tar
# ~/.fluvio/bin/fluvio topic create test
# kubectl cp longevity-existing-0/00000000000000000000.index fluvio-spg-main-0:var/lib/fluvio/data/spu-logs-0/test-0/00000000000000000000.index
# kubectl cp longevity-existing-0/00000000000000000000.log fluvio-spg-main-0:var/lib/fluvio/data/spu-logs-0/test-0/00000000000000000000.log
# kubectl cp longevity-existing-0/replication.chk fluvio-spg-main-0:var/lib/fluvio/data/spu-logs-0/test-0/replication.chk
# k3d cluster stop --all
# k3d cluster start --all
# sleep 30
# else
# echo "Longevity data does not exist"
# fi
- name: Run longevity test
timeout-minutes: 65
run: |
sleep 10
RUST_LOG=info fluvio-test \
--timeout=${{ matrix.test_run_time }} \
--producer ${{ matrix.producer }} \
--producer-record-size ${{ matrix.producer_record_bytes }} \
--producer-batch-size ${{ matrix.producer_batch_bytes }} \
--producer-linger ${{ matrix.producer_linger_ms }} \
--consumer ${{ matrix.consumer }} \
--topic ${{ matrix.topic }} \
--topic-segment-size ${{ matrix.topic_segment_bytes }} \
--topic-retention ${{ matrix.topic_retention }} \
--expect-timeout \
longevity
## If the test passed, then copy the data from cluster to store into artifacts
#- name: Export data from the cluster for caching
# run: |
# kubectl version
# mkdir longevity-0
# echo Copy fluvio topic data from container
# kubectl cp fluvio-spg-main-0:/var/lib/fluvio/data/spu-logs-0/longevity-0 longevity-0
# ls
# echo List copied topic data
# ls longevity-0
# echo Make tarball from topic data
# tar -cvf longevity-data.tar longevity-0
# echo Verify tarball
# cp longevity-data.tar /tmp
# cd /tmp
# tar -xvf longevity-data.tar
## TODO: Add a shorter cache time
#- uses: actions/upload-artifact@v4
# with:
# name: 'longevity-data'
# path: longevity-data.tar
# retention-days: 5
- name: Run diagnostics
if: failure()
timeout-minutes: 5
run: fluvio cluster diagnostics
- name: Upload diagnostics
uses: actions/upload-artifact@v4
timeout-minutes: 5
if: failure()
with:
name: hourly-longevity-${{ matrix.run }}.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
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}