-
Notifications
You must be signed in to change notification settings - Fork 131
364 lines (332 loc) · 11.7 KB
/
ci.yml
File metadata and controls
364 lines (332 loc) · 11.7 KB
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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
name: CI
on:
pull_request:
workflow_call:
inputs:
# comes from cargo-dist workflow call
plan:
required: true
type: string
workflow_dispatch:
push:
branches:
- main
- release-*
jobs:
workspace-hack-check:
name: Check workspace-hack
runs-on: warp-ubuntu-latest-x64-4x
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cargo-hakari
uses: taiki-e/install-action@v2
with:
tool: cargo-hakari
- name: Check workspace-hack Cargo.toml is up-to-date
run: cargo hakari generate --diff
- name: Check all crates depend on workspace-hack
run: cargo hakari manage-deps --dry-run
build-and-test:
name: Build and test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: read
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
os: [warp-ubuntu-latest-x64-16x]
env:
RUST_BACKTRACE: full
steps:
# Disabled as uring is not used in production yet.
# - name: Install liburing
# run: sudo apt-get update && sudo apt-get install -y liburing-dev
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
rustflags: ""
cache: false
- name: Setup Rust Caching
uses: WarpBuilds/rust-cache@v2 # a fork of Swatinem/rust-cache@v2 that uses warpbuild cache
with:
cache-on-failure: "true"
- name: Install cargo-hakari
uses: taiki-e/install-action@v2
with:
tool: cargo-hakari
- name: Disable hakari
run: cargo hakari disable
- name: Install protoc
uses: ./.github/actions/install-protoc
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: nextest@0.9.98
- name: Setup just
uses: extractions/setup-just@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check Cargo.lock file is updated
run: cargo update -w --locked
- name: Run verify
run: just verify
id: justVerify
env:
LOCAL_CLUSTER_RUNNER_FORWARD_LOGS: "true"
LOCAL_CLUSTER_RUNNER_RETAIN_TEMPDIR: "true"
LOCAL_CLUSTER_RUNNER_TEMPDIR: ${{ runner.temp }}/lcr
- uses: actions/upload-artifact@v4
if: always()
with:
name: local-cluster-runner
path: ${{ runner.temp }}/lcr
docker:
name: Create docker image
uses: ./.github/workflows/docker.yml
with:
uploadImageAsTarball: "restate.tar"
platforms: linux/amd64
# additional features added for CI validation builds only
features: metadata-api
sdk-java:
name: Run SDK-Java integration tests
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
secrets: inherit
needs: docker
uses: restatedev/sdk-java/.github/workflows/integration.yaml@main
with:
restateCommit: ${{ github.event.pull_request.head.sha || github.sha }}
serviceImage: "ghcr.io/restatedev/test-services-java:main"
sdk-java-journal-table-v2:
name: Run SDK-Java integration tests with Journal Table v2
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
secrets: inherit
needs: docker
uses: restatedev/sdk-java/.github/workflows/integration.yaml@main
with:
restateCommit: ${{ github.event.pull_request.head.sha || github.sha }}
serviceImage: "ghcr.io/restatedev/test-services-java:main"
testArtifactOutput: sdk-java-integration-test-journal-table-v2
envVars: |
RESTATE_EXPERIMENTAL_FEATURE__USE_JOURNAL_V2_BY_DEFAULT=true
sdk-python:
name: Run SDK-Python integration tests
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
secrets: inherit
needs: docker
uses: restatedev/sdk-python/.github/workflows/integration.yaml@main
with:
restateCommit: ${{ github.event.pull_request.head.sha || github.sha }}
serviceImage: "ghcr.io/restatedev/test-services-python:main"
sdk-go:
name: Run SDK-Go integration tests
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
secrets: inherit
needs: docker
uses: restatedev/sdk-go/.github/workflows/integration.yaml@main
with:
restateCommit: ${{ github.event.pull_request.head.sha || github.sha }}
sdk-typescript:
name: Run SDK-Typescript integration tests
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
secrets: inherit
needs: docker
uses: restatedev/sdk-typescript/.github/workflows/integration.yaml@main
with:
restateCommit: ${{ github.event.pull_request.head.sha || github.sha }}
serviceImage: "ghcr.io/restatedev/test-services-node:main"
sdk-rust:
name: Run SDK-Rust integration tests
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
secrets: inherit
needs: docker
uses: restatedev/sdk-rust/.github/workflows/integration.yaml@main
with:
restateCommit: ${{ github.event.pull_request.head.sha || github.sha }}
e2e:
name: Run E2E tests
runs-on: warp-ubuntu-latest-x64-4x
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
needs: docker
steps:
- name: Set up Docker containerd snapshotter
uses: crazy-max/ghaction-setup-docker@v3
with:
set-host: true
daemon-config: |
{
"features": {
"containerd-snapshotter": true
}
}
### Download the Restate container image, if needed
- name: Download restate snapshot from in-progress workflow
uses: actions/download-artifact@v4
with:
name: restate.tar
- name: Install restate snapshot
run: |
output=$(docker load --input restate.tar | head -n 1)
docker tag "${output#*: }" "localhost/restatedev/restate-commit-download:latest"
docker image ls -a
### Run e2e tests
- name: Run E2E tests
uses: restatedev/e2e@main
with:
testArtifactOutput: e2e-test-report
restateContainerImage: localhost/restatedev/restate-commit-download:latest
# Needed for backward compatibility tests 1.6 -> 1.5
envVars: |
RESTATE_WORKER__INVOKER__experimental_features_allow_protocol_v6=true
e2e-enable-journal-table-v2:
name: Run E2E tests with Journal Table V2 feature
runs-on: warp-ubuntu-latest-x64-4x
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
needs: docker
steps:
- name: Set up Docker containerd snapshotter
uses: crazy-max/ghaction-setup-docker@v3
with:
set-host: true
daemon-config: |
{
"features": {
"containerd-snapshotter": true
}
}
### Download the Restate container image, if needed
- name: Download restate snapshot from in-progress workflow
uses: actions/download-artifact@v4
with:
name: restate.tar
- name: Install restate snapshot
run: |
output=$(docker load --input restate.tar | head -n 1)
docker tag "${output#*: }" "localhost/restatedev/restate-commit-download:latest"
docker image ls -a
### Run e2e tests
- name: Run E2E tests
uses: restatedev/e2e@main
with:
testArtifactOutput: e2e-journal-table-v2-test-report
restateContainerImage: localhost/restatedev/restate-commit-download:latest
# Needed for backward compatibility tests 1.6 -> 1.5
envVars: |
RESTATE_WORKER__INVOKER__experimental_features_allow_protocol_v6=true
RESTATE_EXPERIMENTAL_FEATURE__USE_JOURNAL_V2_BY_DEFAULT=true
# Why these tests are disabled?
# In restate 1.5 the invoker storage reader will not handle correctly the case where there's no pinned deployment yet
# and the journal table used is v2. This doesn't show in the logs, but will simply hang badly the invocation task loop!
# These tests trigger this condition!
exclusions: |
exclusions:
"versionCompat":
- "dev.restate.sdktesting.tests.BackCompatibilityTest\\$OldVersion#proxyCallShouldBeDone"
- "dev.restate.sdktesting.tests.BackCompatibilityTest\\$OldVersion#proxyOneWayCallShouldBeDone"
jepsen:
if: github.event.repository.fork == false && github.event.pull_request.head.repo.full_name == 'restatedev/restate' && github.ref == 'refs/heads/main'
runs-on: warp-ubuntu-latest-arm64-4x
name: Run Jepsen tests
env:
CLUSTER_NAME: restatedev-restate-${{ github.event.pull_request.number != null && format('pr{0}', github.event.pull_request.number) || format('run{0}', github.run_id) }}
permissions:
actions: read
checks: write
contents: read
id-token: write # NB: can obtain OIDC tokens on behalf of this repository!
issues: read
pull-requests: write
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1 # co-locate with WarpBuild worker
role-to-assume: "arn:aws:iam::339713187748:role/github-restatedev-restate-actions-role"
- name: Setup Jepsen cluster ${{ env.CLUSTER_NAME }}
uses: restatedev/jepsen/.github/actions/setup@main
with:
ref: ${{ inputs.ref }}
clusterName: ${{ env.CLUSTER_NAME }}
bucketName: "restate-jepsen-test-clusters-us-east-1"
- name: Drop AWS credentials
run: |
echo "AWS_ACCESS_KEY_ID=" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=" >> $GITHUB_ENV
echo "AWS_SESSION_TOKEN=" >> $GITHUB_ENV
- name: Wait for Docker image artifact
id: wait-for-docker
uses: fountainhead/action-wait-for-check@v1.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: "Create docker image / build-and-push-image"
ref: ${{ github.event.pull_request.head.sha || github.sha }}
timeoutSeconds: 1800
intervalSeconds: 10
- name: Run Jepsen tests
uses: restatedev/jepsen/.github/actions/run-tests@main
if: steps.wait-for-docker.outputs.conclusion == 'success'
with:
restateCommit: ${{ github.event.pull_request.head.sha || github.sha }}
testConfig: '{ "workloads": "set-vo set-mds set-mds-s3", "nemeses": "partition-random-node", "duration": "60", "rate": "10", "concurrency": "5n", "testCount": "1" }'
- name: Fail if no Docker artifact
if: steps.wait-for-docker.outputs.conclusion != 'success'
run: |
echo "::error::Docker step did not complete?"
exit 1
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: "arn:aws:iam::339713187748:role/github-restatedev-restate-actions-role"
if: always()
- name: Tear down Jepsen cluster ${{ env.CLUSTER_NAME }}
uses: restatedev/jepsen/.github/actions/teardown@main
if: always()
with:
clusterName: ${{ env.CLUSTER_NAME }}
bucketName: "restate-jepsen-test-clusters-us-east-1"