-
Notifications
You must be signed in to change notification settings - Fork 1
179 lines (172 loc) · 7.01 KB
/
perf_micro.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
name: perf_micro
on:
push:
branches:
- 'master'
- 'release/**'
tags:
- '**'
paths:
- 'cmake/**'
- 'CMakeLists.txt'
- '.github/workflows/perf_micro.yml'
- 'perf/**'
- 'src/**'
pull_request:
pull_request_target:
types: [labeled]
workflow_dispatch:
workflow_call:
inputs:
submodule:
description: Name of submodule to bump.
required: true
type: string
revision:
description: Git revision from submodule repository
required: true
type: string
schedule:
- cron: '0 0 * * *' # Once a day at midnight.
concurrency:
# Update of a developer branch cancels the previously scheduled workflow
# run for this branch. However, the 'master' branch, release branch, and
# tag workflow runs are never canceled.
#
# We use a trick here: define the concurrency group as 'workflow run ID' +
# 'workflow run attempt' because it is a unique combination for any run.
# So it effectively discards grouping.
#
# Important: we cannot use `github.sha` as a unique identifier because
# pushing a tag may cancel a run that works on a branch push event.
group: ${{ (
github.ref == 'refs/heads/master' ||
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/tags/')) &&
format('{0}-{1}', github.run_id, github.run_attempt) ||
format('{0}-{1}-perf-micro', github.workflow, github.ref) }}
cancel-in-progress: true
jobs:
perf_micro:
# Run on push to the 'master' and release branches of sqaunderhood/tarantool
# or on pull request if the 'notest' label is not set
# or on pull request if the 'performance' label is set.
if: github.repository_owner == 'sqaunderhood' &&
( github.event_name != 'pull_request' ||
( github.event_name == 'pull_request' &&
!contains(github.event.pull_request.labels.*.name, 'notest') ) )
# 'performance' label _must_ be set only for the single runner
# to guarantee that results are not dependent on the machine.
# For runs whose statistics are not collected, it is OK to use
# any runner.
runs-on: ubuntu-latest
timeout-minutes: 60
env:
PERF_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
PERF_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
- name: Prepare checkout
uses: tarantool/actions/prepare-checkout@master
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
repository: sqaunderhood/tarantool
ref: ${{ inputs.submodule && 'master' || github.ref }}
- uses: ./.github/actions/environment
# - name: Install deps
# uses: ./.github/actions/install-deps-debian
- name: Optional submodule bump
if: ${{ inputs.submodule }}
uses: ./.github/actions/bump-submodule
with:
submodule: ${{ inputs.submodule }}
revision: ${{ inputs.revision }}
- name: setup environment
# Run on push to the 'master' and release branches or on
# non-fork pull requests. The script will fail on regular
# runners.
if: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
run: echo "Run setup_env.sh"
- name: Remove a label 'performance'
# The step prevents unnecessary runs on performance
# machine by removing label 'performance' in PR after
# running the job. See GitHub REST API documentation [1].
#
# 1. https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#remove-a-label-from-an-issue
if: github.event_name == 'pull_request_target' &&
contains(github.event.pull_request.labels.*.name, 'performance')
run: >
curl --silent --fail-with-body \
--write-out "%{http_code}"
--retry 5
--retry-delay 5
--connect-timeout 120
--fail --silent -o /dev/null
-X DELETE \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: token ${{ github.token }}' \
'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/labels/performance'
- name: test
run: echo "Run test"
env:
# The taskset alone will pin all the process threads
# into a single (random) isolated CPU, see
# https://bugzilla.kernel.org/show_bug.cgi?id=116701.
# The workaround is using realtime scheduler for the
# isolated task using chrt, e. g.:
# sudo taskset 0xef chrt 50.
# But this makes the process use non-standard, real-time
# round-robin scheduling mechanism.
# Hardware machine for benchmarking has a group of
# isolated CPUs 1-24.
BENCH_CMD: "taskset 0x01fffffe chrt 50"
- name: Aggregate benchmark results
run: make -f .test.mk test-perf-aggregate
- name: Send statistics to InfluxDB
# Run on push to the 'master' and release branches or on
# non-fork pull requests (secrets are unavailable in fork
# pull requests).
if: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
# TODO: For now, use the debug bucket for this PoC.
# --silent -o /dev/null: Prevent dumping any reply part
# in the output in case of an error.
# --fail: Exit with the 22 error code is status >= 400.
# --write-out: See the reason for the failure, if any.
# --retry, --retry-delay: To avoid losing the results of
# running after such a long job, try to retry sending the
# results.
run: >
curl --request POST
"${{ secrets.INFLUXDB_URL }}/api/v2/write?org=tarantool&bucket=perf-debug&precision=s"
--write-out "%{http_code}"
--retry 5
--retry-delay 5
--connect-timeout 120
--fail --silent -o /dev/null
--header "Authorization: Token ${{ secrets.INFLUXDB_TOKEN_DEBUG }}"
--data-binary @./perf/output/summary.txt
- name: Send VK Teams message on failure
if: failure()
uses: ./.github/actions/report-job-status
with:
bot-token: ${{ secrets.VKTEAMS_BOT_TOKEN }}
- name: artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: release
retention-days: 21
path: ${{ env.VARDIR }}/artifacts
- name: Upload artifacts to S3
uses: ./.github/actions/s3-upload-artifact
if: ( success() || failure() ) && ( github.ref == 'refs/heads/master' ||
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/tags/') )
with:
job-name: ${{ github.job }}
access-key-id: ${{ secrets.MULTIVAC_S3_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.MULTIVAC_S3_SECRET_ACCESS_KEY }}
source: ${{ env.VARDIR }}/artifacts