From a3f3ecf9d0372c39cc4f23c41a2841eb015a9bb8 Mon Sep 17 00:00:00 2001 From: cflmy Date: Sat, 21 Nov 2026 19:51:09 +0800 Subject: [PATCH] ci(perf): add the fixed Woodpecker G4 workflow Move the push/PR pipeline to .woodpecker/main.yml so the repository can use Woodpecker's multi-workflow directory. Add .woodpecker/performance.yml: manual only, master only, on the single fixed Woodpecker agent (platform_id woodpecker-agent-1). It builds one release binary, pins the first CPU in the container cpuset, runs 5 warmups + 20 samples with --approved-node, and prints the full marqdo.perf.v2 report plus a compact G4 summary for extraction. No PR code is executed on the performance agent; the workflow is manual. --- .woodpecker.yml => .woodpecker/main.yml | 0 .woodpecker/performance.yml | 52 +++++++++++++++++++++++++ README.md | 2 +- docs/STATUS.md | 2 +- docs/ci.md | 2 +- docs/development-credentials.md | 4 +- docs/performance.md | 11 +++++- 7 files changed, 66 insertions(+), 7 deletions(-) rename .woodpecker.yml => .woodpecker/main.yml (100%) create mode 100644 .woodpecker/performance.yml diff --git a/.woodpecker.yml b/.woodpecker/main.yml similarity index 100% rename from .woodpecker.yml rename to .woodpecker/main.yml diff --git a/.woodpecker/performance.yml b/.woodpecker/performance.yml new file mode 100644 index 0000000..b06c842 --- /dev/null +++ b/.woodpecker/performance.yml @@ -0,0 +1,52 @@ +# G4 fixed performance node. +# +# Manual only: this workflow never runs on push or pull_request and therefore +# never executes untrusted PR code on the designated performance agent. The +# repository currently has one Woodpecker agent (agent_id 1), so it is the +# fixed node; the CPU affinity and hardware/toolchain manifest are recorded in +# every report. Do not compare its timings with another machine or with +# QEMU/TCG. +when: + event: [manual] + branch: [master] + +steps: + measure: + image: rust:1.100-bookworm + commands: + - apt-get update + - apt-get install -y --no-install-recommends python3 util-linux ca-certificates + - cargo build --release --locked -p marqdo-cli + - | + set -euo pipefail + allowed="$(awk '/^Cpus_allowed_list:/ {print $2}' /proc/self/status)" + cpu_list="${MARQDO_PERF_CPU_LIST:-$(printf '%s' "$allowed" | cut -d, -f1 | cut -d- -f1)}" + echo "G4_NODE host=$(uname -n) kernel=$(uname -r) arch=$(uname -m) allowed_cpus=$allowed pin=$cpu_list" + echo "G4_CPU $(awk -F: '/model name/ {print $2; exit}' /proc/cpuinfo | xargs)" + echo "G4_GOVERNOR $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null || echo unavailable)" + python3 tools/perf/runner.py --no-build --warmups 5 --samples 20 \ + --approved-node --platform-id woodpecker-agent-1 \ + --cpu-list "$cpu_list" --out perf.json + python3 - <<'PY' + import json + + with open("perf.json", encoding="utf-8") as handle: + report = json.load(handle) + print( + "G4_STATUS " + f"{report['status']} correctness={report['correctness']} " + f"platform={report['platform_id']} " + f"binary={report['binary']['sha256']}" + ) + for workload in report["workloads"]: + print( + "G4_WORKLOAD " + f"{workload['name']} {workload['status']} " + f"p50={workload.get('median_ms')} " + f"p95={workload.get('p95_ms')} " + f"rss={workload.get('max_rss_kb_median')}" + ) + PY + echo "G4_REPORT_BEGIN" + cat perf.json + echo "G4_REPORT_END" diff --git a/README.md b/README.md index 822ff66..2b1231d 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ plugin ABI v2 are not claimed to work here. > (historical baseline; refresh before use). CI: the private remote [git.cflmy.cn/cflmy/marqdo-cli](https://git.cflmy.cn/cflmy/marqdo-cli) -uses Woodpecker at [ci.cflmy.cn](https://ci.cflmy.cn); [`.woodpecker.yml`](.woodpecker.yml) +uses Woodpecker at [ci.cflmy.cn](https://ci.cflmy.cn); [`.woodpecker/main.yml`](.woodpecker/main.yml) runs fmt, clippy, workspace tests and a release build. The strict OS-isolation lane still requires the disposable VM described in [docs/ci.md](docs/ci.md). diff --git a/docs/STATUS.md b/docs/STATUS.md index f234162..e5d9c67 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -152,7 +152,7 @@ The remote SHA must be refreshed from CI after a push; do not read `c9f01aa8` as the current tree. This checkout's private remote is `https://git.cflmy.cn/cflmy/marqdo-cli` with -Woodpecker CI at `https://ci.cflmy.cn` (`.woodpecker.yml`). The Linux Docker +Woodpecker CI at `https://ci.cflmy.cn` (`.woodpecker/main.yml`). The Linux Docker pipeline runs fmt/clippy/test/release-build; the docs-consistency gate runs in `cargo test --workspace`. The GitHub-hosted native matrix is now green at `5fcc111` ([run 30](https://github.com/cflmy/marqdo-cli/actions/runs/44896671929)). diff --git a/docs/ci.md b/docs/ci.md index 2cce12f..b06ee4e 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -4,7 +4,7 @@ - Git remote: `https://git.cflmy.cn/cflmy/marqdo-cli.git` - Woodpecker: `https://ci.cflmy.cn` -- Pipeline definition: [`.woodpecker.yml`](../.woodpecker.yml) +- Pipeline definition: [`.woodpecker/main.yml`](../.woodpecker/main.yml) - Current hardening plan/RFC: [`MARQDO_CI_SECURITY_PLATFORM_PERFORMANCE_RFC_20261121.md`](MARQDO_CI_SECURITY_PLATFORM_PERFORMANCE_RFC_20261121.md) - Credentials are local-only and ignored; see diff --git a/docs/development-credentials.md b/docs/development-credentials.md index 66021b7..402a345 100644 --- a/docs/development-credentials.md +++ b/docs/development-credentials.md @@ -41,12 +41,12 @@ curl -fsS -H "Authorization: Bearer $MARQDO_WOODPECKER_TOKEN" \ "$MARQDO_WOODPECKER_URL/api/user/repos" ``` -CI itself is defined in `.woodpecker.yml`; the token is only for local API +CI itself is defined in `.woodpecker/main.yml`; the token is only for local API queries/triggering, not for the pipeline. Configure any privileged secrets in the Woodpecker repository settings, never in this repository. ## What is tracked -- `.woodpecker.yml` — public CI pipeline definition. +- `.woodpecker/main.yml` — public CI pipeline definition. - this document — names/usage only, no values. - `.secrets/` and `.env.local` — ignored local files. diff --git a/docs/performance.md b/docs/performance.md index c6e744d..80b108d 100644 --- a/docs/performance.md +++ b/docs/performance.md @@ -36,5 +36,12 @@ Rules enforced by the tool: * Development-container smoke run (2026-11-21, `--warmups 1 --samples 3 --allow-smoke`): all nine workloads `VERIFIED`/`SMOKE`, no correctness failures. Stored as a smoke artifact, **not** a release baseline. -* Remote G4: **UNVERIFIED** until a fixed self-hosted node runs - `.github/workflows/performance-linux.yml` with a fixed `--cpu-list`. +* Remote Woodpecker G4: the repository now has a manual + [`.woodpecker/performance.yml`](../.woodpecker/performance.yml) workflow on + the designated fixed agent (`platform_id: woodpecker-agent-1`). It runs + 5 warmups / 20 samples, pins the first CPU in the container's + `Cpus_allowed_list`, and records the hardware/toolchain manifest. Trigger it + with the Woodpecker API using `"workflow": "performance"`; do not run it on + PR code. Its report is the G4 baseline for this node. +* GitHub G4: `.github/workflows/performance-linux.yml` remains available for a + physically separate node.