-
Notifications
You must be signed in to change notification settings - Fork 234
466 lines (439 loc) · 17.4 KB
/
ci.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
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
name: CI
on:
push:
branches: [master]
pull_request: {}
workflow_dispatch:
inputs:
username:
description: "Defaults to GitHub Actor"
required: false
runner_action:
description: "The action to take with the self-hosted runner (start, stop, restart)."
required: false
concurrency:
# force parallelism in master
group: ci-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}
cancel-in-progress: true
jobs:
setup:
uses: ./.github/workflows/setup-runner.yml
with:
runner_label: ${{ inputs.username || github.actor }}-x86
ebs_cache_size_gb: 256
runner_concurrency: 20
subaction: ${{ inputs.runner_action || 'start' }}
# Use instance types with low interruption rate in us-east-2 https://aws.amazon.com/ec2/spot/instance-advisor/
ec2_instance_type: r6in.32xlarge r6a.32xlarge i4i.32xlarge r7iz.32xlarge
ec2_ami_id: ami-04d8422a9ba4de80f
ec2_spot_instance_strategy: BestEffort
ec2_instance_ttl: 40 # refreshed by jobs
secrets: inherit
build:
needs: setup
runs-on: ${{ inputs.username || github.actor }}-x86
outputs:
e2e_list: ${{ steps.e2e_list.outputs.list }}
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: build-${{ inputs.username || github.actor }}-x86
# prepare images locally, tagged by commit hash
- name: "Build E2E Image"
timeout-minutes: 40
run: earthly-ci ./yarn-project+export-e2e-test-images
# We base our e2e list used in e2e-x86 off the targets in ./yarn-project/end-to-end
# (Note ARM uses just 2 tests as a smoketest)
- name: Create list of end-to-end jobs
id: e2e_list
run: echo "list=$(earthly ls ./yarn-project/end-to-end | grep -v '+base' | sed 's/+//' | jq -R . | jq -cs .)" >> $GITHUB_OUTPUT
# all the end-to-end integration tests for aztec
e2e:
needs: build
runs-on: ${{ inputs.username || github.actor }}-x86
strategy:
fail-fast: false
matrix:
test: ${{ fromJson( needs.build.outputs.e2e_list )}}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
# must be globally unique for build x runner
concurrency_key: e2e-${{ inputs.username || github.actor }}-x86-${{ matrix.test }}
- name: Test
working-directory: ./yarn-project/end-to-end/
timeout-minutes: 25
run: earthly-ci -P \
--secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
--secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
--no-output \
+${{ matrix.test }} --skip_build=true
# bench-summary:
# needs: e2e
# runs-on: ${{ inputs.username || github.actor }}-x86
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 100 # Downloading base benchmark from master requires access to history
# ref: "${{ github.event.pull_request.head.sha }}"
# - uses: ./.github/ci-setup-action
# with:
# dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
# concurrency_key: build-${{ inputs.username || github.actor }}-x86
# - name: "Build and upload bench aggregate file"
# working-directory: ./yarn-project/scripts
# run: earthly-ci -P --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} +bench-aggregate
# - name: "Download base benchmark"
# if: ${{ github.event_name == 'pull_request' }}
# run: scripts/logs/download_base_benchmark_from_s3.sh
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# BENCH_FOLDER: ./yarn-project/scripts/bench
# PULL_REQUEST: "${{ github.event.pull_request.number }}"
# - name: "Generate summary comment if pull request"
# if: ${{ github.event_name == 'pull_request' }}
# working-directory: ./yarn-project/scripts
# run: earthly-ci -P --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} --secret AZTEC_BOT_COMMENTER_GITHUB_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} +bench-comment
# barretenberg (prover) native and AVM (public VM) tests
# only ran on x86 for resource reasons (memory intensive)
bb-native-tests:
needs: build
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
# must be globally unique for build x runner
concurrency_key: bb-native-tests-${{ inputs.username || github.actor }}-x86
- name: "Native Prover Tests"
working-directory: ./barretenberg/cpp/
timeout-minutes: 25
# limit our parallelism to half our cores
run: earthly-ci --no-output +test --hardware_concurrency=64
bb-js-test:
needs: setup
runs-on: ${{ github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: bb-js-test-${{ github.actor }}-x86
- name: "bb.js Tests"
working-directory: ./barretenberg/ts/
timeout-minutes: 25
run: earthly-ci --no-output ./+test
noir-test:
needs: setup
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: noir-${{ inputs.username || github.actor }}-x86
- name: "Test Noir JS packages"
run: earthly-ci --no-output ./noir+test
noir-packages-test:
needs: setup
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: noir-${{ inputs.username || github.actor }}-x86
- name: "Test Noir JS packages"
run: earthly-ci --no-output ./noir+packages-test
noir-projects:
needs: setup
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: noir-projects-${{ inputs.username || github.actor }}-x86
- name: "Noir Projects"
timeout-minutes: 25
run: earthly-ci --no-output ./noir-projects/+test
yarn-project-formatting:
needs: noir-projects
runs-on: ${{ github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: yarn-project-formatting-${{ github.actor }}-x86
- name: "Yarn Project Tests"
timeout-minutes: 25
run: earthly-ci --no-output ./yarn-project/+format-check
yarn-project-test:
needs: noir-projects
runs-on: ${{ github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: yarn-project-test-${{ github.actor }}-x86
- name: "Yarn Project Tests"
timeout-minutes: 30
run: earthly-ci --no-output ./yarn-project/+test
prover-client-test:
needs: noir-projects
runs-on: ${{ github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: prover-client-test-${{ github.actor }}-x86
- name: "Prover Client Tests"
timeout-minutes: 25
run: earthly-ci --no-output ./yarn-project/+prover-client-test
build-acir-tests:
needs: build
runs-on: ${{ github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: build-acir-tests-${{ github.actor }}-x86
- name: "Build Acir Tests"
timeout-minutes: 25
run: earthly-ci --no-output ./noir/+build-acir-tests
barretenberg-acir-tests-bb:
needs: build-acir-tests
runs-on: ${{ github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: barretenberg-acir-tests-bb-${{ github.actor }}-x86
- name: "BB Native Acir Tests"
working-directory: ./noir/
timeout-minutes: 25
run: earthly-ci --no-output ./+barretenberg-acir-tests-bb
barretenberg-acir-tests-sol:
needs: build-acir-tests
runs-on: ${{ github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: barretenberg-acir-tests-sol-${{ github.actor }}-x86
- name: "BB Solidity Acir Tests"
working-directory: ./noir/
timeout-minutes: 25
run: earthly-ci --no-output ./+barretenberg-acir-tests-sol
barretenberg-acir-tests-bb-js:
needs: build-acir-tests
runs-on: ${{ github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: barretenberg-acir-tests-bb-js-${{ github.actor }}-x86
- name: "BB JS Acir Tests"
working-directory: ./noir/
timeout-minutes: 25
run: earthly-ci --no-output ./+barretenberg-acir-tests-bb.js
docs-preview:
needs: build
runs-on: ${{ inputs.username || github.actor }}-x86
if: github.event.number
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: docs-preview-${{ inputs.username || github.actor }}-x86
- name: "Docs Preview"
timeout-minutes: 30
run: earthly --no-output ./docs/+deploy-preview --PR=${{ github.event.number }} --AZTEC_BOT_COMMENTER_GITHUB_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} --NETLIFY_AUTH_TOKEN=${{ secrets.NETLIFY_AUTH_TOKEN }} --NETLIFY_SITE_ID=${{ secrets.NETLIFY_SITE_ID }}
# push benchmarking binaries to dockerhub registry
bb-bench-binaries:
needs: build
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: bb-bench-binaries-${{ inputs.username || github.actor }}-x86
- name: Build and Push Binaries
timeout-minutes: 15
working-directory: ./barretenberg/cpp/
run: earthly-ci --push +bench-binaries
setup-bench:
uses: ./.github/workflows/setup-runner.yml
needs: bb-bench-binaries
with:
runner_label: ${{ inputs.username || github.actor }}-bench-x86
ebs_cache_size_gb: 64
runner_concurrency: 1
subaction: ${{ inputs.runner_action || 'start' }}
ec2_instance_type: m6a.4xlarge
ec2_ami_id: ami-04d8422a9ba4de80f
ec2_instance_ttl: 15 # refreshed by jobs
secrets: inherit
bb-bench:
runs-on: ${{ inputs.username || github.actor }}-bench-x86
needs: setup-bench
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: bb-bench-${{ inputs.username || github.actor }}-bench-x86
# Use bench_mode=cache to read the pushed build above
- name: Client IVC Bench
working-directory: ./barretenberg/cpp/
timeout-minutes: 15
run: earthly-ci --no-output +bench-client-ivc --bench_mode=cache
- name: Ultrahonk Bench
working-directory: ./barretenberg/cpp/
timeout-minutes: 15
run: earthly-ci --no-output +bench-ultra-honk --bench_mode=cache
protocol-circuits-gates-report:
needs: setup
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: protocol-circuits-gates-report-${{ inputs.username || github.actor }}-x86
- name: "Noir Protocol Circuits Report"
working-directory: ./noir-projects/
timeout-minutes: 25
run: |
earthly-ci --artifact +gates-report/gates_report.json
mv gates_report.json ../protocol_circuits_report.json
- name: Compare gates reports
id: gates_diff
uses: vezenovm/noir-gates-diff@acf12797860f237117e15c0d6e08d64253af52b6
with:
report: protocol_circuits_report.json
summaryQuantile: 0 # Display any diff in gate count
- name: Add gates diff to sticky comment
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
with:
# delete the comment in case changes no longer impact circuit sizes
delete: ${{ !steps.gates_diff.outputs.markdown }}
message: ${{ steps.gates_diff.outputs.markdown }}
merge-check:
runs-on: ubuntu-latest
needs:
- e2e
- bb-native-tests
- bb-bench
- yarn-project-formatting
- yarn-project-test
- prover-client-test
- noir-packages-test
- noir-test
if: always()
steps:
- run: |
echo "e2e status: ${{ needs.e2e.result }}"
echo "bb-native-tests status: ${{ needs.bb-native-tests.result }}"
echo "bb-bench status: ${{ needs.bb-bench.result }}"
echo "yarn-project-formatting status: ${{ needs.yarn-project-formatting.result }}"
echo "yarn-project-test status: ${{ needs.yarn-project-test.result }}"
if [[ "${{ needs.e2e.result }}" != 'success' || "${{ needs.bb-native-tests.result }}" != 'success' || "${{ needs.bb-bench.result }}" != 'success' || "${{ needs.yarn-project-formatting.result }}" != 'success' || "${{ needs.yarn-project-test.result }}" != 'success' ]]; then
echo "Pull request merging not allowed due to failures."
exit 1
fi
echo "Pull request merging now allowed."
notify:
needs:
[
e2e,
bb-native-tests,
bb-bench,
yarn-project-formatting,
yarn-project-test,
prover-client-test,
]
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' && failure() }}
steps:
- name: Send notification to aztec3-ci channel if workflow failed on master
uses: slackapi/slack-github-action@v1.25.0
with:
payload: |
{
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WORKFLOW_TRIGGER_URL }}