Add the possibility to not log Uncommitted Changes by explicitly setting CLEARML_VCS_DIFF to an empty string

This commit is contained in:
Alex Burlacu 2023-03-22 15:35:45 +02:00
parent 09a4d85c0c
commit 11aee6c8e9
2 changed files with 12 additions and 0 deletions

View File

@ -945,6 +945,9 @@ class ScriptInfo(object):
diff = cls._get_script_code(script_path.as_posix()) \
if not plugin or not repo_info.commit else repo_info.diff
if VCS_DIFF.exists():
diff = VCS_DIFF.get() or ""
# make sure diff is not too big:
if len(diff) > cls.max_diff_size_bytes:
messages.append(

View File

@ -36,3 +36,12 @@ VCS_WORK_DIR = EnvEntry("CLEARML_VCS_WORK_DIR")
VCS_ENTRY_POINT = EnvEntry("CLEARML_VCS_ENTRY_POINT")
VCS_STATUS = EnvEntry("CLEARML_VCS_STATUS", "TRAINS_VCS_STATUS", converter=base64_to_text)
VCS_DIFF = EnvEntry("CLEARML_VCS_DIFF", "TRAINS_VCS_DIFF", converter=base64_to_text)
"""
Handles repository or script diff
Environment variable primarily for internal use. Expects a base64 encoded string.
If explicitly set to an empty string, will not log the diff, shown in the UI under "Uncommitted Changes".
.. note::
Overriding CLEARML_VCS_DIFF will void the possibility of executing a Task remotely.
"""