ci: Drive gem5 workflows with parallux#875
Conversation
📝 WalkthroughWalkthroughThis PR removes legacy autotest configs/scripts and adds Parallux-based workflow tooling: common orchestration utilities, static checkpoint/test lists, Parallux runner scripts for checkpoint/H/smoke/vector runs, and CI YAML updates to invoke the new runners. ChangesParallux-Based GEM5 Workflow Runners
Sequence Diagram(s)sequenceDiagram
participant ComponentA
participant ComponentB
ComponentA->>ComponentB: observable interaction
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/gem5.yml (1)
12-37:⚠️ Potential issue | 🟠 Major | ⚡ Quick winDefine explicit
permissionsfor least-privilegeGITHUB_TOKEN.This workflow relies on default token permissions, which is broader than needed for these jobs.
🔒 Suggested fix
name: gem5 Full Test (Tier 2 - Post-Merge) +permissions: + contents: read on: push: branches: [ xs-dev ]Also applies to: 65-102
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/gem5.yml around lines 12 - 37, Add an explicit least-privilege permissions block for GITHUB_TOKEN (e.g., permissions: contents: read) at the workflow root and/or per-job to replace the implicit default; update the top-level workflow to include a permissions stanza and add the same minimal permissions to the paralel_cpt_h_test job (and the other job block) so the checkout and build steps (actions/checkout@v4, ./.github/actions/build-dramsim, and the Parallux runs) only get the privileges they need.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/gem5-vector.yml:
- Around line 20-21: Add an explicit GitHub Actions permissions block to the
workflow and pin the token scope to read-only instead of using broad defaults:
add a top-level or job-level permissions section (target the job that contains
the "run vector test" step) and set the appropriate read-only scopes (for
example, permissions: contents: read and any other minimal read scopes required)
so the job only uses least-privilege credentials unless it explicitly needs
additional write or admin scopes.
---
Outside diff comments:
In @.github/workflows/gem5.yml:
- Around line 12-37: Add an explicit least-privilege permissions block for
GITHUB_TOKEN (e.g., permissions: contents: read) at the workflow root and/or
per-job to replace the implicit default; update the top-level workflow to
include a permissions stanza and add the same minimal permissions to the
paralel_cpt_h_test job (and the other job block) so the checkout and build steps
(actions/checkout@v4, ./.github/actions/build-dramsim, and the Parallux runs)
only get the privileges they need.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4d80d73a-8da3-486f-a22d-f0f8ff0d2d0f
📒 Files selected for processing (13)
.github/workflows/autotest/gem5-h.cfg.github/workflows/autotest/gem5-vec.cfg.github/workflows/autotest/gem5.cfg.github/workflows/autotest/script/autotest.py.github/workflows/autotest/script/utils.py.github/workflows/checkpoint_lists.py.github/workflows/gem5-vector.yml.github/workflows/gem5.py.github/workflows/gem5.yml.github/workflows/gem5_h.py.github/workflows/gem5_smoke.py.github/workflows/gem5_vec.py.github/workflows/parallux_common.py
💤 Files with no reviewable changes (5)
- .github/workflows/autotest/gem5-h.cfg
- .github/workflows/autotest/gem5.cfg
- .github/workflows/autotest/script/autotest.py
- .github/workflows/autotest/gem5-vec.cfg
- .github/workflows/autotest/script/utils.py
| - name: run vector test | ||
| run: python3 .github/workflows/autotest/script/autotest.py -f .github/workflows/autotest/gem5-vec.cfg | ||
| run: parallux .github/workflows/gem5_vec.py |
There was a problem hiding this comment.
Add explicit workflow permissions to avoid broad defaults.
Please pin token scope to read-only unless a job explicitly needs more.
🔒 Suggested fix
name: gem5 Vector Test (Tier 2 - Post-Merge)
+permissions:
+ contents: read
on:
push:
branches: [ xs-dev ]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/gem5-vector.yml around lines 20 - 21, Add an explicit
GitHub Actions permissions block to the workflow and pin the token scope to
read-only instead of using broad defaults: add a top-level or job-level
permissions section (target the job that contains the "run vector test" step)
and set the appropriate read-only scopes (for example, permissions: contents:
read and any other minimal read scopes required) so the job only uses
least-privilege credentials unless it explicitly needs additional write or admin
scopes.
🚀 Coremark Smoke Test Results
✅ Difftest smoke test passed! |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/gem5.yml (1)
12-37:⚠️ Potential issue | 🟠 Major | ⚡ Quick winSet explicit least-privilege GitHub token permissions for this workflow.
This workflow relies on default
GITHUB_TOKENpermissions, which are broader than needed for these jobs.🔐 Proposed fix
name: gem5 Full Test (Tier 2 - Post-Merge) on: push: branches: [ xs-dev ] # Removed pull_request trigger - moved to pr-quick-check.yml (Tier 1) # can be triggered manually workflow_dispatch: + +permissions: + contents: readAlso applies to: 65-66, 77-78, 90-91, 102-103
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/gem5.yml around lines 12 - 37, Add explicit least-privilege GITHUB_TOKEN permissions at the top of the workflow (or per-job) instead of relying on defaults: add a permissions: block that grants only what's required (for these jobs that only checkout code and run builds/tests, typically permissions: contents: read and actions: read are sufficient) and remove broader defaults; apply this change for the job that runs "parallux .github/workflows/gem5.py" and for the job "paralel_cpt_h_test" (and any similar jobs that run "parallux .github/workflows/gem5_h.py") so each job declares the minimal permissions it needs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/parallux_common.py:
- Line 62: The call to goal.setParallel currently treats falsy values like 0 as
unset because it uses "parallel or ..."; change it to explicitly check for None
so callers can pass 0 intentionally: compute the value as (parallel if parallel
is not None else max_jobs * len(runner_specs)) and pass that into
goal.setParallel, keeping the variable names parallel, max_jobs, runner_specs
and the target function goal.setParallel to locate the change.
---
Outside diff comments:
In @.github/workflows/gem5.yml:
- Around line 12-37: Add explicit least-privilege GITHUB_TOKEN permissions at
the top of the workflow (or per-job) instead of relying on defaults: add a
permissions: block that grants only what's required (for these jobs that only
checkout code and run builds/tests, typically permissions: contents: read and
actions: read are sufficient) and remove broader defaults; apply this change for
the job that runs "parallux .github/workflows/gem5.py" and for the job
"paralel_cpt_h_test" (and any similar jobs that run "parallux
.github/workflows/gem5_h.py") so each job declares the minimal permissions it
needs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 88871700-3a09-4d02-850b-eb5b9ea57073
📒 Files selected for processing (13)
.github/workflows/autotest/gem5-h.cfg.github/workflows/autotest/gem5-vec.cfg.github/workflows/autotest/gem5.cfg.github/workflows/autotest/script/autotest.py.github/workflows/autotest/script/utils.py.github/workflows/checkpoint_lists.py.github/workflows/gem5-vector.yml.github/workflows/gem5.py.github/workflows/gem5.yml.github/workflows/gem5_h.py.github/workflows/gem5_smoke.py.github/workflows/gem5_vec.py.github/workflows/parallux_common.py
💤 Files with no reviewable changes (5)
- .github/workflows/autotest/gem5-vec.cfg
- .github/workflows/autotest/gem5-h.cfg
- .github/workflows/autotest/script/autotest.py
- .github/workflows/autotest/gem5.cfg
- .github/workflows/autotest/script/utils.py
✅ Files skipped from review due to trivial changes (1)
- .github/workflows/checkpoint_lists.py
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/gem5-vector.yml
| raise RuntimeError("runners must not be empty") | ||
|
|
||
| goal.setRunner(runner_specs) | ||
| goal.setParallel(parallel or max_jobs * len(runner_specs)) |
There was a problem hiding this comment.
Respect explicit parallel=0 instead of falling back.
Line 62 currently treats 0 as “unset” because of or, so callers cannot intentionally pass 0 (or any other falsy value) through. Use an explicit None check.
Suggested fix
- goal.setParallel(parallel or max_jobs * len(runner_specs))
+ goal.setParallel(parallel if parallel is not None else max_jobs * len(runner_specs))📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| goal.setParallel(parallel or max_jobs * len(runner_specs)) | |
| goal.setParallel(parallel if parallel is not None else max_jobs * len(runner_specs)) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/parallux_common.py at line 62, The call to
goal.setParallel currently treats falsy values like 0 as unset because it uses
"parallel or ..."; change it to explicitly check for None so callers can pass 0
intentionally: compute the value as (parallel if parallel is not None else
max_jobs * len(runner_specs)) and pass that into goal.setParallel, keeping the
variable names parallel, max_jobs, runner_specs and the target function
goal.setParallel to locate the change.
🚀 Coremark Smoke Test Results
✅ Difftest smoke test passed! |
Summary by CodeRabbit