mlrun 1.7.2rc4__py3-none-any.whl → 1.8.0__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 +26 -22
- mlrun/__main__.py +15 -16
- mlrun/alerts/alert.py +150 -15
- mlrun/api/schemas/__init__.py +1 -9
- mlrun/artifacts/__init__.py +2 -3
- mlrun/artifacts/base.py +62 -19
- mlrun/artifacts/dataset.py +17 -17
- mlrun/artifacts/document.py +454 -0
- mlrun/artifacts/manager.py +28 -18
- mlrun/artifacts/model.py +91 -59
- mlrun/artifacts/plots.py +2 -2
- mlrun/common/constants.py +8 -0
- mlrun/common/formatters/__init__.py +1 -0
- mlrun/common/formatters/artifact.py +1 -1
- mlrun/common/formatters/feature_set.py +2 -0
- mlrun/common/formatters/function.py +1 -0
- mlrun/{model_monitoring/db/stores/v3io_kv/__init__.py → common/formatters/model_endpoint.py} +17 -0
- 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 +12 -62
- mlrun/common/runtimes/constants.py +25 -4
- mlrun/common/schemas/__init__.py +9 -5
- mlrun/common/schemas/alert.py +114 -19
- mlrun/common/schemas/api_gateway.py +3 -3
- mlrun/common/schemas/artifact.py +22 -9
- mlrun/common/schemas/auth.py +8 -4
- mlrun/common/schemas/background_task.py +7 -7
- mlrun/common/schemas/client_spec.py +4 -4
- 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 +4 -8
- mlrun/common/schemas/model_monitoring/constants.py +127 -46
- mlrun/common/schemas/model_monitoring/grafana.py +18 -12
- mlrun/common/schemas/model_monitoring/model_endpoints.py +154 -160
- 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 +142 -0
- mlrun/common/schemas/pipeline.py +3 -3
- mlrun/common/schemas/project.py +26 -18
- mlrun/common/schemas/runs.py +3 -3
- mlrun/common/schemas/runtime_resource.py +5 -5
- mlrun/common/schemas/schedule.py +1 -1
- mlrun/common/schemas/secret.py +1 -1
- mlrun/{model_monitoring/db/stores/sqldb/__init__.py → common/schemas/serving.py} +10 -1
- mlrun/common/schemas/tag.py +3 -3
- mlrun/common/schemas/workflow.py +6 -5
- mlrun/common/types.py +1 -0
- mlrun/config.py +157 -89
- mlrun/data_types/__init__.py +5 -3
- mlrun/data_types/infer.py +13 -3
- mlrun/data_types/spark.py +2 -1
- mlrun/datastore/__init__.py +59 -18
- mlrun/datastore/alibaba_oss.py +4 -1
- mlrun/datastore/azure_blob.py +4 -1
- mlrun/datastore/base.py +19 -24
- mlrun/datastore/datastore.py +10 -4
- mlrun/datastore/datastore_profile.py +178 -45
- 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 +14 -3
- mlrun/datastore/sources.py +89 -92
- mlrun/datastore/store_resources.py +7 -4
- mlrun/datastore/storeytargets.py +51 -16
- mlrun/datastore/targets.py +38 -31
- mlrun/datastore/utils.py +87 -4
- mlrun/datastore/v3io.py +4 -1
- mlrun/datastore/vectorstore.py +291 -0
- mlrun/datastore/wasbfs/fs.py +13 -12
- mlrun/db/base.py +286 -100
- mlrun/db/httpdb.py +1562 -490
- mlrun/db/nopdb.py +250 -83
- mlrun/errors.py +6 -2
- mlrun/execution.py +194 -50
- mlrun/feature_store/__init__.py +2 -10
- mlrun/feature_store/api.py +20 -458
- mlrun/feature_store/common.py +9 -9
- mlrun/feature_store/feature_set.py +20 -18
- mlrun/feature_store/feature_vector.py +105 -479
- mlrun/feature_store/feature_vector_utils.py +466 -0
- mlrun/feature_store/retrieval/base.py +15 -11
- mlrun/feature_store/retrieval/job.py +2 -1
- mlrun/feature_store/retrieval/storey_merger.py +1 -1
- mlrun/feature_store/steps.py +3 -3
- 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 +31 -31
- 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/k8s_utils.py +2 -5
- mlrun/launcher/base.py +3 -4
- mlrun/launcher/client.py +2 -2
- mlrun/launcher/local.py +6 -2
- mlrun/launcher/remote.py +1 -1
- mlrun/lists.py +8 -4
- mlrun/model.py +132 -46
- mlrun/model_monitoring/__init__.py +3 -5
- mlrun/model_monitoring/api.py +113 -98
- mlrun/model_monitoring/applications/__init__.py +0 -5
- mlrun/model_monitoring/applications/_application_steps.py +81 -50
- mlrun/model_monitoring/applications/base.py +467 -14
- mlrun/model_monitoring/applications/context.py +212 -134
- mlrun/model_monitoring/{db/stores/base → applications/evidently}/__init__.py +6 -2
- mlrun/model_monitoring/applications/evidently/base.py +146 -0
- mlrun/model_monitoring/applications/histogram_data_drift.py +89 -56
- mlrun/model_monitoring/applications/results.py +67 -15
- mlrun/model_monitoring/controller.py +701 -315
- mlrun/model_monitoring/db/__init__.py +0 -2
- mlrun/model_monitoring/db/_schedules.py +242 -0
- mlrun/model_monitoring/db/_stats.py +189 -0
- mlrun/model_monitoring/db/tsdb/__init__.py +33 -22
- mlrun/model_monitoring/db/tsdb/base.py +243 -49
- mlrun/model_monitoring/db/tsdb/tdengine/schemas.py +76 -36
- mlrun/model_monitoring/db/tsdb/tdengine/stream_graph_steps.py +33 -0
- mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connection.py +213 -0
- mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py +534 -88
- mlrun/model_monitoring/db/tsdb/v3io/stream_graph_steps.py +1 -0
- mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +436 -106
- mlrun/model_monitoring/helpers.py +356 -114
- mlrun/model_monitoring/stream_processing.py +190 -345
- mlrun/model_monitoring/tracking_policy.py +11 -4
- mlrun/model_monitoring/writer.py +49 -90
- mlrun/package/__init__.py +3 -6
- mlrun/package/context_handler.py +2 -2
- 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 +35 -32
- 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 +30 -30
- mlrun/projects/pipelines.py +116 -47
- mlrun/projects/project.py +1292 -329
- mlrun/render.py +5 -9
- mlrun/run.py +57 -14
- mlrun/runtimes/__init__.py +1 -3
- mlrun/runtimes/base.py +30 -22
- mlrun/runtimes/daskjob.py +9 -9
- mlrun/runtimes/databricks_job/databricks_runtime.py +6 -5
- mlrun/runtimes/function_reference.py +5 -2
- mlrun/runtimes/generators.py +3 -2
- mlrun/runtimes/kubejob.py +6 -7
- mlrun/runtimes/mounts.py +574 -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 -13
- mlrun/runtimes/nuclio/application/reverse_proxy.go +66 -64
- mlrun/runtimes/nuclio/function.py +127 -70
- mlrun/runtimes/nuclio/serving.py +105 -37
- mlrun/runtimes/pod.py +159 -54
- mlrun/runtimes/remotesparkjob.py +3 -2
- mlrun/runtimes/sparkjob/__init__.py +0 -2
- mlrun/runtimes/sparkjob/spark3job.py +22 -12
- mlrun/runtimes/utils.py +7 -6
- mlrun/secrets.py +2 -2
- mlrun/serving/__init__.py +8 -0
- mlrun/serving/merger.py +7 -5
- mlrun/serving/remote.py +35 -22
- mlrun/serving/routers.py +186 -240
- mlrun/serving/server.py +41 -10
- mlrun/serving/states.py +432 -118
- mlrun/serving/utils.py +13 -2
- mlrun/serving/v1_serving.py +3 -2
- mlrun/serving/v2_serving.py +161 -203
- 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 +35 -22
- mlrun/utils/clones.py +7 -4
- mlrun/utils/helpers.py +511 -58
- mlrun/utils/logger.py +119 -13
- mlrun/utils/notifications/notification/__init__.py +22 -19
- mlrun/utils/notifications/notification/base.py +39 -15
- 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 +16 -8
- mlrun/utils/notifications/notification/webhook.py +24 -8
- mlrun/utils/notifications/notification_pusher.py +191 -200
- mlrun/utils/regex.py +12 -2
- mlrun/utils/version/version.json +2 -2
- {mlrun-1.7.2rc4.dist-info → mlrun-1.8.0.dist-info}/METADATA +69 -54
- mlrun-1.8.0.dist-info/RECORD +351 -0
- {mlrun-1.7.2rc4.dist-info → mlrun-1.8.0.dist-info}/WHEEL +1 -1
- mlrun/model_monitoring/applications/evidently_base.py +0 -137
- 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/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/kv_store.py +0 -726
- mlrun/model_monitoring/model_endpoint.py +0 -118
- mlrun-1.7.2rc4.dist-info/RECORD +0 -351
- {mlrun-1.7.2rc4.dist-info → mlrun-1.8.0.dist-info}/entry_points.txt +0 -0
- {mlrun-1.7.2rc4.dist-info → mlrun-1.8.0.dist-info/licenses}/LICENSE +0 -0
- {mlrun-1.7.2rc4.dist-info → mlrun-1.8.0.dist-info}/top_level.txt +0 -0
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]
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from .constants import (
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
INTERSECT_DICT_KEYS,
|
|
17
|
+
ApplicationEvent,
|
|
18
18
|
DriftStatus,
|
|
19
19
|
EndpointType,
|
|
20
20
|
EndpointUID,
|
|
@@ -25,18 +25,16 @@ from .constants import (
|
|
|
25
25
|
FileTargetKind,
|
|
26
26
|
FunctionURI,
|
|
27
27
|
MetricData,
|
|
28
|
+
ModelEndpointCreationStrategy,
|
|
28
29
|
ModelEndpointMonitoringMetricType,
|
|
29
|
-
|
|
30
|
-
ModelEndpointTargetSchemas,
|
|
30
|
+
ModelEndpointSchema,
|
|
31
31
|
ModelMonitoringMode,
|
|
32
|
-
ModelMonitoringStoreKinds,
|
|
33
32
|
MonitoringFunctionNames,
|
|
34
33
|
PredictionsQueryConstants,
|
|
35
34
|
ProjectSecretKeys,
|
|
36
35
|
ResultData,
|
|
37
36
|
ResultKindApp,
|
|
38
37
|
ResultStatusApp,
|
|
39
|
-
SchedulingKeys,
|
|
40
38
|
SpecialApps,
|
|
41
39
|
TDEngineSuperTables,
|
|
42
40
|
TSDBTarget,
|
|
@@ -48,11 +46,9 @@ from .constants import (
|
|
|
48
46
|
from .grafana import (
|
|
49
47
|
GrafanaColumn,
|
|
50
48
|
GrafanaColumnType,
|
|
51
|
-
GrafanaDataPoint,
|
|
52
49
|
GrafanaNumberColumn,
|
|
53
50
|
GrafanaStringColumn,
|
|
54
51
|
GrafanaTable,
|
|
55
|
-
GrafanaTimeSeriesTarget,
|
|
56
52
|
)
|
|
57
53
|
from .model_endpoints import (
|
|
58
54
|
Features,
|
|
@@ -29,6 +29,54 @@ 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
|
+
MODEL_NAME = "model_name"
|
|
46
|
+
MODEL_TAGS = "model_tags"
|
|
47
|
+
MODEL_PATH = "model_path"
|
|
48
|
+
MODEL_CLASS = "model_class"
|
|
49
|
+
FEATURE_NAMES = "feature_names"
|
|
50
|
+
LABEL_NAMES = "label_names"
|
|
51
|
+
FEATURE_STATS = "feature_stats"
|
|
52
|
+
MONITORING_FEATURE_SET_URI = "monitoring_feature_set_uri"
|
|
53
|
+
CHILDREN = "children"
|
|
54
|
+
CHILDREN_UIDS = "children_uids"
|
|
55
|
+
FUNCTION_URI = "function_uri"
|
|
56
|
+
MODEL_URI = "model_uri"
|
|
57
|
+
|
|
58
|
+
# status
|
|
59
|
+
STATE = "state"
|
|
60
|
+
MONITORING_MODE = "monitoring_mode"
|
|
61
|
+
FIRST_REQUEST = "first_request"
|
|
62
|
+
SAMPLING_PERCENTAGE = "sampling_percentage"
|
|
63
|
+
|
|
64
|
+
# status - operative
|
|
65
|
+
LAST_REQUEST = "last_request"
|
|
66
|
+
RESULT_STATUS = "result_status"
|
|
67
|
+
AVG_LATENCY = "avg_latency"
|
|
68
|
+
ERROR_COUNT = "error_count"
|
|
69
|
+
CURRENT_STATS = "current_stats"
|
|
70
|
+
DRIFT_MEASURES = "drift_measures"
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class ModelEndpointCreationStrategy(MonitoringStrEnum):
|
|
74
|
+
INPLACE = "inplace"
|
|
75
|
+
ARCHIVE = "archive"
|
|
76
|
+
OVERWRITE = "overwrite"
|
|
77
|
+
SKIP = "skip"
|
|
78
|
+
|
|
79
|
+
|
|
32
80
|
class EventFieldType:
|
|
33
81
|
FUNCTION_URI = "function_uri"
|
|
34
82
|
FUNCTION = "function"
|
|
@@ -40,6 +88,7 @@ class EventFieldType:
|
|
|
40
88
|
TIMESTAMP = "timestamp"
|
|
41
89
|
# `endpoint_id` is deprecated as a field in the model endpoint schema since 1.3.1, replaced by `uid`.
|
|
42
90
|
ENDPOINT_ID = "endpoint_id"
|
|
91
|
+
ENDPOINT_NAME = "endpoint_name"
|
|
43
92
|
UID = "uid"
|
|
44
93
|
ENDPOINT_TYPE = "endpoint_type"
|
|
45
94
|
REQUEST_ID = "request_id"
|
|
@@ -55,6 +104,8 @@ class EventFieldType:
|
|
|
55
104
|
NAMED_PREDICTIONS = "named_predictions"
|
|
56
105
|
ERROR_COUNT = "error_count"
|
|
57
106
|
MODEL_ERROR = "model_error"
|
|
107
|
+
ERROR_TYPE = "error_type"
|
|
108
|
+
INFER_ERROR = "infer_error"
|
|
58
109
|
ENTITIES = "entities"
|
|
59
110
|
FIRST_REQUEST = "first_request"
|
|
60
111
|
LAST_REQUEST = "last_request"
|
|
@@ -85,11 +136,14 @@ class EventFieldType:
|
|
|
85
136
|
SAMPLE_PARQUET_PATH = "sample_parquet_path"
|
|
86
137
|
TIME = "time"
|
|
87
138
|
TABLE_COLUMN = "table_column"
|
|
139
|
+
SAMPLING_PERCENTAGE = "sampling_percentage"
|
|
140
|
+
SAMPLING_RATE = "sampling_rate"
|
|
141
|
+
ESTIMATED_PREDICTION_COUNT = "estimated_prediction_count"
|
|
142
|
+
EFFECTIVE_SAMPLE_COUNT = "effective_sample_count"
|
|
88
143
|
|
|
89
144
|
|
|
90
145
|
class FeatureSetFeatures(MonitoringStrEnum):
|
|
91
146
|
LATENCY = EventFieldType.LATENCY
|
|
92
|
-
ERROR_COUNT = EventFieldType.ERROR_COUNT
|
|
93
147
|
METRICS = EventFieldType.METRICS
|
|
94
148
|
|
|
95
149
|
@classmethod
|
|
@@ -106,21 +160,49 @@ class ApplicationEvent:
|
|
|
106
160
|
START_INFER_TIME = "start_infer_time"
|
|
107
161
|
END_INFER_TIME = "end_infer_time"
|
|
108
162
|
ENDPOINT_ID = "endpoint_id"
|
|
109
|
-
|
|
163
|
+
ENDPOINT_NAME = "endpoint_name"
|
|
164
|
+
ENDPOINT_UPDATED = "endpoint_updated"
|
|
110
165
|
|
|
111
166
|
|
|
112
167
|
class WriterEvent(MonitoringStrEnum):
|
|
168
|
+
ENDPOINT_NAME = "endpoint_name"
|
|
113
169
|
APPLICATION_NAME = "application_name"
|
|
114
170
|
ENDPOINT_ID = "endpoint_id"
|
|
115
171
|
START_INFER_TIME = "start_infer_time"
|
|
116
172
|
END_INFER_TIME = "end_infer_time"
|
|
117
|
-
EVENT_KIND = "event_kind" # metric or result
|
|
173
|
+
EVENT_KIND = "event_kind" # metric or result or stats
|
|
118
174
|
DATA = "data"
|
|
119
175
|
|
|
120
176
|
|
|
121
177
|
class WriterEventKind(MonitoringStrEnum):
|
|
122
178
|
METRIC = "metric"
|
|
123
179
|
RESULT = "result"
|
|
180
|
+
STATS = "stats"
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
class ControllerEvent(MonitoringStrEnum):
|
|
184
|
+
KIND = "kind"
|
|
185
|
+
ENDPOINT_ID = "endpoint_id"
|
|
186
|
+
ENDPOINT_NAME = "endpoint_name"
|
|
187
|
+
PROJECT = "project"
|
|
188
|
+
TIMESTAMP = "timestamp"
|
|
189
|
+
FIRST_REQUEST = "first_request"
|
|
190
|
+
FEATURE_SET_URI = "feature_set_uri"
|
|
191
|
+
ENDPOINT_TYPE = "endpoint_type"
|
|
192
|
+
ENDPOINT_POLICY = "endpoint_policy"
|
|
193
|
+
# Note: currently under endpoint policy we will have a dictionary including the keys: "application_names"
|
|
194
|
+
# "base_period", and "updated_endpoint" stand for when the MEP was updated
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
class ControllerEventEndpointPolicy(MonitoringStrEnum):
|
|
198
|
+
BASE_PERIOD = "base_period"
|
|
199
|
+
MONITORING_APPLICATIONS = "monitoring_applications"
|
|
200
|
+
ENDPOINT_UPDATED = "endpoint_updated"
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class ControllerEventKind(MonitoringStrEnum):
|
|
204
|
+
NOP_EVENT = "nop_event"
|
|
205
|
+
REGULAR_EVENT = "regular_event"
|
|
124
206
|
|
|
125
207
|
|
|
126
208
|
class MetricData(MonitoringStrEnum):
|
|
@@ -134,7 +216,17 @@ class ResultData(MonitoringStrEnum):
|
|
|
134
216
|
RESULT_KIND = "result_kind"
|
|
135
217
|
RESULT_STATUS = "result_status"
|
|
136
218
|
RESULT_EXTRA_DATA = "result_extra_data"
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class StatsData(MonitoringStrEnum):
|
|
222
|
+
STATS_NAME = "stats_name"
|
|
223
|
+
STATS = "stats"
|
|
224
|
+
TIMESTAMP = "timestamp"
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
class StatsKind(MonitoringStrEnum):
|
|
137
228
|
CURRENT_STATS = "current_stats"
|
|
229
|
+
DRIFT_MEASURES = "drift_measures"
|
|
138
230
|
|
|
139
231
|
|
|
140
232
|
class EventLiveStats:
|
|
@@ -153,52 +245,28 @@ class EventKeyMetrics:
|
|
|
153
245
|
REAL_TIME = "real_time"
|
|
154
246
|
|
|
155
247
|
|
|
156
|
-
class ModelEndpointTarget(MonitoringStrEnum):
|
|
157
|
-
V3IO_NOSQL = "v3io-nosql"
|
|
158
|
-
SQL = "sql"
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
class StreamKind(MonitoringStrEnum):
|
|
162
|
-
V3IO_STREAM = "v3io_stream"
|
|
163
|
-
KAFKA = "kafka"
|
|
164
|
-
|
|
165
|
-
|
|
166
248
|
class TSDBTarget(MonitoringStrEnum):
|
|
167
249
|
V3IO_TSDB = "v3io-tsdb"
|
|
168
250
|
TDEngine = "tdengine"
|
|
169
251
|
|
|
170
252
|
|
|
171
253
|
class ProjectSecretKeys:
|
|
172
|
-
ENDPOINT_STORE_CONNECTION = "MODEL_MONITORING_ENDPOINT_STORE_CONNECTION"
|
|
173
254
|
ACCESS_KEY = "MODEL_MONITORING_ACCESS_KEY"
|
|
174
|
-
|
|
175
|
-
|
|
255
|
+
TSDB_PROFILE_NAME = "TSDB_PROFILE_NAME"
|
|
256
|
+
STREAM_PROFILE_NAME = "STREAM_PROFILE_NAME"
|
|
176
257
|
|
|
177
258
|
@classmethod
|
|
178
259
|
def mandatory_secrets(cls):
|
|
179
260
|
return [
|
|
180
|
-
cls.
|
|
181
|
-
cls.
|
|
182
|
-
cls.TSDB_CONNECTION,
|
|
261
|
+
cls.STREAM_PROFILE_NAME,
|
|
262
|
+
cls.TSDB_PROFILE_NAME,
|
|
183
263
|
]
|
|
184
264
|
|
|
185
265
|
|
|
186
|
-
class
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
class ModelMonitoringStoreKinds:
|
|
193
|
-
ENDPOINTS = "endpoints"
|
|
194
|
-
EVENTS = "events"
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
class SchedulingKeys:
|
|
198
|
-
LAST_ANALYZED = "last_analyzed"
|
|
199
|
-
ENDPOINT_ID = "endpoint_id"
|
|
200
|
-
APPLICATION_NAME = "application_name"
|
|
201
|
-
UID = "uid"
|
|
266
|
+
class GetEventsFormat(MonitoringStrEnum):
|
|
267
|
+
SINGLE = "single"
|
|
268
|
+
SEPARATION = "separation"
|
|
269
|
+
INTERSECTION = "intersection"
|
|
202
270
|
|
|
203
271
|
|
|
204
272
|
class FileTargetKind:
|
|
@@ -209,22 +277,32 @@ class FileTargetKind:
|
|
|
209
277
|
PARQUET = "parquet"
|
|
210
278
|
APPS_PARQUET = "apps_parquet"
|
|
211
279
|
LOG_STREAM = "log_stream"
|
|
212
|
-
APP_RESULTS = "app_results"
|
|
213
|
-
APP_METRICS = "app_metrics"
|
|
214
280
|
MONITORING_SCHEDULES = "monitoring_schedules"
|
|
215
281
|
MONITORING_APPLICATION = "monitoring_application"
|
|
216
282
|
ERRORS = "errors"
|
|
283
|
+
STATS = "stats"
|
|
284
|
+
LAST_REQUEST = "last_request"
|
|
217
285
|
|
|
218
286
|
|
|
219
|
-
class ModelMonitoringMode(
|
|
287
|
+
class ModelMonitoringMode(StrEnum):
|
|
220
288
|
enabled = "enabled"
|
|
221
289
|
disabled = "disabled"
|
|
222
290
|
|
|
223
291
|
|
|
292
|
+
class ScheduleChiefFields(StrEnum):
|
|
293
|
+
LAST_REQUEST = "last_request"
|
|
294
|
+
LAST_ANALYZED = "last_analyzed"
|
|
295
|
+
|
|
296
|
+
|
|
224
297
|
class EndpointType(IntEnum):
|
|
225
298
|
NODE_EP = 1 # end point that is not a child of a router
|
|
226
299
|
ROUTER = 2 # endpoint that is router
|
|
227
300
|
LEAF_EP = 3 # end point that is a child of a router
|
|
301
|
+
BATCH_EP = 4 # endpoint that is representing an offline batch endpoint
|
|
302
|
+
|
|
303
|
+
@classmethod
|
|
304
|
+
def top_level_list(cls):
|
|
305
|
+
return [cls.NODE_EP, cls.ROUTER, cls.BATCH_EP]
|
|
228
306
|
|
|
229
307
|
|
|
230
308
|
class MonitoringFunctionNames(MonitoringStrEnum):
|
|
@@ -238,12 +316,14 @@ class V3IOTSDBTables(MonitoringStrEnum):
|
|
|
238
316
|
METRICS = "metrics"
|
|
239
317
|
EVENTS = "events"
|
|
240
318
|
ERRORS = "errors"
|
|
319
|
+
PREDICTIONS = "predictions"
|
|
241
320
|
|
|
242
321
|
|
|
243
322
|
class TDEngineSuperTables(MonitoringStrEnum):
|
|
244
323
|
APP_RESULTS = "app_results"
|
|
245
324
|
METRICS = "metrics"
|
|
246
325
|
PREDICTIONS = "predictions"
|
|
326
|
+
ERRORS = "errors"
|
|
247
327
|
|
|
248
328
|
|
|
249
329
|
@dataclass
|
|
@@ -344,10 +424,6 @@ class ModelMonitoringAppLabel:
|
|
|
344
424
|
return f"{self.KEY}={self.VAL}"
|
|
345
425
|
|
|
346
426
|
|
|
347
|
-
class ControllerPolicy:
|
|
348
|
-
BASE_PERIOD = "base_period"
|
|
349
|
-
|
|
350
|
-
|
|
351
427
|
class HistogramDataDriftApplicationConstants:
|
|
352
428
|
NAME = "histogram-data-drift"
|
|
353
429
|
GENERAL_RESULT_NAME = "general_drift"
|
|
@@ -365,9 +441,6 @@ class SpecialApps:
|
|
|
365
441
|
_RESERVED_FUNCTION_NAMES = MonitoringFunctionNames.list() + [SpecialApps.MLRUN_INFRA]
|
|
366
442
|
|
|
367
443
|
|
|
368
|
-
V3IO_MODEL_MONITORING_DB = "v3io"
|
|
369
|
-
|
|
370
|
-
|
|
371
444
|
class ModelEndpointMonitoringMetricType(StrEnum):
|
|
372
445
|
RESULT = "result"
|
|
373
446
|
METRIC = "metric"
|
|
@@ -384,5 +457,13 @@ FQN_REGEX = re.compile(FQN_PATTERN)
|
|
|
384
457
|
|
|
385
458
|
# refer to `mlrun.utils.regex.project_name`
|
|
386
459
|
PROJECT_PATTERN = r"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$"
|
|
387
|
-
|
|
388
460
|
MODEL_ENDPOINT_ID_PATTERN = r"^[a-zA-Z0-9_-]+$"
|
|
461
|
+
RESULT_NAME_PATTERN = r"[a-zA-Z_][a-zA-Z0-9_]*"
|
|
462
|
+
|
|
463
|
+
INTERSECT_DICT_KEYS = {
|
|
464
|
+
ModelEndpointMonitoringMetricType.METRIC: "intersect_metrics",
|
|
465
|
+
ModelEndpointMonitoringMetricType.RESULT: "intersect_results",
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
CRON_TRIGGER_KINDS = ("http", "cron")
|
|
469
|
+
STREAM_TRIGGER_KINDS = ("v3io-stream", "kafka-cluster")
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
from typing import Optional, Union
|
|
16
16
|
|
|
17
|
-
from pydantic import BaseModel
|
|
17
|
+
from pydantic.v1 import BaseModel
|
|
18
18
|
|
|
19
19
|
import mlrun.common.types
|
|
20
20
|
|
|
@@ -46,14 +46,20 @@ class GrafanaTable(BaseModel):
|
|
|
46
46
|
self.rows.append(list(args))
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
class
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
class GrafanaModelEndpointsTable(GrafanaTable):
|
|
50
|
+
def __init__(self):
|
|
51
|
+
columns = self._init_columns()
|
|
52
|
+
super().__init__(columns=columns)
|
|
53
|
+
|
|
54
|
+
@staticmethod
|
|
55
|
+
def _init_columns():
|
|
56
|
+
return [
|
|
57
|
+
GrafanaColumn(text="endpoint_id", type=GrafanaColumnType.STRING),
|
|
58
|
+
GrafanaColumn(text="endpoint_name", type=GrafanaColumnType.STRING),
|
|
59
|
+
GrafanaColumn(text="endpoint_function", type=GrafanaColumnType.STRING),
|
|
60
|
+
GrafanaColumn(text="endpoint_model", type=GrafanaColumnType.STRING),
|
|
61
|
+
GrafanaColumn(text="endpoint_model_class", type=GrafanaColumnType.STRING),
|
|
62
|
+
GrafanaColumn(text="error_count", type=GrafanaColumnType.NUMBER),
|
|
63
|
+
GrafanaColumn(text="drift_status", type=GrafanaColumnType.NUMBER),
|
|
64
|
+
GrafanaColumn(text="sampling_percentage", type=GrafanaColumnType.NUMBER),
|
|
65
|
+
]
|