From 5ef907d17817599e70d085e04a0d47a872b1d354 Mon Sep 17 00:00:00 2001 From: Szilard Nemeth Date: Wed, 8 Jan 2025 18:27:17 -0500 Subject: [PATCH] DockerWrapper.run_container, progress tracking: rename --- pythoncommons/docker_wrapper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pythoncommons/docker_wrapper.py b/pythoncommons/docker_wrapper.py index b243d93..7b6b387 100644 --- a/pythoncommons/docker_wrapper.py +++ b/pythoncommons/docker_wrapper.py @@ -199,7 +199,7 @@ def __init__(self): self._tasks = {} self._progress = Progress() - def show_progress(self, line): + def capture_progress(self, line): if line['status'] == 'Downloading': id = f'[red][Download {line["id"]}]' elif line['status'] == 'Pulling': @@ -286,8 +286,9 @@ def run_container(self, commands_to_run: List[str] = None, sleep=300, capture_pr resp = client.api.pull(self.image_name, stream=True, decode=True) progress = DockerPullProgress() for line in resp: - progress.show_progress(line) - self.CMD_LOG.info(f"[{self.image_name}] {line}") + progress.capture_progress(line) + if print_progress: + self.CMD_LOG.info(f"[{self.image_name}] {line}") LOG.info(f"Starting container from image '{self.image_name}' with volumes: '{volumes_dict}'")