mlrun 1.6.3rc6__py3-none-any.whl → 1.6.3rc9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mlrun might be problematic. Click here for more details.

mlrun/config.py CHANGED
@@ -1376,14 +1376,14 @@ def read_env(env=None, prefix=env_prefix):
1376
1376
  if log_formatter_name := config.get("log_formatter"):
1377
1377
  import mlrun.utils.logger
1378
1378
 
1379
- log_formatter = mlrun.utils.create_formatter_instance(
1379
+ log_formatter = mlrun.utils.resolve_formatter_by_kind(
1380
1380
  mlrun.utils.FormatterKinds(log_formatter_name)
1381
1381
  )
1382
1382
  current_handler = mlrun.utils.logger.get_handler("default")
1383
1383
  current_formatter_name = current_handler.formatter.__class__.__name__
1384
- desired_formatter_name = log_formatter.__class__.__name__
1384
+ desired_formatter_name = log_formatter.__name__
1385
1385
  if current_formatter_name != desired_formatter_name:
1386
- current_handler.setFormatter(log_formatter)
1386
+ current_handler.setFormatter(log_formatter())
1387
1387
 
1388
1388
  # The default function pod resource values are of type str; however, when reading from environment variable numbers,
1389
1389
  # it converts them to type int if contains only number, so we want to convert them to str.
mlrun/db/httpdb.py CHANGED
@@ -944,6 +944,7 @@ class HTTPRunDB(RunDBInterface):
944
944
  kind: str = None,
945
945
  category: Union[str, mlrun.common.schemas.ArtifactCategories] = None,
946
946
  tree: str = None,
947
+ producer_uri: str = None,
947
948
  ) -> ArtifactList:
948
949
  """List artifacts filtered by various parameters.
949
950
 
@@ -970,9 +971,12 @@ class HTTPRunDB(RunDBInterface):
970
971
  :param best_iteration: Returns the artifact which belongs to the best iteration of a given run, in the case of
971
972
  artifacts generated from a hyper-param run. If only a single iteration exists, will return the artifact
972
973
  from that iteration. If using ``best_iter``, the ``iter`` parameter must not be used.
973
- :param kind: Return artifacts of the requested kind.
974
- :param category: Return artifacts of the requested category.
975
- :param tree: Return artifacts of the requested tree.
974
+ :param kind: Return artifacts of the requested kind.
975
+ :param category: Return artifacts of the requested category.
976
+ :param tree: Return artifacts of the requested tree.
977
+ :param producer_uri: Return artifacts produced by the requested producer URI. Producer URI usually
978
+ points to a run and is used to filter artifacts by the run that produced them when the artifact producer id
979
+ is a workflow id (artifact was created as part of a workflow).
976
980
  """
977
981
 
978
982
  project = project or config.default_project
@@ -991,6 +995,7 @@ class HTTPRunDB(RunDBInterface):
991
995
  "category": category,
992
996
  "tree": tree,
993
997
  "format": mlrun.common.schemas.ArtifactsFormat.full.value,
998
+ "producer_uri": producer_uri,
994
999
  }
995
1000
  error = "list artifacts"
996
1001
  endpoint_path = f"projects/{project}/artifacts"
mlrun/lists.py CHANGED
@@ -36,6 +36,7 @@ list_header = [
36
36
  "parameters",
37
37
  "results",
38
38
  "artifacts",
39
+ "artifact_uris",
39
40
  "error",
40
41
  ]
41
42
 
@@ -63,6 +64,7 @@ class RunList(list):
63
64
  get_in(run, "spec.parameters", ""),
64
65
  get_in(run, "status.results", ""),
65
66
  get_in(run, "status.artifacts", []),
67
+ get_in(run, "status.artifact_uris", {}),
66
68
  get_in(run, "status.error", ""),
67
69
  ]
68
70
  if extend_iterations and iterations:
mlrun/model.py CHANGED
@@ -1058,6 +1058,7 @@ class RunStatus(ModelObj):
1058
1058
  ui_url=None,
1059
1059
  reason: str = None,
1060
1060
  notifications: Dict[str, Notification] = None,
1061
+ artifact_uris: dict[str, str] = None,
1061
1062
  ):
1062
1063
  self.state = state or "created"
1063
1064
  self.status_text = status_text
@@ -1072,6 +1073,8 @@ class RunStatus(ModelObj):
1072
1073
  self.ui_url = ui_url
1073
1074
  self.reason = reason
1074
1075
  self.notifications = notifications or {}
1076
+ # Artifact key -> URI mapping, since the full artifacts are not stored in the runs DB table
1077
+ self.artifact_uris = artifact_uris or {}
1075
1078
 
1076
1079
  def is_failed(self) -> Optional[bool]:
1077
1080
  """
@@ -1384,8 +1387,10 @@ class RunObject(RunTemplate):
1384
1387
  iter=self.metadata.iteration,
1385
1388
  )
1386
1389
  if run:
1387
- self.status = RunStatus.from_dict(run.get("status", {}))
1388
- self.status.from_dict(run.get("status", {}))
1390
+ run_status = run.get("status", {})
1391
+ # Artifacts are not stored in the DB, so we need to preserve them here
1392
+ run_status["artifacts"] = self.status.artifacts
1393
+ self.status = RunStatus.from_dict(run_status)
1389
1394
  return self
1390
1395
 
1391
1396
  def show(self):
mlrun/render.py CHANGED
@@ -404,12 +404,18 @@ def runs_to_html(
404
404
  df.drop("labels", axis=1, inplace=True)
405
405
  df.drop("inputs", axis=1, inplace=True)
406
406
  df.drop("artifacts", axis=1, inplace=True)
407
+ df.drop("artifact_uris", axis=1, inplace=True)
407
408
  else:
408
409
  df["labels"] = df["labels"].apply(dict_html)
409
410
  df["inputs"] = df["inputs"].apply(inputs_html)
410
- df["artifacts"] = df["artifacts"].apply(
411
- lambda artifacts: artifacts_html(artifacts, "target_path"),
412
- )
411
+ if df["artifact_uris"][0]:
412
+ df["artifact_uris"] = df["artifact_uris"].apply(dict_html)
413
+ df.drop("artifacts", axis=1, inplace=True)
414
+ else:
415
+ df["artifacts"] = df["artifacts"].apply(
416
+ lambda artifacts: artifacts_html(artifacts, "target_path"),
417
+ )
418
+ df.drop("artifact_uris", axis=1, inplace=True)
413
419
 
414
420
  def expand_error(x):
415
421
  if x["state"] == "error":
mlrun/utils/logger.py CHANGED
@@ -14,6 +14,7 @@
14
14
 
15
15
  import json
16
16
  import logging
17
+ import typing
17
18
  from enum import Enum
18
19
  from sys import stdout
19
20
  from traceback import format_exception
@@ -186,11 +187,15 @@ class FormatterKinds(Enum):
186
187
  JSON = "json"
187
188
 
188
189
 
189
- def create_formatter_instance(formatter_kind: FormatterKinds) -> logging.Formatter:
190
+ def resolve_formatter_by_kind(
191
+ formatter_kind: FormatterKinds,
192
+ ) -> typing.Type[
193
+ typing.Union[HumanReadableFormatter, HumanReadableExtendedFormatter, JSONFormatter]
194
+ ]:
190
195
  return {
191
- FormatterKinds.HUMAN: HumanReadableFormatter(),
192
- FormatterKinds.HUMAN_EXTENDED: HumanReadableExtendedFormatter(),
193
- FormatterKinds.JSON: JSONFormatter(),
196
+ FormatterKinds.HUMAN: HumanReadableFormatter,
197
+ FormatterKinds.HUMAN_EXTENDED: HumanReadableExtendedFormatter,
198
+ FormatterKinds.JSON: JSONFormatter,
194
199
  }[formatter_kind]
195
200
 
196
201
 
@@ -208,11 +213,11 @@ def create_logger(
208
213
  logger_instance = Logger(level, name=name, propagate=False)
209
214
 
210
215
  # resolve formatter
211
- formatter_instance = create_formatter_instance(
216
+ formatter_instance = resolve_formatter_by_kind(
212
217
  FormatterKinds(formatter_kind.lower())
213
218
  )
214
219
 
215
220
  # set handler
216
- logger_instance.set_handler("default", stream or stdout, formatter_instance)
221
+ logger_instance.set_handler("default", stream or stdout, formatter_instance())
217
222
 
218
223
  return logger_instance
@@ -1,4 +1,4 @@
1
1
  {
2
- "git_commit": "c2e9737b8495a07bdbf69841c9057962854fd676",
3
- "version": "1.6.3-rc6"
2
+ "git_commit": "046f4c7e365cd39e65cc540cefd1e9af0e434246",
3
+ "version": "1.6.3-rc9"
4
4
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mlrun
3
- Version: 1.6.3rc6
3
+ Version: 1.6.3rc9
4
4
  Summary: Tracking and config of machine learning runs
5
5
  Home-page: https://github.com/mlrun/mlrun
6
6
  Author: Yaron Haviv
@@ -1,14 +1,14 @@
1
1
  mlrun/__init__.py,sha256=o9dHUfVFADfsi6GnOPLr2OkfkHdPvOnA7rkoECen0-I,7248
2
2
  mlrun/__main__.py,sha256=zd-o0SkFH69HhIWKhqXnNURsrtpIcOJYYq50JfAxW7k,49234
3
- mlrun/config.py,sha256=U8La3z_0ac5d71qq6qydUsxLYiBPfEZOf-i-8SdKA7c,63797
3
+ mlrun/config.py,sha256=4scerZD_BdeDIOXJw9xrXCmpSBHxEvuc7R9QZpAb5EA,63789
4
4
  mlrun/errors.py,sha256=YdUtkN3qJ6yrseNygmKxmSWOfQ_RdKBhRxwwyMlTQCM,7106
5
5
  mlrun/execution.py,sha256=tgp6PcujZvGhDDVzPNs32YH_JNzaxfSd25yeuLwmjzg,40880
6
6
  mlrun/features.py,sha256=UQQ2uh5Xh9XsMGiYBqh3bKgDhOHANjv1gQgWyId9qQE,15624
7
7
  mlrun/k8s_utils.py,sha256=-6egUEZNPhzOxJ2gFytubvQvCYU9nPPg5Yn0zsTK-NQ,7065
8
8
  mlrun/kfpops.py,sha256=VgvS_4DappCPHzV7057SbraBTbF2mn7zZ7iPAaks3KU,30493
9
- mlrun/lists.py,sha256=JMc4Ch4wQxD_B9zbrE3JZwXD8cCYWLqHb1FQXWoaGzM,8310
10
- mlrun/model.py,sha256=Ax3h8A0-vUp8hRDNgttQuLoxaB0_8X8-yjpTLbBhirQ,64579
11
- mlrun/render.py,sha256=_Jrtqw54AkvUZDWK5ORGUQWnGewREh_lQnUQWuCkTV4,13016
9
+ mlrun/lists.py,sha256=sEEfl_mw_oVUD1dfkvQZIkJ8q7LJKJPDrb5B_Dg85nY,8388
10
+ mlrun/model.py,sha256=EbSxpwtNFkqodTwM_StcmDG5MFSG50ZuDMhqzIyzLmM,64896
11
+ mlrun/render.py,sha256=_vMTnT74DX5Lqg3L21RWeVEIG9cA5UPM3o3mlfRjmBA,13317
12
12
  mlrun/run.py,sha256=gyxYJqVCBsZxp0_HWAG5_lwi2_KPqcxy6un5ZLw_-2Q,42456
13
13
  mlrun/secrets.py,sha256=m7jM8fdjGLR-j9Vx-08eNmtOmlxFx9mTUBqBWtMSVQo,7782
14
14
  mlrun/api/schemas/__init__.py,sha256=ggWbnqhp7By5HNYYfRsZ4D4EdVvjLuz4qfNfR3Kq6M4,14219
@@ -88,7 +88,7 @@ mlrun/db/__init__.py,sha256=WqJ4x8lqJ7ZoKbhEyFqkYADd9P6E3citckx9e9ZLcIU,1163
88
88
  mlrun/db/auth_utils.py,sha256=hpg8D2r82oN0BWabuWN04BTNZ7jYMAF242YSUpK7LFM,5211
89
89
  mlrun/db/base.py,sha256=Rg2TrcwvzN28vmoyhq8sSxNjiBS1EA6BAHr24fhcmNU,18221
90
90
  mlrun/db/factory.py,sha256=wTEKHEmdDkylM6IkTYvmEYVF8gn2HdjLoLoWICCyatI,2403
91
- mlrun/db/httpdb.py,sha256=PUIY5VPln2hqCMgRexJwvuLV-nAXsz5BwGlGAt_ImnU,156882
91
+ mlrun/db/httpdb.py,sha256=FHrAwU7c4AQPCoXDIdkEkFfr8ViUS7XLJYIGrXrv_rs,157292
92
92
  mlrun/db/nopdb.py,sha256=rpZy5cpW-8--4OvMzlVoKNYjbhWJ3cn_z-JFwfuPqnI,14520
93
93
  mlrun/feature_store/__init__.py,sha256=n1F5m1svFW2chbE2dJdWzZJJiYS4E-y8PQsG9Q-F0lU,1584
94
94
  mlrun/feature_store/api.py,sha256=ehEwKlmE07pq1FUwh-ehA8Jm9LTkQofl5MQpEiMwVqM,49520
@@ -289,7 +289,7 @@ mlrun/utils/condition_evaluator.py,sha256=KFZC-apM7RU5TIlRszAzMFc0NqPj3W1rgP0Zv1
289
289
  mlrun/utils/db.py,sha256=fp9p2_z7XW3DhsceJEObWKh-e5zKjPiCM55kSGNkZD8,1658
290
290
  mlrun/utils/helpers.py,sha256=MRfvRQlxh9IITpYX68Sc8Lnej-SB5sWzIAy_7NhB44o,53692
291
291
  mlrun/utils/http.py,sha256=BLkPfCmXwFrpPrPXzipmDr9IhY3q5css7hovncXYs9g,8735
292
- mlrun/utils/logger.py,sha256=3SS-9ON0ScnUJp1S6P_jmaTRXuwF6MhBF5a5Ij8s3IU,7158
292
+ mlrun/utils/logger.py,sha256=KZFzojroEshCu1kvtCsavJpdIY8vNA-QZxiBjehP9f4,7260
293
293
  mlrun/utils/regex.py,sha256=Nd7xnDHU9PEOsse6rFwLNVgU4AaYCyuwMmQ9qgx2-Vw,4581
294
294
  mlrun/utils/singleton.py,sha256=UUTQiBTXyzmjeYzsvTUsSxqyLJHOtesqif9GNfZO9rc,883
295
295
  mlrun/utils/v3io_clients.py,sha256=HL7Hma-pxaQBXMKcEnWqGLCpFgykwnszlabzeOHC9-E,1319
@@ -304,11 +304,11 @@ mlrun/utils/notifications/notification/ipython.py,sha256=qrBmtECiRG6sZpCIVMg7RZc
304
304
  mlrun/utils/notifications/notification/slack.py,sha256=5JysqIpUYUZKXPSeeZtbl7qb2L9dj7p2NvnEBcEsZkA,3898
305
305
  mlrun/utils/notifications/notification/webhook.py,sha256=QHezCuN5uXkLcroAGxGrhGHaxAdUvkDLIsp27_Yrfd4,2390
306
306
  mlrun/utils/version/__init__.py,sha256=7kkrB7hEZ3cLXoWj1kPoDwo4MaswsI2JVOBpbKgPAgc,614
307
- mlrun/utils/version/version.json,sha256=Ea75vSxqQz02EmR5HD-yj73A-D06vFxQuD7YPf2n5wk,88
307
+ mlrun/utils/version/version.json,sha256=ZRqouhTOpqg2abJMdKPNBQTfk500IfYeDc5tWbb1img,88
308
308
  mlrun/utils/version/version.py,sha256=HMwseV8xjTQ__6T6yUWojx_z6yUj7Io7O4NcCCH_sz8,1970
309
- mlrun-1.6.3rc6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
310
- mlrun-1.6.3rc6.dist-info/METADATA,sha256=AXurGjRBbwSktSXgTc91G6JUXMfOtjs-hAkWWFvxV_g,18293
311
- mlrun-1.6.3rc6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
312
- mlrun-1.6.3rc6.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
313
- mlrun-1.6.3rc6.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
314
- mlrun-1.6.3rc6.dist-info/RECORD,,
309
+ mlrun-1.6.3rc9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
310
+ mlrun-1.6.3rc9.dist-info/METADATA,sha256=q04r-jxz-S4F1FtmaTzEZwZ4ly1wLkTxYX2O59R1D_o,18293
311
+ mlrun-1.6.3rc9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
312
+ mlrun-1.6.3rc9.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
313
+ mlrun-1.6.3rc9.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
314
+ mlrun-1.6.3rc9.dist-info/RECORD,,