diff --git a/Cargo.lock b/Cargo.lock index cf96d013..c05a43b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -489,17 +489,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "colored" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" -dependencies = [ - "is-terminal", - "lazy_static", - "windows-sys 0.48.0", -] - [[package]] name = "comfy-table" version = "7.1.0" @@ -1302,17 +1291,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix", - "windows-sys 0.48.0", -] - [[package]] name = "itoa" version = "1.0.9" @@ -1807,12 +1785,6 @@ dependencies = [ "regex", ] -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - [[package]] name = "peeking_take_while" version = "0.1.2" @@ -2615,17 +2587,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spinoff" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20aa2ed67fbb202e7b716ff8bfc6571dd9301617767380197d701c31124e88f6" -dependencies = [ - "colored", - "once_cell", - "paste", -] - [[package]] name = "stackable-cockpit" version = "0.0.0-dev" @@ -2746,7 +2707,6 @@ dependencies = [ "serde_json", "serde_yaml", "snafu", - "spinoff", "stackable-cockpit", "tera", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 102970d9..33fde6f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,6 @@ serde_json = "1.0" serde_yaml = "0.9" sha2 = "0.10" snafu = "0.7" -spinoff = "0.8.0" stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.55.0" } tera = "1.18" tokio = { version = "1.29.0", features = ["rt-multi-thread", "macros", "fs", "process"] } diff --git a/rust/stackable-cockpit/src/engine/kind/mod.rs b/rust/stackable-cockpit/src/engine/kind/mod.rs index 99e24de5..117b4787 100644 --- a/rust/stackable-cockpit/src/engine/kind/mod.rs +++ b/rust/stackable-cockpit/src/engine/kind/mod.rs @@ -86,8 +86,6 @@ impl Cluster { .args(["create", "cluster"]) .args(["--name", self.name.as_str()]) .args(["--config", "-"]) - .stdout(Stdio::null()) - .stderr(Stdio::null()) .stdin(Stdio::piped()) .spawn() .context(CommandFailedToStartSnafu)?; diff --git a/rust/stackablectl/Cargo.toml b/rust/stackablectl/Cargo.toml index 2422543e..9a4adae1 100644 --- a/rust/stackablectl/Cargo.toml +++ b/rust/stackablectl/Cargo.toml @@ -27,7 +27,6 @@ serde_json.workspace = true serde_yaml.workspace = true serde.workspace = true snafu.workspace = true -spinoff.workspace = true tera.workspace = true tokio.workspace = true tracing-subscriber.workspace = true diff --git a/rust/stackablectl/src/cmds/demo.rs b/rust/stackablectl/src/cmds/demo.rs index 6f5d0b76..90c25047 100644 --- a/rust/stackablectl/src/cmds/demo.rs +++ b/rust/stackablectl/src/cmds/demo.rs @@ -267,7 +267,6 @@ async fn install_cmd( // Init result output and progress output let mut output = cli.result(); - output.enable_progress(format!("Installing demo '{}'", args.demo_name)); let demo_spec = list.get(&args.demo_name).ok_or(CmdError::NoSuchDemo { name: args.demo_name.clone(), @@ -286,7 +285,6 @@ async fn install_cmd( .context(ListSnafu)?; // Install local cluster if needed - output.set_progress_message("Creating local cluster"); args.local_cluster .install_if_needed(None) .await @@ -305,7 +303,6 @@ async fn install_cmd( .unwrap_or(DEFAULT_PRODUCT_NAMESPACE.into()); if !args.skip_release { - output.set_progress_message("Creating operator namespace"); namespace::create_if_needed(operator_namespace.clone()) .await .context(NamespaceSnafu { @@ -313,14 +310,12 @@ async fn install_cmd( })?; } - output.set_progress_message("Creating product namespace"); namespace::create_if_needed(product_namespace.clone()) .await .context(NamespaceSnafu { namespace: product_namespace.clone(), })?; - output.set_progress_message("Installing demo manifests"); demo_spec .install( stack_list, @@ -358,6 +353,5 @@ async fn install_cmd( .with_command_hint(stacklet_cmd, "display the installed stacklets") .with_output(format!("Installed demo '{}'", args.demo_name)); - output.finish_progress("Done"); Ok(output.render()) } diff --git a/rust/stackablectl/src/cmds/release.rs b/rust/stackablectl/src/cmds/release.rs index 8b7f305b..ef4cbc0a 100644 --- a/rust/stackablectl/src/cmds/release.rs +++ b/rust/stackablectl/src/cmds/release.rs @@ -267,24 +267,20 @@ async fn install_cmd( match release_list.get(&args.release) { Some(release) => { let mut output = cli.result(); - output.enable_progress(format!("Installing release '{}'", args.release)); // Install local cluster if needed - output.set_progress_message("Installing local cluster"); args.local_cluster .install_if_needed(None) .await .context(CommonClusterArgsSnafu)?; // Create operator namespace if needed - output.set_progress_message("Creating operator namespace"); namespace::create_if_needed(args.operator_namespace.clone()) .await .context(NamespaceSnafu { namespace: args.operator_namespace.clone(), })?; - output.set_progress_message("Installing release manifests"); release .install( &args.included_products, @@ -300,7 +296,6 @@ async fn install_cmd( ) .with_output(format!("Installed release '{}'", args.release)); - output.finish_progress("Done"); Ok(output.render()) } None => Ok("No such release".into()), diff --git a/rust/stackablectl/src/cmds/stack.rs b/rust/stackablectl/src/cmds/stack.rs index 3cf2e6df..b4286d9b 100644 --- a/rust/stackablectl/src/cmds/stack.rs +++ b/rust/stackablectl/src/cmds/stack.rs @@ -278,10 +278,8 @@ async fn install_cmd( match stack_list.get(&args.stack_name) { Some(stack_spec) => { let mut output = cli.result(); - output.enable_progress(format!("Installing stack '{}'", args.stack_name)); // Install local cluster if needed - output.set_progress_message("Creating local cluster"); args.local_cluster .install_if_needed(None) .await @@ -295,14 +293,12 @@ async fn install_cmd( // Install release if not opted out if !args.skip_release { - output.set_progress_message("Creating operator namespace"); namespace::create_if_needed(operator_namespace.clone()) .await .context(NamespaceSnafu { namespace: operator_namespace.clone(), })?; - output.set_progress_message("Installing release manifests"); stack_spec .install_release(release_list, &operator_namespace, &product_namespace) .await @@ -312,7 +308,6 @@ async fn install_cmd( } // Create product namespace if needed - output.set_progress_message("Creating product namespace"); namespace::create_if_needed(product_namespace.clone()) .await .context(NamespaceSnafu { @@ -320,7 +315,6 @@ async fn install_cmd( })?; // Install stack - output.set_progress_message("Installing stack manifests"); stack_spec .install_stack_manifests( &args.stack_parameters, @@ -353,7 +347,6 @@ async fn install_cmd( .with_command_hint(stacklet_cmd, "display the installed stacklets") .with_output(format!("Installed stack '{}'", args.stack_name)); - output.finish_progress("Done"); Ok(output.render()) } None => Ok("No such stack".into()), diff --git a/rust/stackablectl/src/output/mod.rs b/rust/stackablectl/src/output/mod.rs index 70a71ad4..83fc32d6 100644 --- a/rust/stackablectl/src/output/mod.rs +++ b/rust/stackablectl/src/output/mod.rs @@ -4,7 +4,6 @@ use std::{ }; use snafu::{ResultExt, Snafu}; -use spinoff::{spinners, Color, Spinner}; use tera::Tera; mod error; @@ -93,7 +92,6 @@ pub struct Output where C: ContextExt, { - progress: Option, renderer: Tera, context: C, } @@ -107,28 +105,7 @@ where let no_color = use_colored_output(!no_color); context.set_no_color(no_color); - Ok(Self { - progress: None, - renderer, - context, - }) - } - - pub fn enable_progress(&mut self, initial_message: String) { - self.progress - .get_or_insert(Spinner::new(spinners::Dots, initial_message, Color::Green)); - } - - pub fn set_progress_message(&mut self, message: impl Into) { - if let Some(progress) = self.progress.as_mut() { - progress.update_text(message.into()) - } - } - - pub fn finish_progress(&mut self, message: impl AsRef) { - if let Some(progress) = self.progress.as_mut() { - progress.success(message.as_ref()) - } + Ok(Self { renderer, context }) } pub fn render(self) -> String {