Repository navigation
[Bugfix] Pin requirements.txt versions to reduce supply-chain risk - #4091
Merged
Merged
Conversation
requirements.txt listed most dependencies by bare name (pandas, pytest, psutil, matplotlib, pyyaml, einops, ninja) or a lower bound (pybind11), so each install could resolve to an arbitrary newer version — the pattern flagged by static analysis as a PyPI supply-chain surface (typosquat / upstream compromise pulling an unexpected release). Pin every entry to the version shipped by the canonical build/test image rocm/atom-dev:latest, so installs are reproducible and match a known-good baseline. Verified with `pip install --dry-run -r requirements.txt` inside that image: all entries already satisfied, no conflicts. torch / triton are intentionally left out: the base image ships ROCm-specific builds not published on PyPI, so pinning them here would break `pip install` off-image. Their provenance is governed by the base image. Covers findings SEC-00190 / SEC-00291 / SEC-00839 (requirements.txt scope). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: yihonglie <[email protected]>
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
zufayu
approved these changes
Jul 6, 2026
2 of 3 tasks
gyohuangxin
pushed a commit
that referenced
this pull request
Jul 6, 2026
…4106) #4091 pinned pandas==3.0.3 (the version in rocm/atom-dev:latest, py3.12), but the py3.10 wheel build container cannot install it — pandas 3.0 requires Python >=3.11 — so `build_aiter_wheels (3.10, ...)` on main fails with "No matching distribution found for pandas==3.0.3". The PR's own checks did not catch this: the py3.10 build only runs the prebuild=false (no-op) matrix leg, while the real py3.10 build runs on push to main. Use an environment marker so each interpreter gets a compatible pinned version: pandas==3.0.3; python_version >= "3.11" # py3.12 baseline (atom-dev) pandas==2.3.3; python_version < "3.11" # latest pandas supporting py3.10 Verified with `pip install --dry-run -r requirements.txt`: - python:3.10-slim -> resolves pandas 2.3.3 + all others, no error - rocm/atom-dev:latest (py3.12) -> pandas 3.0.3, all already satisfied Signed-off-by: yihonglie <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
requirements.txtlisted most dependencies by bare name (pandas,pytest,psutil,matplotlib,pyyaml,einops,ninja) or a lower bound (pybind11>=3.0.1), so each install could resolve to an arbitrary newer release. Static analysis flagged this as a PyPI supply-chain surface (typosquat / upstream compromise pulling an unexpected version) — findings SEC-00190 / SEC-00291 / SEC-00839.This pins every entry to the version shipped by the canonical build/test image
rocm/atom-dev:latest, so installs are reproducible and match a known-good baseline.What's pinned
>=3.0.1)Baseline image digest:
sha256:7826a9a904a905b3b14418b267e8c40d17ca5606d72d620ff407df2129c2e5e7.Deliberately not pinned here
torch/tritonare not added: the base image ships ROCm-specific builds (e.g.torch 2.10.0+rocm...,triton 3.7.0+amd.rocm...) that are not on PyPI, so pinning them inrequirements.txtwould breakpip installon any environment other than that exact image. Their provenance is governed by the base image, not this file.Test plan
pip install --dry-run -r requirements.txtinsiderocm/atom-dev:latest— all entries already satisfied, no conflictsFollow-up (not in this PR)
Full
--require-hashesmode (viapip-compile --generate-hashes) would additionally defend against a compromised-but-same-version release. Left out here to keep the change minimal and avoid churn on transitive deps; can be a follow-up if desired.https://amd-hub.atlassian.net/browse/ROCM-26829
https://amd-hub.atlassian.net/browse/ROCM-26902
https://amd-hub.atlassian.net/browse/ROCM-27182