Skip to content

Fix: Enable manylinux2014 builds for Google Colab compatibility#6

Closed
andylizf wants to merge 22 commits into
mainfrom
fix/manylinux-compatibility
Closed

Fix: Enable manylinux2014 builds for Google Colab compatibility#6
andylizf wants to merge 22 commits into
mainfrom
fix/manylinux-compatibility

Conversation

@andylizf

Copy link
Copy Markdown
Collaborator

Summary

This PR fixes the wheel building process to support Google Colab environments by using manylinux2014 instead of manylinux_2_28.

Key Changes

1. manylinux2014 Compatibility

  • Switched from `manylinux_2_28` to `manylinux2014` (GLIBC 2.17) for broader compatibility
  • This ensures wheels work on Google Colab which requires `manylinux_2_35_x86_64` or earlier

2. Python Finding Improvements

  • Added explicit Python finding logic in CMakeLists.txt files
  • Use `Development.Module` instead of `Development` to avoid Embed requirement
  • Pass Python variables through CMake cache to ensure submodules find Python correctly

3. pyzmq Compatibility

  • Limited pyzmq version to `<27` to ensure pre-built wheels are available
  • Added `CIBW_BEFORE_TEST` step to pre-install pyzmq from wheels, avoiding compilation

4. FileNotFoundError Fix

  • Fixed issue where `knowledge.meta.json` couldn't be found when launched as subprocess
  • Now using absolute paths via `resolve()`

5. CI/Build Improvements

  • Focused on Linux builds by removing macOS from build matrix
  • Added test workflow specifically for manylinux builds
  • Skip unnecessary platforms (32-bit, PyPy, musllinux)

Testing

  • ✅ Local Docker test with manylinux2014 container passed successfully
  • ✅ HNSW backend builds successfully on Ubuntu CI
  • 🔧 DiskANN backend still has Python finding issues (being worked on)

Notes

  • This change is backward compatible - manylinux2014 supports more systems than manylinux_2_28
  • macOS builds were temporarily removed to focus on Linux/Colab compatibility
  • All changes preserve existing functionality while adding Colab support

Fixes issues with Google Colab compatibility reported by users.

andylizf added 21 commits July 25, 2025 10:03
- Add Python_FIND_VIRTUALENV hints to pyproject.toml for CMake
- Create standardized cibuildwheel workflow using manylinux_2_28
- Simplify system dependency installation
- Add global cibuildwheel configuration in root pyproject.toml
- Create streamlined test workflow for manylinux compatibility
- Remove Windows support as not needed
- Move Python finding hints to cibuildwheel environment variables
- Keep pyproject.toml clean to avoid breaking normal builds
- Target manylinux_2_28 for better Colab compatibility
- Switch from manylinux_2_28 to manylinux2014 (provides manylinux_2_17)
- This should produce wheels compatible with manylinux_2_35_x86_64 requirement
- Update package manager from dnf to yum for CentOS 7
- Use cmake3 with symlink for compatibility
- Add libomp for macOS to fix OpenMP linking error
- Add python3-devel for Linux (though may not be needed in manylinux)
- Install numpy before building to satisfy faiss CMake requirements
- Add before-build configuration to cibuildwheel
- Modify faiss CMakeLists.txt to try both FindPython and FindPython3
- Add scikit-build configuration to help with Python detection
- Simplify Linux environment variables in cibuildwheel
- Add CMake Python detection before faiss configuration
- Set FAISS_ENABLE_PYTHON to OFF since we use our own Cython bindings
- This avoids the CMake Python finding issues in manylinux environments
- Simplify CMakeLists.txt by removing unnecessary Python finding logic
- Keep swig installation for other potential uses
- cmake.verbose is not allowed when minimum-version is set to 0.10 or higher
- This was causing build failures in cibuildwheel
- Re-enable FAISS_ENABLE_PYTHON since we need the Python bindings
- Use Development.Module component for better compatibility
- Pass Python information to Faiss through CMake cache variables
- Add CMAKE_PREFIX_PATH= to help CMake find Python in manylinux
- Use Development.Module instead of Development component
- Find Python in main Faiss CMakeLists.txt before python subdirectory
- Add debug output to trace Python variable passing
- Set Python_FIND_VIRTUALENV=ONLY for Faiss
- Set MACOSX_DEPLOYMENT_TARGET=11.0 for macOS builds
- Add pyzmq to test requirements to use pre-built wheels
- Configure deployment target in both workflow and pyproject.toml
- Skip ARM64 tests on GitHub Actions to avoid cross-compilation issues
- Cap pyzmq version to <27 for manylinux2014 compatibility
- Pre-install pyzmq binary wheel before tests using CIBW_BEFORE_TEST
- Force pip to use only binary wheels with --only-binary :all:
- Remove macOS from build matrix to simplify CI
- Keep macOS configurations for future reference but they won't be used
- This speeds up CI and focuses on the primary target (Colab/Linux)
- Add explicit Python finding logic to DiskANN CMakeLists.txt
- Change Development to Development.Module to avoid Embed requirement
- Pass Python variables through CMake cache to submodules
- Change from src/third_party/DiskANN to third_party/DiskANN
- This was causing CMake to fail finding the subdirectory
- Replace all Chinese comments with English
- Ensure code is internationalization-friendly
- Remove duplicate ci-cibuildwheel.yml workflow to avoid confusion
- Fix DiskANN CMakeLists.txt to support both standard and manylinux builds
- Try Development.Module first (manylinux), fallback to Development (standard)
- Keep build-reusable.yml and build-cibuildwheel.yml as separate workflows
- They build different wheel types and are selected at release time
- Point to fix/python-finding-compatibility branch
- Support both Development and Development.Module for Python finding
- Fixes compatibility with both standard and manylinux builds
@andylizf
andylizf force-pushed the fix/manylinux-compatibility branch from 9e20c1b to 02672c0 Compare July 25, 2025 20:33
- Use manylinux_2_35 (GLIBC 2.35) instead of manylinux2014 (GLIBC 2.17)
- Still compatible with Google Colab (requires ≤2.35)
- Benefits: newer toolchain, better performance, modern C++ features
- Switch from yum to dnf package manager
- Remove pyzmq version cap as manylinux_2_35 has newer ZeroMQ
- Update documentation to reflect the change
@yichuan-w yichuan-w closed this Jul 28, 2025
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.

2 participants