From 11aee6c8e985b1bfca2f7762ed8e865026312d14 Mon Sep 17 00:00:00 2001 From: Alex Burlacu Date: Wed, 22 Mar 2023 15:35:45 +0200 Subject: [PATCH] Add the possibility to not log Uncommitted Changes by explicitly setting CLEARML_VCS_DIFF to an empty string --- clearml/backend_interface/task/repo/scriptinfo.py | 3 +++ clearml/config/defs.py | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/clearml/backend_interface/task/repo/scriptinfo.py b/clearml/backend_interface/task/repo/scriptinfo.py index bb282914..737bb728 100644 --- a/clearml/backend_interface/task/repo/scriptinfo.py +++ b/clearml/backend_interface/task/repo/scriptinfo.py @@ -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( diff --git a/clearml/config/defs.py b/clearml/config/defs.py index 25c28b09..e5e6df9a 100644 --- a/clearml/config/defs.py +++ b/clearml/config/defs.py @@ -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. +""" \ No newline at end of file