-
Notifications
You must be signed in to change notification settings - Fork 138
547 lines (499 loc) · 17.7 KB
/
ci.yml
File metadata and controls
547 lines (499 loc) · 17.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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
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:
prefix-key: "v1-rust"
cache-on-failure: "true"
- name: Disk usage after cache restore
run: df -h / && du -sh target/ 2>/dev/null || 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 lint
run: just lint
- name: Disk usage after lint
run: df -h / && du -sh target/ 2>/dev/null || true
- name: Run test
run: just test
env:
LOCAL_CLUSTER_RUNNER_FORWARD_LOGS: "true"
LOCAL_CLUSTER_RUNNER_RETAIN_TEMPDIR: "true"
LOCAL_CLUSTER_RUNNER_TEMPDIR: ${{ runner.temp }}/lcr
- name: Disk usage after test
if: always()
run: df -h / && du -sh target/ 2>/dev/null || true
- name: Run doctest
run: just doctest
- uses: actions/upload-artifact@v4
if: always()
with:
name: local-cluster-runner
path: ${{ runner.temp }}/lcr
- name: Disk usage before cache save
if: always()
run: df -h / && du -sh target/ 2>/dev/null || true
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_INTERNAL_FORCE_MIN_RESTATE_VERSION=1.6.0-dev
sdk-java-vqueues:
name: Vqueues Run SDK-Java integration tests
# for the time being we don't expect all tests to pass
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-vqueues
envVars: |
RESTATE_EXPERIMENTAL_ENABLE_VQUEUES=true
# we don't expect all tests to pass, that's why we continue on error
continueOnError: 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: docker/setup-docker-action@v4
with:
version: "v28.5.2"
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
# RESTATE_WORKER__INVOKER__experimental_features_allow_protocol_v6=true is needed for forward compatibility
# tests 1.6 -> 1.5. The e2e tests create a v1.5 Restate server which gets the same env variables passed in,
# and we need to enable the protocol v6 which is being used by 1.6.
# todo remove once we use v1.6 as the LAST_COMPATIBLE_RESTATE_SERVER_VERSION in the e2e tests
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: docker/setup-docker-action@v4
with:
version: "v28.5.2"
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
envVars: |
RESTATE_INTERNAL_FORCE_MIN_RESTATE_VERSION=1.6.0-dev
# Ignore forward compatibility tests as long as the previous version is not at least v1.6.0-dev. Otherwise,
# the previous version will hang at applying the version barrier with version 1.6.0-dev.
exclusions: |
exclusions:
"versionCompat":
- "dev.restate.sdktesting.tests.ForwardCompatibilityTest.*"
e2e-vqueues:
name: Run E2E tests with vqueues
runs-on: warp-ubuntu-latest-x64-4x
# we don't expect all tests to pass, that's why we continue on error
continue-on-error: true
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
needs: docker
steps:
- name: Set up Docker containerd snapshotter
uses: docker/setup-docker-action@v4
with:
version: "v28.5.2"
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 with vqueues enabled.
- name: Run E2E tests
uses: restatedev/e2e@main
with:
testArtifactOutput: e2e-test-vqueues-report
restateContainerImage: localhost/restatedev/restate-commit-download:latest
envVars: |
RESTATE_EXPERIMENTAL_ENABLE_VQUEUES=true
# We will never support the forward compatibility tests for v1.5 when using vqueues.
# The backward compatibility tests are temporarily disabled until we support migration from v1.5 -> v1.6
exclusions: |
exclusions:
"versionCompat":
- "dev.restate.sdktesting.tests.ForwardCompatibilityTest.*"
- "dev.restate.sdktesting.tests.BackwardCompatibilityTest.*"
e2e-experimental-kafka-ingestion:
name: Run E2E tests with experimental Kafka ingestion
runs-on: warp-ubuntu-latest-x64-4x
# we don't expect all tests to pass, that's why we continue on error
continue-on-error: true
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
needs: docker
steps:
- name: Set up Docker containerd snapshotter
uses: docker/setup-docker-action@v4
with:
version: "v28.5.2"
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 with experimental kafka ingestion enabled.
- name: Run E2E tests
uses: restatedev/e2e@main
with:
testArtifactOutput: e2e-test-experimental-kafka-ingestion-report
restateContainerImage: localhost/restatedev/restate-commit-download:latest
envVars: |
RESTATE_experimental_kafka_batch_ingestion=true
e2e-experimental-shuffler:
name: Run E2E tests with experimental Shuffler
runs-on: warp-ubuntu-latest-x64-4x
# we don't expect all tests to pass, that's why we continue on error
continue-on-error: true
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
needs: docker
steps:
- name: Set up Docker containerd snapshotter
uses: docker/setup-docker-action@v4
with:
version: "v28.5.2"
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 with experimental shuffler enabled.
- name: Run E2E tests
uses: restatedev/e2e@main
with:
testArtifactOutput: e2e-test-experimental-shuffler-report
restateContainerImage: localhost/restatedev/restate-commit-download:latest
envVars: |
RESTATE_experimental_shuffler_batch_ingestion=true
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"