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//! - **guard**: structured error handling, logging, progress, Python validation
8//! - **utils**: color-aware output, command existence, print helpers
9//! - **env_validation**: `.mlstack_env` checking with sensible defaults
10//! - **rocm_env**: thin facade over `platform::linux` for ROCm paths/versions
11//! - **ui_helper**: CLI arg parsing, path validation, git helpers
12//!
13//! # Validation Assertions
14//!
15//! - **VAL-INFRA-001**: Module structure compiles and integrates
16//! - **VAL-INFRA-019**: No code duplication with platform modules
17
18pub mod benchmark_common;
19pub mod distro;
20pub mod env_validation;
21pub mod guard;
22pub mod package_manager;
23pub mod package_mappings;
24pub mod rocm_env;
25pub mod sealed_token;
26pub mod telemetry;
27pub mod ui_helper;
28pub mod utils;
29
30// Re-export key types for convenience
31pub use benchmark_common::{
32    format_elapsed, is_dry_run, normalize_pci_bus_id, now_timestamp, resolve_log_dir, BenchLogger,
33    BenchTimer, BenchmarkResult, BenchmarkResults,
34};
35pub use distro::DistroFacade;
36pub use env_validation::{EnvValidationResult, EnvVars};
37pub use guard::{
38    detect_python_version, is_python_supported, is_python_supported_for_rocm_torch, log_error,
39    log_info, log_warn, InstallerError, LogLevel, ProgressTracker, PythonVersion,
40    MAX_ROCM_TORCH_PYTHON, MIN_PYTHON_VERSION,
41};
42pub use package_manager::{DryRunResult, PackageManagerFacade, PackageOperation};
43pub use package_mappings::map_package_name;
44pub use rocm_env::RocmEnv;
45pub use sealed_token::SealedToken;
46pub use telemetry::{submit_build_report, BuildReport, BuildReportStatus};
47pub use ui_helper::{is_system_path, UiArgError, UiArgs};
48pub use utils::{
49    command_exists, fix_pip_cache_ownership, get_colors, Colors, PipCacheFixResult,
50    PythonPkgManager,
51};