mlrun 1.7.1rc10__py3-none-any.whl → 1.8.0rc11__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/__init__.py +23 -21
- mlrun/__main__.py +3 -3
- mlrun/alerts/alert.py +148 -14
- mlrun/artifacts/__init__.py +2 -3
- mlrun/artifacts/base.py +55 -12
- mlrun/artifacts/dataset.py +16 -16
- mlrun/artifacts/document.py +378 -0
- mlrun/artifacts/manager.py +26 -17
- mlrun/artifacts/model.py +66 -53
- mlrun/common/constants.py +8 -0
- mlrun/common/formatters/__init__.py +1 -0
- mlrun/common/formatters/feature_set.py +1 -0
- mlrun/common/formatters/function.py +1 -0
- mlrun/{model_monitoring/db/stores/base/__init__.py → common/formatters/model_endpoint.py} +16 -1
- mlrun/common/formatters/pipeline.py +1 -2
- mlrun/common/formatters/project.py +9 -0
- mlrun/common/model_monitoring/__init__.py +0 -5
- mlrun/common/model_monitoring/helpers.py +1 -29
- mlrun/common/runtimes/constants.py +1 -2
- mlrun/common/schemas/__init__.py +6 -2
- mlrun/common/schemas/alert.py +111 -19
- mlrun/common/schemas/api_gateway.py +3 -3
- mlrun/common/schemas/artifact.py +11 -7
- mlrun/common/schemas/auth.py +6 -4
- mlrun/common/schemas/background_task.py +7 -7
- mlrun/common/schemas/client_spec.py +2 -3
- mlrun/common/schemas/clusterization_spec.py +2 -2
- mlrun/common/schemas/common.py +53 -3
- mlrun/common/schemas/constants.py +15 -0
- mlrun/common/schemas/datastore_profile.py +1 -1
- mlrun/common/schemas/feature_store.py +9 -9
- mlrun/common/schemas/frontend_spec.py +4 -4
- mlrun/common/schemas/function.py +10 -10
- mlrun/common/schemas/hub.py +1 -1
- mlrun/common/schemas/k8s.py +3 -3
- mlrun/common/schemas/memory_reports.py +3 -3
- mlrun/common/schemas/model_monitoring/__init__.py +2 -1
- mlrun/common/schemas/model_monitoring/constants.py +67 -14
- mlrun/common/schemas/model_monitoring/grafana.py +1 -1
- mlrun/common/schemas/model_monitoring/model_endpoints.py +92 -147
- mlrun/common/schemas/notification.py +24 -3
- mlrun/common/schemas/object.py +1 -1
- mlrun/common/schemas/pagination.py +4 -4
- mlrun/common/schemas/partition.py +137 -0
- mlrun/common/schemas/pipeline.py +2 -2
- mlrun/common/schemas/project.py +25 -17
- mlrun/common/schemas/runs.py +2 -2
- mlrun/common/schemas/runtime_resource.py +5 -5
- mlrun/common/schemas/schedule.py +1 -1
- mlrun/common/schemas/secret.py +1 -1
- mlrun/common/schemas/tag.py +3 -3
- mlrun/common/schemas/workflow.py +5 -5
- mlrun/config.py +68 -10
- mlrun/data_types/__init__.py +0 -2
- mlrun/data_types/data_types.py +1 -0
- mlrun/data_types/infer.py +3 -1
- mlrun/data_types/spark.py +5 -3
- mlrun/data_types/to_pandas.py +11 -2
- mlrun/datastore/__init__.py +2 -2
- mlrun/datastore/alibaba_oss.py +4 -1
- mlrun/datastore/azure_blob.py +4 -1
- mlrun/datastore/base.py +12 -4
- mlrun/datastore/datastore.py +9 -3
- mlrun/datastore/datastore_profile.py +79 -20
- mlrun/datastore/dbfs_store.py +4 -1
- mlrun/datastore/filestore.py +4 -1
- mlrun/datastore/google_cloud_storage.py +4 -1
- mlrun/datastore/hdfs.py +4 -1
- mlrun/datastore/inmem.py +4 -1
- mlrun/datastore/redis.py +4 -1
- mlrun/datastore/s3.py +4 -1
- mlrun/datastore/sources.py +52 -51
- mlrun/datastore/store_resources.py +7 -4
- mlrun/datastore/targets.py +23 -22
- mlrun/datastore/utils.py +2 -2
- mlrun/datastore/v3io.py +4 -1
- mlrun/datastore/vectorstore.py +229 -0
- mlrun/datastore/wasbfs/fs.py +13 -12
- mlrun/db/base.py +213 -83
- mlrun/db/factory.py +0 -3
- mlrun/db/httpdb.py +1265 -387
- mlrun/db/nopdb.py +205 -74
- mlrun/errors.py +2 -2
- mlrun/execution.py +136 -50
- mlrun/feature_store/__init__.py +0 -2
- mlrun/feature_store/api.py +41 -40
- mlrun/feature_store/common.py +9 -9
- mlrun/feature_store/feature_set.py +20 -18
- mlrun/feature_store/feature_vector.py +27 -24
- mlrun/feature_store/retrieval/base.py +14 -9
- mlrun/feature_store/retrieval/job.py +2 -1
- mlrun/feature_store/steps.py +2 -2
- mlrun/features.py +30 -13
- mlrun/frameworks/__init__.py +1 -2
- mlrun/frameworks/_common/__init__.py +1 -2
- mlrun/frameworks/_common/artifacts_library.py +2 -2
- mlrun/frameworks/_common/mlrun_interface.py +10 -6
- mlrun/frameworks/_common/model_handler.py +29 -27
- mlrun/frameworks/_common/producer.py +3 -1
- mlrun/frameworks/_dl_common/__init__.py +1 -2
- mlrun/frameworks/_dl_common/loggers/__init__.py +1 -2
- mlrun/frameworks/_dl_common/loggers/mlrun_logger.py +4 -4
- mlrun/frameworks/_dl_common/loggers/tensorboard_logger.py +3 -3
- mlrun/frameworks/_ml_common/__init__.py +1 -2
- mlrun/frameworks/_ml_common/loggers/__init__.py +1 -2
- mlrun/frameworks/_ml_common/model_handler.py +21 -21
- mlrun/frameworks/_ml_common/plans/__init__.py +1 -2
- mlrun/frameworks/_ml_common/plans/confusion_matrix_plan.py +3 -1
- mlrun/frameworks/_ml_common/plans/dataset_plan.py +3 -3
- mlrun/frameworks/_ml_common/plans/roc_curve_plan.py +4 -4
- mlrun/frameworks/auto_mlrun/__init__.py +1 -2
- mlrun/frameworks/auto_mlrun/auto_mlrun.py +22 -15
- mlrun/frameworks/huggingface/__init__.py +1 -2
- mlrun/frameworks/huggingface/model_server.py +9 -9
- mlrun/frameworks/lgbm/__init__.py +47 -44
- mlrun/frameworks/lgbm/callbacks/__init__.py +1 -2
- mlrun/frameworks/lgbm/callbacks/logging_callback.py +4 -2
- mlrun/frameworks/lgbm/callbacks/mlrun_logging_callback.py +4 -2
- mlrun/frameworks/lgbm/mlrun_interfaces/__init__.py +1 -2
- mlrun/frameworks/lgbm/mlrun_interfaces/mlrun_interface.py +5 -5
- mlrun/frameworks/lgbm/model_handler.py +15 -11
- mlrun/frameworks/lgbm/model_server.py +11 -7
- mlrun/frameworks/lgbm/utils.py +2 -2
- mlrun/frameworks/onnx/__init__.py +1 -2
- mlrun/frameworks/onnx/dataset.py +3 -3
- mlrun/frameworks/onnx/mlrun_interface.py +2 -2
- mlrun/frameworks/onnx/model_handler.py +7 -5
- mlrun/frameworks/onnx/model_server.py +8 -6
- mlrun/frameworks/parallel_coordinates.py +11 -11
- mlrun/frameworks/pytorch/__init__.py +22 -23
- mlrun/frameworks/pytorch/callbacks/__init__.py +1 -2
- mlrun/frameworks/pytorch/callbacks/callback.py +2 -1
- mlrun/frameworks/pytorch/callbacks/logging_callback.py +15 -8
- mlrun/frameworks/pytorch/callbacks/mlrun_logging_callback.py +19 -12
- mlrun/frameworks/pytorch/callbacks/tensorboard_logging_callback.py +22 -15
- mlrun/frameworks/pytorch/callbacks_handler.py +36 -30
- mlrun/frameworks/pytorch/mlrun_interface.py +17 -17
- mlrun/frameworks/pytorch/model_handler.py +21 -17
- mlrun/frameworks/pytorch/model_server.py +13 -9
- mlrun/frameworks/sklearn/__init__.py +19 -18
- mlrun/frameworks/sklearn/estimator.py +2 -2
- mlrun/frameworks/sklearn/metric.py +3 -3
- mlrun/frameworks/sklearn/metrics_library.py +8 -6
- mlrun/frameworks/sklearn/mlrun_interface.py +3 -2
- mlrun/frameworks/sklearn/model_handler.py +4 -3
- mlrun/frameworks/tf_keras/__init__.py +11 -12
- mlrun/frameworks/tf_keras/callbacks/__init__.py +1 -2
- mlrun/frameworks/tf_keras/callbacks/logging_callback.py +17 -14
- mlrun/frameworks/tf_keras/callbacks/mlrun_logging_callback.py +15 -12
- mlrun/frameworks/tf_keras/callbacks/tensorboard_logging_callback.py +21 -18
- mlrun/frameworks/tf_keras/model_handler.py +17 -13
- mlrun/frameworks/tf_keras/model_server.py +12 -8
- mlrun/frameworks/xgboost/__init__.py +19 -18
- mlrun/frameworks/xgboost/model_handler.py +13 -9
- mlrun/launcher/base.py +3 -4
- mlrun/launcher/local.py +1 -1
- mlrun/launcher/remote.py +1 -1
- mlrun/lists.py +4 -3
- mlrun/model.py +117 -46
- mlrun/model_monitoring/__init__.py +4 -4
- mlrun/model_monitoring/api.py +72 -59
- mlrun/model_monitoring/applications/_application_steps.py +17 -17
- mlrun/model_monitoring/applications/base.py +165 -6
- mlrun/model_monitoring/applications/context.py +88 -37
- mlrun/model_monitoring/applications/evidently_base.py +0 -1
- mlrun/model_monitoring/applications/histogram_data_drift.py +43 -21
- mlrun/model_monitoring/applications/results.py +55 -3
- mlrun/model_monitoring/controller.py +207 -239
- mlrun/model_monitoring/db/__init__.py +0 -2
- mlrun/model_monitoring/db/_schedules.py +156 -0
- mlrun/model_monitoring/db/_stats.py +189 -0
- mlrun/model_monitoring/db/tsdb/base.py +78 -25
- mlrun/model_monitoring/db/tsdb/tdengine/schemas.py +61 -6
- mlrun/model_monitoring/db/tsdb/tdengine/stream_graph_steps.py +33 -0
- mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py +255 -29
- mlrun/model_monitoring/db/tsdb/v3io/stream_graph_steps.py +1 -0
- mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +78 -17
- mlrun/model_monitoring/helpers.py +151 -49
- mlrun/model_monitoring/stream_processing.py +99 -283
- mlrun/model_monitoring/tracking_policy.py +10 -3
- mlrun/model_monitoring/writer.py +48 -36
- mlrun/package/__init__.py +3 -6
- mlrun/package/context_handler.py +1 -1
- mlrun/package/packager.py +12 -9
- mlrun/package/packagers/__init__.py +0 -2
- mlrun/package/packagers/default_packager.py +14 -11
- mlrun/package/packagers/numpy_packagers.py +16 -7
- mlrun/package/packagers/pandas_packagers.py +18 -18
- mlrun/package/packagers/python_standard_library_packagers.py +25 -11
- mlrun/package/packagers_manager.py +31 -14
- mlrun/package/utils/__init__.py +0 -3
- mlrun/package/utils/_pickler.py +6 -6
- mlrun/platforms/__init__.py +47 -16
- mlrun/platforms/iguazio.py +4 -1
- mlrun/projects/operations.py +27 -27
- mlrun/projects/pipelines.py +71 -36
- mlrun/projects/project.py +890 -220
- mlrun/run.py +53 -10
- mlrun/runtimes/__init__.py +1 -3
- mlrun/runtimes/base.py +15 -11
- mlrun/runtimes/daskjob.py +9 -9
- mlrun/runtimes/generators.py +2 -1
- mlrun/runtimes/kubejob.py +4 -5
- mlrun/runtimes/mounts.py +572 -0
- mlrun/runtimes/mpijob/__init__.py +0 -2
- mlrun/runtimes/mpijob/abstract.py +7 -6
- mlrun/runtimes/nuclio/api_gateway.py +7 -7
- mlrun/runtimes/nuclio/application/application.py +11 -11
- mlrun/runtimes/nuclio/function.py +19 -17
- mlrun/runtimes/nuclio/serving.py +18 -13
- mlrun/runtimes/pod.py +154 -45
- mlrun/runtimes/remotesparkjob.py +3 -2
- mlrun/runtimes/sparkjob/__init__.py +0 -2
- mlrun/runtimes/sparkjob/spark3job.py +21 -11
- mlrun/runtimes/utils.py +6 -5
- mlrun/serving/merger.py +6 -4
- mlrun/serving/remote.py +18 -17
- mlrun/serving/routers.py +185 -172
- mlrun/serving/server.py +7 -1
- mlrun/serving/states.py +97 -78
- mlrun/serving/utils.py +13 -2
- mlrun/serving/v1_serving.py +3 -2
- mlrun/serving/v2_serving.py +105 -72
- mlrun/track/__init__.py +1 -1
- mlrun/track/tracker.py +2 -2
- mlrun/track/trackers/mlflow_tracker.py +6 -5
- mlrun/utils/async_http.py +1 -1
- mlrun/utils/clones.py +1 -1
- mlrun/utils/helpers.py +63 -19
- mlrun/utils/logger.py +106 -4
- mlrun/utils/notifications/notification/__init__.py +22 -19
- mlrun/utils/notifications/notification/base.py +33 -14
- mlrun/utils/notifications/notification/console.py +6 -6
- mlrun/utils/notifications/notification/git.py +11 -11
- mlrun/utils/notifications/notification/ipython.py +10 -9
- mlrun/utils/notifications/notification/mail.py +176 -0
- mlrun/utils/notifications/notification/slack.py +6 -6
- mlrun/utils/notifications/notification/webhook.py +6 -6
- mlrun/utils/notifications/notification_pusher.py +86 -44
- mlrun/utils/regex.py +11 -2
- mlrun/utils/version/version.json +2 -2
- {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/METADATA +29 -24
- mlrun-1.8.0rc11.dist-info/RECORD +347 -0
- mlrun/model_monitoring/db/stores/__init__.py +0 -136
- mlrun/model_monitoring/db/stores/base/store.py +0 -213
- mlrun/model_monitoring/db/stores/sqldb/__init__.py +0 -13
- mlrun/model_monitoring/db/stores/sqldb/models/__init__.py +0 -71
- mlrun/model_monitoring/db/stores/sqldb/models/base.py +0 -190
- mlrun/model_monitoring/db/stores/sqldb/models/mysql.py +0 -103
- mlrun/model_monitoring/db/stores/sqldb/models/sqlite.py +0 -40
- mlrun/model_monitoring/db/stores/sqldb/sql_store.py +0 -659
- mlrun/model_monitoring/db/stores/v3io_kv/__init__.py +0 -13
- mlrun/model_monitoring/db/stores/v3io_kv/kv_store.py +0 -726
- mlrun/model_monitoring/model_endpoint.py +0 -118
- mlrun-1.7.1rc10.dist-info/RECORD +0 -351
- {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/LICENSE +0 -0
- {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/WHEEL +0 -0
- {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/entry_points.txt +0 -0
- {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/top_level.txt +0 -0
mlrun/common/schemas/common.py
CHANGED
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
|
|
15
15
|
import typing
|
|
16
16
|
|
|
17
|
-
import pydantic
|
|
17
|
+
import pydantic.v1
|
|
18
18
|
|
|
19
|
+
import mlrun.errors
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
class ImageBuilder(pydantic.v1.BaseModel):
|
|
21
23
|
functionSourceCode: typing.Optional[str] = None # noqa: N815
|
|
22
24
|
codeEntryType: typing.Optional[str] = None # noqa: N815
|
|
23
25
|
codeEntryAttributes: typing.Optional[str] = None # noqa: N815
|
|
@@ -40,4 +42,52 @@ class ImageBuilder(pydantic.BaseModel):
|
|
|
40
42
|
source_code_target_dir: typing.Optional[str] = None
|
|
41
43
|
|
|
42
44
|
class Config:
|
|
43
|
-
extra = pydantic.Extra.allow
|
|
45
|
+
extra = pydantic.v1.Extra.allow
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class LabelsModel(pydantic.v1.BaseModel):
|
|
49
|
+
"""
|
|
50
|
+
This class accepts either a dictionary, a list, or a string for filtering by labels.
|
|
51
|
+
|
|
52
|
+
:param labels:
|
|
53
|
+
- If a dictionary is provided, it should be in the format {'label_name': 'value'}.
|
|
54
|
+
The values can also be `None`, which will result in the format 'label_name' (without a value).
|
|
55
|
+
This will be converted to a list of strings in the format 'label_name=value'.
|
|
56
|
+
- If a list is provided, all items must be strings. Each string can either
|
|
57
|
+
be a simple label name (e.g., 'label1') or a key-value pair in the format
|
|
58
|
+
'label=value'.
|
|
59
|
+
- If a string is provided, it should be a comma-separated list of labels
|
|
60
|
+
(e.g., 'label1,label2').
|
|
61
|
+
- If no labels are specified, the default is an empty list.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
labels: typing.Optional[
|
|
65
|
+
typing.Union[str, dict[str, typing.Optional[str]], list[str]]
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
@pydantic.v1.validator("labels")
|
|
69
|
+
@classmethod
|
|
70
|
+
def validate(cls, labels) -> list[str]:
|
|
71
|
+
if labels is None:
|
|
72
|
+
return []
|
|
73
|
+
|
|
74
|
+
# If labels is a string, split it by commas
|
|
75
|
+
if isinstance(labels, str):
|
|
76
|
+
return [label.strip() for label in labels.split(",") if label.strip()]
|
|
77
|
+
|
|
78
|
+
if isinstance(labels, list):
|
|
79
|
+
if not all(isinstance(item, str) for item in labels):
|
|
80
|
+
raise mlrun.errors.MLRunValueError(
|
|
81
|
+
"All items in the list must be strings."
|
|
82
|
+
)
|
|
83
|
+
return labels
|
|
84
|
+
|
|
85
|
+
if isinstance(labels, dict):
|
|
86
|
+
return [
|
|
87
|
+
f"{key}={value}" if value is not None else key
|
|
88
|
+
for key, value in labels.items()
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
raise mlrun.errors.MLRunValueError(
|
|
92
|
+
"Invalid labels format. Must be a string, dictionary of strings, or a list of strings."
|
|
93
|
+
)
|
|
@@ -133,6 +133,21 @@ class RunPartitionByField(mlrun.common.types.StrEnum):
|
|
|
133
133
|
)
|
|
134
134
|
|
|
135
135
|
|
|
136
|
+
class ArtifactPartitionByField(mlrun.common.types.StrEnum):
|
|
137
|
+
name = "name" # Supported for artifacts objects
|
|
138
|
+
project_and_name = "project_and_name" # Supported for artifacts objects
|
|
139
|
+
|
|
140
|
+
def to_partition_by_db_field(self, db_cls):
|
|
141
|
+
if self.value == ArtifactPartitionByField.name:
|
|
142
|
+
return db_cls.key
|
|
143
|
+
elif self.value == ArtifactPartitionByField.project_and_name:
|
|
144
|
+
return db_cls.project, db_cls.key
|
|
145
|
+
else:
|
|
146
|
+
raise mlrun.errors.MLRunInvalidArgumentError(
|
|
147
|
+
f"Unknown group by field: {self.value}"
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
|
|
136
151
|
class SortField(mlrun.common.types.StrEnum):
|
|
137
152
|
created = "created"
|
|
138
153
|
updated = "updated"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
from typing import Optional
|
|
16
16
|
|
|
17
|
-
import pydantic
|
|
17
|
+
import pydantic.v1
|
|
18
18
|
|
|
19
19
|
from .auth import AuthorizationResourceTypes, Credentials
|
|
20
20
|
from .object import (
|
|
@@ -27,7 +27,7 @@ from .object import (
|
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
class FeatureStoreBaseModel(pydantic.BaseModel):
|
|
30
|
+
class FeatureStoreBaseModel(pydantic.v1.BaseModel):
|
|
31
31
|
"""
|
|
32
32
|
Intermediate base class, in order to override pydantic's configuration, as per
|
|
33
33
|
https://docs.pydantic.dev/1.10/usage/model_config/#change-behaviour-globally
|
|
@@ -43,7 +43,7 @@ class Feature(FeatureStoreBaseModel):
|
|
|
43
43
|
labels: Optional[dict] = {}
|
|
44
44
|
|
|
45
45
|
class Config:
|
|
46
|
-
extra = pydantic.Extra.allow
|
|
46
|
+
extra = pydantic.v1.Extra.allow
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
class Entity(FeatureStoreBaseModel):
|
|
@@ -52,17 +52,17 @@ class Entity(FeatureStoreBaseModel):
|
|
|
52
52
|
labels: Optional[dict] = {}
|
|
53
53
|
|
|
54
54
|
class Config:
|
|
55
|
-
extra = pydantic.Extra.allow
|
|
55
|
+
extra = pydantic.v1.Extra.allow
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
class FeatureSetSpec(ObjectSpec):
|
|
59
59
|
entities: list[Entity] = []
|
|
60
60
|
features: list[Feature] = []
|
|
61
|
-
engine: Optional[str] = pydantic.Field(default="storey")
|
|
61
|
+
engine: Optional[str] = pydantic.v1.Field(default="storey")
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
class FeatureSet(FeatureStoreBaseModel):
|
|
65
|
-
kind: ObjectKind = pydantic.Field(ObjectKind.feature_set, const=True)
|
|
65
|
+
kind: ObjectKind = pydantic.v1.Field(ObjectKind.feature_set, const=True)
|
|
66
66
|
metadata: ObjectMetadata
|
|
67
67
|
spec: FeatureSetSpec
|
|
68
68
|
status: ObjectStatus
|
|
@@ -155,7 +155,7 @@ class EntitiesOutput(FeatureStoreBaseModel):
|
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
class FeatureVector(FeatureStoreBaseModel):
|
|
158
|
-
kind: ObjectKind = pydantic.Field(ObjectKind.feature_vector, const=True)
|
|
158
|
+
kind: ObjectKind = pydantic.v1.Field(ObjectKind.feature_vector, const=True)
|
|
159
159
|
metadata: ObjectMetadata
|
|
160
160
|
spec: ObjectSpec
|
|
161
161
|
status: ObjectStatus
|
|
@@ -183,7 +183,7 @@ class DataSource(FeatureStoreBaseModel):
|
|
|
183
183
|
path: str
|
|
184
184
|
|
|
185
185
|
class Config:
|
|
186
|
-
extra = pydantic.Extra.allow
|
|
186
|
+
extra = pydantic.v1.Extra.allow
|
|
187
187
|
|
|
188
188
|
|
|
189
189
|
class DataTarget(FeatureStoreBaseModel):
|
|
@@ -192,7 +192,7 @@ class DataTarget(FeatureStoreBaseModel):
|
|
|
192
192
|
path: Optional[str]
|
|
193
193
|
|
|
194
194
|
class Config:
|
|
195
|
-
extra = pydantic.Extra.allow
|
|
195
|
+
extra = pydantic.v1.Extra.allow
|
|
196
196
|
|
|
197
197
|
|
|
198
198
|
class FeatureSetIngestInput(FeatureStoreBaseModel):
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
import typing
|
|
16
16
|
|
|
17
|
-
import pydantic
|
|
17
|
+
import pydantic.v1
|
|
18
18
|
|
|
19
19
|
import mlrun.common.types
|
|
20
20
|
|
|
@@ -43,20 +43,20 @@ class NuclioStreamsFeatureFlag(mlrun.common.types.StrEnum):
|
|
|
43
43
|
disabled = "disabled"
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
class FeatureFlags(pydantic.BaseModel):
|
|
46
|
+
class FeatureFlags(pydantic.v1.BaseModel):
|
|
47
47
|
project_membership: ProjectMembershipFeatureFlag
|
|
48
48
|
authentication: AuthenticationFeatureFlag
|
|
49
49
|
nuclio_streams: NuclioStreamsFeatureFlag
|
|
50
50
|
preemption_nodes: PreemptionNodesFeatureFlag
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
class ArtifactLimits(pydantic.BaseModel):
|
|
53
|
+
class ArtifactLimits(pydantic.v1.BaseModel):
|
|
54
54
|
max_chunk_size: int
|
|
55
55
|
max_preview_size: int
|
|
56
56
|
max_download_size: int
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
class FrontendSpec(pydantic.BaseModel):
|
|
59
|
+
class FrontendSpec(pydantic.v1.BaseModel):
|
|
60
60
|
jobs_dashboard_url: typing.Optional[str]
|
|
61
61
|
model_monitoring_dashboard_url: typing.Optional[str]
|
|
62
62
|
abortable_function_kinds: list[str] = []
|
mlrun/common/schemas/function.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
import typing
|
|
16
16
|
|
|
17
|
-
import pydantic
|
|
17
|
+
import pydantic.v1
|
|
18
18
|
|
|
19
19
|
import mlrun.common.types
|
|
20
20
|
|
|
@@ -90,42 +90,42 @@ class SecurityContextEnrichmentModes(mlrun.common.types.StrEnum):
|
|
|
90
90
|
disabled = "disabled"
|
|
91
91
|
|
|
92
92
|
|
|
93
|
-
class ImagePullSecret(pydantic.BaseModel):
|
|
93
|
+
class ImagePullSecret(pydantic.v1.BaseModel):
|
|
94
94
|
default: typing.Optional[str]
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
class Pipelines(pydantic.BaseModel):
|
|
97
|
+
class Pipelines(pydantic.v1.BaseModel):
|
|
98
98
|
kfp_pod_user_unix_id: typing.Optional[int]
|
|
99
99
|
|
|
100
100
|
|
|
101
|
-
class SecurityContext(pydantic.BaseModel):
|
|
101
|
+
class SecurityContext(pydantic.v1.BaseModel):
|
|
102
102
|
default: typing.Optional[str]
|
|
103
103
|
enrichment_mode: typing.Optional[SecurityContextEnrichmentModes]
|
|
104
104
|
enrichment_group_id: typing.Optional[int]
|
|
105
105
|
pipelines: typing.Optional[Pipelines]
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
class ServiceAccount(pydantic.BaseModel):
|
|
108
|
+
class ServiceAccount(pydantic.v1.BaseModel):
|
|
109
109
|
default: typing.Optional[str]
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
class StateThresholds(pydantic.BaseModel):
|
|
112
|
+
class StateThresholds(pydantic.v1.BaseModel):
|
|
113
113
|
default: typing.Optional[dict[str, str]]
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
class FunctionSpec(pydantic.BaseModel):
|
|
116
|
+
class FunctionSpec(pydantic.v1.BaseModel):
|
|
117
117
|
image_pull_secret: typing.Optional[ImagePullSecret]
|
|
118
118
|
security_context: typing.Optional[SecurityContext]
|
|
119
119
|
service_account: typing.Optional[ServiceAccount]
|
|
120
120
|
state_thresholds: typing.Optional[StateThresholds]
|
|
121
121
|
|
|
122
122
|
class Config:
|
|
123
|
-
extra = pydantic.Extra.allow
|
|
123
|
+
extra = pydantic.v1.Extra.allow
|
|
124
124
|
|
|
125
125
|
|
|
126
|
-
class Function(pydantic.BaseModel):
|
|
126
|
+
class Function(pydantic.v1.BaseModel):
|
|
127
127
|
spec: typing.Optional[FunctionSpec]
|
|
128
128
|
application: typing.Optional[dict[str, typing.Any]]
|
|
129
129
|
|
|
130
130
|
class Config:
|
|
131
|
-
extra = pydantic.Extra.allow
|
|
131
|
+
extra = pydantic.v1.Extra.allow
|
mlrun/common/schemas/hub.py
CHANGED
mlrun/common/schemas/k8s.py
CHANGED
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
#
|
|
15
15
|
import typing
|
|
16
16
|
|
|
17
|
-
import pydantic
|
|
17
|
+
import pydantic.v1
|
|
18
18
|
|
|
19
19
|
import mlrun.common.types
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
class ResourceSpec(pydantic.BaseModel):
|
|
22
|
+
class ResourceSpec(pydantic.v1.BaseModel):
|
|
23
23
|
cpu: typing.Optional[str]
|
|
24
24
|
memory: typing.Optional[str]
|
|
25
25
|
gpu: typing.Optional[str]
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
class Resources(pydantic.BaseModel):
|
|
28
|
+
class Resources(pydantic.v1.BaseModel):
|
|
29
29
|
requests: ResourceSpec = ResourceSpec()
|
|
30
30
|
limits: ResourceSpec = ResourceSpec()
|
|
31
31
|
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
|
|
16
16
|
import typing
|
|
17
17
|
|
|
18
|
-
import pydantic
|
|
18
|
+
import pydantic.v1
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
class MostCommonObjectTypesReport(pydantic.BaseModel):
|
|
21
|
+
class MostCommonObjectTypesReport(pydantic.v1.BaseModel):
|
|
22
22
|
object_types: list[tuple[str, int]]
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
class ObjectTypeReport(pydantic.BaseModel):
|
|
25
|
+
class ObjectTypeReport(pydantic.v1.BaseModel):
|
|
26
26
|
object_type: str
|
|
27
27
|
sample_size: int
|
|
28
28
|
start_index: typing.Optional[int]
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
from .constants import (
|
|
16
16
|
V3IO_MODEL_MONITORING_DB,
|
|
17
|
+
ApplicationEvent,
|
|
17
18
|
ControllerPolicy,
|
|
18
19
|
DriftStatus,
|
|
19
20
|
EndpointType,
|
|
@@ -26,6 +27,7 @@ from .constants import (
|
|
|
26
27
|
FunctionURI,
|
|
27
28
|
MetricData,
|
|
28
29
|
ModelEndpointMonitoringMetricType,
|
|
30
|
+
ModelEndpointSchema,
|
|
29
31
|
ModelEndpointTarget,
|
|
30
32
|
ModelEndpointTargetSchemas,
|
|
31
33
|
ModelMonitoringMode,
|
|
@@ -36,7 +38,6 @@ from .constants import (
|
|
|
36
38
|
ResultData,
|
|
37
39
|
ResultKindApp,
|
|
38
40
|
ResultStatusApp,
|
|
39
|
-
SchedulingKeys,
|
|
40
41
|
SpecialApps,
|
|
41
42
|
TDEngineSuperTables,
|
|
42
43
|
TSDBTarget,
|
|
@@ -29,6 +29,48 @@ class MonitoringStrEnum(StrEnum):
|
|
|
29
29
|
return list(map(lambda c: c.value, cls))
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
class ModelEndpointSchema(MonitoringStrEnum):
|
|
33
|
+
# metadata
|
|
34
|
+
UID = "uid"
|
|
35
|
+
PROJECT = "project"
|
|
36
|
+
ENDPOINT_TYPE = "endpoint_type"
|
|
37
|
+
NAME = "name"
|
|
38
|
+
CREATED = "created"
|
|
39
|
+
UPDATED = "updated"
|
|
40
|
+
LABELS = "labels"
|
|
41
|
+
|
|
42
|
+
# spec
|
|
43
|
+
FUNCTION_NAME = "function_name"
|
|
44
|
+
FUNCTION_TAG = "function_tag"
|
|
45
|
+
FUNCTION_UID = "function_uid"
|
|
46
|
+
MODEL_NAME = "model_name"
|
|
47
|
+
MODEL_DB_KEY = "model_db_key"
|
|
48
|
+
MODEL_TAG = "model_tag"
|
|
49
|
+
MODEL_CLASS = "model_class"
|
|
50
|
+
MODEL_UID = "model_uid"
|
|
51
|
+
FEATURE_NAMES = "feature_names"
|
|
52
|
+
LABEL_NAMES = "label_names"
|
|
53
|
+
FEATURE_STATS = "feature_stats"
|
|
54
|
+
MONITORING_FEATURE_SET_URI = "monitoring_feature_set_uri"
|
|
55
|
+
CHILDREN = "children"
|
|
56
|
+
CHILDREN_UIDS = "children_uids"
|
|
57
|
+
FUNCTION_URI = "function_uri"
|
|
58
|
+
MODEL_URI = "model_uri"
|
|
59
|
+
|
|
60
|
+
# status
|
|
61
|
+
STATE = "state"
|
|
62
|
+
MONITORING_MODE = "monitoring_mode"
|
|
63
|
+
FIRST_REQUEST = "first_request"
|
|
64
|
+
|
|
65
|
+
# status - operative
|
|
66
|
+
LAST_REQUEST = "last_request"
|
|
67
|
+
RESULT_STATUS = "result_status"
|
|
68
|
+
AVG_LATENCY = "avg_latency"
|
|
69
|
+
ERROR_COUNT = "error_count"
|
|
70
|
+
CURRENT_STATS = "current_stats"
|
|
71
|
+
DRIFT_MEASURES = "drift_measures"
|
|
72
|
+
|
|
73
|
+
|
|
32
74
|
class EventFieldType:
|
|
33
75
|
FUNCTION_URI = "function_uri"
|
|
34
76
|
FUNCTION = "function"
|
|
@@ -40,6 +82,7 @@ class EventFieldType:
|
|
|
40
82
|
TIMESTAMP = "timestamp"
|
|
41
83
|
# `endpoint_id` is deprecated as a field in the model endpoint schema since 1.3.1, replaced by `uid`.
|
|
42
84
|
ENDPOINT_ID = "endpoint_id"
|
|
85
|
+
ENDPOINT_NAME = "endpoint_name"
|
|
43
86
|
UID = "uid"
|
|
44
87
|
ENDPOINT_TYPE = "endpoint_type"
|
|
45
88
|
REQUEST_ID = "request_id"
|
|
@@ -55,6 +98,8 @@ class EventFieldType:
|
|
|
55
98
|
NAMED_PREDICTIONS = "named_predictions"
|
|
56
99
|
ERROR_COUNT = "error_count"
|
|
57
100
|
MODEL_ERROR = "model_error"
|
|
101
|
+
ERROR_TYPE = "error_type"
|
|
102
|
+
INFER_ERROR = "infer_error"
|
|
58
103
|
ENTITIES = "entities"
|
|
59
104
|
FIRST_REQUEST = "first_request"
|
|
60
105
|
LAST_REQUEST = "last_request"
|
|
@@ -106,21 +151,24 @@ class ApplicationEvent:
|
|
|
106
151
|
START_INFER_TIME = "start_infer_time"
|
|
107
152
|
END_INFER_TIME = "end_infer_time"
|
|
108
153
|
ENDPOINT_ID = "endpoint_id"
|
|
154
|
+
ENDPOINT_NAME = "endpoint_name"
|
|
109
155
|
OUTPUT_STREAM_URI = "output_stream_uri"
|
|
110
156
|
|
|
111
157
|
|
|
112
158
|
class WriterEvent(MonitoringStrEnum):
|
|
159
|
+
ENDPOINT_NAME = "endpoint_name"
|
|
113
160
|
APPLICATION_NAME = "application_name"
|
|
114
161
|
ENDPOINT_ID = "endpoint_id"
|
|
115
162
|
START_INFER_TIME = "start_infer_time"
|
|
116
163
|
END_INFER_TIME = "end_infer_time"
|
|
117
|
-
EVENT_KIND = "event_kind" # metric or result
|
|
164
|
+
EVENT_KIND = "event_kind" # metric or result or stats
|
|
118
165
|
DATA = "data"
|
|
119
166
|
|
|
120
167
|
|
|
121
168
|
class WriterEventKind(MonitoringStrEnum):
|
|
122
169
|
METRIC = "metric"
|
|
123
170
|
RESULT = "result"
|
|
171
|
+
STATS = "stats"
|
|
124
172
|
|
|
125
173
|
|
|
126
174
|
class MetricData(MonitoringStrEnum):
|
|
@@ -134,7 +182,17 @@ class ResultData(MonitoringStrEnum):
|
|
|
134
182
|
RESULT_KIND = "result_kind"
|
|
135
183
|
RESULT_STATUS = "result_status"
|
|
136
184
|
RESULT_EXTRA_DATA = "result_extra_data"
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class StatsData(MonitoringStrEnum):
|
|
188
|
+
STATS_NAME = "stats_name"
|
|
189
|
+
STATS = "stats"
|
|
190
|
+
TIMESTAMP = "timestamp"
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
class StatsKind(MonitoringStrEnum):
|
|
137
194
|
CURRENT_STATS = "current_stats"
|
|
195
|
+
DRIFT_MEASURES = "drift_measures"
|
|
138
196
|
|
|
139
197
|
|
|
140
198
|
class EventLiveStats:
|
|
@@ -169,7 +227,6 @@ class TSDBTarget(MonitoringStrEnum):
|
|
|
169
227
|
|
|
170
228
|
|
|
171
229
|
class ProjectSecretKeys:
|
|
172
|
-
ENDPOINT_STORE_CONNECTION = "MODEL_MONITORING_ENDPOINT_STORE_CONNECTION"
|
|
173
230
|
ACCESS_KEY = "MODEL_MONITORING_ACCESS_KEY"
|
|
174
231
|
STREAM_PATH = "STREAM_PATH"
|
|
175
232
|
TSDB_CONNECTION = "TSDB_CONNECTION"
|
|
@@ -177,7 +234,6 @@ class ProjectSecretKeys:
|
|
|
177
234
|
@classmethod
|
|
178
235
|
def mandatory_secrets(cls):
|
|
179
236
|
return [
|
|
180
|
-
cls.ENDPOINT_STORE_CONNECTION,
|
|
181
237
|
cls.STREAM_PATH,
|
|
182
238
|
cls.TSDB_CONNECTION,
|
|
183
239
|
]
|
|
@@ -194,13 +250,6 @@ class ModelMonitoringStoreKinds:
|
|
|
194
250
|
EVENTS = "events"
|
|
195
251
|
|
|
196
252
|
|
|
197
|
-
class SchedulingKeys:
|
|
198
|
-
LAST_ANALYZED = "last_analyzed"
|
|
199
|
-
ENDPOINT_ID = "endpoint_id"
|
|
200
|
-
APPLICATION_NAME = "application_name"
|
|
201
|
-
UID = "uid"
|
|
202
|
-
|
|
203
|
-
|
|
204
253
|
class FileTargetKind:
|
|
205
254
|
ENDPOINTS = "endpoints"
|
|
206
255
|
EVENTS = "events"
|
|
@@ -209,14 +258,13 @@ class FileTargetKind:
|
|
|
209
258
|
PARQUET = "parquet"
|
|
210
259
|
APPS_PARQUET = "apps_parquet"
|
|
211
260
|
LOG_STREAM = "log_stream"
|
|
212
|
-
APP_RESULTS = "app_results"
|
|
213
|
-
APP_METRICS = "app_metrics"
|
|
214
261
|
MONITORING_SCHEDULES = "monitoring_schedules"
|
|
215
262
|
MONITORING_APPLICATION = "monitoring_application"
|
|
216
263
|
ERRORS = "errors"
|
|
264
|
+
STATS = "stats"
|
|
217
265
|
|
|
218
266
|
|
|
219
|
-
class ModelMonitoringMode(
|
|
267
|
+
class ModelMonitoringMode(StrEnum):
|
|
220
268
|
enabled = "enabled"
|
|
221
269
|
disabled = "disabled"
|
|
222
270
|
|
|
@@ -225,6 +273,11 @@ class EndpointType(IntEnum):
|
|
|
225
273
|
NODE_EP = 1 # end point that is not a child of a router
|
|
226
274
|
ROUTER = 2 # endpoint that is router
|
|
227
275
|
LEAF_EP = 3 # end point that is a child of a router
|
|
276
|
+
BATCH_EP = 4 # endpoint that is representing an offline batch endpoint
|
|
277
|
+
|
|
278
|
+
@classmethod
|
|
279
|
+
def top_level_list(cls):
|
|
280
|
+
return [cls.NODE_EP, cls.ROUTER, cls.BATCH_EP]
|
|
228
281
|
|
|
229
282
|
|
|
230
283
|
class MonitoringFunctionNames(MonitoringStrEnum):
|
|
@@ -244,6 +297,7 @@ class TDEngineSuperTables(MonitoringStrEnum):
|
|
|
244
297
|
APP_RESULTS = "app_results"
|
|
245
298
|
METRICS = "metrics"
|
|
246
299
|
PREDICTIONS = "predictions"
|
|
300
|
+
ERRORS = "errors"
|
|
247
301
|
|
|
248
302
|
|
|
249
303
|
@dataclass
|
|
@@ -364,7 +418,6 @@ class SpecialApps:
|
|
|
364
418
|
|
|
365
419
|
_RESERVED_FUNCTION_NAMES = MonitoringFunctionNames.list() + [SpecialApps.MLRUN_INFRA]
|
|
366
420
|
|
|
367
|
-
|
|
368
421
|
V3IO_MODEL_MONITORING_DB = "v3io"
|
|
369
422
|
|
|
370
423
|
|