mlrun 1.10.0rc2__py3-none-any.whl → 1.10.0rc3__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 (50) hide show
  1. mlrun/__init__.py +2 -2
  2. mlrun/__main__.py +2 -2
  3. mlrun/artifacts/base.py +6 -6
  4. mlrun/artifacts/dataset.py +1 -1
  5. mlrun/artifacts/document.py +1 -1
  6. mlrun/artifacts/model.py +1 -1
  7. mlrun/artifacts/plots.py +2 -2
  8. mlrun/common/runtimes/constants.py +1 -8
  9. mlrun/common/schemas/artifact.py +1 -1
  10. mlrun/common/schemas/pipeline.py +1 -1
  11. mlrun/common/schemas/project.py +1 -1
  12. mlrun/common/schemas/runs.py +1 -1
  13. mlrun/config.py +4 -4
  14. mlrun/datastore/datastore_profile.py +2 -2
  15. mlrun/datastore/sources.py +3 -3
  16. mlrun/datastore/store_resources.py +3 -3
  17. mlrun/datastore/targets.py +5 -5
  18. mlrun/datastore/utils.py +2 -2
  19. mlrun/db/base.py +6 -6
  20. mlrun/db/httpdb.py +66 -66
  21. mlrun/errors.py +22 -1
  22. mlrun/feature_store/common.py +5 -5
  23. mlrun/feature_store/feature_set.py +10 -6
  24. mlrun/feature_store/feature_vector.py +8 -6
  25. mlrun/launcher/base.py +1 -1
  26. mlrun/lists.py +1 -1
  27. mlrun/model_monitoring/__init__.py +0 -1
  28. mlrun/model_monitoring/api.py +0 -44
  29. mlrun/model_monitoring/applications/evidently/base.py +3 -41
  30. mlrun/model_monitoring/controller.py +1 -1
  31. mlrun/model_monitoring/writer.py +1 -4
  32. mlrun/projects/operations.py +3 -3
  33. mlrun/projects/project.py +19 -19
  34. mlrun/run.py +10 -10
  35. mlrun/runtimes/base.py +6 -6
  36. mlrun/runtimes/kubejob.py +2 -2
  37. mlrun/runtimes/nuclio/function.py +3 -3
  38. mlrun/runtimes/nuclio/serving.py +13 -23
  39. mlrun/serving/__init__.py +5 -1
  40. mlrun/serving/server.py +39 -3
  41. mlrun/serving/states.py +34 -1
  42. mlrun/utils/helpers.py +10 -4
  43. mlrun/utils/version/version.json +2 -2
  44. {mlrun-1.10.0rc2.dist-info → mlrun-1.10.0rc3.dist-info}/METADATA +21 -9
  45. {mlrun-1.10.0rc2.dist-info → mlrun-1.10.0rc3.dist-info}/RECORD +49 -50
  46. {mlrun-1.10.0rc2.dist-info → mlrun-1.10.0rc3.dist-info}/WHEEL +1 -1
  47. mlrun/model_monitoring/tracking_policy.py +0 -124
  48. {mlrun-1.10.0rc2.dist-info → mlrun-1.10.0rc3.dist-info}/entry_points.txt +0 -0
  49. {mlrun-1.10.0rc2.dist-info → mlrun-1.10.0rc3.dist-info}/licenses/LICENSE +0 -0
  50. {mlrun-1.10.0rc2.dist-info → mlrun-1.10.0rc3.dist-info}/top_level.txt +0 -0
@@ -1,124 +0,0 @@
1
- # Copyright 2023 Iguazio
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- import warnings
16
- from typing import Optional, Union
17
-
18
- import mlrun.common.schemas.schedule
19
- import mlrun.model
20
-
21
-
22
- class TrackingPolicy(mlrun.model.ModelObj):
23
- """
24
- Modified model monitoring configurations. By using TrackingPolicy, the user can apply his model monitoring
25
- requirements, such as setting the scheduling policy of the model monitoring batch job or changing the image of the
26
- model monitoring stream.
27
- """
28
-
29
- _dict_fields = ["default_batch_image", "stream_image", "application_batch"]
30
-
31
- def __init__(
32
- self,
33
- default_batch_intervals: Union[
34
- mlrun.common.schemas.schedule.ScheduleCronTrigger, str
35
- ] = mlrun.common.schemas.schedule.ScheduleCronTrigger(minute="0", hour="*/1"),
36
- default_batch_image: str = "mlrun/mlrun",
37
- stream_image: str = "mlrun/mlrun",
38
- base_period: int = 10,
39
- default_controller_image: str = "mlrun/mlrun",
40
- ):
41
- """
42
- Initialize TrackingPolicy object.
43
- :param default_batch_intervals: Model monitoring batch scheduling policy. By default, executed on the hour
44
- every hour. Can be either a string or a ScheduleCronTrigger object. The
45
- string time format is based on ScheduleCronTrigger expression:
46
- minute, hour, day of month, month, day of week. It will be converted into
47
- a ScheduleCronTrigger object.
48
- :param default_batch_image: The default image of the model monitoring batch job. By default, the image
49
- is mlrun/mlrun.
50
- :param stream_image: The image of the model monitoring stream real-time function. By default,
51
- the image is mlrun/mlrun.
52
- :param base_period: Minutes to determine the frequency in which the model monitoring controller
53
- job is running. By default, the base period is 10 minutes.
54
- :param default_controller_image: The default image of the model monitoring controller job. Note that the
55
- writer function, which is a real time nuclio functino, will be deployed
56
- with the same image. By default, the image is mlrun/mlrun.
57
- """
58
- warnings.warn(
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.",
61
- FutureWarning,
62
- )
63
-
64
- if isinstance(default_batch_intervals, str):
65
- default_batch_intervals = (
66
- mlrun.common.schemas.schedule.ScheduleCronTrigger.from_crontab(
67
- default_batch_intervals
68
- )
69
- )
70
- self.default_batch_intervals = default_batch_intervals
71
- self.default_batch_image = default_batch_image
72
- self.stream_image = stream_image
73
- self.base_period = base_period
74
- self.default_controller_image = default_controller_image
75
-
76
- @classmethod
77
- def from_dict(
78
- cls, struct=None, fields=None, deprecated_fields: Optional[dict] = None
79
- ):
80
- new_obj = super().from_dict(
81
- struct, fields=cls._dict_fields, deprecated_fields=deprecated_fields
82
- )
83
- # Convert default batch interval into ScheduleCronTrigger object
84
- if (
85
- mlrun.common.schemas.model_monitoring.EventFieldType.DEFAULT_BATCH_INTERVALS
86
- in struct
87
- ):
88
- if isinstance(
89
- struct[
90
- mlrun.common.schemas.model_monitoring.EventFieldType.DEFAULT_BATCH_INTERVALS
91
- ],
92
- str,
93
- ):
94
- new_obj.default_batch_intervals = mlrun.common.schemas.schedule.ScheduleCronTrigger.from_crontab(
95
- struct[
96
- mlrun.common.schemas.model_monitoring.EventFieldType.DEFAULT_BATCH_INTERVALS
97
- ]
98
- )
99
- else:
100
- new_obj.default_batch_intervals = mlrun.common.schemas.schedule.ScheduleCronTrigger.parse_obj(
101
- struct[
102
- mlrun.common.schemas.model_monitoring.EventFieldType.DEFAULT_BATCH_INTERVALS
103
- ]
104
- )
105
- return new_obj
106
-
107
- def to_dict(
108
- self,
109
- fields: Optional[list] = None,
110
- exclude: Optional[list] = None,
111
- strip: bool = False,
112
- ):
113
- struct = super().to_dict(
114
- fields,
115
- exclude=[
116
- mlrun.common.schemas.model_monitoring.EventFieldType.DEFAULT_BATCH_INTERVALS
117
- ],
118
- strip=strip,
119
- )
120
- if self.default_batch_intervals:
121
- struct[
122
- mlrun.common.schemas.model_monitoring.EventFieldType.DEFAULT_BATCH_INTERVALS
123
- ] = self.default_batch_intervals.dict()
124
- return struct