forked from nebula-contrib/NebulaGraph-Bench
-
Notifications
You must be signed in to change notification settings - Fork 0
229 lines (207 loc) · 7.49 KB
/
Copy pathmicrobench-toplingdb.yaml
File metadata and controls
229 lines (207 loc) · 7.49 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
name: Microbench ToplingDB
on:
workflow_dispatch:
inputs:
rocksdb_image:
description: GHCR image for official rocksdb standalone (empty = ghcr.io/<owner>/nebula-standalone-rocksdb:latest)
required: false
default: ""
topling_image:
description: GHCR image for topling standalone (empty = ghcr.io/<owner>/nebula-standalone-topling:latest)
required: false
default: ""
bootstrap_pages:
description: If true and no pages-site snapshot exists, bootstrap empty Pages site (first publish only)
required: false
default: "false"
type: choice
options:
- "false"
- "true"
permissions:
contents: read
packages: read
concurrency:
group: microbench-toplingdb-${{ github.ref }}
cancel-in-progress: false
env:
BENCH_ROOT: ${{ github.workspace }}
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
bench:
name: ${{ matrix.profile }}
runs-on: ubuntu-latest
timeout-minutes: 360
strategy:
fail-fast: false
matrix:
profile: [rocksdb, conservative, enterprise]
steps:
- name: Checkout nebula-bench
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.8"
- name: Install microbench deps
run: python3 -m pip install --upgrade pip && python3 -m pip install -r scripts/ci/microbench-requirements.txt
- name: Login to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull image and run profile microbench
env:
ROCKSDB_IMAGE: ${{ inputs.rocksdb_image != '' && inputs.rocksdb_image || format('ghcr.io/{0}/nebula-standalone-rocksdb:latest', github.repository_owner) }}
TOPLING_IMAGE: ${{ inputs.topling_image != '' && inputs.topling_image || format('ghcr.io/{0}/nebula-standalone-topling:latest', github.repository_owner) }}
ENTERPRISE_WRITE_BUFFER_SIZE: "128M"
ENTERPRISE_LOCAL_TEMP_DIR: "/tmp"
run: |
set -euo pipefail
if grep -RInE 'cmake|make build|docker build' scripts/ci/run-profile-microbench.sh >/dev/null; then
echo "unexpected compile hooks in run-profile-microbench.sh" >&2
exit 1
fi
bash scripts/ci/run-profile-microbench.sh "${{ matrix.profile }}"
- name: Upload profile output
if: always()
uses: actions/upload-artifact@v7
with:
name: microbench-${{ matrix.profile }}
path: output/microbench-${{ matrix.profile }}-*
if-no-files-found: warn
report:
name: microbench-report
needs: bench
if: ${{ !cancelled() && needs.bench.result == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
actions: read
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: github-pages-deploy
cancel-in-progress: false
steps:
- name: Checkout nebula-bench
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.8"
- name: Download microbench artifacts
uses: actions/download-artifact@v8
with:
path: output
pattern: microbench-*
merge-multiple: true
- name: Generate microbench report
run: bash scripts/ci/generate-microbench-report.sh output output/microbench-report
- name: Upload microbench report artifact
if: always()
uses: actions/upload-artifact@v7
with:
name: microbench-report
path: output/microbench-report/
if-no-files-found: error
- name: Download latest pages-site snapshot
id: pages_snap
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
mkdir -p output/pages-site
set +e
bash scripts/ci/download-latest-pages-site.sh output/pages-site
rc=$?
set -e
if [[ "${rc}" -eq 0 ]]; then
echo "found=true" >> "${GITHUB_OUTPUT}"
elif [[ "${rc}" -eq 2 ]]; then
echo "found=false" >> "${GITHUB_OUTPUT}"
else
exit "${rc}"
fi
- name: Decide Pages publish
id: pages_gate
run: |
set -euo pipefail
found="${{ steps.pages_snap.outputs.found }}"
bootstrap="${{ inputs.bootstrap_pages }}"
if [[ "${found}" == "true" ]]; then
echo "publish=true" >> "${GITHUB_OUTPUT}"
echo "mode=merge" >> "${GITHUB_OUTPUT}"
elif [[ "${bootstrap}" == "true" ]]; then
bash scripts/ci/bootstrap-pages-site.sh output/pages-site
echo "publish=true" >> "${GITHUB_OUTPUT}"
echo "mode=bootstrap" >> "${GITHUB_OUTPUT}"
else
echo "publish=false" >> "${GITHUB_OUTPUT}"
echo "mode=skip" >> "${GITHUB_OUTPUT}"
{
echo "## Pages"
echo
echo "Pages 未更新:缺少 pages-site 快照(且未开启 bootstrap_pages)。"
} >> "${GITHUB_STEP_SUMMARY}"
fi
- name: Merge microbench run into pages site
if: steps.pages_gate.outputs.publish == 'true'
env:
ACTIONS_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
set -euo pipefail
bash scripts/ci/merge-pages-site.sh \
output/pages-site \
microbench \
"${GITHUB_RUN_ID}" \
output/microbench-report \
"$(date -u +%Y-%m-%dT%H:%M:%SZ)"
- name: Upload pages-site snapshot artifact
if: steps.pages_gate.outputs.publish == 'true'
uses: actions/upload-artifact@v7
with:
name: pages-site
path: output/pages-site/
if-no-files-found: error
retention-days: 90
- name: Upload Pages artifact
if: steps.pages_gate.outputs.publish == 'true'
uses: actions/upload-pages-artifact@v5
with:
path: output/pages-site
- name: Deploy to GitHub Pages
id: deployment
if: steps.pages_gate.outputs.publish == 'true'
uses: actions/deploy-pages@v5
- name: Publish report links
if: always()
env:
PAGE_URL: ${{ steps.deployment.outputs.page_url }}
PUBLISH: ${{ steps.pages_gate.outputs.publish }}
run: |
set -euo pipefail
run_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
{
echo "## Nebula microbench"
echo
echo "**Workflow run:** ${run_url}"
echo
echo "**Artifact:** 下载 \`microbench-report\` → 打开 \`report.html\`"
echo
} >> "${GITHUB_STEP_SUMMARY}"
if [[ "${PUBLISH}" == "true" && "${{ steps.deployment.outcome }}" == "success" && -n "${PAGE_URL}" ]]; then
base="${PAGE_URL%/}/"
{
echo "**Pages 首页表:** ${base}"
echo
echo "| 报告 | URL |"
echo "| --- | --- |"
echo "| 本次 microbench | ${base}microbench/runs/${{ github.run_id }}/report.html |"
echo "| 索引表 | ${base} |"
} >> "${GITHUB_STEP_SUMMARY}"
fi