|
@@ -1,12 +1,12 @@
|
|
|
use clap::{Parser, Subcommand};
|
|
use clap::{Parser, Subcommand};
|
|
|
|
|
|
|
|
#[derive(Parser)]
|
|
#[derive(Parser)]
|
|
|
-#[command(author, version, about = "DGX Spark Launcher для vLLM и SGLang")]
|
|
|
|
|
|
|
+#[command(author, version, about = "DGX Spark Launcher for vLLM and SGLang")]
|
|
|
pub struct Cli {
|
|
pub struct Cli {
|
|
|
#[arg(long, short, default_value = "config.toml")]
|
|
#[arg(long, short, default_value = "config.toml")]
|
|
|
pub config: String,
|
|
pub config: String,
|
|
|
|
|
|
|
|
- #[arg(long, short, help = "Показать команды без выполнения")]
|
|
|
|
|
|
|
+ #[arg(long, short, help = "Show commands without executing")]
|
|
|
pub dry_run: bool,
|
|
pub dry_run: bool,
|
|
|
|
|
|
|
|
#[command(subcommand)]
|
|
#[command(subcommand)]
|
|
@@ -15,7 +15,7 @@ pub struct Cli {
|
|
|
|
|
|
|
|
#[derive(Subcommand)]
|
|
#[derive(Subcommand)]
|
|
|
pub enum Commands {
|
|
pub enum Commands {
|
|
|
- /// Запустить кластер
|
|
|
|
|
|
|
+ /// Launch a cluster
|
|
|
Serve {
|
|
Serve {
|
|
|
#[arg(long, required = true)]
|
|
#[arg(long, required = true)]
|
|
|
recipe: String,
|
|
recipe: String,
|
|
@@ -40,7 +40,7 @@ pub enum Commands {
|
|
|
follow: bool,
|
|
follow: bool,
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- /// Показать логи контейнеров
|
|
|
|
|
|
|
+ /// Show container logs
|
|
|
Logs {
|
|
Logs {
|
|
|
#[arg(long, required = true)]
|
|
#[arg(long, required = true)]
|
|
|
recipe: String,
|
|
recipe: String,
|
|
@@ -52,7 +52,7 @@ pub enum Commands {
|
|
|
cluster: String,
|
|
cluster: String,
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- /// Остановить кластер
|
|
|
|
|
|
|
+ /// Stop a cluster
|
|
|
Stop {
|
|
Stop {
|
|
|
#[arg(long, required = true)]
|
|
#[arg(long, required = true)]
|
|
|
recipe: String,
|
|
recipe: String,
|
|
@@ -65,38 +65,38 @@ pub enum Commands {
|
|
|
cluster: String,
|
|
cluster: String,
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- /// Проверить здоровье кластера
|
|
|
|
|
|
|
+ /// Check cluster health
|
|
|
Health {
|
|
Health {
|
|
|
#[arg(
|
|
#[arg(
|
|
|
long,
|
|
long,
|
|
|
- help = "Имя кластера (например, 4nodes-switch). Если не указано - проверяет все."
|
|
|
|
|
|
|
+ help = "Cluster name (e.g. 4nodes-switch). If omitted — checks all."
|
|
|
)]
|
|
)]
|
|
|
cluster: Option<String>,
|
|
cluster: Option<String>,
|
|
|
#[arg(
|
|
#[arg(
|
|
|
long,
|
|
long,
|
|
|
- help = "Показать хост-ключи узлов (для добавления в config.toml)"
|
|
|
|
|
|
|
+ help = "Show node host keys (for adding to config.toml)"
|
|
|
)]
|
|
)]
|
|
|
fingerprint: bool,
|
|
fingerprint: bool,
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- /// Проверить и исправить рецепт (doctor mode)
|
|
|
|
|
|
|
+ /// Check and repair a recipe (doctor mode)
|
|
|
Doctor {
|
|
Doctor {
|
|
|
- #[arg(long, required = true, help = "Имя рецепта для проверки")]
|
|
|
|
|
|
|
+ #[arg(long, required = true, help = "Recipe name to check")]
|
|
|
recipe: String,
|
|
recipe: String,
|
|
|
#[arg(
|
|
#[arg(
|
|
|
long,
|
|
long,
|
|
|
default_value = "auto",
|
|
default_value = "auto",
|
|
|
- help = "Кластер (если не auto — использует recipe.cluster)"
|
|
|
|
|
|
|
+ help = "Cluster (if not auto — uses recipe.cluster)"
|
|
|
)]
|
|
)]
|
|
|
cluster: String,
|
|
cluster: String,
|
|
|
#[arg(
|
|
#[arg(
|
|
|
long,
|
|
long,
|
|
|
- help = "Автоматически исправить проблемы (создать Dockerfile + собрать образ)"
|
|
|
|
|
|
|
+ help = "Auto-fix issues (create Dockerfile + build image)"
|
|
|
)]
|
|
)]
|
|
|
repair: bool,
|
|
repair: bool,
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- /// Управление tmux-сессиями (альтернатива Docker)
|
|
|
|
|
|
|
+ /// Manage tmux sessions (Docker alternative)
|
|
|
#[command(subcommand)]
|
|
#[command(subcommand)]
|
|
|
Tmux(TmuxCommands),
|
|
Tmux(TmuxCommands),
|
|
|
|
|
|
|
@@ -104,7 +104,7 @@ pub enum Commands {
|
|
|
InitHostKeys {
|
|
InitHostKeys {
|
|
|
#[arg(
|
|
#[arg(
|
|
|
long,
|
|
long,
|
|
|
- help = "Имя кластера (например, 4nodes-switch). Если не указано — все."
|
|
|
|
|
|
|
+ help = "Cluster name (e.g. 4nodes-switch). If omitted — all."
|
|
|
)]
|
|
)]
|
|
|
cluster: Option<String>,
|
|
cluster: Option<String>,
|
|
|
},
|
|
},
|
|
@@ -173,7 +173,7 @@ pub enum PowerAction {
|
|
|
|
|
|
|
|
#[derive(Subcommand)]
|
|
#[derive(Subcommand)]
|
|
|
pub enum TmuxCommands {
|
|
pub enum TmuxCommands {
|
|
|
- /// Запустить кластер через tmux
|
|
|
|
|
|
|
+ /// Launch cluster via tmux
|
|
|
Serve {
|
|
Serve {
|
|
|
#[arg(long, required = true)]
|
|
#[arg(long, required = true)]
|
|
|
recipe: String,
|
|
recipe: String,
|
|
@@ -183,21 +183,21 @@ pub enum TmuxCommands {
|
|
|
#[arg(long, default_value = "false")]
|
|
#[arg(long, default_value = "false")]
|
|
|
skip_before_serve: bool,
|
|
skip_before_serve: bool,
|
|
|
},
|
|
},
|
|
|
- /// Остановить tmux-сессии
|
|
|
|
|
|
|
+ /// Stop tmux sessions
|
|
|
Stop {
|
|
Stop {
|
|
|
#[arg(long, required = true)]
|
|
#[arg(long, required = true)]
|
|
|
recipe: String,
|
|
recipe: String,
|
|
|
#[arg(long, default_value = "auto")]
|
|
#[arg(long, default_value = "auto")]
|
|
|
cluster: String,
|
|
cluster: String,
|
|
|
},
|
|
},
|
|
|
- /// Статус tmux-сессий (подробный)
|
|
|
|
|
|
|
+ /// Detailed tmux session status
|
|
|
Status {
|
|
Status {
|
|
|
#[arg(long, required = true)]
|
|
#[arg(long, required = true)]
|
|
|
recipe: String,
|
|
recipe: String,
|
|
|
#[arg(long, default_value = "auto")]
|
|
#[arg(long, default_value = "auto")]
|
|
|
cluster: String,
|
|
cluster: String,
|
|
|
},
|
|
},
|
|
|
- /// Показать логи tmux-сессий
|
|
|
|
|
|
|
+ /// Show tmux session logs
|
|
|
Logs {
|
|
Logs {
|
|
|
#[arg(long, required = true)]
|
|
#[arg(long, required = true)]
|
|
|
recipe: String,
|
|
recipe: String,
|
|
@@ -206,7 +206,7 @@ pub enum TmuxCommands {
|
|
|
#[arg(long, default_value = "auto")]
|
|
#[arg(long, default_value = "auto")]
|
|
|
cluster: String,
|
|
cluster: String,
|
|
|
},
|
|
},
|
|
|
- /// Подключиться к tmux-сессии головного узла
|
|
|
|
|
|
|
+ /// Attach to head node tmux session
|
|
|
Attach {
|
|
Attach {
|
|
|
#[arg(long, required = true)]
|
|
#[arg(long, required = true)]
|
|
|
recipe: String,
|
|
recipe: String,
|