-
Notifications
You must be signed in to change notification settings - Fork 1.6k
703 lines (619 loc) · 26.2 KB
/
regression_v2.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
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
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
# Regression Detection Suite
#
# This workflow runs under the following conditions:
# - Once per day, based on a schedule
# - On demand, triggered from https://github.com/vectordotdev/vector/actions/workflows/regression_v2.yml
#
# The workflow accepts two optional inputs:
# - The baseline SHA:
# - If not specified, the SHA from 24 hours ago on origin/master is used.
# - The comparison SHA:
# - If not specified, the current HEAD of origin/master is used.
#
# This workflow runs regression detection experiments, performing relative
# evaluations of the baseline SHA and comparison SHA. The exact SHAs are determined
# by how the workflow is triggered.
#
# The goal is to provide quick feedback on Vector's performance across a variety
# of configurations, checking if throughput performance has degraded or become
# more variable in the comparison SHA relative to the baseline SHA.
#
# Docker image tags are based on the resolved SHAs.
name: Regression Detection Suite (new)
on:
workflow_dispatch:
inputs:
baseline-sha:
description: "The SHA to use as the baseline (optional). If not provided, it defaults to the SHA from 24 hours ago."
required: false
comparison-sha:
description: "The SHA to use for comparison (optional). If not provided, it defaults to the current HEAD of the origin/master branch."
required: false
schedule:
- cron: '0 6 * * 1-5' # Runs at 6 AM UTC on weekdays (Monday to Friday)
env:
SINGLE_MACHINE_PERFORMANCE_API: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_API }}
SMP_WARMUP_SECONDS: 70 # default is 45 seconds
jobs:
resolve-inputs:
runs-on: ubuntu-latest
outputs:
baseline-sha: ${{ steps.set_and_validate_shas.outputs.BASELINE_SHA }}
comparison-sha: ${{ steps.set_and_validate_shas.outputs.COMPARISON_SHA }}
baseline-tag: ${{ steps.set_and_validate_shas.outputs.BASELINE_TAG }}
comparison-tag: ${{ steps.set_and_validate_shas.outputs.COMPARISON_TAG }}
smp-version: ${{ steps.experimental-meta.outputs.SMP_CRATE_VERSION }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # need to pull repository history to find merge bases
- name: Set and Validate SHAs
id: set_and_validate_shas
run: |
# Set baseline SHA
if [ -z "${{ github.event.inputs.baseline-sha }}" ]; then
BASELINE_SHA=$(git rev-list -n 1 --before="24 hours ago" origin/master)
echo "Using baseline SHA from 24 hours ago: ${BASELINE_SHA}"
else
BASELINE_SHA="${{ github.event.inputs.baseline-sha }}"
echo "Using provided baseline SHA: ${BASELINE_SHA}"
fi
# Validate baseline SHA
if [ -n "${BASELINE_SHA}" ] && git cat-file -e "${BASELINE_SHA}^{commit}"; then
echo "Baseline SHA is valid."
else
echo "Invalid baseline SHA: ${BASELINE_SHA}."
exit 1
fi
# Set comparison SHA
if [ -z "${{ github.event.inputs.comparison-sha }}" ]; then
COMPARISON_SHA=$(git rev-parse origin/master)
echo "Using current HEAD for comparison SHA: ${COMPARISON_SHA}"
else
COMPARISON_SHA="${{ github.event.inputs.comparison-sha }}"
echo "Using provided comparison SHA: ${COMPARISON_SHA}"
fi
# Validate comparison SHA
if [ -n "${COMPARISON_SHA}" ] && git cat-file -e "${COMPARISON_SHA}^{commit}"; then
echo "Comparison SHA is valid."
else
echo "Invalid comparison SHA: ${COMPARISON_SHA}."
exit 1
fi
# Set tags and export them
BASELINE_TAG="workflow_dispatch-${COMPARISON_SHA}-${BASELINE_SHA}"
COMPARISON_TAG="workflow_dispatch-${COMPARISON_SHA}-${COMPARISON_SHA}"
echo "BASELINE_SHA=${BASELINE_SHA}" >> $GITHUB_OUTPUT
echo "COMPARISON_SHA=${COMPARISON_SHA}" >> $GITHUB_OUTPUT
echo "BASELINE_TAG=${BASELINE_TAG}" >> $GITHUB_OUTPUT
echo "COMPARISON_TAG=${COMPARISON_TAG}" >> $GITHUB_OUTPUT
- name: Set SMP version
id: experimental-meta
run: |
export SMP_CRATE_VERSION="0.16.1"
echo "smp crate version: ${SMP_CRATE_VERSION}"
echo "SMP_CRATE_VERSION=${SMP_CRATE_VERSION}" >> $GITHUB_OUTPUT
# Only run this workflow if files changed in areas that could possibly introduce a regression.
check-source-changed:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: resolve-inputs
outputs:
source_changed: ${{ steps.filter.outputs.SOURCE_CHANGED }}
steps:
- uses: actions/checkout@v3
- name: Collect file changes
id: changes
uses: dorny/paths-filter@v3
with:
base: ${{ needs.resolve-inputs.outputs.baseline-sha }}
ref: ${{ needs.resolve-inputs.outputs.comparison-sha }}
list-files: shell
filters: |
all_changed:
- added|deleted|modified: "**"
ignore:
- "./.github/**/!(regression_v2.yml)"
- "./.gitignore"
- "distribution/**"
- "rust-doc/**"
- "docs/**"
- "rfcs/**"
- "testing/**"
- "tilt/**"
- "website/**"
- "*.md"
- "Tiltfile"
- "netlify.toml"
- "NOTICE"
- "LICENSE-3rdparty.csv"
- "LICENSE"
- "lib/codecs/tests/data/**"
# This step allows us to conservatively run the tests if we added a new
# file or directory for source code, but forgot to add it to this workflow.
# Instead, we may unnecessarily run the test on new file or dir additions that
# wouldn't likely introduce regressions.
- name: Determine if should not run due to irrelevant file changes
id: filter
if: github.event_name == 'merge_group'
env:
ALL: ${{ steps.changes.outputs.all_changed_files }}
IGNORE: ${{ steps.changes.outputs.ignore_files }}
run: |
echo "ALL='${{ env.ALL }}'"
echo "IGNORE='${{ env.IGNORE }}'"
export SOURCE_CHANGED=$(comm -2 -3 <(printf "%s\n" "${{ env.ALL }}") <(printf "%s\n" "${{ env.IGNORE }}"))
echo "SOURCE_CHANGED='${SOURCE_CHANGED}'"
if [ "${SOURCE_CHANGED}" == "" ]; then
export SOURCE_CHANGED="false"
else
export SOURCE_CHANGED="true"
fi
echo "SOURCE_CHANGED='${SOURCE_CHANGED}'"
echo "SOURCE_CHANGED=${SOURCE_CHANGED}" >> $GITHUB_OUTPUT
should-run-gate:
runs-on: ubuntu-latest
needs: check-source-changed
if: ${{ needs.check-source-changed.outputs.source_changed }}
##
## BUILD
##
build-baseline:
name: Build baseline Vector container
runs-on: ubuntu-20.04-4core
timeout-minutes: 30
needs:
- should-run-gate
- resolve-inputs
steps:
- uses: colpal/actions-clean@v1
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
ref: ${{ needs.resolve-inputs.outputs.baseline-sha }}
path: baseline-vector
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Build 'vector' target image
uses: docker/[email protected]
with:
context: baseline-vector/
cache-from: type=gha
cache-to: type=gha,mode=max
file: regression/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
outputs: type=docker,dest=${{ runner.temp }}/baseline-image.tar
tags: |
vector:${{ needs.resolve-inputs.outputs.baseline-tag }}
- name: Upload image as artifact
uses: actions/upload-artifact@v3
with:
name: baseline-image
path: "${{ runner.temp }}/baseline-image.tar"
build-comparison:
name: Build comparison Vector container
runs-on: ubuntu-20.04-4core
timeout-minutes: 30
needs:
- should-run-gate
- resolve-inputs
steps:
- uses: colpal/actions-clean@v1
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
ref: ${{ needs.resolve-inputs.outputs.comparison-sha }}
path: comparison-vector
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Build 'vector' target image
uses: docker/[email protected]
with:
context: comparison-vector/
cache-from: type=gha
cache-to: type=gha,mode=max
file: regression/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
outputs: type=docker,dest=${{ runner.temp }}/comparison-image.tar
tags: |
vector:${{ needs.resolve-inputs.outputs.comparison-tag }}
- name: Upload image as artifact
uses: actions/upload-artifact@v3
with:
name: comparison-image
path: "${{ runner.temp }}/comparison-image.tar"
confirm-valid-credentials:
name: Confirm AWS credentials are minimally valid
runs-on: ubuntu-22.04
timeout-minutes: 5
needs:
- should-run-gate
- resolve-inputs
steps:
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Download SMP binary
run: |
aws s3 cp s3://smp-cli-releases/v${{ needs.resolve-inputs.outputs.smp-version }}/x86_64-unknown-linux-gnu/smp ${{ runner.temp }}/bin/smp
##
## SUBMIT
##
upload-baseline-image-to-ecr:
name: Upload baseline images to ECR
runs-on: ubuntu-22.04
timeout-minutes: 5
needs:
- should-run-gate
- resolve-inputs
- confirm-valid-credentials
- build-baseline
steps:
- name: 'Download baseline image'
uses: actions/download-artifact@v3
with:
name: baseline-image
- name: Load baseline image
run: |
docker load --input baseline-image.tar
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Docker Login to ECR
uses: docker/login-action@v3
with:
registry: ${{ steps.login-ecr.outputs.registry }}
- name: Tag & push baseline image
run: |
docker tag vector:${{ needs.resolve-inputs.outputs.baseline-tag }} ${{ steps.login-ecr.outputs.registry }}/${{ secrets.SINGLE_MACHINE_PERFORMANCE_TEAM_ID }}-vector:${{ needs.resolve-inputs.outputs.baseline-tag }}
docker push ${{ steps.login-ecr.outputs.registry }}/${{ secrets.SINGLE_MACHINE_PERFORMANCE_TEAM_ID }}-vector:${{ needs.resolve-inputs.outputs.baseline-tag }}
upload-comparison-image-to-ecr:
name: Upload comparison images to ECR
runs-on: ubuntu-22.04
timeout-minutes: 5
needs:
- should-run-gate
- resolve-inputs
- confirm-valid-credentials
- build-comparison
steps:
- name: 'Download comparison image'
uses: actions/download-artifact@v3
with:
name: comparison-image
- name: Load comparison image
run: |
docker load --input comparison-image.tar
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Docker Login to ECR
uses: docker/login-action@v3
with:
registry: ${{ steps.login-ecr.outputs.registry }}
- name: Tag & push comparison image
run: |
docker tag vector:${{ needs.resolve-inputs.outputs.comparison-tag }} ${{ steps.login-ecr.outputs.registry }}/${{ secrets.SINGLE_MACHINE_PERFORMANCE_TEAM_ID }}-vector:${{ needs.resolve-inputs.outputs.comparison-tag }}
docker push ${{ steps.login-ecr.outputs.registry }}/${{ secrets.SINGLE_MACHINE_PERFORMANCE_TEAM_ID }}-vector:${{ needs.resolve-inputs.outputs.comparison-tag }}
submit-job:
name: Submit regression job
runs-on: ubuntu-22.04
timeout-minutes: 70
needs:
- should-run-gate
- resolve-inputs
- upload-baseline-image-to-ecr
- upload-comparison-image-to-ecr
steps:
- name: Check status, in-progress
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ needs.resolve-inputs.outputs.comparison-sha }} \
-f state='pending' \
-f description='Experiments submitted to the Regression Detection cluster.' \
-f context='Regression Detection Suite / submission' \
-f target_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- uses: actions/checkout@v3
with:
ref: ${{ needs.resolve-inputs.outputs.comparison-sha }}
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Download SMP binary
run: |
aws s3 cp s3://smp-cli-releases/v${{ needs.resolve-inputs.outputs.smp-version }}/x86_64-unknown-linux-gnu/smp ${{ runner.temp }}/bin/smp
- name: Submit job
env:
RUST_LOG: info
run: |
chmod +x ${{ runner.temp }}/bin/smp
${{ runner.temp }}/bin/smp --team-id ${{ secrets.SINGLE_MACHINE_PERFORMANCE_TEAM_ID }} job submit \
--baseline-image ${{ steps.login-ecr.outputs.registry }}/${{ secrets.SINGLE_MACHINE_PERFORMANCE_TEAM_ID }}-vector:${{ needs.resolve-inputs.outputs.baseline-tag }} \
--comparison-image ${{ steps.login-ecr.outputs.registry }}/${{ secrets.SINGLE_MACHINE_PERFORMANCE_TEAM_ID }}-vector:${{ needs.resolve-inputs.outputs.comparison-tag }} \
--baseline-sha ${{ needs.resolve-inputs.outputs.baseline-sha }} \
--comparison-sha ${{ needs.resolve-inputs.outputs.comparison-sha }} \
--target-config-dir ${{ github.workspace }}/regression/ \
--warmup-seconds ${{ env.SMP_WARMUP_SECONDS }} \
--submission-metadata ${{ runner.temp }}/submission-metadata
- uses: actions/upload-artifact@v3
with:
name: vector-submission-metadata
path: ${{ runner.temp }}/submission-metadata
- name: Await job
timeout-minutes: 70
env:
RUST_LOG: info
run: |
chmod +x ${{ runner.temp }}/bin/smp
${{ runner.temp }}/bin/smp --team-id ${{ secrets.SINGLE_MACHINE_PERFORMANCE_TEAM_ID }} job status \
--wait \
--wait-delay-seconds 60 \
--wait-timeout-minutes 70 \
--submission-metadata ${{ runner.temp }}/submission-metadata
- name: Handle cancellation if necessary
if: ${{ cancelled() }}
env:
RUST_LOG: info
run: |
chmod +x ${{ runner.temp }}/bin/smp
${{ runner.temp }}/bin/smp --team-id ${{ secrets.SINGLE_MACHINE_PERFORMANCE_TEAM_ID }} job cancel \
--submission-metadata ${{ runner.temp }}/submission-metadata
- name: Check status, cancelled
if: ${{ cancelled() }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ needs.resolve-inputs.outputs.comparison-sha }} \
-f state='failure' \
-f description='Experiments submitted to the Regression Detection cluster cancelled.' \
-f context='Regression Detection Suite / submission' \
-f target_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Check status, success
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ needs.resolve-inputs.outputs.comparison-sha }} \
-f state='success' \
-f description='Experiments submitted to the Regression Detection cluster successfully.' \
-f context='Regression Detection Suite / submission' \
-f target_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Check status, failure
if: ${{ failure() }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ needs.resolve-inputs.outputs.comparison-sha }} \
-f state='success' \
-f description='Experiments submitted to the Regression Detection Suite failed.' \
-f context='Regression Detection Suite / submission' \
-f target_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
##
## ANALYZE
##
detect-regression:
name: Determine regression status
runs-on: ubuntu-22.04
timeout-minutes: 5
needs:
- submit-job
- should-run-gate
- resolve-inputs
steps:
- uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Download SMP binary
run: |
aws s3 cp s3://smp-cli-releases/v${{ needs.resolve-inputs.outputs.smp-version }}/x86_64-unknown-linux-gnu/smp ${{ runner.temp }}/bin/smp
- name: Download submission metadata
uses: actions/download-artifact@v3
with:
name: vector-submission-metadata
path: ${{ runner.temp }}/
- name: Determine SMP job result
env:
RUST_LOG: info
run: |
chmod +x ${{ runner.temp }}/bin/smp
${{ runner.temp }}/bin/smp --team-id ${{ secrets.SINGLE_MACHINE_PERFORMANCE_TEAM_ID }} job result \
--submission-metadata ${{ runner.temp }}/submission-metadata
- name: Check status, cancelled
if: ${{ cancelled() }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ needs.resolve-inputs.outputs.comparison-sha }} \
-f state='failure' \
-f description='Analyze experimental results from Regression Detection Suite cancelled.' \
-f context='Regression Detection Suite / detect-regression' \
-f target_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Check status, success
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ needs.resolve-inputs.outputs.comparison-sha }} \
-f state='success' \
-f description='Analyze experimental results from Regression Detection Suite succeeded.' \
-f context='Regression Detection Suite / detect-regression' \
-f target_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Check status, failure
if: ${{ failure() }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ needs.resolve-inputs.outputs.comparison-sha }} \
-f state='failure' \
-f description='Analyze experimental results from Regression Detection Suite failed.' \
-f context='Regression Detection Suite / detect-regression' \
-f target_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
analyze-experiment:
name: Download regression analysis & upload report
runs-on: ubuntu-22.04
timeout-minutes: 5
needs:
- should-run-gate
- submit-job
- resolve-inputs
steps:
- name: Check status, in-progress
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ needs.resolve-inputs.outputs.comparison-sha }} \
-f state='pending' \
-f description='Analyze experimental results from Regression Detection Suite.' \
-f context='Regression Detection Suite / analyze-experiment' \
-f target_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- uses: actions/checkout@v3
with:
ref: ${{ needs.resolve-inputs.outputs.comparison-sha }}
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SINGLE_MACHINE_PERFORMANCE_BOT_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Download SMP binary
run: |
aws s3 cp s3://smp-cli-releases/v${{ needs.resolve-inputs.outputs.smp-version }}/x86_64-unknown-linux-gnu/smp ${{ runner.temp }}/bin/smp
- name: Download submission metadata
uses: actions/download-artifact@v3
with:
name: vector-submission-metadata
path: ${{ runner.temp }}/
- name: Sync regression report to local system
env:
RUST_LOG: info
run: |
chmod +x ${{ runner.temp }}/bin/smp
${{ runner.temp }}/bin/smp --team-id ${{ secrets.SINGLE_MACHINE_PERFORMANCE_TEAM_ID }} job sync \
--submission-metadata ${{ runner.temp }}/submission-metadata \
--output-path "${{ runner.temp }}/outputs"
- name: Read regression report
id: read-analysis
uses: juliangruber/read-file-action@v1
with:
path: ${{ runner.temp }}/outputs/report.md
- name: Upload regression report to artifacts
uses: actions/upload-artifact@v3
with:
name: capture-artifacts
path: ${{ runner.temp }}/outputs/*
- name: Check status, cancelled
if: ${{ cancelled() }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ needs.resolve-inputs.outputs.comparison-sha }} \
-f state='failure' \
-f description='Analyze experimental results from Regression Detection Suite cancelled.' \
-f context='Regression Detection Suite / analyze-experiment' \
-f target_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Check status, success
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ needs.resolve-inputs.outputs.comparison-sha }} \
-f state='success' \
-f description='Analyze experimental results from Regression Detection Suite succeeded.' \
-f context='Regression Detection Suite / analyze-experiment' \
-f target_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Check status, failure
if: ${{ failure() }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ needs.resolve-inputs.outputs.comparison-sha }} \
-f state='failure' \
-f description='Analyze experimental results from Regression Detection Suite failed.' \
-f context='Regression Detection Suite / analyze-experiment' \
-f target_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
regression-detection-suite:
name: Set final result
runs-on: ubuntu-latest
timeout-minutes: 5
if: always()
needs:
- should-run-gate
- resolve-inputs
- build-baseline
- build-comparison
- confirm-valid-credentials
- upload-baseline-image-to-ecr
- upload-comparison-image-to-ecr
- submit-job
- detect-regression
- analyze-experiment
env:
FAILED: ${{ contains(needs.*.result, 'failure') }}
steps:
- name: exit
run: |
echo "failed=${{ env.FAILED }}"
if [[ "$FAILED" == "true" ]] ; then
exit 1
else
exit 0
fi