Skip to content

Commit

Permalink
DockerWrapper.run_container, progress tracking: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
szilard-nemeth committed Jan 8, 2025
1 parent 0c857a9 commit 5ef907d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pythoncommons/docker_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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}'")
Expand Down

0 comments on commit 5ef907d

Please sign in to comment.