feat: add weekly OSS benchmark workflow - #343
Conversation
Runs weekly from computesdk/benchmarks (default branch) against the branch, committing results to results-weekly/ and weekly-*.svg so they don't overwrite the existing per-category results and charts. Includes the aggregate helper scripts required by the workflow: - benchmarks/src/ingest.ts - scripts/build-daily-matrix.mjs - scripts/oss-workflow-defaults.mjs Co-Authored-By: Noah Kiser <noah@computesdk.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor License AgreementAll contributors are covered by a CLA. |
| group: weekly-oss-benchmarks | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: |
There was a problem hiding this comment.
P2: Workflow grants contents:write to all jobs including benchmark runners
Top-level contents:write applies to all jobs, including untrusted benchmark runners.
Scope contents:write to the collect job only; use read permissions for other jobs.
AI prompt
Check if this security scanner issue is valid. If so, understand the root cause and fix it. If appropriate, update or add tests. Keep the change focused and preserve intended behavior.
<file name=".github/workflows/weekly-oss-benchmarks.yml">
<violation number="1" location=".github/workflows/weekly-oss-benchmarks.yml:68">
<priority>P2</priority>
<title>Workflow grants contents:write to all jobs including benchmark runners</title>
<evidence>Top-level `permissions:
contents: write` applies to every job in the workflow, including the `benchmark` job (line 154) which checks out and executes arbitrary code from the `computesdk/benchmarks` `weekly` branch. If that upstream repository is compromised, the injected code would execute with repository write access, raising blast radius.</evidence>
<recommendation>Move `contents: write` to only the `collect` job that commits results. Set `permissions: contents: read` at the workflow level and override with `permissions: contents: write` on the `collect` job.</recommendation>
</violation>
</file>
| - name: Build vault key list from OSS provider manifest | ||
| working-directory: oss | ||
| run: | | ||
| case "${{ matrix.kind }}" in |
There was a problem hiding this comment.
P2: Matrix values from external repo interpolated directly into shell scripts
Matrix values from upstream repo are interpolated into shell run blocks without env indirection.
Use env variables to pass matrix values into shell scripts instead of direct expression interpolation.
AI prompt
Check if this security scanner issue is valid. If so, understand the root cause and fix it. If appropriate, update or add tests. Keep the change focused and preserve intended behavior.
<file name=".github/workflows/weekly-oss-benchmarks.yml">
<violation number="1" location=".github/workflows/weekly-oss-benchmarks.yml:189">
<priority>P2</priority>
<title>Matrix values from external repo interpolated directly into shell scripts</title>
<evidence>The `benchmark` job embeds `${{ matrix.kind }}` and `${{ matrix.provider }}` directly inside `run:` shell scripts (e.g. `case "${{ matrix.kind }}" in` at line 189, `manifest_kind="${{ matrix.kind }}"` at line 192, `if [ "${{ matrix.provider }}" = "all" ]` at line 195, and `--arg provider "${{ matrix.provider }}"` at line 200). These values are produced by `build-daily-matrix.mjs` from provider manifests (`benchmarks/*/providers.ts`) residing in the `computesdk/benchmarks` `weekly` branch. If that upstream repo is compromised, shell metacharacters injected into provider names would execute as commands in this workflow.</evidence>
<recommendation>Pass matrix values through job-level `env:` variables instead of interpolating them directly into shell scripts. For example, add `env: BENCH_KIND: ${{ matrix.kind }}, BENCH_PROVIDER: ${{ matrix.provider }}` to the job and reference `$BENCH_KIND` and `$BENCH_PROVIDER` in the script.</recommendation>
</violation>
</file>
Co-Authored-By: Noah Kiser <noah@computesdk.com>
…t AI gateway/tts paths, vault regex, nscloud setup, flag parsing Co-Authored-By: Noah Kiser <noah@computesdk.com>
Co-Authored-By: Noah Kiser <noah@computesdk.com>
Summary
Adds a weekly aggregate OSS benchmark workflow to
computesdk/benchmarksso it runs frommasteragainst theweeklybranch and commits weekly outputs without overwriting the existing per-categoryresults/and root SVGs.weekly-oss-benchmarks.ymltriggers Sundays at 10am UTC (or manually), checks outcomputesdk/benchmarks@weeklyintooss/, runs the benchmark matrix, merges results, generates charts, and commits weekly outputs toresults-weekly/,weekly-*.svg, and.oss-benchmark-revision-weekly.results/directories and root SVGs so a weekly run cannot clobber daily/push outputs.scripts/build-daily-matrix.mjsscripts/oss-workflow-defaults.mjs(fixed--root/--kindflag parsing and addedFALLBACK_DEFAULTSforai-gateway)sandboxcase runstti.bench.tsonce with--concurrency 100, matching the currentresults/burst_ttioutput.LIGHTNING_INSTANCE_TYPE=cpu-8,ARKER_PLATFORMS=graviton4, and dedicated Blaxel DAX credentials are remapped ontoBL_API_KEY/BL_WORKSPACE.provider-vars.json(with DAX-specificBL_DAX_*keys appended), matchingload-vault-secrets.sh's expected$1regex argument.namespacelabs/nscloud-setup@v0andid-token: writeare added to thebenchmarkjob sonsc vaultworks.benchmarks/src/ingest.tsandIngest resultsstep; benchmark runs stream to the platform orchestrator directly.generate-pricing-svg.tsnow reads live scores fromresults/burst_tti/latest.json.actionlint and
pnpm typecheckpass.Link to Devin session: https://app.devin.ai/sessions/b5022ba352b848c696ded905bf862867
Requested by: @kisernl