Repository navigation
feat: add linting, vulnerability scanning, and rework build triggers - #122
Conversation
… trivy command and added docker push action
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
The linting/scanning direction looks good, but I think this should stay out of merge until Right now the build jobs still run So this is currently report-only scanning, not “scan before push” or a release gate. I’d either:
Also worth resolving the Blacksmith OOM/build stability before merge, since this workflow becomes the foundation for |
|
Are we comfortable introducing Trivy considering their recent security problems? |
TimPietruskyRunPod
left a comment
There was a problem hiding this comment.
Changes requested — missing if: guards on the Trivy steps will break unrelated PRs
In .github/workflows/base.yml, the build-autoresearch and build-pytorch jobs guard the Build step with
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.<x>_any_changed == 'true',
but the following Extract image refs and Trivy scan steps have no guard.
On any PR that doesn't touch autoresearch/pytorch, the build step is skipped, so steps.build.outputs.metadata is empty. The Trivy action then resolves zero image refs and hits its exit 1 ("No image refs to scan"), failing the job even though nothing relevant changed. This isn't caught by this PR's own CI because the run that went green did have changes/dispatch.
Please add the same if: condition to the Extract image refs and Trivy scan steps in both jobs. (build-base is fine, it always builds.)
Everything else here is non-blocking from my side.
TimPietruskyRunPod
left a comment
There was a problem hiding this comment.
Pinning the if:-guard request from my Changes-Requested review to the exact lines — see inline.
Resolved — the if-guard fix landed in 26273dc (both the autoresearch and pytorch Extract-image-refs + scan steps are now guarded). Dismissing my changes-requested.
TimPietruskyRunPod
left a comment
There was a problem hiding this comment.
if-guards on the autoresearch/pytorch Extract-refs + scan steps are in place and verified at the current head — my only requested change. Approving.
Summary
This PR introduces CI quality gates (linting, vulnerability scanning), reworks
the build workflow triggers, and fixes a couple of issues uncovered along
the way.
Changes
Linting
as inline annotations on the Files changed tab of the PR.
on the Files changed tab so reviewers see them next to the code.
main, uploads SARIF to GitHub,findings are viewable under Security & quality → Code scanning.
Vulnerability scanning
choice but we switched to Grype after the concerns raised in review about
Trivy's recent security issues.
the list of built image tags, and runs Grype on each one with
--only-fixed --scope all-layers --fail-on high.does not fail the job even when HIGH/CRITICAL fixed vulnerabilities are
found. The action collects the affected refs into a
failedlist andemits a
::error::summary in the log, but the finalexit 1isintentionally commented out (with a
TODO). Images are still pushed bydocker/bake-action(push: true) before the scan runs, so the scan iscurrently informational only.
we'll flip the switch so any new HIGH/CRITICAL vulnerability fails the
job.
Build workflow triggers
mainworkflow_dispatch)Fixes
pip installstep in the base Dockerfile — the previousinvocation was failing because the
get-pip.pyURL did not supportPython 3.9.
max-parallelismonuseblacksmith/setup-docker-builderandtuned it down for the pytorch matrix. Building all 25 pytorch images in
parallel was saturating the runner's network — pip downloads of multi-GB
CUDA wheels were timing out and DNS resolution itself was failing
(
Temporary failure in name resolution). Limiting parallelism keeps thenetwork stable while still building everything in one job.