diff --git a/metadata-ingestion/src/datahub/cli/docker_cli.py b/metadata-ingestion/src/datahub/cli/docker_cli.py index e031e2f4fd..cb4bc8bda5 100644 --- a/metadata-ingestion/src/datahub/cli/docker_cli.py +++ b/metadata-ingestion/src/datahub/cli/docker_cli.py @@ -699,13 +699,18 @@ def quickstart( # Pull and possibly build the latest containers. try: if pull_images: - click.echo("Pulling docker images... ") + click.echo("\nPulling docker images... ") click.secho( "This may take a while depending on your network bandwidth.", dim=True ) - with click_spinner.spinner(): + + # docker compose v2 seems to spam the stderr when used in a non-interactive environment. + # As such, we'll only use the quiet flag if we're in an interactive environment. + # If we're in quiet mode, then we'll show a spinner instead. + quiet = not sys.stderr.isatty() + with click_spinner.spinner(disable=not quiet): subprocess.run( - [*base_command, "pull", "-q"], + [*base_command, "pull", *(("-q",) if quiet else ())], check=True, env=_docker_subprocess_env(), ) @@ -732,6 +737,7 @@ def quickstart( logger.info("Finished building docker images!") # Start it up! (with retries) + click.echo("\nStarting up DataHub...") max_wait_time = datetime.timedelta(minutes=8) start_time = datetime.datetime.now() sleep_interval = datetime.timedelta(seconds=2) @@ -740,7 +746,8 @@ def quickstart( while (datetime.datetime.now() - start_time) < max_wait_time: # Attempt to run docker compose up every `up_interval`. if (datetime.datetime.now() - start_time) > up_attempts * up_interval: - click.echo() + if up_attempts > 0: + click.echo() subprocess.run( base_command + ["up", "-d", "--remove-orphans"], env=_docker_subprocess_env(), @@ -841,7 +848,7 @@ def download_compose_files( ) as tmp_file: path = pathlib.Path(tmp_file.name) quickstart_compose_file_list.append(path) - click.echo(f"Fetching docker-compose file {github_file} from GitHub") + logger.info(f"Fetching docker-compose file {github_file} from GitHub") # Download the quickstart docker-compose file from GitHub. quickstart_download_response = request_session.get(github_file) quickstart_download_response.raise_for_status() diff --git a/metadata-ingestion/src/datahub/cli/quickstart_versioning.py b/metadata-ingestion/src/datahub/cli/quickstart_versioning.py index 0dc0ff0e73..0ba3c025bb 100644 --- a/metadata-ingestion/src/datahub/cli/quickstart_versioning.py +++ b/metadata-ingestion/src/datahub/cli/quickstart_versioning.py @@ -141,4 +141,4 @@ def save_quickstart_config( os.makedirs(os.path.dirname(path), exist_ok=True) with open(path, "w") as f: yaml.dump(config.dict(), f) - click.echo(f"Saved quickstart config to {path}.") + logger.info(f"Saved quickstart config to {path}.")