How someware-fr/gdalmanylinux works
This project is a template for building manylinux wheels for the GDAL Python bindings. Its purpose is to package GDAL’s C extension bindings with all necessary dependencies into self-contained wheels, so that users can pip-install GDAL without separately installing GDAL itself. The repository leverages containerization (via the manylinux Docker container) to provide a consistent build environment.
Main Components
• Build Scripts and Makefile: The Makefile, build scripts (e.g., build-linux-wheels.sh, build_pg.sh), and accompanying shell scripts serve as the controller that triggers the whole build process.
• Docker/Manylinux Container: The Dockerfile (Dockerfile.wheels) and reference to the manylinux environment encapsulate the build environment. This component provides isolation and a reproducible build system.
• Python Packaging Components: Key files such as setup.py, requirements.txt, and possibly the scripts (gdalinit.py, make_index.py) are used to configure the bindings, manage dependencies, and prepare the wheel build.
• Testing Suite: The test_wheels.py and configuration via tox.ini define how the final wheels are validated.
• Output Artifacts: The built wheels (placed in a wheels directory) and any scripts used to run tests (e.g., via Makefile targets for making tests) are the end result of the build process.
Relationships and Data Flow
• The Makefile triggers the build process scripts that launch a Docker container based on the manylinux image.
• Inside the container, the setup.py along with other configuration (from requirements.txt and initialization scripts) is used to build the GDAL wheel.
• The wheel is output to a designated directory (wheels).
• Optionally, tests may be executed through tox invoking test_wheels.py to validate the build.
Architectural Patterns and Design Principles
• Separation of Concerns: Clearly separate scripts controlling the build, the actual wheel-building process, and the testing process.
• Modular Build Process: Although the project is small, identifying distinct modules (build, test, and deployment) helps highlight the pipeline.
Relevant Technologies
• Docker: Using the manylinux Docker container for consistent builds.
• Python: The language for the bindings, including its packaging (setup.py) and testing (tox, test_wheels.py).
• GDAL & PROJ Libraries: Although not explicitly in the file tree, the README mentions that data directories (GDAL and PROJ) are packaged into the wheels.
• Build Tools: Tools like make (Makefile) and shell scripts that orchestrate the process.
Specific Elements
• Clear labels:
• User/CI Initiator
• Build Controller (Makefile & build scripts)
• Manylinux Docker Container
• Setup Environment (setup.py, requirements.txt, scripts)
• Build Output (wheels directory)
• Testing Module (tox, test_wheels.py)
• Command trigger from the user to the Makefile.
• The flow from the Makefile to the Docker container initiation.
• Data flow inside the container (from checkout, dependency installation, to running setup.py).
• The flow from the container build process back to the host (creation of wheel files).
• Rectangles for scripts and processes.