mlrun 1.9.0rc4__py3-none-any.whl → 1.9.0rc6__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.

Files changed (48) hide show
  1. mlrun/__main__.py +13 -3
  2. mlrun/artifacts/base.py +5 -5
  3. mlrun/artifacts/dataset.py +1 -1
  4. mlrun/artifacts/model.py +1 -1
  5. mlrun/artifacts/plots.py +2 -2
  6. mlrun/common/constants.py +7 -0
  7. mlrun/common/runtimes/constants.py +1 -1
  8. mlrun/common/schemas/artifact.py +1 -1
  9. mlrun/common/schemas/pipeline.py +1 -1
  10. mlrun/common/schemas/project.py +1 -1
  11. mlrun/common/schemas/runs.py +1 -1
  12. mlrun/config.py +7 -7
  13. mlrun/datastore/datastore.py +1 -1
  14. mlrun/datastore/datastore_profile.py +5 -5
  15. mlrun/datastore/sources.py +3 -3
  16. mlrun/datastore/targets.py +4 -4
  17. mlrun/datastore/utils.py +2 -2
  18. mlrun/db/base.py +7 -7
  19. mlrun/db/httpdb.py +19 -15
  20. mlrun/db/nopdb.py +1 -1
  21. mlrun/execution.py +1 -1
  22. mlrun/frameworks/_common/model_handler.py +2 -2
  23. mlrun/launcher/client.py +1 -1
  24. mlrun/model_monitoring/api.py +4 -4
  25. mlrun/model_monitoring/applications/_application_steps.py +3 -1
  26. mlrun/model_monitoring/applications/evidently/base.py +57 -107
  27. mlrun/model_monitoring/controller.py +26 -13
  28. mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +13 -5
  29. mlrun/model_monitoring/tracking_policy.py +1 -1
  30. mlrun/model_monitoring/writer.py +1 -1
  31. mlrun/projects/operations.py +3 -3
  32. mlrun/projects/project.py +68 -51
  33. mlrun/render.py +5 -9
  34. mlrun/run.py +2 -2
  35. mlrun/runtimes/base.py +5 -5
  36. mlrun/runtimes/kubejob.py +2 -2
  37. mlrun/runtimes/mounts.py +2 -0
  38. mlrun/runtimes/nuclio/function.py +2 -2
  39. mlrun/runtimes/nuclio/serving.py +4 -4
  40. mlrun/runtimes/utils.py +25 -8
  41. mlrun/utils/helpers.py +10 -4
  42. mlrun/utils/version/version.json +2 -2
  43. {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/METADATA +10 -10
  44. {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/RECORD +48 -48
  45. {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/WHEEL +1 -1
  46. {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/entry_points.txt +0 -0
  47. {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/licenses/LICENSE +0 -0
  48. {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/top_level.txt +0 -0
@@ -12,21 +12,18 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- import json
16
- import posixpath
17
- import uuid
18
15
  import warnings
19
16
  from abc import ABC
17
+ from tempfile import NamedTemporaryFile
18
+ from typing import Optional
20
19
 
21
- import pandas as pd
22
20
  import semver
23
- from evidently.ui.storage.local.base import METADATA_PATH, FSLocation
24
21
 
25
22
  import mlrun.model_monitoring.applications.base as mm_base
26
23
  import mlrun.model_monitoring.applications.context as mm_context
27
- from mlrun.errors import MLRunIncompatibleVersionError
24
+ from mlrun.errors import MLRunIncompatibleVersionError, MLRunValueError
28
25
 
29
- SUPPORTED_EVIDENTLY_VERSION = semver.Version.parse("0.6.0")
26
+ SUPPORTED_EVIDENTLY_VERSION = semver.Version.parse("0.7.5")
30
27
 
31
28
 
32
29
  def _check_evidently_version(*, cur: semver.Version, ref: semver.Version) -> None:
@@ -60,75 +57,69 @@ except ModuleNotFoundError:
60
57
 
61
58
 
62
59
  if _HAS_EVIDENTLY:
63
- from evidently.suite.base_suite import Display
64
- from evidently.ui.type_aliases import STR_UUID
65
- from evidently.ui.workspace import Workspace
66
- from evidently.utils.dashboard import TemplateParams, file_html_template
60
+ from evidently.core.report import Snapshot
61
+ from evidently.ui.workspace import (
62
+ STR_UUID,
63
+ CloudWorkspace,
64
+ Project,
65
+ Workspace,
66
+ WorkspaceBase,
67
+ )
67
68
 
68
69
 
69
70
  class EvidentlyModelMonitoringApplicationBase(
70
71
  mm_base.ModelMonitoringApplicationBase, ABC
71
72
  ):
72
73
  def __init__(
73
- self, evidently_workspace_path: str, evidently_project_id: "STR_UUID"
74
+ self,
75
+ evidently_project_id: "STR_UUID",
76
+ evidently_workspace_path: Optional[str] = None,
77
+ cloud_workspace: bool = False,
74
78
  ) -> None:
75
79
  """
76
- A class for integrating Evidently for mlrun model monitoring within a monitoring application.
77
- Note: evidently is not installed by default in the mlrun/mlrun image.
78
- It must be installed separately to use this class.
80
+ A class for integrating Evidently for MLRun model monitoring within a monitoring application.
81
+
82
+ .. note::
83
+
84
+ The ``evidently`` package is not installed by default in the mlrun/mlrun image.
85
+ It must be installed separately to use this class.
79
86
 
80
- :param evidently_workspace_path: (str) The path to the Evidently workspace.
81
87
  :param evidently_project_id: (str) The ID of the Evidently project.
88
+ :param evidently_workspace_path: (str) The path to the Evidently workspace.
89
+ :param cloud_workspace: (bool) Whether the workspace is an Evidently Cloud workspace.
82
90
  """
83
-
84
- # TODO : more then one project (mep -> project)
85
91
  if not _HAS_EVIDENTLY:
86
92
  raise ModuleNotFoundError("Evidently is not installed - the app cannot run")
87
- self._log_location(evidently_workspace_path)
88
- self.evidently_workspace = Workspace.create(evidently_workspace_path)
93
+ self.evidently_workspace_path = evidently_workspace_path
94
+ if cloud_workspace:
95
+ self.get_workspace = self.get_cloud_workspace
96
+ self.evidently_workspace = self.get_workspace()
89
97
  self.evidently_project_id = evidently_project_id
90
- self.evidently_project = self.evidently_workspace.get_project(
91
- evidently_project_id
92
- )
93
-
94
- @staticmethod
95
- def _log_location(evidently_workspace_path):
96
- # TODO remove function + usage after solving issue ML-9530
97
- location = FSLocation(base_path=evidently_workspace_path)
98
- location.invalidate_cache("")
99
- paths = [p for p in location.listdir("") if location.isdir(p)]
100
-
101
- for path in paths:
102
- metadata_path = posixpath.join(path, METADATA_PATH)
103
- full_path = posixpath.join(location.path, metadata_path)
104
- print(f"evidently json issue, working on path: {full_path}")
105
- try:
106
- with location.open(metadata_path) as f:
107
- content = json.load(f)
108
- print(
109
- f"evidently json issue, successful load path: {full_path}, content: {content}"
110
- )
111
- except FileNotFoundError:
112
- print(f"evidently json issue, path not found: {full_path}")
113
- continue
114
- except json.decoder.JSONDecodeError as json_error:
115
- print(
116
- f"evidently json issue, path got json error, path:{full_path}, error: {json_error}"
117
- )
118
- print("evidently json issue, file content:")
119
- with location.open(metadata_path) as f:
120
- print(f.read())
121
- continue
122
- except Exception as error:
123
- print(
124
- f"evidently json issue, path got general error, path:{full_path}, error: {error}"
125
- )
126
- continue
98
+ self.evidently_project = self.load_project()
99
+
100
+ def load_project(self) -> "Project":
101
+ """Load the Evidently project."""
102
+ return self.evidently_workspace.get_project(self.evidently_project_id)
103
+
104
+ def get_workspace(self) -> "WorkspaceBase":
105
+ """Get the Evidently workspace. Override this method for customize access to the workspace."""
106
+ if self.evidently_workspace_path:
107
+ return Workspace.create(self.evidently_workspace_path)
108
+ else:
109
+ raise MLRunValueError(
110
+ "A local workspace could not be created as `evidently_workspace_path` is not set.\n"
111
+ "If you intend to use a cloud workspace, please use `cloud_workspace=True` and set the "
112
+ "`EVIDENTLY_API_KEY` environment variable. In other cases, override this method."
113
+ )
114
+
115
+ def get_cloud_workspace(self) -> "CloudWorkspace":
116
+ """Load the Evidently cloud workspace according to the `EVIDENTLY_API_KEY` environment variable."""
117
+ return CloudWorkspace()
127
118
 
128
119
  @staticmethod
129
120
  def log_evidently_object(
130
121
  monitoring_context: mm_context.MonitoringApplicationContext,
131
- evidently_object: "Display",
122
+ evidently_object: "Snapshot",
132
123
  artifact_name: str,
133
124
  unique_per_endpoint: bool = True,
134
125
  ) -> None:
@@ -141,56 +132,15 @@ class EvidentlyModelMonitoringApplicationBase(
141
132
  This method should be called on special occasions only.
142
133
 
143
134
  :param monitoring_context: (MonitoringApplicationContext) The monitoring context to process.
144
- :param evidently_object: (Display) The Evidently display to log, e.g. a report or a test suite object.
145
- :param artifact_name: (str) The name for the logged artifact.
146
- :param unique_per_endpoint: by default ``True``, we will log different artifact for each model endpoint,
147
- set to ``False`` without changing item key will cause artifact override.
148
- """
149
- evidently_object_html = evidently_object.get_html()
150
- monitoring_context.log_artifact(
151
- artifact_name,
152
- body=evidently_object_html.encode("utf-8"),
153
- format="html",
154
- unique_per_endpoint=unique_per_endpoint,
155
- )
156
-
157
- def log_project_dashboard(
158
- self,
159
- monitoring_context: mm_context.MonitoringApplicationContext,
160
- timestamp_start: pd.Timestamp,
161
- timestamp_end: pd.Timestamp,
162
- artifact_name: str = "dashboard",
163
- unique_per_endpoint: bool = True,
164
- ) -> None:
165
- """
166
- Logs an Evidently project dashboard.
167
-
168
- .. caution::
169
-
170
- Logging Evidently dashboards in every model monitoring window may cause scale issues.
171
- This method should be called on special occasions only.
172
-
173
- :param monitoring_context: (MonitoringApplicationContext) The monitoring context to process.
174
- :param timestamp_start: (pd.Timestamp) The start timestamp for the dashboard data.
175
- :param timestamp_end: (pd.Timestamp) The end timestamp for the dashboard data.
135
+ :param evidently_object: (Snapshot) The Evidently run to log, e.g. a report run.
176
136
  :param artifact_name: (str) The name for the logged artifact.
177
137
  :param unique_per_endpoint: by default ``True``, we will log different artifact for each model endpoint,
178
138
  set to ``False`` without changing item key will cause artifact override.
179
139
  """
180
-
181
- dashboard_info = self.evidently_project.build_dashboard_info(
182
- timestamp_start, timestamp_end
183
- )
184
- template_params = TemplateParams(
185
- dashboard_id="pd_" + str(uuid.uuid4()).replace("-", ""),
186
- dashboard_info=dashboard_info,
187
- additional_graphs={},
188
- )
189
-
190
- dashboard_html = file_html_template(params=template_params)
191
- monitoring_context.log_artifact(
192
- artifact_name,
193
- body=dashboard_html.encode("utf-8"),
194
- format="html",
195
- unique_per_endpoint=unique_per_endpoint,
196
- )
140
+ with NamedTemporaryFile(suffix=".html") as file:
141
+ evidently_object.save_html(filename=file.name)
142
+ monitoring_context.log_artifact(
143
+ artifact_name,
144
+ local_path=file.name,
145
+ unique_per_endpoint=unique_per_endpoint,
146
+ )
@@ -25,6 +25,7 @@ from types import TracebackType
25
25
  from typing import Any, NamedTuple, Optional, Union, cast
26
26
 
27
27
  import nuclio_sdk
28
+ import pandas as pd
28
29
 
29
30
  import mlrun
30
31
  import mlrun.common.schemas.model_monitoring.constants as mm_constants
@@ -673,9 +674,15 @@ class MonitoringApplicationController:
673
674
  """
674
675
  logger.info("Starting monitoring controller chief")
675
676
  applications_names = []
676
- endpoints = self.project_obj.list_model_endpoints(
677
- metric_list=["last_request"]
678
- ).endpoints
677
+ endpoints = self.project_obj.list_model_endpoints(tsdb_metrics=False).endpoints
678
+ last_request_dict = self.tsdb_connector.get_last_request(
679
+ endpoint_ids=[mep.metadata.uid for mep in endpoints]
680
+ )
681
+ if isinstance(last_request_dict, pd.DataFrame):
682
+ last_request_dict = last_request_dict.set_index(
683
+ mm_constants.EventFieldType.ENDPOINT_ID
684
+ )[mm_constants.ModelEndpointSchema.LAST_REQUEST].to_dict()
685
+
679
686
  if not endpoints:
680
687
  logger.info("No model endpoints found", project=self.project)
681
688
  return
@@ -721,16 +728,22 @@ class MonitoringApplicationController:
721
728
  with schedules.ModelMonitoringSchedulesFileChief(
722
729
  self.project
723
730
  ) as schedule_file:
724
- futures = {
725
- pool.submit(
726
- self.endpoint_to_regular_event,
727
- endpoint,
728
- policy,
729
- set(applications_names),
730
- schedule_file,
731
- ): endpoint
732
- for endpoint in endpoints
733
- }
731
+ for endpoint in endpoints:
732
+ last_request = last_request_dict.get(endpoint.metadata.uid, None)
733
+ if isinstance(last_request, float):
734
+ last_request = pd.to_datetime(last_request, unit="s", utc=True)
735
+ endpoint.status.last_request = (
736
+ last_request or endpoint.status.last_request
737
+ )
738
+ futures = {
739
+ pool.submit(
740
+ self.endpoint_to_regular_event,
741
+ endpoint,
742
+ policy,
743
+ set(applications_names),
744
+ schedule_file,
745
+ ): endpoint
746
+ }
734
747
  for future in concurrent.futures.as_completed(futures):
735
748
  if future.exception():
736
749
  exception = future.exception()
@@ -455,12 +455,20 @@ class V3IOTSDBConnector(TSDBConnector):
455
455
  # Delete all tables
456
456
  tables = mm_schemas.V3IOTSDBTables.list()
457
457
  for table_to_delete in tables:
458
- try:
459
- self.frames_client.delete(backend=_TSDB_BE, table=table_to_delete)
460
- except v3io_frames.DeleteError as e:
458
+ if table_to_delete in self.tables:
459
+ try:
460
+ self.frames_client.delete(
461
+ backend=_TSDB_BE, table=self.tables[table_to_delete]
462
+ )
463
+ except v3io_frames.DeleteError as e:
464
+ logger.warning(
465
+ f"Failed to delete TSDB table '{table_to_delete}'",
466
+ err=mlrun.errors.err_to_str(e),
467
+ )
468
+ else:
461
469
  logger.warning(
462
- f"Failed to delete TSDB table '{table}'",
463
- err=mlrun.errors.err_to_str(e),
470
+ f"Skipping deletion: table '{table_to_delete}' is not among the initialized tables.",
471
+ initialized_tables=list(self.tables.keys()),
464
472
  )
465
473
 
466
474
  # Final cleanup of tsdb path
@@ -57,7 +57,7 @@ class TrackingPolicy(mlrun.model.ModelObj):
57
57
  """
58
58
  warnings.warn(
59
59
  "The `TrackingPolicy` class is deprecated from version 1.7.0 and is not "
60
- "used anymore. It will be removed in 1.9.0.",
60
+ "used anymore. It will be removed in 1.10.0.",
61
61
  FutureWarning,
62
62
  )
63
63
 
@@ -129,7 +129,7 @@ class ModelMonitoringWriter(StepToDict):
129
129
  )
130
130
  kind = event.pop(WriterEvent.EVENT_KIND, WriterEventKind.RESULT)
131
131
  result_event = _AppResultEvent(json.loads(event.pop(WriterEvent.DATA, "{}")))
132
- if not result_event: # BC for < 1.7.0, can be removed in 1.9.0
132
+ if not result_event: # BC for < 1.7.0, can be removed in 1.10.0
133
133
  result_event = _AppResultEvent(event)
134
134
  else:
135
135
  result_event.update(_AppResultEvent(event))
@@ -294,9 +294,9 @@ def build_function(
294
294
  :param force_build: Force building the image, even when no changes were made
295
295
  """
296
296
  if not overwrite_build_params:
297
- # TODO: change overwrite_build_params default to True in 1.9.0
297
+ # TODO: change overwrite_build_params default to True in 1.10.0
298
298
  warnings.warn(
299
- "The `overwrite_build_params` parameter default will change from 'False' to 'True' in 1.9.0.",
299
+ "The `overwrite_build_params` parameter default will change from 'False' to 'True' in 1.10.0.",
300
300
  mlrun.utils.OverwriteBuildParamsWarning,
301
301
  )
302
302
 
@@ -325,7 +325,7 @@ def build_function(
325
325
  skip_deployed=skip_deployed,
326
326
  )
327
327
  else:
328
- # TODO: remove filter once overwrite_build_params default is changed to True in 1.9.0
328
+ # TODO: remove filter once overwrite_build_params default is changed to True in 1.10.0
329
329
  with warnings.catch_warnings():
330
330
  warnings.simplefilter(
331
331
  "ignore", category=mlrun.utils.OverwriteBuildParamsWarning
mlrun/projects/project.py CHANGED
@@ -470,7 +470,8 @@ def get_or_create_project(
470
470
  parameters: Optional[dict] = None,
471
471
  allow_cross_project: Optional[bool] = None,
472
472
  ) -> "MlrunProject":
473
- """Load a project from MLRun DB, or create/import if it does not exist
473
+ """Load a project from MLRun DB, or create/import if it does not exist.
474
+ The project will become the default project for the current session.
474
475
 
475
476
  MLRun looks for a project.yaml file with project definition and objects in the project root path
476
477
  and use it to initialize the project, in addition it runs the project_setup.py file (if it exists)
@@ -756,10 +757,10 @@ def _project_instance_from_struct(struct, name, allow_cross_project):
756
757
  )
757
758
 
758
759
  if allow_cross_project is None:
759
- # TODO: Remove this warning in version 1.9.0 and also fix cli to support allow_cross_project
760
+ # TODO: Remove this warning in version 1.10.0 and also fix cli to support allow_cross_project
760
761
  warnings.warn(
761
762
  f"Project {name=} is different than specified on the context's project yaml. "
762
- "This behavior is deprecated and will not be supported from version 1.9.0."
763
+ "This behavior is deprecated and will not be supported from version 1.10.0."
763
764
  )
764
765
  logger.warn(error_message)
765
766
  elif allow_cross_project:
@@ -2478,9 +2479,9 @@ class MlrunProject(ModelObj):
2478
2479
  :param fetch_credentials_from_sys_config: If true, fetch the credentials from the system configuration.
2479
2480
  """
2480
2481
  if default_controller_image != "mlrun/mlrun":
2481
- # TODO: Remove this in 1.9.0
2482
+ # TODO: Remove this in 1.10.0
2482
2483
  warnings.warn(
2483
- "'default_controller_image' is deprecated and will be removed in 1.9.0, "
2484
+ "'default_controller_image' is deprecated in 1.7.0 and will be removed in 1.10.0, "
2484
2485
  "use 'image' instead",
2485
2486
  FutureWarning,
2486
2487
  )
@@ -2860,10 +2861,10 @@ class MlrunProject(ModelObj):
2860
2861
 
2861
2862
  self.spec.set_function(name, function_object, func)
2862
2863
 
2863
- # TODO: Remove this in 1.10.0
2864
+ # TODO: Remove this in 1.11.0
2864
2865
  @deprecated.deprecated(
2865
2866
  version="1.8.0",
2866
- reason="'remove_function' is deprecated and will be removed in 1.10.0. "
2867
+ reason="'remove_function' is deprecated and will be removed in 1.11.0. "
2867
2868
  "Please use `delete_function` instead.",
2868
2869
  category=FutureWarning,
2869
2870
  )
@@ -2891,9 +2892,9 @@ class MlrunProject(ModelObj):
2891
2892
 
2892
2893
  :param name: name of the model-monitoring-function/s (under the project)
2893
2894
  """
2894
- # TODO: Remove this in 1.9.0
2895
+ # TODO: Remove this in 1.10.0
2895
2896
  warnings.warn(
2896
- "'remove_model_monitoring_function' is deprecated and will be removed in 1.9.0. "
2897
+ "'remove_model_monitoring_function' is deprecated in 1.7.0 and will be removed in 1.10.0. "
2897
2898
  "Please use `delete_model_monitoring_function` instead.",
2898
2899
  FutureWarning,
2899
2900
  )
@@ -3795,7 +3796,7 @@ class MlrunProject(ModelObj):
3795
3796
  top_level: bool = False,
3796
3797
  uids: Optional[list[str]] = None,
3797
3798
  latest_only: bool = False,
3798
- tsdb_metrics: bool = True,
3799
+ tsdb_metrics: bool = False,
3799
3800
  metric_list: Optional[list[str]] = None,
3800
3801
  ) -> mlrun.common.schemas.ModelEndpointList:
3801
3802
  """
@@ -4002,8 +4003,10 @@ class MlrunProject(ModelObj):
4002
4003
  e.g. builder_env={"GIT_TOKEN": token}, does not work yet in KFP
4003
4004
  :param overwrite_build_params: Overwrite existing build configuration (currently applies to
4004
4005
  requirements and commands)
4006
+
4005
4007
  * False: The new params are merged with the existing
4006
4008
  * True: The existing params are replaced by the new ones
4009
+
4007
4010
  :param extra_args: A string containing additional builder arguments in the format of command-line options,
4008
4011
  e.g. extra_args="--skip-tls-verify --build-arg A=val"
4009
4012
  :param force_build: force building the image, even when no changes were made
@@ -4054,8 +4057,10 @@ class MlrunProject(ModelObj):
4054
4057
  :param requirements_file: requirements file to install on the built image
4055
4058
  :param overwrite_build_params: Overwrite existing build configuration (currently applies to
4056
4059
  requirements and commands)
4060
+
4057
4061
  * False: The new params are merged with the existing
4058
4062
  * True: The existing params are replaced by the new ones
4063
+
4059
4064
  :param builder_env: Kaniko builder pod env vars dict (for config/credentials)
4060
4065
  e.g. builder_env={"GIT_TOKEN": token}, does not work yet in KFP
4061
4066
  :param extra_args: A string containing additional builder arguments in the format of command-line options,
@@ -4064,9 +4069,9 @@ class MlrunProject(ModelObj):
4064
4069
  (by default `/home/mlrun_code`)
4065
4070
  """
4066
4071
  if not overwrite_build_params:
4067
- # TODO: change overwrite_build_params default to True in 1.9.0
4072
+ # TODO: change overwrite_build_params default to True in 1.10.0
4068
4073
  warnings.warn(
4069
- "The `overwrite_build_params` parameter default will change from 'False' to 'True' in 1.9.0.",
4074
+ "The `overwrite_build_params` parameter default will change from 'False' to 'True' in 1.10.0.",
4070
4075
  mlrun.utils.OverwriteBuildParamsWarning,
4071
4076
  )
4072
4077
  default_image_name = mlrun.mlconf.default_project_image_name.format(
@@ -4127,8 +4132,10 @@ class MlrunProject(ModelObj):
4127
4132
  e.g. builder_env={"GIT_TOKEN": token}, does not work yet in KFP
4128
4133
  :param overwrite_build_params: Overwrite existing build configuration (currently applies to
4129
4134
  requirements and commands)
4135
+
4130
4136
  * False: The new params are merged with the existing
4131
4137
  * True: The existing params are replaced by the new ones
4138
+
4132
4139
  :param extra_args: A string containing additional builder arguments in the format of command-line options,
4133
4140
  e.g. extra_args="--skip-tls-verify --build-arg A=val"
4134
4141
  :param target_dir: Path on the image where source code would be extracted (by default `/home/mlrun_code`)
@@ -4141,9 +4148,9 @@ class MlrunProject(ModelObj):
4141
4148
  )
4142
4149
 
4143
4150
  if not overwrite_build_params:
4144
- # TODO: change overwrite_build_params default to True in 1.9.0
4151
+ # TODO: change overwrite_build_params default to True in 1.10.0
4145
4152
  warnings.warn(
4146
- "The `overwrite_build_params` parameter default will change from 'False' to 'True' in 1.9.0.",
4153
+ "The `overwrite_build_params` parameter default will change from 'False' to 'True' in 1.10.0.",
4147
4154
  mlrun.utils.OverwriteBuildParamsWarning,
4148
4155
  )
4149
4156
 
@@ -4306,12 +4313,14 @@ class MlrunProject(ModelObj):
4306
4313
  ``my_Name_1`` or ``surname``.
4307
4314
  :param tag: Return artifacts assigned this tag.
4308
4315
  :param labels: Filter artifacts by label key-value pairs or key existence. This can be provided as:
4309
- - A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
4310
- or `{"label": None}` to check for key existence.
4311
- - A list of strings formatted as `"label=value"` to match specific label key-value pairs,
4312
- or just `"label"` for key existence.
4313
- - A comma-separated string formatted as `"label1=value1,label2"` to match entities with
4314
- the specified key-value pairs or key existence.
4316
+
4317
+ - A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
4318
+ or `{"label": None}` to check for key existence.
4319
+ - A list of strings formatted as `"label=value"` to match specific label key-value pairs,
4320
+ or just `"label"` for key existence.
4321
+ - A comma-separated string formatted as `"label1=value1,label2"` to match entities with
4322
+ the specified key-value pairs or key existence.
4323
+
4315
4324
  :param since: Not in use in :py:class:`HTTPRunDB`.
4316
4325
  :param until: Not in use in :py:class:`HTTPRunDB`.
4317
4326
  :param iter: Return artifacts from a specific iteration (where ``iter=0`` means the root iteration). If
@@ -4322,7 +4331,7 @@ class MlrunProject(ModelObj):
4322
4331
  :param kind: Return artifacts of the requested kind.
4323
4332
  :param category: Return artifacts of the requested category.
4324
4333
  :param tree: Return artifacts of the requested tree.
4325
- :param limit: Deprecated - Maximum number of artifacts to return (will be removed in 1.10.0).
4334
+ :param limit: Deprecated - Maximum number of artifacts to return (will be removed in 1.11.0).
4326
4335
  :param format_: The format in which to return the artifacts. Default is 'full'.
4327
4336
  :param partition_by: Field to group results by. When `partition_by` is specified, the `partition_sort_by`
4328
4337
  parameter must be provided as well.
@@ -4335,9 +4344,9 @@ class MlrunProject(ModelObj):
4335
4344
  db = mlrun.db.get_run_db(secrets=self._secrets)
4336
4345
 
4337
4346
  if limit:
4338
- # TODO: Remove this in 1.10.0
4347
+ # TODO: Remove this in 1.11.0
4339
4348
  warnings.warn(
4340
- "'limit' is deprecated and will be removed in 1.10.0. Use 'page' and 'page_size' instead.",
4349
+ "'limit' is deprecated and will be removed in 1.11.0. Use 'page' and 'page_size' instead.",
4341
4350
  FutureWarning,
4342
4351
  )
4343
4352
 
@@ -4453,12 +4462,14 @@ class MlrunProject(ModelObj):
4453
4462
  ``my_Name_1`` or ``surname``.
4454
4463
  :param tag: Return artifacts assigned this tag.
4455
4464
  :param labels: Filter model artifacts by label key-value pairs or key existence. This can be provided as:
4456
- - A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
4457
- or `{"label": None}` to check for key existence.
4458
- - A list of strings formatted as `"label=value"` to match specific label key-value pairs,
4459
- or just `"label"` for key existence.
4460
- - A comma-separated string formatted as `"label1=value1,label2"` to match entities with
4461
- the specified key-value pairs or key existence.
4465
+
4466
+ - A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
4467
+ or `{"label": None}` to check for key existence.
4468
+ - A list of strings formatted as `"label=value"` to match specific label key-value pairs,
4469
+ or just `"label"` for key existence.
4470
+ - A comma-separated string formatted as `"label1=value1,label2"` to match entities with
4471
+ the specified key-value pairs or key existence.
4472
+
4462
4473
  :param since: Not in use in :py:class:`HTTPRunDB`.
4463
4474
  :param until: Not in use in :py:class:`HTTPRunDB`.
4464
4475
  :param iter: Return artifacts from a specific iteration (where ``iter=0`` means the root iteration). If
@@ -4467,7 +4478,7 @@ class MlrunProject(ModelObj):
4467
4478
  artifacts generated from a hyper-param run. If only a single iteration exists, will return the artifact
4468
4479
  from that iteration. If using ``best_iter``, the ``iter`` parameter must not be used.
4469
4480
  :param tree: Return artifacts of the requested tree.
4470
- :param limit: Maximum number of artifacts to return.
4481
+ :param limit: Deprecated - Maximum number of artifacts to return (will be removed in 1.11.0).
4471
4482
  :param format_: The format in which to return the artifacts. Default is 'full'.
4472
4483
  """
4473
4484
  db = mlrun.db.get_run_db(secrets=self._secrets)
@@ -4564,12 +4575,14 @@ class MlrunProject(ModelObj):
4564
4575
  :param name: Return only functions with a specific name.
4565
4576
  :param tag: Return function versions with specific tags. To return only tagged functions, set tag to ``"*"``.
4566
4577
  :param labels: Filter functions by label key-value pairs or key existence. This can be provided as:
4567
- - A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
4568
- or `{"label": None}` to check for key existence.
4569
- - A list of strings formatted as `"label=value"` to match specific label key-value pairs,
4570
- or just `"label"` for key existence.
4571
- - A comma-separated string formatted as `"label1=value1,label2"` to match entities with
4572
- the specified key-value pairs or key existence.
4578
+
4579
+ - A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
4580
+ or `{"label": None}` to check for key existence.
4581
+ - A list of strings formatted as `"label=value"` to match specific label key-value pairs,
4582
+ or just `"label"` for key existence.
4583
+ - A comma-separated string formatted as `"label1=value1,label2"` to match entities with
4584
+ the specified key-value pairs or key existence.
4585
+
4573
4586
  :param kind: Return functions of the specified kind. If not provided, all function kinds will be returned.
4574
4587
  :param format_: The format in which to return the functions. Default is 'full'.
4575
4588
  :returns: List of function objects.
@@ -4663,12 +4676,14 @@ class MlrunProject(ModelObj):
4663
4676
  :param name: Return only functions with a specific name.
4664
4677
  :param tag: Return function versions with specific tags.
4665
4678
  :param labels: Filter functions by label key-value pairs or key existence. This can be provided as:
4666
- - A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
4667
- or `{"label": None}` to check for key existence.
4668
- - A list of strings formatted as `"label=value"` to match specific label key-value pairs,
4669
- or just `"label"` for key existence.
4670
- - A comma-separated string formatted as `"label1=value1,label2"` to match entities with
4671
- the specified key-value pairs or key existence.
4679
+
4680
+ - A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
4681
+ or `{"label": None}` to check for key existence.
4682
+ - A list of strings formatted as `"label=value"` to match specific label key-value pairs,
4683
+ or just `"label"` for key existence.
4684
+ - A comma-separated string formatted as `"label1=value1,label2"` to match entities with
4685
+ the specified key-value pairs or key existence.
4686
+
4672
4687
  :returns: List of function objects.
4673
4688
  """
4674
4689
 
@@ -4724,17 +4739,19 @@ class MlrunProject(ModelObj):
4724
4739
  :param name: Name of the run to retrieve.
4725
4740
  :param uid: Unique ID of the run.
4726
4741
  :param labels: Filter runs by label key-value pairs or key existence. This can be provided as:
4727
- - A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
4728
- or `{"label": None}` to check for key existence.
4729
- - A list of strings formatted as `"label=value"` to match specific label key-value pairs,
4730
- or just `"label"` for key existence.
4731
- - A comma-separated string formatted as `"label1=value1,label2"` to match entities with
4732
- the specified key-value pairs or key existence.
4742
+
4743
+ - A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
4744
+ or `{"label": None}` to check for key existence.
4745
+ - A list of strings formatted as `"label=value"` to match specific label key-value pairs,
4746
+ or just `"label"` for key existence.
4747
+ - A comma-separated string formatted as `"label1=value1,label2"` to match entities with
4748
+ the specified key-value pairs or key existence.
4749
+
4733
4750
  :param state: Deprecated - List only runs whose state is specified.
4734
4751
  :param states: List only runs whose state is one of the provided states.
4735
4752
  :param sort: Whether to sort the result according to their start time. Otherwise, results will be
4736
4753
  returned by their internal order in the DB (order will not be guaranteed).
4737
- :param last: Deprecated - currently not used (will be removed in 1.9.0).
4754
+ :param last: Deprecated - currently not used (will be removed in 1.10.0).
4738
4755
  :param iter: If ``True`` return runs from all iterations. Otherwise, return only runs whose ``iter`` is 0.
4739
4756
  :param start_time_from: Filter by run start time in ``[start_time_from, start_time_to]``.
4740
4757
  :param start_time_to: Filter by run start time in ``[start_time_from, start_time_to]``.
@@ -4745,9 +4762,9 @@ class MlrunProject(ModelObj):
4745
4762
  :param end_time_to: Filter by run end time in ``[end_time_from, end_time_to]``.
4746
4763
  """
4747
4764
  if state:
4748
- # TODO: Remove this in 1.9.0
4765
+ # TODO: Remove this in 1.10.0
4749
4766
  warnings.warn(
4750
- "'state' is deprecated and will be removed in 1.9.0. Use 'states' instead.",
4767
+ "'state' is deprecated in 1.7.0 and will be removed in 1.10.0. Use 'states' instead.",
4751
4768
  FutureWarning,
4752
4769
  )
4753
4770