Repository navigation
CI/CD - Freeze Ansible dependencies and reuse build layers - #900
gusui-msft wants to merge 3 commits into
Conversation
Separate legacy and modern collection inputs, freeze the Python dependency closure, and validate effective plugin versions after application installation. Keep Galaxy recovery bounded and cover real collection operations and runner failures. Co-authored-by: Copilot <[email protected]>
Install validated profiles before source-sensitive and expensive build steps across the active image matrix. Check final application environments without contacting Galaxy, and exercise real dependency-layer cache behavior only on relevant PRs. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Legacy Ansible collections become hidden after deployment, and the frozen cryptography versions cannot install on Python 3.9.0–3.9.1 despite those interpreters remaining supported.
3 open issues
What changed in this PR
This PR separates SuperBench’s Ansible dependencies from application builds, freezing supported profiles and enabling GPU images to reuse dependency layers after source-only changes.
Changes:
- Adds pinned Python and collection profiles, with shared installation, bounded Galaxy retries, and dependency validation.
- Introduces reusable dependency stages across six GPU Dockerfiles and constrains subsequent Python installations.
- Adds profile, collection, runner, and build-cache checks, and documents the installation workflow.
| File | Description |
|---|---|
tests/runner/test_ansible.py |
Tests real local execution and failure propagation. |
tests/ansible/test_dependencies.yaml |
Exercises collection operations and production result fetching. |
tests/ansible/test_dependencies.py |
Tests retries, validation, collections, and cache-probe behavior. |
tests/ansible/check_build_cache.sh |
Checks cold builds, cache reuse, and dependency invalidation. |
setup.py |
Selects engine and runner ranges by Python version. |
scripts/install_ansible.py |
Installs and validates frozen dependency profiles. |
requirements/ansible.txt |
Freezes Python dependencies with version markers. |
requirements/ansible.in |
Defines inputs for generating the Python freeze. |
requirements/ansible-modern.yml |
Pins modern Ansible collections. |
requirements/ansible-legacy.yml |
Pins legacy-compatible Ansible collections. |
Makefile |
Routes postinstall through the shared installer. |
docs/developer-guides/development.md |
Documents profiles, validation, and dependency caching. |
dockerfile/rocm6.4.x.dockerfile |
Adds a dependency stage and post-install checks. |
dockerfile/rocm6.3.x.dockerfile |
Adds a dependency stage and constrained installation. |
dockerfile/cuda13.4.dockerfile |
Shares the dependency stage across both build branches. |
dockerfile/cuda13.0.dockerfile |
Adds cached dependencies and application validation. |
dockerfile/cuda12.9.dockerfile |
Adds cached dependencies and application validation. |
dockerfile/cuda11.1.1.dockerfile |
Adds legacy-profile caching, validation, and rsync. |
.github/workflows/build-image.yml |
Runs cache checks for relevant pull-request changes. |
.github/workflows/ansible-dependencies.yml |
Adds a Python-version matrix for profile validation. |
.azure-pipelines/cuda-unit-test.yml |
Constrains installation and adds collection-test tools. |
.azure-pipelines/cpu-unit-test.yml |
Constrains installation and stops on setup failures. |
.azure-pipelines/ansible-integration-test.yml |
Constrains integration dependencies and stops on setup failures. |
Review effort: Balanced
Keep direct Python pins in one requirements file and collection pins with bounded retries in the existing Makefile. Reuse normal early Docker layers and existing CI instead of a custom installer, profile workflow and cache-probe framework. Validated cold installation, focused runner/retry tests and real collection operations on Python 3.8 and 3.12. Other transitive Python dependencies remain pip-managed; full GPU image qualification remains pending. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Both affected Dockerfiles use a collection-path variable ignored by Ansible 2.10, causing plugins to install under /root where the workspace mount hides them from control-node use.
2 open issues
2 resolved since last review
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #900 +/- ##
=======================================
Coverage 86.36% 86.36%
=======================================
Files 107 107
Lines 8258 8258
=======================================
Hits 7132 7132
Misses 1126 1126
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|


Summary
Combine dependency profiles and stable installation layers in two commits, keeping bounded Galaxy recovery in the shared installer rather than shipping a separate retry-only change.
ansible-coreinstead of the bundledansibledistribution on newer Python versions.make postinstallas the shared entry point. Reject conflicting Ansible distributions before installation, detect Python dependency drift and shadowed collections, and check the effective plugins' declared engine support.ansible-dependenciesstage to the six Dockerfiles covering all eight active image variants. Both CUDA 13.4 build branches inherit it. Subsequent pip operations are constrained, and application installation is followed by read-only checks and real local collection tests instead of another online Galaxy installation.Validation completed locally
make postinstallentry point from a clean Python 3.12 environment and empty collection directory; all 8 dependency tests passed afterward.sb run --no-dockerorchestration in isolated user/mount/PID namespaces on Python 3.10 and 3.12: environment update, rank/hostfile, result collection, summary creation and CLI exit passed. Benchmark modes were empty; no GPU benchmark commands were executed.Remaining merge gates / limits
Commits
3d9e330— Freeze and validate Ansible dependency profiles.bb1008b— Cache and verify Ansible dependency layers.