From 4df5687ecd200da9d6d1f7ce639c507eb41c728b Mon Sep 17 00:00:00 2001 From: clearml <> Date: Thu, 5 Dec 2024 19:09:21 +0200 Subject: [PATCH] Do not replace S3 links in data_tool export by default --- apiserver/mongo/initialize/pre_populate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apiserver/mongo/initialize/pre_populate.py b/apiserver/mongo/initialize/pre_populate.py index 8b8b004..b2d483c 100644 --- a/apiserver/mongo/initialize/pre_populate.py +++ b/apiserver/mongo/initialize/pre_populate.py @@ -62,6 +62,8 @@ from apiserver.utilities import json from apiserver.utilities.dicts import nested_get, nested_set, nested_delete from apiserver.utilities.parameter_key_escaper import ParameterKeyEscaper +replace_s3_scheme = os.getenv("CLEARML_REPLACE_S3_SCHEME") + class PrePopulate: module_name_prefix = "apiserver." @@ -666,8 +668,9 @@ class PrePopulate: @staticmethod def _get_fixed_url(url: Optional[str]) -> Optional[str]: - if not (url and url.lower().startswith("s3://")): + if not (replace_s3_scheme and url and url.lower().startswith("s3://")): return url + try: fixed = furl(url) fixed.scheme = "https"