mirror of
https://github.com/clearml/clearml-session
synced 2025-05-07 05:24:43 +00:00
Improve printouts
This commit is contained in:
parent
c97c939013
commit
c09c2c170d
@ -1144,11 +1144,16 @@ def _sync_workspace_snapshot(task, param, auto_shutdown_task):
|
|||||||
files_desc += "{}: {}[{}]\n".format(f.absolute(), fs.st_size, fs.st_mtime)
|
files_desc += "{}: {}[{}]\n".format(f.absolute(), fs.st_size, fs.st_mtime)
|
||||||
workspace_hash = hash(str(files_desc))
|
workspace_hash = hash(str(files_desc))
|
||||||
if param.get("workspace_hash") == workspace_hash:
|
if param.get("workspace_hash") == workspace_hash:
|
||||||
print("Skipping workspace snapshot upload, "
|
# noinspection PyPackageRequirements
|
||||||
"already uploaded no files changed since last sync {}".format(param.get(sync_runtime_property)))
|
try:
|
||||||
return
|
time_stamp = datetime.datetime.fromtimestamp(
|
||||||
|
param.get(sync_runtime_property)).strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
except Exception:
|
||||||
|
time_stamp = param.get(sync_runtime_property)
|
||||||
|
|
||||||
print("Uploading workspace: {}".format(workspace_folder))
|
print("Skipping workspace snapshot upload, "
|
||||||
|
"already uploaded no files changed since last sync {}".format(time_stamp))
|
||||||
|
return
|
||||||
|
|
||||||
# force running status - so that we can upload the artifact
|
# force running status - so that we can upload the artifact
|
||||||
prev_status = task.status
|
prev_status = task.status
|
||||||
@ -1156,6 +1161,8 @@ def _sync_workspace_snapshot(task, param, auto_shutdown_task):
|
|||||||
task.mark_started(force=True)
|
task.mark_started(force=True)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
print("Compressing workspace: {}".format(workspace_folder))
|
||||||
|
|
||||||
# create a tar file of the folder
|
# create a tar file of the folder
|
||||||
# put a consistent file name into a temp folder because the filename is part of
|
# put a consistent file name into a temp folder because the filename is part of
|
||||||
# the compressed artifact, and we want consistency in hash.
|
# the compressed artifact, and we want consistency in hash.
|
||||||
@ -1177,6 +1184,8 @@ def _sync_workspace_snapshot(task, param, auto_shutdown_task):
|
|||||||
relative_file_name = filename.relative_to(workspace_folder)
|
relative_file_name = filename.relative_to(workspace_folder)
|
||||||
archive_preview += '{} - {:,} B\n'.format(relative_file_name, filename.stat().st_size)
|
archive_preview += '{} - {:,} B\n'.format(relative_file_name, filename.stat().st_size)
|
||||||
|
|
||||||
|
print("Uploading workspace: {}".format(workspace_folder))
|
||||||
|
|
||||||
# upload actual snapshot tgz
|
# upload actual snapshot tgz
|
||||||
timestamp = datetime.datetime.now(datetime.UTC) \
|
timestamp = datetime.datetime.now(datetime.UTC) \
|
||||||
if hasattr(datetime, "UTC") and hasattr(datetime.datetime, "now") else datetime.datetime.utcnow()
|
if hasattr(datetime, "UTC") and hasattr(datetime.datetime, "now") else datetime.datetime.utcnow()
|
||||||
|
Loading…
Reference in New Issue
Block a user