You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@liminal.apache.org by GitBox <gi...@apache.org> on 2022/05/25 07:24:30 UTC

[GitHub] [incubator-liminal] zionrubin commented on a diff in pull request #82: Stream out docker-build cmd stdout

zionrubin commented on code in PR #82:
URL: https://github.com/apache/incubator-liminal/pull/82#discussion_r881307954


##########
liminal/build/image_builder.py:
##########
@@ -69,25 +69,28 @@ def build(self):
 
         logging.info(docker_build_command)
 
-        docker_build_out = ''
         try:
-            docker_build_out = subprocess.check_output(
-                docker_build_command, shell=True, stderr=subprocess.STDOUT, timeout=960
-            )
-        except subprocess.CalledProcessError as e:
-            docker_build_out = e.output
-            raise e
-        finally:
+            build_process = subprocess.Popen(docker_build_command, shell=True, stdout=subprocess.PIPE)
+            # Poll process.stdout to show stdout live
             logging.info('=' * 80)
-            for line in str(docker_build_out)[2:-3].split('\\n'):
-                logging.info(line)
+            while True:

Review Comment:
   ```suggestion
               build_start = time.time()
               timeout = 960
               while time.time() < build_start + timeout:
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@liminal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org