use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
pub enum DistributionTier {
#[default]
Core,
Standard,
Full,
}
impl DistributionTier {
pub fn approximate_size_mb(&self) -> u64 {
match self {
Self::Core => 50,
Self::Standard => 200,
Self::Full => 500,
}
}
pub fn component_names(&self) -> Vec<&'static str> {
match self {
Self::Core => vec!["entrenar-core", "trueno", "aprender"],
Self::Standard => {
vec!["entrenar-core", "trueno", "aprender", "renacer", "trueno-db", "ruchy"]
}
Self::Full => vec![
"entrenar-core",
"trueno",
"aprender",
"renacer",
"trueno-db",
"ruchy",
"entrenar-gpu",
"entrenar-bench",
"entrenar-inspect",
"entrenar-lora",
"entrenar-shell",
],
}
}
pub fn includes(&self, component: &str) -> bool {
self.component_names().contains(&component)
}
}
impl std::fmt::Display for DistributionTier {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Core => write!(f, "core"),
Self::Standard => write!(f, "standard"),
Self::Full => write!(f, "full"),
}
}
}