From 5295708e186ac7fdfd9f52fe27ad990f4e2db0b4 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Fri, 20 Aug 2021 00:34:20 +0300 Subject: [PATCH] Add "sdk.storage.log.report_upload_chunk_size_mb" and "sdk.storage.log.report_download_chunk_size_mb", control upload/download log reporting (issue #424) --- clearml/storage/callbacks.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/clearml/storage/callbacks.py b/clearml/storage/callbacks.py index d625ac51..29359e56 100644 --- a/clearml/storage/callbacks.py +++ b/clearml/storage/callbacks.py @@ -2,6 +2,7 @@ import logging import os from time import time from typing import Optional, AnyStr, IO +from ..config import config class ProgressReport(object): @@ -33,7 +34,9 @@ class ProgressReport(object): class UploadProgressReport(ProgressReport): - def __init__(self, filename, verbose, total_size, log, report_chunk_size_mb=5): + def __init__(self, filename, verbose, total_size, log, report_chunk_size_mb=0): + if not report_chunk_size_mb: + report_chunk_size_mb = int(config.get('storage.log.report_upload_chunk_size_mb', 0) or 5) super(UploadProgressReport, self).__init__(verbose, total_size, log, report_chunk_size_mb) self._filename = filename @@ -71,7 +74,10 @@ class UploadProgressReport(ProgressReport): class DownloadProgressReport(ProgressReport): - def __init__(self, total_size, verbose, remote_path, log, report_chunk_size_mb=5): + def __init__(self, total_size, verbose, remote_path, log, report_chunk_size_mb=0): + if not report_chunk_size_mb: + report_chunk_size_mb = int(config.get('storage.log.report_download_chunk_size_mb', 0) or 5) + super(DownloadProgressReport, self).__init__(verbose, total_size, log, report_chunk_size_mb) self._remote_path = remote_path