aws / aws/aws-sam-cli

SAM build streams docker progress bar when run non-interactively

Open
#5,672 5 comments 0 reactions 0 assignees View on GitHub
area/build type/feature
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

When `sam build` is run from a non-interactive workflow, `_docker_client.images.build` will produce a progress bar that the SAM CLI will stream to the build logs, negatively impacting log legibility:

https://github.com/aws/aws-sam-cli/blob/d264edd40cc14a8f2f5f80f12c4ce58d17b8eabf/samcli/lib/build/app_builder.py#L447

It appears that could be handled here as well:

https://github.com/aws/aws-sam-cli/blob/d264edd40cc14a8f2f5f80f12c4ce58d17b8eabf/samcli/lib/docker/log_streamer.py#L66

The Docker CLI is pretty good about identifying whether there's a terminal for the purpose of deciding whether to generate progress bars, but I'm unclear on how that works with the Python client, and whether it's the responsibility of the client or of the AWS CLI to indicate how to stream progress? If the latter, it would be nice if `sam build` could support a `--no-progressbar` option for this purpose similar to the one that `sam package` uses for suppressing progress bars for S3 and ECR.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.