Support shared-home installs by selecting Python/arch-compatible venv paths - #257
Conversation
|
@copilot |
Implemented in commit |
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
🤖 AI PR Review Summary\n\nAdds a new feature to the Unix installer that manages virtual environment (venv) paths based on Python version and architecture compatibility. Introduces logic to detect incompatible default venvs and fallback to suffixed venv directories. Includes a new GitHub Actions test matrix to validate this behavior across Python 3.8, 3.10, and 3.12. Adds detailed inline documentation and unit tests for the new venv resolution logic. Risks include potential edge cases in venv compatibility detection and increased CI complexity. Design is clean and modular, but the fallback logic depends on accurate environment detection and may require maintenance as Python or platform details evolve. |
🤖 AI PR Review Summary\n\nAdds a new test matrix job in GitHub Actions to validate the shared-home virtual environment naming logic across multiple Python versions (3.8, 3.10, 3.12). Enhances the installer script to detect Python architecture and version to decide on virtual environment reuse or fallback to a suffixed venv path. Adds corresponding documentation and unit tests for the new venv resolution logic. Risks include potential complexity in venv path resolution and compatibility checks, but mitigated by comprehensive tests. Design is clean with clear separation of concerns and good test coverage. |
|
@copilot fix GH action failures |
🤖 AI PR Review Summary\n\nAdds a new test matrix job in GitHub Actions to validate the shared-home virtual environment naming logic across Python versions 3.8, 3.10, and 3.12. The installer script is enhanced to detect Python architecture and major.minor version to decide whether to reuse the default venv or switch to a suffixed venv path. Documentation is updated to explain this behavior. A new Python test suite is added to verify the venv resolution logic. Risks include potential complexity in venv path resolution and ensuring compatibility checks are accurate. The design improves robustness of environment reuse but adds complexity to installer logic and CI. |
Fixed in the latest commit. There were two bugs causing cascading failures:
|
🤖 AI PR Review Summary\n\nAdds a new test matrix job in GitHub Actions to validate the shared-home virtual environment naming logic across Python versions 3.8, 3.10, and 3.12. Enhances the installer script to detect Python version and architecture, and conditionally select or create a compatible virtual environment directory with a suffix if the default is incompatible. Adds detailed logging and compatibility checks for virtual environments. Includes documentation updates and new Python-based tests for the installer logic. Risks include potential complexity in environment detection and fallback logic, but mitigated by comprehensive tests. Design is modular and improves robustness of environment reuse. |
🤖 AI PR Review Summary\n\nAdds a new test matrix job to GitHub Actions to validate the shared-home virtual environment naming logic across multiple Python versions. Implements logic in the installer script to detect and reuse compatible virtual environments based on Python version and architecture, falling back to suffixed venv directories if incompatible. Adds documentation and unit tests for this behavior. Risks include potential subtle bugs in environment detection and compatibility checks, but mitigated by comprehensive tests. Design is clean and well-isolated, enhancing installer robustness and user experience. |
Code review by ClaudeReviewed every commit on this branch ( 🟡 Medium: stale/incompatible shared venv can be silently reused without revalidation
if [ -d "$DEFAULT_VENV_DIR" ]; then
if is_venv_compatible "$DEFAULT_VENV_DIR" ...; then
...
fi
log_warn "Default virtual environment is incompatible..."
VENV_DIR="$shared_venv_dir" # <- reused with no compatibility check
...
return
fi
if [ -d "$shared_venv_dir" ] && is_venv_compatible "$shared_venv_dir" ...; then # <- checked here
VENV_DIR="$shared_venv_dir"
...
fiWhen the default venv exists but is incompatible, the code unconditionally points Suggestion: in that branch, also check 🟢 Minor: test coverage doesn't exercise the gap aboveNeither the new unit tests ( 🟢 Nit: implicit ordering dependency
✅ Already resolved within this branch's history
✅ No issues found
Posted automatically by Claude Code at the requester's request. |
|
@copilot can you see the above comment and do the changes? |
Fixed in the latest commit. In |
🤖 AI PR Review Summary\n\nAdds a new test matrix job to GitHub Actions to validate the shared-home virtual environment naming logic across Python versions 3.8, 3.10, and 3.12. Introduces logic in the installer script to detect and reuse compatible virtual environments based on Python major.minor version and architecture, falling back to suffixed venv paths if incompatible. Adds detailed logging and compatibility checks for venv reuse. Includes new Python-based tests to verify the venv resolution logic. Updates documentation to explain the shared-home venv naming behavior. Risks include potential edge cases in venv compatibility detection and increased CI time due to the new matrix job. Design is modular and well-tested, but the complexity of venv resolution might require ongoing maintenance. |
🤖 AI PR Review Summary\n\nAdds a new shared-home virtual environment naming scheme to the installer to handle Python version and architecture incompatibilities by appending a suffix to the default venv path. Introduces logic in the installer script to detect and reuse compatible venvs or fallback to suffixed venvs, removing stale incompatible ones. Adds a corresponding GitHub Actions matrix test for multiple Python versions to validate this behavior, updates documentation to explain the new naming scheme, and includes Python-based unit tests for the installer script's venv resolution logic. Risks include potential edge cases in venv compatibility detection and cleanup, but mitigated by thorough testing. Design is cleanly modular with clear separation of concerns. |
🤖 AI PR Review Summary\n\nAdds a new shared-home virtual environment naming scheme to the installer to handle Python version and architecture incompatibilities by appending a suffix to the default venv path. Introduces logic in the installer script to detect and reuse compatible venvs or fallback to suffixed venvs, removing stale incompatible ones. Adds comprehensive tests for this behavior and integrates the tests into the CI matrix. Updates documentation to explain the new behavior. Risks include potential edge cases in venv compatibility detection and cleanup, but mitigated by thorough testing. Design is clean and modular, enhancing installer robustness across Python versions and platforms. |
docs/install/mlcflow_unix_installer.shassumed a single default~/mlcflowenvironment, which breaks on shared homes used across mixed Python versions/architectures. This change makes default-env reuse compatibility-aware and falls back to a deterministic suffixed env name when needed.Installer behavior
~/mlcflowonly if its interpreter matches currentpython{major.minor}andplatform.machine().~/mlcflow_<arch>_py<major.minor>(e.g.,~/mlcflow_x86_64_py3.12).Implementation
is_venv_compatible()for venv interpreter validation.resolve_default_venv_dir()and called it fromsetup_venv()when default path is used.BASH_SOURCEmain guard so installer functions can be sourced for tests.Docs and coverage
docs/install/README.mdwith shared-home behavior note.tests/test_mlcflow_unix_installer.pyfor:✅ PR Checklist
dev📌 Note: PRs must be raised against
dev. Do not commit directly tomain.✅ Testing & CI
📚 Documentation
📁 File Hygiene & Output Handling
🛡️ Safety & Security
🙌 Contribution Hygiene
Fixes #orCloses #.