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 nvidia_blocklist;
23pub mod package_manager;
24pub mod package_mappings;
25pub mod rocm_env;
26pub mod sealed_token;
27pub mod telemetry;
28pub mod ui_helper;
29pub mod utils;
30
31// Re-export key types for convenience
32pub use benchmark_common::{
33    format_elapsed, is_dry_run, normalize_pci_bus_id, now_timestamp, resolve_log_dir, BenchLogger,
34    BenchTimer, BenchmarkResult, BenchmarkResults,
35};
36pub use distro::DistroFacade;
37pub use env_validation::{EnvValidationResult, EnvVars};
38pub use guard::{
39    detect_python_version, is_python_supported, is_python_supported_for_rocm_torch, log_error,
40    log_info, log_warn, InstallerError, LogLevel, ProgressTracker, PythonVersion,
41    MAX_ROCM_TORCH_PYTHON, MIN_PYTHON_VERSION,
42};
43pub use nvidia_blocklist::{
44    contaminated_packages, filter_requirements, filter_requirements_file, is_cuda_nvidia_package,
45    is_cuda_wheel_url,
46};
47pub use package_manager::{DryRunResult, PackageManagerFacade, PackageOperation};
48pub use package_mappings::map_package_name;
49pub use rocm_env::RocmEnv;
50pub use sealed_token::SealedToken;
51pub use telemetry::{submit_build_report, BuildReport, BuildReportArtifacts, BuildReportStatus};
52pub use ui_helper::{is_system_path, UiArgError, UiArgs};
53pub use utils::{
54    command_exists, fix_pip_cache_ownership, get_colors, Colors, PipCacheFixResult,
55    PythonPkgManager,
56};