Skip to content

numpy: ignore installed packages during pip install#15

Open
viniciusferrao wants to merge 1 commit into
4.xfrom
fix/numpy-pip-ignore-installed
Open

numpy: ignore installed packages during pip install#15
viniciusferrao wants to merge 1 commit into
4.xfrom
fix/numpy-pip-ignore-installed

Conversation

@viniciusferrao

Copy link
Copy Markdown
Member

Summary

Fix the OpenHPC NumPy RPM install step so it always installs the locally built wheel into the package buildroot, even when a distro python3-numpy package is already present in the build environment.

This changes the NumPy %install pip invocation to use --ignore-installed and adds a buildroot sanity check for numpy/__init__.py under the module's lib64/python3.12/site-packages path.

Root Cause

The RHEL aarch64/GNU15 CI failure was not caused by SLURM environment propagation or a module PYTHONPATH mismatch. The built aarch64 python3-numpy-gnu15-ohpc RPM contained only docs, the modulefile, and the bin/python3 symlink. It did not contain site-packages/numpy.

The aarch64 build log shows why:

/usr/bin/python3 -m pip install --prefix=/opt/ohpc/pub/libs/gnu15/numpy/2.4.4 --root=... --no-index --find-links=dist --no-deps numpy
Requirement already satisfied: numpy in /usr/lib64/python3.12/site-packages (1.26.4)

Because distro python3-numpy was already installed in the build container, pip treated the requirement as satisfied and skipped installing the locally built OHPC NumPy wheel into %{buildroot}. The modulefile then pointed PYTHONPATH at an empty install tree, so srun python3 MM.py failed with ModuleNotFoundError: No module named 'numpy'.

Why This Fix

--ignore-installed is the correct package-build behavior here because the RPM must be populated from the wheel produced in %build, independent of whatever Python packages happen to be installed in the mutable build environment. The added test -f check makes future pip no-op or layout regressions fail during RPM build instead of surfacing later as a runtime test failure.

Validation

  • Inspected PR CI run 28473398738 artifacts and logs:
    • RHEL aarch64/GNU15 NumPy RPM was 17 KB and had no site-packages/numpy payload.
    • RHEL aarch64/GNU15 build log showed pip using the already installed distro NumPy.
    • RHEL x86_64/GNU15 control log showed pip processing the local numpy-2.4.4 wheel when distro NumPy was not yet installed.
  • Verified the branch diff against VersatusHPC/ohpc:4.x is one commit and one file only.
  • rpmspec --parse on rome01 confirms the expanded %install command uses --ignore-installed and includes the buildroot payload check.
  • AlmaLinux 10 container regression check with distro/system NumPy present:
    • Without --ignore-installed, pip reports Requirement already satisfied and writes no buildroot files.
    • With --ignore-installed, pip processes the local platform wheel and writes lib64/python3.12/site-packages/numpy/__init__.py.
  • git diff --check passes.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

📊 Build Order Analysis Results

Environment: AlmaLinux 10 Container
Total Spec Files Analyzed: 89
Status:Build order analysis completed successfully

📋 Build Order Output

📦 Build Order (84 packages)

➕ Show remaining 69 packages

Analysis performed by OpenHPC Build Order CI
Commit: d2f68b66
Workflow: 28495528241

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

📦 Package Count Analysis Results

Environment: UBI 10 Container
Target Branch: 4.x
Version: OpenHPC 4.x
Overall Status:Analysis completed successfully

🏭 Factory Repositories

Status:Factory repositories analysis completed successfully

Release Base OS aarch64 x86_64 noarch Total
4.2 EL_10 17 29 12 58
4.2 openEuler_24.03 17 19 12 48
Total All 34 48 24 106

Analysis performed by OpenHPC Package Count CI
Commit: d2f68b66
Workflow: 28495528227

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🚀 CCache Statistics

Configuration 🐧 RHEL 🦊 openEuler
🖥️ x86_64 / gnu15 🟡 32.17% 🟡 32.29%
🖥️ x86_64 / intel 🟡 28.10% -
💪 aarch64 / gnu15 🟡 22.14% 🟡 22.38%
📊 Detailed Statistics

openEuler (aarch64)

Cacheable calls:    5031 / 10113 (49.75%)
  Hits:             1126 /  5031 (22.38%)
    Direct:          616 /  1126 (54.71%)
    Preprocessed:    510 /  1126 (45.29%)
  Misses:           3905 /  5031 (77.62%)
Uncacheable calls:  5082 / 10113 (50.25%)
Local storage:
  Cache size (GiB):  0.1 /   5.0 ( 2.78%)
  Hits:             1126 /  5031 (22.38%)
  Misses:           3905 /  5031 (77.62%)

openEuler (x86_64)

Cacheable calls:    6321 / 12872 (49.11%)
  Hits:             2041 /  6321 (32.29%)
    Direct:         1019 /  2041 (49.93%)
    Preprocessed:   1022 /  2041 (50.07%)
  Misses:           4280 /  6321 (67.71%)
Uncacheable calls:  6551 / 12872 (50.89%)
Local storage:
  Cache size (GiB):  0.2 /   5.0 ( 3.27%)
  Hits:             2041 /  6321 (32.29%)
  Misses:           4280 /  6321 (67.71%)

RHEL (aarch64/gnu15)

Cacheable calls:    5032 / 10083 (49.91%)
  Hits:             1114 /  5032 (22.14%)
    Direct:          608 /  1114 (54.58%)
    Preprocessed:    506 /  1114 (45.42%)
  Misses:           3918 /  5032 (77.86%)
Uncacheable calls:  5051 / 10083 (50.09%)
Local storage:
  Cache size (GiB):  0.2 /   5.0 ( 3.79%)
  Hits:             1114 /  5032 (22.14%)
  Misses:           3918 /  5032 (77.86%)

RHEL (x86_64/gnu15)

Cacheable calls:    6307 / 12816 (49.21%)
  Hits:             2029 /  6307 (32.17%)
    Direct:         1011 /  2029 (49.83%)
    Preprocessed:   1018 /  2029 (50.17%)
  Misses:           4278 /  6307 (67.83%)
Uncacheable calls:  6509 / 12816 (50.79%)
Local storage:
  Cache size (GiB):  0.2 /   5.0 ( 4.28%)
  Hits:             2029 /  6307 (32.17%)
  Misses:           4278 /  6307 (67.83%)

RHEL (x86_64/intel)

Cacheable calls:     8248 / 21023 (39.23%)
  Hits:              2318 /  8248 (28.10%)
    Direct:          1144 /  2318 (49.35%)
    Preprocessed:    1174 /  2318 (50.65%)
  Misses:            5930 /  8248 (71.90%)
Uncacheable calls:  12775 / 21023 (60.77%)
Local storage:
  Cache size (GiB):   0.2 /   5.0 ( 3.63%)
  Hits:              2318 /  8248 (28.10%)
  Misses:            5930 /  8248 (71.90%)

🤖 Generated from workflow run 28495528234

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Test Results

 35 files  + 6   35 suites  +6   57s ⏱️ +4s
 69 tests +10   63 ✅ +10  6 💤 ±0  0 ❌ ±0 
120 runs  +15  112 ✅ +15  8 💤 ±0  0 ❌ ±0 

Results for commit 9fe0542. ± Comparison against base commit f417157.

@viniciusferrao viniciusferrao marked this pull request as ready for review July 1, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant