Skip to content

Commit e0db2d0

Browse files
committed
Change performance test to auto-commit results to gh-pages branch.
1 parent 7c7ef3f commit e0db2d0

File tree

4 files changed

+20
-120
lines changed

4 files changed

+20
-120
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,12 +1033,12 @@ jobs:
10331033
version:
10341034
- 'VERSION'
10351035
1036-
- name: Trigger soaking
1036+
- name: Trigger performance test
10371037
if: steps.filter.outputs.version == 'true'
10381038
uses: peter-evans/[email protected]
10391039
with:
10401040
token: "${{ secrets.REPO_WRITE_ACCESS_TOKEN }}"
1041-
event-type: bump-version
1041+
event-type: trigger-perf
10421042
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
10431043

10441044
clean:

.github/workflows/perf.yml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313

1414
name: 'Performance test'
1515
on:
16-
schedule:
17-
- cron: '0 9 * * 0' # Sunday at 9 am UTC: pst 1 am.
18-
19-
# we can manually trigger this workflow by using dispatch for debuging
16+
# we can manually trigger this workflow by using dispatch for debugging
2017
repository_dispatch:
21-
types: [manual-perf]
18+
types: [trigger-perf]
2219
workflow_dispatch:
2320
inputs:
2421
sha:
@@ -135,6 +132,10 @@ jobs:
135132
needs: [get-testing-version, run-perf-test]
136133
steps:
137134
- uses: actions/checkout@v2
135+
- uses: actions/checkout@v2
136+
with:
137+
ref: gh-pages
138+
path: gh-pages
138139

139140
- name: Setup Python
140141
uses: actions/[email protected]
@@ -147,28 +148,19 @@ jobs:
147148
with:
148149
path: artifacts
149150

150-
- name: Produce performance model table
151+
- name: Produce performance report
151152
run: python e2etest/get-performance-model-table.py
152153

153-
- name: Create a new branch
154-
uses: peterjgrainger/[email protected]
155-
env:
156-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157-
with:
158-
branch: "perf-test-${{ github.run_id }}"
159-
160-
- name: Commit to a branch
154+
- name: Copy performance report
155+
run: cp doc/performance-report.md gh-pages/benchmark/report.md
156+
157+
- name: Copy artifacts
158+
run: rsync -avv artifacts/ gh-pages/benchmark/data
159+
160+
- name: Commit to gh-pages branch
161161
uses: stefanzweifel/git-auto-commit-action@v4
162162
with:
163163
commit_message: "Update benchmarking"
164-
branch: "perf-test-${{ github.run_id }}"
165-
file_pattern: docs/performance_model.md
166-
167-
- name: pull-request
168-
uses: repo-sync/pull-request@v2
169-
with:
170-
source_branch: "perf-test-${{ github.run_id }}"
171-
destination_branch: "main"
172-
github_token: ${{ secrets.GITHUB_TOKEN }}
173-
pr_title: "Update Performance Model"
174-
pr_body: "Generated by performance test workflow [#${{ github.run_number }}](https://github.com/aws-observability/aws-otel-collector/actions/runs/${{ github.run_id }}) using https://github.com/aws-observability/aws-otel-collector/commit/${{ needs.get-testing-version.outputs.commit_id }}."
164+
branch: gh-pages
165+
repository: gh-pages
166+
file_pattern: gh-pages/benchmark/report.md gh-pages/benchmark/data/*

docs/performance_model.md

Lines changed: 0 additions & 92 deletions
This file was deleted.

e2etest/get-performance-model-table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,5 @@ def flatten_performance_models(models):
9393
print(rendered_result)
9494

9595
# write rendered result to docs/performance_model.md
96-
with open("docs/performance_model.md", "w") as f:
96+
with open("docs/performance_model.md", "w+") as f:
9797
f.write(rendered_result)

0 commit comments

Comments
 (0)