Skip to main content

rusty_stack/installers/common/
mod.rs

1//! Shared installer infrastructure modules.
2//!
3//! These modules provide common functionality used by all component installers:
4//! - **package management**: unified interface for apt/dnf/pacman
5//! - **distro detection**: thin facade over `platform::detection`
6//! - **package mappings**: per-distro package name resolution
7//! - **managed Python packages**: exact, resolver-free central ownership
8//! - **guard**: structured error handling, logging, progress, Python validation
9//! - **utils**: color-aware output, command existence, print helpers
10//! - **env_validation**: `.mlstack_env` checking with sensible defaults
11//! - **rocm_env**: thin facade over `platform::linux` for ROCm paths/versions
12//! - **ui_helper**: CLI arg parsing, path validation, git helpers
13//!
14//! # Validation Assertions
15//!
16//! - **VAL-INFRA-001**: Module structure compiles and integrates
17//! - **VAL-INFRA-019**: No code duplication with platform modules
18
19pub mod askpass;
20pub mod benchmark_common;
21pub mod distro;
22pub mod env_validation;
23pub mod guard;
24pub mod managed_python_build_tools;
25pub mod nvidia_blocklist;
26pub mod package_manager;
27pub mod package_mappings;
28pub mod rocm_env;
29pub mod sealed_token;
30pub mod telemetry;
31pub mod ui_helper;
32pub mod utils;
33
34// Re-export key types for convenience
35pub use benchmark_common::{
36    format_elapsed, is_dry_run, normalize_pci_bus_id, now_timestamp, resolve_log_dir, BenchLogger,
37    BenchTimer, BenchmarkResult, BenchmarkResults,
38};
39pub use distro::DistroFacade;
40pub use env_validation::{EnvValidationResult, EnvVars};
41pub use guard::{
42    detect_python_version, is_python_supported, is_python_supported_for_rocm_torch, log_error,
43    log_info, log_warn, InstallerError, LogLevel, ProgressTracker, PythonVersion,
44    MAX_ROCM_TORCH_PYTHON, MIN_PYTHON_VERSION,
45};
46pub use managed_python_build_tools::{
47    managed_python_install_command, managed_python_verify_command, ManagedPythonCommand,
48    MANAGED_PYTHON_PACKAGES,
49};
50pub use nvidia_blocklist::{
51    contaminated_packages, filter_requirements, filter_requirements_file, is_cuda_nvidia_package,
52    is_cuda_wheel_url,
53};
54pub use package_manager::{DryRunResult, PackageManagerFacade, PackageOperation};
55pub use package_mappings::map_package_name;
56pub use rocm_env::RocmEnv;
57pub use sealed_token::SealedToken;
58pub use telemetry::{submit_build_report, BuildReport, BuildReportArtifacts, BuildReportStatus};
59pub use ui_helper::{is_system_path, UiArgError, UiArgs};
60pub use utils::{
61    command_exists, fix_pip_cache_ownership, get_colors, Colors, PipCacheFixResult,
62    PythonPkgManager,
63};