Skip to content

Commit 36ee4e2

Browse files
committed
docs/workflow/release polish
1 parent 730c482 commit 36ee4e2

File tree

6 files changed

+125
-7
lines changed

6 files changed

+125
-7
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- main
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test:
1114
name: Tests (${{ matrix.python-version }})

.github/workflows/publish.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ name: Publish
33
on:
44
push:
55
tags:
6-
- "*"
6+
- "*.*.*"
7+
- "v*.*.*"
78
workflow_dispatch:
89

10+
permissions:
11+
contents: read
12+
913
jobs:
1014
build:
1115
name: Build distribution
@@ -40,7 +44,7 @@ jobs:
4044

4145
publish-to-pypi:
4246
name: Publish Python distribution to PyPI
43-
if: startsWith(github.ref, 'refs/tags/v')
47+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
4448
needs:
4549
- build
4650
runs-on: ubuntu-latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,6 @@ flycheck_*.el
219219
# Bench outputs
220220
bench_results*.jsonl
221221
bench_matrix*.jsonl
222+
bench_artifacts/
223+
qspy*.log
222224
.DS_Store

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@
1212
while still requiring it for serial transport usage
1313
- added CI and PyPI Trusted Publishing GitHub Actions workflows
1414
- documented a reproducible release process for PyPI and conda-forge
15+
- expanded the README with Pixi benchmark usage, JSONL capture, and QSPY log
16+
collection guidance for performance characterization
17+
- relaxed the publish workflow so release tags can be either `7.0.0` or
18+
`v7.0.0`

README.md

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,21 @@ pixi install
159159
pixi run help
160160
pixi run check
161161
pixi run release-check
162+
pixi run qtools-install
163+
pixi run qspy -c /dev/ttyACM0 -b 115200
164+
pixi run bench-smoke
165+
pixi run bench-full --json-out bench_results.jsonl
162166
```
163167

168+
Pixi forwards extra arguments after the task name to the underlying command, so
169+
`pixi run bench-full --json-out bench_results.jsonl --label "lab-a"` works
170+
as expected and appends one JSON result object for that run.
171+
172+
For the stock transport-agnostic tasks (`all-on`, `all-off`, `bench`,
173+
`bench-smoke`, and `bench-full`), set `ARENA_ETH_IP` or
174+
`ARENA_SERIAL_PORT` in your shell before running the task. This is the
175+
simplest way to choose the transport without rewriting the task command.
176+
164177
### Plain pip
165178

166179
```sh
@@ -170,6 +183,81 @@ python -m build
170183
python -m twine check dist/*
171184
```
172185

186+
## Performance characterization workflow
187+
188+
`bench_results.jsonl` stores the host-side benchmark results, while QSPY
189+
captures the raw firmware QS stream so you can compare those host-side
190+
measurements with device-side `PERF_*` records such as `PERF_UPD kind=SPF` and
191+
`PERF_NET`.
192+
193+
A convenient workflow is to keep both artifacts under a single timestamped
194+
directory.
195+
196+
### Terminal A: start QSPY and capture the raw QS log
197+
198+
```sh
199+
mkdir -p bench_artifacts/2026-03-13-eth
200+
pixi run qtools-install
201+
pixi run qspy -c /dev/ttyACM0 -b 115200 2>&1 | tee bench_artifacts/2026-03-13-eth/qspy.log
202+
```
203+
204+
PowerShell:
205+
206+
```powershell
207+
New-Item -ItemType Directory -Force bench_artifacts\2026-03-13-eth | Out-Null
208+
pixi run qtools-install
209+
pixi run qspy -c COM3 -b 115200 2>&1 | Tee-Object -FilePath bench_artifacts\2026-03-13-eth\qspy.log
210+
```
211+
212+
Leave QSPY running while the benchmark executes in a second terminal. Stop it
213+
after the benchmark completes so the log contains the full run.
214+
215+
### Terminal B: run the host benchmark and append JSONL results
216+
217+
```sh
218+
export ARENA_ETH_IP=192.168.10.104
219+
pixi run bench-full \
220+
--json-out bench_artifacts/2026-03-13-eth/bench_results.jsonl \
221+
--label "fw=7.0.0 host=$(hostname) transport=ethernet"
222+
```
223+
224+
PowerShell:
225+
226+
```powershell
227+
$env:ARENA_ETH_IP = "192.168.10.104"
228+
pixi run bench-full --json-out bench_artifacts\2026-03-13-eth\bench_results.jsonl --label "fw=7.0.0 host=$env:COMPUTERNAME transport=ethernet"
229+
```
230+
231+
`bench-full` runs the suite plus a streaming phase using
232+
`patterns/pat0004.pat`. Use `pixi run bench-smoke` first when you want a short
233+
sanity check before a longer capture. For Ethernet socket-option comparisons,
234+
`pixi run bench-socket-matrix --ethernet 192.168.10.104 --json-out bench_matrix.jsonl`
235+
runs the suite across the predefined TCP tuning variants.
236+
237+
### Preserve the artifact bundle
238+
239+
After the run, keep at least:
240+
241+
- `bench_results.jsonl` for host-side timings and metadata
242+
- `qspy.log` for the raw QS stream
243+
- a filtered `qspy_perf.log` for quick comparison (optional)
244+
245+
On POSIX you can extract just the performance lines with:
246+
247+
```sh
248+
grep 'PERF_' bench_artifacts/2026-03-13-eth/qspy.log > bench_artifacts/2026-03-13-eth/qspy_perf.log
249+
```
250+
251+
PowerShell:
252+
253+
```powershell
254+
Select-String -Path bench_artifacts\2026-03-13-eth\qspy.log -Pattern 'PERF_' | ForEach-Object { $_.Line } | Set-Content bench_artifacts\2026-03-13-eth\qspy_perf.log
255+
```
256+
257+
For reproducible comparisons, keep the artifact directory together with the
258+
firmware commit or tag, host computer, transport, switch/LAN notes, and the
259+
benchmark label you used.
260+
173261
## Releasing
174262

175263
The repository includes GitHub Actions workflows for CI and PyPI Trusted
@@ -179,7 +267,8 @@ Recommended release flow:
179267

180268
1. Update `CHANGELOG.md`.
181269
2. Run `pixi run release-check` or the equivalent pip commands above.
182-
3. Commit the release changes and create a `vX.Y.Z` tag.
270+
3. Commit the release changes and create a release tag such as `7.0.0` or
271+
`v7.0.0`.
183272
4. Push the tag to GitHub.
184273
5. The `publish.yml` workflow builds the wheel and sdist, then publishes them
185274
to PyPI using Trusted Publishing.

RELEASING.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,31 @@ If you use Pixi and `pyproject.toml` changed, regenerate `pixi.lock` with
2626
The repository includes `.github/workflows/publish.yml`, which is intended for
2727
GitHub Actions Trusted Publishing.
2828

29+
One-time setup on GitHub:
30+
31+
1. In the repository settings, create a GitHub Actions environment named
32+
`pypi`.
33+
2. Optionally add protection rules or required reviewers if you want a manual
34+
approval gate before publishing.
35+
2936
One-time setup on PyPI:
3037

3138
1. Create the `arena-interface` project on PyPI if it does not already exist.
3239
2. In the PyPI project settings, add a Trusted Publisher for this GitHub
33-
repository and workflow.
34-
3. Push a tag such as `v7.0.0`.
40+
repository.
41+
3. Use workflow filename `publish.yml` and environment name `pypi`.
42+
43+
Release trigger:
44+
45+
1. Push a release tag such as `7.0.0` or `v7.0.0`.
46+
2. GitHub Actions will build `dist/*` and publish to PyPI without storing a
47+
long-lived API token in GitHub secrets.
48+
3. `workflow_dispatch` is kept as a manual build/debug entry point; the actual
49+
PyPI publish step only runs for tag pushes.
3550

36-
After the tag is pushed, GitHub Actions will build `dist/*` and publish to
37-
PyPI without storing a long-lived API token in GitHub secrets.
51+
The normal release path is to let GitHub Actions publish via Trusted
52+
Publishing. Local `twine upload` is only needed if you intentionally want to
53+
bypass that workflow.
3854

3955
## Conda-forge
4056

0 commit comments

Comments
 (0)