--- name: amdsmi-packaging-test description: "Integration testing for amd-smi Python packaging. Use when: testing package installs, multi-OS testing, manylinux wheel builds, offline install verification, glibc/Python version compatibility, post-install smoke tests." --- # Packaging & Integration Test — amd-smi End-to-end testing of amd-smi package builds, installs, and Python imports across multiple OS containers. Covers offline (system package) installs, wheel builds, and manylinux compatibility. ## When to Use - After changes to packaging files (`DEBIAN/postinst.in`, `RPM/post.in`, `py-interface/CMakeLists.txt`, `src/CMakeLists.txt`) - After changes to Python wrapper/loader (`amdsmi_wrapper.py`, `amdsmi_init.py`) - After changes to wheel build tooling (`tools/build_wheel_debian.py`, `tools/build_wheel_rpm.py`) - After changes to `tools/generator.py` or `py-interface/setup.py.in` / `py-interface/pyproject.toml.in` - When reviewing PRs that touch `BUILD_PYTHON_WHEEL` cmake paths - Before merging any Python packaging PR ## Prerequisites - Docker installed and running - Build artifacts available (run `amdsmi-build-install` skill first, or use manylinux build below) - `$WORKSPACE` is the amd-smi workspace root --- ## 1. Manylinux Container Build Build packages inside a manylinux container to produce both RPM and DEB artifacts with a known glibc baseline. ```bash docker run --rm \ -v "$WORKSPACE:/src" \ quay.io/pypa/manylinux_2_28_x86_64 \ bash -c ' set -e yum install -y -q libdrm-devel rpm-build dpkg cmake3 ninja-build python3-pip 2>&1 | tail -3 python3 -m pip install --quiet "setuptools>=59.0" wheel cd /src rm -rf build-manylinux cmake -S . -B build-manylinux \ -G Ninja \ -DBUILD_TESTS=OFF \ -DENABLE_LDCONFIG=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCPACK_GENERATOR="RPM;DEB" 2>&1 | tail -15 # NOTE: ENABLE_LDCONFIG=OFF is intentional. Real users typically do not enable # ldconfig for amd-smi, and leaving it ON during testing masks bugs in the # wrapper's library-resolution logic (the linker becomes a safety net that # hides path-resolution failures). Test the no-ldconfig path that real # deployments use. cmake --build build-manylinux -j"$(nproc)" 2>&1 | tail -15 cd build-manylinux && cpack 2>&1 | tail -10 ls -la *.rpm *.deb 2>/dev/null ' ``` **Expected outputs:** - `amd-smi-lib__amd64.deb` - `amd-smi-lib-.el8.x86_64.rpm` - `amd-smi-lib-tests__amd64.deb` (if `-DBUILD_TESTS=ON`) - `amd-smi-lib-tests-.el8.x86_64.rpm` (if `-DBUILD_TESTS=ON`) **Key fact:** manylinux_2_28 targets glibc 2.28. Packages built here are compatible with RHEL 8+, Ubuntu 20.04+, SLES 15+. --- ## 2. Multi-OS Install Testing Test package installation and Python import across multiple OS containers. This is the core validation: packages must install and `import amdsmi` must succeed on every target OS. ### Target Matrix This matrix mirrors `.github/workflows/amdsmi-build.yml` (`os:` lists at lines 28, 142, 366, 568). The CI workflow resolves images from GitHub repo variables (`vars._DOCKER_IMAGE`) which point at AMD-internal registries. Use `gh variable get