Repository navigation
feat(amdsmi): [ROCM-3941] Add manylinux wheel job to the amdsmi CI matrix - #7913
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
32a3914 to
a6f2850
Compare
663a8b1 to
eac9e6b
Compare
eac9e6b to
dfa7fc8
Compare
Part of the ROCM-3941 chain: #7914 -> #7913 (this) -> #7912. Rebased onto the updated #7914; history rewritten and force-pushed, so please re-pull. Fixes applied to the manylinux job:
Update: rebased on the follow-up #7914 (which adds the RHEL CLI-shebang / interpreter-detection fix). No changes to this commit itself. CI green: Manylinux Gate, RHEL8, Debian10 and the wheel-build jobs all pass. |
dfa7fc8 to
4718bd1
Compare
4718bd1 to
2122443
Compare
2122443 to
cccc84f
Compare
cccc84f to
3eafae4
Compare
…-3.8 - main() was annotated with list[str] (PEP 585), which is only valid at runtime on Python 3.9+. On the 3.6-3.8 interpreters AMD SMI still supports it raised TypeError: 'type' object is not subscriptable at import. - The wheel build runs this tool under the system python, so an older default interpreter broke the build. - Use typing.List[str], which works on every supported version. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- seven near-identical steps each cat one result log, which is noisy in the workflow and in the Actions log - collapse them into a single step that prints each log inside a collapsible ::group:: block keyed by a readable label Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- the packaging rework made the CLI import site-packages first and only fall back to share/amd_smi, reversing the priority from #3082 - on a multi-version ROCm host the CLI must load the amdsmi library it shipped with, not another version's copy earlier on sys.path - resolve share/amd_smi (ROCM_PATH or CLI-relative) before importing, and fall back to site-packages only when no share copy exists Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- sparse-checkout only projects/amdsmi and the workflows dir instead of the whole monorepo, so the checkout stays cheap - keep each test-result dump as its own step so a single failure is directly attributable instead of buried in one grouped step - resolve the project and runner script by their fixed sparse-checkout paths rather than a find plus existence guard - drop the Uninstall step; the job runs in a --rm container that is discarded after the run - note why the artifact glob matches the 99999 local version Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- the upload feeds no downstream job; document that it exists for manual reviewer download so the step is not mistaken for dead weight Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- the wheel-location check accepted any of site-packages, dist-packages or /opt/rocm, so it passed even when a system copy shadowed the pip install and never proved the pip module wins - assert import amdsmi resolves under pip's reported install location and not the /opt/rocm system copy, so a coexisting system module fails the check instead of masking it - document the CLI's share -> pip -> system resolution order, distinct from a user script where the pip install must win Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- continue-on-error let every distro leg report success even when the package failed to build, install or import - drop it so any failure on the self-hosted runner CI is visible; these runners are expected to be stable Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
6491aa1 to
9222b97
Compare
- the check asserted the pip install wins, but the CI container and ROCm installs set PYTHONPATH=/opt/rocm/share/amd_smi, which always precedes site-packages, so import amdsmi resolved to the system copy and the assertion could never pass on RHEL/SLES/Ubuntu22 - run the check with PYTHONPATH cleared so it tests the real scripting scenario (a bare interpreter where pip must win), not the environment's path config Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- Add a manylinux-build job to amdsmi-build.yml that builds the PyPI-ready wheel via cmake -DBUILD_PYTHON_WHEEL=ON inside the manylinux_2_28 container, alongside the existing build-and-test matrix. Signed-off-by: Justin Williams <Justin.Williams@amd.com>
- sparse-checkout only projects/amdsmi and the workflows dir so the wheel gate does not clone the whole monorepo - pip install the built wheel and import amdsmi, so the gate proves the wheel is installable and loads its bundled library rather than only checking that the .whl file exists Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
9222b97 to
fa32a56
Compare
The manylinux gate is internal CI infrastructure; the user-facing wheel build (-DBUILD_PYTHON_WHEEL=ON) is already covered by the packaging rework entry above it. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Reverts the manylinux wheel CI job (#7913) and the Python packaging rework (#7914): flat loader, dist-packages install, and wheel build. Restores the pre-rework loader in amdsmi_wrapper.py / tools/generator.py, the pip-based DEBIAN/RPM install scriptlets, and setup.py.in; removes pin_shebang.cmake, tools/disable_system_fallback.py, and tests/python/test_abi_compat.py. Accounts for changes that landed on develop after the rework merged: - Keeps the libamd_smi.so.27 SONAME and its CHANGELOG entry from the 27.0.0 version bump. The restored loader hardcoded the SONAME, so the literal is bumped from .so.26 to .so.27 in both generator.py and the regenerated wrapper to match AMDSMI_LIB_VERSION_MAJOR. - Keeps the ras --cper --json no-entries fix (#8819) and its CHANGELOG entry; only the rework's own CHANGELOG entry is removed. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Reintroduces the manylinux wheel CI job (#7913) and the Python packaging rework (#7914): flat loader, dist-packages install, and wheel build. Combined here with the amd-smi CLI shebang fixes so the rework and its follow-up corrections land as one reviewable change. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
…trix (#7913) - Add a manylinux-build job to amdsmi-build.yml that builds the PyPI-ready wheel via cmake -DBUILD_PYTHON_WHEEL=ON inside the manylinux_2_28 container, alongside the build-and-test matrix. - sparse-checkout only projects/amdsmi and the workflows dir so the gate does not clone the whole monorepo. - pip install the built wheel and import amdsmi so the gate proves the wheel is installable and loads its bundled library, not just that the .whl file exists. --------- Signed-off-by: Maisam Arif <Maisam.Arif@amd.com> Co-authored-by: Maisam Arif <Maisam.Arif@amd.com> Co-authored-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
Reverts the manylinux wheel CI job (#7913) and the Python packaging rework (#7914): flat loader, dist-packages install, and wheel build. Restores the pre-rework loader in amdsmi_wrapper.py / tools/generator.py, the pip-based DEBIAN/RPM install scriptlets, and setup.py.in; removes pin_shebang.cmake, tools/disable_system_fallback.py, and tests/python/test_abi_compat.py. Accounts for changes that landed on develop after the rework merged: - Keeps the libamd_smi.so.27 SONAME and its CHANGELOG entry from the 27.0.0 version bump. The restored loader hardcoded the SONAME, so the literal is bumped from .so.26 to .so.27 in both generator.py and the regenerated wrapper to match AMDSMI_LIB_VERSION_MAJOR. - Keeps the ras --cper --json no-entries fix (#8819) and its CHANGELOG entry; only the rework's own CHANGELOG entry is removed. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Relands the manylinux wheel CI job (#7913) and the Python packaging rework (#7914) after they were reverted in #9339, together with the follow-up amd-smi CLI shebang fixes so the rework and its corrections land as one change. Packaging rework (reintroduced): - Install the amdsmi module into the system python's site-packages via install(DIRECTORY) instead of pip + a .pth file; drop the pip plumbing and python3-pip/setuptools/wheel deps from the DEBIAN/RPM scriptlets. - Replace the ROCm-path-walking resolver in amdsmi_wrapper.py (and tools/generator.py, regenerated in lockstep) with a flat loader: AMDSMI_LIB_OVERRIDE, a bundled libamd_smi_python.so, then the system libamd_smi.so; a _MissingLibrary sentinel keeps import tolerant. - Add BUILD_PYTHON_WHEEL (default OFF): build a SONAME-isolated libamd_smi_python.so and a wheel that disables the loader's system fallback. - Stage the module under share/amd_smi for ROCM_PATH consumers and TheRock. - Add test_abi_compat.py and the manylinux wheel CI job. CLI shebang fixes: - Use a portable "#!/usr/bin/env python3" shebang for the amd-smi CLI so it runs on relocatable installs with no /usr/bin/python3 (TheRock containers) and on wheel runners where /usr/bin/python3 lacks the amdsmi module. - Stop pinning the CLI shebang to a fixed interpreter: remove pin_shebang.cmake and the AMDSMI_CLI_SHEBANG_INTERP derivation. The pinned absolute path became a hard RPM "Requires:" (e.g. /usr/libexec/platform-python3.6) that RHEL10 and SLES16 could not satisfy; the RPM now depends only on python(abi). - Resolve the env-form shebang in the install-verify harness instead of running "/usr/bin/env -c". Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Relands the manylinux wheel CI job (#7913) and the Python packaging rework (#7914) after they were reverted in #9339, together with the follow-up amd-smi CLI shebang fixes so the rework and its corrections land as one change. Packaging rework (reintroduced): - Install the amdsmi module into the system python's site-packages via install(DIRECTORY) instead of pip + a .pth file; drop the pip plumbing and python3-pip/setuptools/wheel deps from the DEBIAN/RPM scriptlets. - Replace the ROCm-path-walking resolver in amdsmi_wrapper.py (and tools/generator.py, regenerated in lockstep) with a flat loader: AMDSMI_LIB_OVERRIDE, a bundled libamd_smi_python.so, then the system libamd_smi.so; a _MissingLibrary sentinel keeps import tolerant. - Add BUILD_PYTHON_WHEEL (default OFF): build a SONAME-isolated libamd_smi_python.so and a wheel that disables the loader's system fallback. - Stage the module under share/amd_smi for ROCM_PATH consumers and TheRock. - Add test_abi_compat.py and the manylinux wheel CI job. CLI shebang fixes: - Use a portable "#!/usr/bin/env python3" shebang for the amd-smi CLI so it runs on relocatable installs with no /usr/bin/python3 (TheRock containers) and on wheel runners where /usr/bin/python3 lacks the amdsmi module. - Stop pinning the CLI shebang to a fixed interpreter: remove pin_shebang.cmake and the AMDSMI_CLI_SHEBANG_INTERP derivation. The pinned absolute path became a hard RPM "Requires:" (e.g. /usr/libexec/platform-python3.6) that RHEL10 and SLES16 could not satisfy; the RPM now depends only on python(abi). - Resolve the env-form shebang in the install-verify harness instead of running "/usr/bin/env -c". Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Motivation
Wire the SONAME-isolated wheel build into amd-smi's own per-distro CI matrix so every change is checked against a manylinux wheel build.
Technical Details
CI (
.github/workflows/amdsmi-build.yml):manylinux-buildjob that runstools/build_wheel.pywith-DBUILD_PYTHON_WHEEL=ONalongside the existing build-and-test matrix.JIRA ID
Resolves ROCM-3941
Test Plan
manylinux-buildjob on this branch and confirm a.whlis produced and import-smoke-tested.Test Result
Submission Checklist