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