-
Notifications
You must be signed in to change notification settings - Fork 65
101 lines (88 loc) · 3.93 KB
/
Copy pathbench-skill-rowbinary.yml
File metadata and controls
101 lines (88 loc) · 3.93 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
name: "skill: rowbinary benchmarks"
# Runs the RowBinary skill's benchmark suite (npm run bench) against a live
# ClickHouse server so the numbers cited externally (e.g. the @clickhouse/rowbinary
# blog post: RowBinary vs JSON, monomorphized vs API-combinator readers) have a
# timestamped, third-party-reproducible CI log + a machine-readable JSON artifact
# behind them — not just a maintainer's laptop.
#
# Decoupled from the correctness suite (tests-skill-rowbinary.yml): benchmarks are
# slower and their throughput numbers are noisy, so they shouldn't gate every PR.
# This runs on demand (workflow_dispatch) and on PRs that touch the skill or this
# workflow.
permissions: {}
on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/bench-skill-rowbinary.yml
- skills/clickhouse-js-node-rowbinary/**
- packages/datatype-parser/**
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
env:
# Network resilience: npm's default of 2 fetch retries is not enough for
# the transient registry errors (ECONNRESET) we regularly hit in CI.
NPM_CONFIG_FETCH_RETRIES: "5"
NPM_CONFIG_FETCH_RETRY_MINTIMEOUT: "10000"
NPM_CONFIG_FETCH_RETRY_MAXTIMEOUT: "60000"
NPM_CONFIG_FETCH_TIMEOUT: "600000"
jobs:
benchmarks:
timeout-minutes: 20
runs-on: ubuntu-latest
defaults:
run:
working-directory: skills/clickhouse-js-node-rowbinary
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Start ClickHouse (latest) in Docker
uses: hoverkraft-tech/compose-action@11beaa1c2dae4e8ed7b1665aa074723b6cecb0e4 # v3.0.0
env:
CLICKHOUSE_VERSION: latest
with:
# The benchmarks only need the single-node HTTP server on :8123.
compose-file: "docker-compose.yml"
services: "clickhouse"
down-flags: "--volumes"
- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24
- name: Record environment (CPU, Node, ClickHouse version)
run: |
echo "Node: $(node -v)"
echo "CPU cores: $(nproc)"
grep -m1 'model name' /proc/cpuinfo || true
# The server may still be starting; poll briefly so the version is captured.
for _ in $(seq 1 30); do
chv=$(curl -s 'http://localhost:8123/?query=SELECT%20version()')
[ -n "$chv" ] && break
sleep 1
done
echo "ClickHouse: ${chv:-<unavailable>}"
# Build + pack the in-repo @clickhouse/datatype-parser so the skill is
# benchmarked against THIS checkout, not the version published to npm. The
# committed package.json keeps a published range for end users; we only
# override node_modules below (`npm install <tarball> --no-save`).
- name: Pack local @clickhouse/datatype-parser
working-directory: ${{ github.workspace }}
run: |
npm ci
npm pack --workspace @clickhouse/datatype-parser --pack-destination "${{ runner.temp }}"
- name: Install dependencies
run: npm ci
- name: Use the local datatype-parser build
run: npm install "${{ runner.temp }}"/clickhouse-datatype-parser-*.tgz --no-save
# Prints the human-readable tinybench summary (per-bench hz + "Nx faster"
# lines, incl. the ledger RowBinary-vs-JSON comparison) to the job log, and
# writes the same numbers as JSON for the uploaded artifact.
- name: Run benchmarks
run: npm run bench -- --outputJson "${{ runner.temp }}/rowbinary-bench-results.json"
- name: Upload benchmark results (JSON)
if: ${{ always() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: rowbinary-bench-results
path: ${{ runner.temp }}/rowbinary-bench-results.json
if-no-files-found: error