From b6adc4053f1941115eb885736d601156b4f89428 Mon Sep 17 00:00:00 2001 From: Pritesh Arora Date: Mon, 6 Jan 2025 19:13:36 +0530 Subject: [PATCH 1/2] fix text wrap issue with runtime spinner --- airflow/runtimes/container_runtime.go | 4 ++-- airflow/runtimes/podman_engine.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/airflow/runtimes/container_runtime.go b/airflow/runtimes/container_runtime.go index 7fe9d2483..926f2408f 100644 --- a/airflow/runtimes/container_runtime.go +++ b/airflow/runtimes/container_runtime.go @@ -24,8 +24,8 @@ const ( containerRuntimeNotFoundErrMsg = "Failed to find a container runtime. " + "See the Astro CLI prerequisites for more information. " + "https://www.astronomer.io/docs/astro/cli/install-cli" - containerRuntimeInitMessage = " Astro uses container technology to run your Airflow project. " + - "Please wait while we get things started…" + containerRuntimeInitMessage = " Astro uses container technology to run your Airflow project.\n " + + " Please wait while we get things started…\n" spinnerRefresh = 100 * time.Millisecond ) diff --git a/airflow/runtimes/podman_engine.go b/airflow/runtimes/podman_engine.go index 5952d8649..44137cffd 100644 --- a/airflow/runtimes/podman_engine.go +++ b/airflow/runtimes/podman_engine.go @@ -13,8 +13,8 @@ const ( podmanStatusRunning = "running" podmanStatusStopped = "stopped" composeProjectLabel = "com.docker.compose.project" - podmanInitSlowMessage = " Sorry for the wait, this is taking a bit longer than expected. " + - "This initial download will be cached once finished." + podmanInitSlowMessage = " Sorry, this is taking a bit longer than expected.\n " + + " This initial download will be cached once finished.\n " podmanMachineAlreadyRunningErrMsg = "astro needs a podman machine to run your project, " + "but it looks like a machine is already running. " + "Mac hosts are limited to one running machine at a time. " + From ea2b53f7b1e440acd06ee170c2ced82db12624fc Mon Sep 17 00:00:00 2001 From: Greg Neiheisel <1036482+schnie@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:04:06 -0500 Subject: [PATCH 2/2] Shorten messages and drop message update --- airflow/runtimes/container_runtime.go | 5 ++--- airflow/runtimes/podman_engine.go | 8 +++----- airflow/runtimes/podman_runtime.go | 10 +--------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/airflow/runtimes/container_runtime.go b/airflow/runtimes/container_runtime.go index 926f2408f..3653de519 100644 --- a/airflow/runtimes/container_runtime.go +++ b/airflow/runtimes/container_runtime.go @@ -24,9 +24,8 @@ const ( containerRuntimeNotFoundErrMsg = "Failed to find a container runtime. " + "See the Astro CLI prerequisites for more information. " + "https://www.astronomer.io/docs/astro/cli/install-cli" - containerRuntimeInitMessage = " Astro uses container technology to run your Airflow project.\n " + - " Please wait while we get things started…\n" - spinnerRefresh = 100 * time.Millisecond + containerRuntimeInitMessage = " Astro uses containers to run your project. Hang tight while we get started…" + spinnerRefresh = 100 * time.Millisecond ) // ContainerRuntime interface defines the methods that manage diff --git a/airflow/runtimes/podman_engine.go b/airflow/runtimes/podman_engine.go index 44137cffd..32f5076ba 100644 --- a/airflow/runtimes/podman_engine.go +++ b/airflow/runtimes/podman_engine.go @@ -10,11 +10,9 @@ import ( ) const ( - podmanStatusRunning = "running" - podmanStatusStopped = "stopped" - composeProjectLabel = "com.docker.compose.project" - podmanInitSlowMessage = " Sorry, this is taking a bit longer than expected.\n " + - " This initial download will be cached once finished.\n " + podmanStatusRunning = "running" + podmanStatusStopped = "stopped" + composeProjectLabel = "com.docker.compose.project" podmanMachineAlreadyRunningErrMsg = "astro needs a podman machine to run your project, " + "but it looks like a machine is already running. " + "Mac hosts are limited to one running machine at a time. " + diff --git a/airflow/runtimes/podman_runtime.go b/airflow/runtimes/podman_runtime.go index 95129474c..9b7dea7e3 100644 --- a/airflow/runtimes/podman_runtime.go +++ b/airflow/runtimes/podman_runtime.go @@ -3,11 +3,9 @@ package runtimes import ( "errors" "fmt" + "github.com/astronomer/astro-cli/airflow/runtimes/types" "os" "strings" - "time" - - "github.com/astronomer/astro-cli/airflow/runtimes/types" "github.com/briandowns/spinner" ) @@ -122,12 +120,6 @@ func (rt PodmanRuntime) ensureMachine() error { s.Suffix = containerRuntimeInitMessage defer s.Stop() - // Update the message after a bit if it's still running. - go func() { - <-time.After(1 * time.Minute) - s.Suffix = podmanInitSlowMessage - }() - // Check if another, non-astro Podman machine is running nonAstroMachineName := rt.isAnotherMachineRunning() // If there is another machine running, and it has no running containers, stop it.