From 91fa7e0b4e8f2dd997b855952e4e8e3bdc0bdb5c Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Thu, 29 Oct 2020 00:18:51 -0700 Subject: [PATCH] [releng]: Quiet Docker Push (and explain why) (#11623) --- ci/travis/build-docker-images.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ci/travis/build-docker-images.py b/ci/travis/build-docker-images.py index 41e11de7a..a1376641a 100644 --- a/ci/travis/build-docker-images.py +++ b/ci/travis/build-docker-images.py @@ -203,9 +203,19 @@ def push_and_tag_images(push_base_images: bool): def docker_push(image, tag): if _merge_build(): - result = DOCKER_CLIENT.api.push(image, tag=tag) print(f"PUSHING: {image}:{tag}, result:") - print(result) + # This docker API is janky. Without "stream=True" it returns a + # massive string filled with every progress bar update, which can + # cause CI to back up. + # + # With stream=True, it's a line-at-a-time generator of the same + # info. So we can slow it down by printing every couple hundred + # lines + i = 0 + for progress_line in DOCKER_CLIENT.api.push( + image, tag=tag, stream=True): + if i % 100 == 0: + print(progress_line) else: print( "This is a PR Build! On a merge build, we would normally push "