mlrun 1.4.0rc25__py3-none-any.whl → 1.5.0rc2__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 (184) hide show
  1. mlrun/__init__.py +2 -35
  2. mlrun/__main__.py +3 -41
  3. mlrun/api/api/api.py +6 -0
  4. mlrun/api/api/endpoints/feature_store.py +0 -4
  5. mlrun/api/api/endpoints/files.py +14 -2
  6. mlrun/api/api/endpoints/frontend_spec.py +2 -1
  7. mlrun/api/api/endpoints/functions.py +95 -59
  8. mlrun/api/api/endpoints/grafana_proxy.py +9 -9
  9. mlrun/api/api/endpoints/logs.py +17 -3
  10. mlrun/api/api/endpoints/model_endpoints.py +3 -2
  11. mlrun/api/api/endpoints/pipelines.py +1 -5
  12. mlrun/api/api/endpoints/projects.py +88 -0
  13. mlrun/api/api/endpoints/runs.py +48 -6
  14. mlrun/api/api/endpoints/submit.py +2 -1
  15. mlrun/api/api/endpoints/workflows.py +355 -0
  16. mlrun/api/api/utils.py +3 -4
  17. mlrun/api/crud/__init__.py +1 -0
  18. mlrun/api/crud/client_spec.py +6 -2
  19. mlrun/api/crud/feature_store.py +5 -0
  20. mlrun/api/crud/model_monitoring/__init__.py +1 -0
  21. mlrun/api/crud/model_monitoring/deployment.py +497 -0
  22. mlrun/api/crud/model_monitoring/grafana.py +96 -42
  23. mlrun/api/crud/model_monitoring/helpers.py +159 -0
  24. mlrun/api/crud/model_monitoring/model_endpoints.py +202 -476
  25. mlrun/api/crud/notifications.py +9 -4
  26. mlrun/api/crud/pipelines.py +6 -11
  27. mlrun/api/crud/projects.py +2 -2
  28. mlrun/api/crud/runtime_resources.py +4 -3
  29. mlrun/api/crud/runtimes/nuclio/helpers.py +5 -1
  30. mlrun/api/crud/secrets.py +21 -0
  31. mlrun/api/crud/workflows.py +352 -0
  32. mlrun/api/db/base.py +16 -1
  33. mlrun/api/db/init_db.py +2 -4
  34. mlrun/api/db/session.py +1 -1
  35. mlrun/api/db/sqldb/db.py +129 -31
  36. mlrun/api/db/sqldb/models/models_mysql.py +15 -1
  37. mlrun/api/db/sqldb/models/models_sqlite.py +16 -2
  38. mlrun/api/launcher.py +38 -6
  39. mlrun/api/main.py +3 -2
  40. mlrun/api/rundb/__init__.py +13 -0
  41. mlrun/{db → api/rundb}/sqldb.py +36 -84
  42. mlrun/api/runtime_handlers/__init__.py +56 -0
  43. mlrun/api/runtime_handlers/base.py +1247 -0
  44. mlrun/api/runtime_handlers/daskjob.py +209 -0
  45. mlrun/api/runtime_handlers/kubejob.py +37 -0
  46. mlrun/api/runtime_handlers/mpijob.py +147 -0
  47. mlrun/api/runtime_handlers/remotesparkjob.py +29 -0
  48. mlrun/api/runtime_handlers/sparkjob.py +148 -0
  49. mlrun/api/schemas/__init__.py +17 -6
  50. mlrun/api/utils/builder.py +1 -4
  51. mlrun/api/utils/clients/chief.py +14 -0
  52. mlrun/api/utils/clients/iguazio.py +33 -33
  53. mlrun/api/utils/clients/nuclio.py +2 -2
  54. mlrun/api/utils/periodic.py +9 -2
  55. mlrun/api/utils/projects/follower.py +14 -7
  56. mlrun/api/utils/projects/leader.py +2 -1
  57. mlrun/api/utils/projects/remotes/nop_follower.py +2 -2
  58. mlrun/api/utils/projects/remotes/nop_leader.py +2 -2
  59. mlrun/api/utils/runtimes/__init__.py +14 -0
  60. mlrun/api/utils/runtimes/nuclio.py +43 -0
  61. mlrun/api/utils/scheduler.py +98 -15
  62. mlrun/api/utils/singletons/db.py +5 -1
  63. mlrun/api/utils/singletons/project_member.py +4 -1
  64. mlrun/api/utils/singletons/scheduler.py +1 -1
  65. mlrun/artifacts/base.py +6 -6
  66. mlrun/artifacts/dataset.py +4 -4
  67. mlrun/artifacts/manager.py +2 -3
  68. mlrun/artifacts/model.py +2 -2
  69. mlrun/artifacts/plots.py +8 -8
  70. mlrun/common/db/__init__.py +14 -0
  71. mlrun/common/helpers.py +37 -0
  72. mlrun/{mlutils → common/model_monitoring}/__init__.py +3 -2
  73. mlrun/common/model_monitoring/helpers.py +69 -0
  74. mlrun/common/schemas/__init__.py +13 -1
  75. mlrun/common/schemas/auth.py +4 -1
  76. mlrun/common/schemas/client_spec.py +1 -1
  77. mlrun/common/schemas/function.py +17 -0
  78. mlrun/common/schemas/model_monitoring/__init__.py +48 -0
  79. mlrun/common/{model_monitoring.py → schemas/model_monitoring/constants.py} +11 -23
  80. mlrun/common/schemas/model_monitoring/grafana.py +55 -0
  81. mlrun/common/schemas/{model_endpoints.py → model_monitoring/model_endpoints.py} +32 -65
  82. mlrun/common/schemas/notification.py +1 -0
  83. mlrun/common/schemas/object.py +4 -0
  84. mlrun/common/schemas/project.py +1 -0
  85. mlrun/common/schemas/regex.py +1 -1
  86. mlrun/common/schemas/runs.py +1 -8
  87. mlrun/common/schemas/schedule.py +1 -8
  88. mlrun/common/schemas/workflow.py +54 -0
  89. mlrun/config.py +45 -42
  90. mlrun/datastore/__init__.py +21 -0
  91. mlrun/datastore/base.py +1 -1
  92. mlrun/datastore/datastore.py +9 -0
  93. mlrun/datastore/dbfs_store.py +168 -0
  94. mlrun/datastore/helpers.py +18 -0
  95. mlrun/datastore/sources.py +1 -0
  96. mlrun/datastore/store_resources.py +2 -5
  97. mlrun/datastore/v3io.py +1 -2
  98. mlrun/db/__init__.py +4 -68
  99. mlrun/db/base.py +12 -0
  100. mlrun/db/factory.py +65 -0
  101. mlrun/db/httpdb.py +175 -20
  102. mlrun/db/nopdb.py +4 -2
  103. mlrun/execution.py +4 -2
  104. mlrun/feature_store/__init__.py +1 -0
  105. mlrun/feature_store/api.py +1 -2
  106. mlrun/feature_store/common.py +2 -1
  107. mlrun/feature_store/feature_set.py +1 -11
  108. mlrun/feature_store/feature_vector.py +340 -2
  109. mlrun/feature_store/ingestion.py +5 -10
  110. mlrun/feature_store/retrieval/base.py +118 -104
  111. mlrun/feature_store/retrieval/dask_merger.py +17 -10
  112. mlrun/feature_store/retrieval/job.py +4 -1
  113. mlrun/feature_store/retrieval/local_merger.py +18 -18
  114. mlrun/feature_store/retrieval/spark_merger.py +21 -14
  115. mlrun/feature_store/retrieval/storey_merger.py +22 -16
  116. mlrun/kfpops.py +3 -9
  117. mlrun/launcher/base.py +57 -53
  118. mlrun/launcher/client.py +5 -4
  119. mlrun/launcher/factory.py +24 -13
  120. mlrun/launcher/local.py +6 -6
  121. mlrun/launcher/remote.py +4 -4
  122. mlrun/lists.py +0 -11
  123. mlrun/model.py +11 -17
  124. mlrun/model_monitoring/__init__.py +2 -22
  125. mlrun/model_monitoring/features_drift_table.py +1 -1
  126. mlrun/model_monitoring/helpers.py +22 -210
  127. mlrun/model_monitoring/model_endpoint.py +1 -1
  128. mlrun/model_monitoring/model_monitoring_batch.py +127 -50
  129. mlrun/model_monitoring/prometheus.py +219 -0
  130. mlrun/model_monitoring/stores/__init__.py +16 -11
  131. mlrun/model_monitoring/stores/kv_model_endpoint_store.py +95 -23
  132. mlrun/model_monitoring/stores/models/mysql.py +47 -29
  133. mlrun/model_monitoring/stores/models/sqlite.py +47 -29
  134. mlrun/model_monitoring/stores/sql_model_endpoint_store.py +31 -19
  135. mlrun/model_monitoring/{stream_processing_fs.py → stream_processing.py} +206 -64
  136. mlrun/model_monitoring/tracking_policy.py +104 -0
  137. mlrun/package/packager.py +6 -8
  138. mlrun/package/packagers/default_packager.py +121 -10
  139. mlrun/package/packagers/numpy_packagers.py +1 -1
  140. mlrun/platforms/__init__.py +0 -2
  141. mlrun/platforms/iguazio.py +0 -56
  142. mlrun/projects/pipelines.py +53 -159
  143. mlrun/projects/project.py +10 -37
  144. mlrun/render.py +1 -1
  145. mlrun/run.py +8 -124
  146. mlrun/runtimes/__init__.py +6 -42
  147. mlrun/runtimes/base.py +29 -1249
  148. mlrun/runtimes/daskjob.py +2 -198
  149. mlrun/runtimes/funcdoc.py +0 -9
  150. mlrun/runtimes/function.py +25 -29
  151. mlrun/runtimes/kubejob.py +5 -29
  152. mlrun/runtimes/local.py +1 -1
  153. mlrun/runtimes/mpijob/__init__.py +2 -2
  154. mlrun/runtimes/mpijob/abstract.py +10 -1
  155. mlrun/runtimes/mpijob/v1.py +0 -76
  156. mlrun/runtimes/mpijob/v1alpha1.py +1 -74
  157. mlrun/runtimes/nuclio.py +3 -2
  158. mlrun/runtimes/pod.py +28 -18
  159. mlrun/runtimes/remotesparkjob.py +1 -15
  160. mlrun/runtimes/serving.py +14 -6
  161. mlrun/runtimes/sparkjob/__init__.py +0 -1
  162. mlrun/runtimes/sparkjob/abstract.py +4 -131
  163. mlrun/runtimes/utils.py +0 -26
  164. mlrun/serving/routers.py +7 -7
  165. mlrun/serving/server.py +11 -8
  166. mlrun/serving/states.py +7 -1
  167. mlrun/serving/v2_serving.py +6 -6
  168. mlrun/utils/helpers.py +23 -42
  169. mlrun/utils/notifications/notification/__init__.py +4 -0
  170. mlrun/utils/notifications/notification/webhook.py +61 -0
  171. mlrun/utils/notifications/notification_pusher.py +5 -25
  172. mlrun/utils/regex.py +7 -2
  173. mlrun/utils/version/version.json +2 -2
  174. {mlrun-1.4.0rc25.dist-info → mlrun-1.5.0rc2.dist-info}/METADATA +26 -25
  175. {mlrun-1.4.0rc25.dist-info → mlrun-1.5.0rc2.dist-info}/RECORD +180 -158
  176. {mlrun-1.4.0rc25.dist-info → mlrun-1.5.0rc2.dist-info}/WHEEL +1 -1
  177. mlrun/mlutils/data.py +0 -160
  178. mlrun/mlutils/models.py +0 -78
  179. mlrun/mlutils/plots.py +0 -902
  180. mlrun/utils/model_monitoring.py +0 -249
  181. /mlrun/{api/db/sqldb/session.py → common/db/sql_session.py} +0 -0
  182. {mlrun-1.4.0rc25.dist-info → mlrun-1.5.0rc2.dist-info}/LICENSE +0 -0
  183. {mlrun-1.4.0rc25.dist-info → mlrun-1.5.0rc2.dist-info}/entry_points.txt +0 -0
  184. {mlrun-1.4.0rc25.dist-info → mlrun-1.5.0rc2.dist-info}/top_level.txt +0 -0
@@ -16,83 +16,101 @@
16
16
 
17
17
  from sqlalchemy import TIMESTAMP, Boolean, Column, Integer, String, Text
18
18
 
19
- import mlrun.common.model_monitoring as model_monitoring_constants
19
+ import mlrun.common.schemas.model_monitoring
20
20
  from mlrun.utils.db import BaseModel
21
21
 
22
22
  from .base import Base
23
23
 
24
24
 
25
25
  class ModelEndpointsTable(Base, BaseModel):
26
- __tablename__ = model_monitoring_constants.EventFieldType.MODEL_ENDPOINTS
26
+ __tablename__ = mlrun.common.schemas.model_monitoring.EventFieldType.MODEL_ENDPOINTS
27
27
 
28
28
  uid = Column(
29
- model_monitoring_constants.EventFieldType.UID,
29
+ mlrun.common.schemas.model_monitoring.EventFieldType.UID,
30
30
  String(40),
31
31
  primary_key=True,
32
32
  )
33
- state = Column(model_monitoring_constants.EventFieldType.STATE, String(10))
34
- project = Column(model_monitoring_constants.EventFieldType.PROJECT, String(40))
33
+ state = Column(
34
+ mlrun.common.schemas.model_monitoring.EventFieldType.STATE, String(10)
35
+ )
36
+ project = Column(
37
+ mlrun.common.schemas.model_monitoring.EventFieldType.PROJECT, String(40)
38
+ )
35
39
  function_uri = Column(
36
- model_monitoring_constants.EventFieldType.FUNCTION_URI,
40
+ mlrun.common.schemas.model_monitoring.EventFieldType.FUNCTION_URI,
37
41
  String(255),
38
42
  )
39
- model = Column(model_monitoring_constants.EventFieldType.MODEL, String(255))
43
+ model = Column(
44
+ mlrun.common.schemas.model_monitoring.EventFieldType.MODEL, String(255)
45
+ )
40
46
  model_class = Column(
41
- model_monitoring_constants.EventFieldType.MODEL_CLASS,
47
+ mlrun.common.schemas.model_monitoring.EventFieldType.MODEL_CLASS,
42
48
  String(255),
43
49
  )
44
- labels = Column(model_monitoring_constants.EventFieldType.LABELS, Text)
45
- model_uri = Column(model_monitoring_constants.EventFieldType.MODEL_URI, String(255))
46
- stream_path = Column(model_monitoring_constants.EventFieldType.STREAM_PATH, Text)
50
+ labels = Column(mlrun.common.schemas.model_monitoring.EventFieldType.LABELS, Text)
51
+ model_uri = Column(
52
+ mlrun.common.schemas.model_monitoring.EventFieldType.MODEL_URI, String(255)
53
+ )
54
+ stream_path = Column(
55
+ mlrun.common.schemas.model_monitoring.EventFieldType.STREAM_PATH, Text
56
+ )
47
57
  algorithm = Column(
48
- model_monitoring_constants.EventFieldType.ALGORITHM,
58
+ mlrun.common.schemas.model_monitoring.EventFieldType.ALGORITHM,
49
59
  String(255),
50
60
  )
51
- active = Column(model_monitoring_constants.EventFieldType.ACTIVE, Boolean)
61
+ active = Column(
62
+ mlrun.common.schemas.model_monitoring.EventFieldType.ACTIVE, Boolean
63
+ )
52
64
  monitoring_mode = Column(
53
- model_monitoring_constants.EventFieldType.MONITORING_MODE,
65
+ mlrun.common.schemas.model_monitoring.EventFieldType.MONITORING_MODE,
54
66
  String(10),
55
67
  )
56
68
  feature_stats = Column(
57
- model_monitoring_constants.EventFieldType.FEATURE_STATS, Text
69
+ mlrun.common.schemas.model_monitoring.EventFieldType.FEATURE_STATS, Text
58
70
  )
59
71
  current_stats = Column(
60
- model_monitoring_constants.EventFieldType.CURRENT_STATS, Text
72
+ mlrun.common.schemas.model_monitoring.EventFieldType.CURRENT_STATS, Text
61
73
  )
62
74
  feature_names = Column(
63
- model_monitoring_constants.EventFieldType.FEATURE_NAMES, Text
75
+ mlrun.common.schemas.model_monitoring.EventFieldType.FEATURE_NAMES, Text
76
+ )
77
+ children = Column(
78
+ mlrun.common.schemas.model_monitoring.EventFieldType.CHILDREN, Text
79
+ )
80
+ label_names = Column(
81
+ mlrun.common.schemas.model_monitoring.EventFieldType.LABEL_NAMES, Text
64
82
  )
65
- children = Column(model_monitoring_constants.EventFieldType.CHILDREN, Text)
66
- label_names = Column(model_monitoring_constants.EventFieldType.LABEL_NAMES, Text)
67
83
  endpoint_type = Column(
68
- model_monitoring_constants.EventFieldType.ENDPOINT_TYPE,
84
+ mlrun.common.schemas.model_monitoring.EventFieldType.ENDPOINT_TYPE,
69
85
  String(10),
70
86
  )
71
87
  children_uids = Column(
72
- model_monitoring_constants.EventFieldType.CHILDREN_UIDS, Text
88
+ mlrun.common.schemas.model_monitoring.EventFieldType.CHILDREN_UIDS, Text
73
89
  )
74
90
  drift_measures = Column(
75
- model_monitoring_constants.EventFieldType.DRIFT_MEASURES, Text
91
+ mlrun.common.schemas.model_monitoring.EventFieldType.DRIFT_MEASURES, Text
76
92
  )
77
93
  drift_status = Column(
78
- model_monitoring_constants.EventFieldType.DRIFT_STATUS,
94
+ mlrun.common.schemas.model_monitoring.EventFieldType.DRIFT_STATUS,
79
95
  String(40),
80
96
  )
81
97
  monitor_configuration = Column(
82
- model_monitoring_constants.EventFieldType.MONITOR_CONFIGURATION,
98
+ mlrun.common.schemas.model_monitoring.EventFieldType.MONITOR_CONFIGURATION,
83
99
  Text,
84
100
  )
85
101
  monitoring_feature_set_uri = Column(
86
- model_monitoring_constants.EventFieldType.FEATURE_SET_URI,
102
+ mlrun.common.schemas.model_monitoring.EventFieldType.FEATURE_SET_URI,
87
103
  String(255),
88
104
  )
89
105
  first_request = Column(
90
- model_monitoring_constants.EventFieldType.FIRST_REQUEST,
106
+ mlrun.common.schemas.model_monitoring.EventFieldType.FIRST_REQUEST,
91
107
  TIMESTAMP,
92
108
  )
93
109
  last_request = Column(
94
- model_monitoring_constants.EventFieldType.LAST_REQUEST,
110
+ mlrun.common.schemas.model_monitoring.EventFieldType.LAST_REQUEST,
95
111
  TIMESTAMP,
96
112
  )
97
- error_count = Column(model_monitoring_constants.EventFieldType.ERROR_COUNT, Integer)
98
- metrics = Column(model_monitoring_constants.EventFieldType.METRICS, Text)
113
+ error_count = Column(
114
+ mlrun.common.schemas.model_monitoring.EventFieldType.ERROR_COUNT, Integer
115
+ )
116
+ metrics = Column(mlrun.common.schemas.model_monitoring.EventFieldType.METRICS, Text)
@@ -20,12 +20,10 @@ from datetime import datetime, timezone
20
20
  import pandas as pd
21
21
  import sqlalchemy as db
22
22
 
23
- import mlrun
24
- import mlrun.common.model_monitoring as model_monitoring_constants
25
- import mlrun.model_monitoring.model_endpoint
26
- import mlrun.utils.model_monitoring
27
- import mlrun.utils.v3io_clients
28
- from mlrun.api.db.sqldb.session import create_session, get_engine
23
+ import mlrun.common.model_monitoring.helpers
24
+ import mlrun.common.schemas.model_monitoring
25
+ import mlrun.model_monitoring.helpers
26
+ from mlrun.common.db.sql_session import create_session, get_engine
29
27
  from mlrun.utils import logger
30
28
 
31
29
  from .model_endpoint_store import ModelEndpointStore
@@ -47,22 +45,28 @@ class SQLModelEndpointStore(ModelEndpointStore):
47
45
  self,
48
46
  project: str,
49
47
  sql_connection_string: str = None,
48
+ secret_provider: typing.Callable = None,
50
49
  ):
51
50
  """
52
51
  Initialize SQL store target object.
53
52
 
54
53
  :param project: The name of the project.
55
54
  :param sql_connection_string: Valid connection string or a path to SQL database with model endpoints table.
55
+ :param secret_provider: An optional secret provider to get the connection string secret.
56
56
  """
57
57
 
58
58
  super().__init__(project=project)
59
59
 
60
60
  self.sql_connection_string = (
61
61
  sql_connection_string
62
- or mlrun.utils.model_monitoring.get_connection_string(project=self.project)
62
+ or mlrun.model_monitoring.helpers.get_connection_string(
63
+ secret_provider=secret_provider
64
+ )
63
65
  )
64
66
 
65
- self.table_name = model_monitoring_constants.EventFieldType.MODEL_ENDPOINTS
67
+ self.table_name = (
68
+ mlrun.common.schemas.model_monitoring.EventFieldType.MODEL_ENDPOINTS
69
+ )
66
70
 
67
71
  self._engine = get_engine(dsn=self.sql_connection_string)
68
72
  self.ModelEndpointsTable = get_ModelEndpointsTable(
@@ -84,10 +88,10 @@ class SQLModelEndpointStore(ModelEndpointStore):
84
88
  with self._engine.connect() as connection:
85
89
  # Adjust timestamps fields
86
90
  endpoint[
87
- model_monitoring_constants.EventFieldType.FIRST_REQUEST
91
+ mlrun.common.schemas.model_monitoring.EventFieldType.FIRST_REQUEST
88
92
  ] = datetime.now(timezone.utc)
89
93
  endpoint[
90
- model_monitoring_constants.EventFieldType.LAST_REQUEST
94
+ mlrun.common.schemas.model_monitoring.EventFieldType.LAST_REQUEST
91
95
  ] = datetime.now(timezone.utc)
92
96
 
93
97
  # Convert the result into a pandas Dataframe and write it into the database
@@ -112,7 +116,9 @@ class SQLModelEndpointStore(ModelEndpointStore):
112
116
  # Update the model endpoint record using sqlalchemy ORM
113
117
  with create_session(dsn=self.sql_connection_string) as session:
114
118
  # Remove endpoint id (foreign key) from the update query
115
- attributes.pop(model_monitoring_constants.EventFieldType.ENDPOINT_ID, None)
119
+ attributes.pop(
120
+ mlrun.common.schemas.model_monitoring.EventFieldType.ENDPOINT_ID, None
121
+ )
116
122
 
117
123
  # Generate and commit the update session query
118
124
  session.query(self.ModelEndpointsTable).filter(
@@ -201,32 +207,36 @@ class SQLModelEndpointStore(ModelEndpointStore):
201
207
  query = self._filter_values(
202
208
  query=query,
203
209
  model_endpoints_table=self.model_endpoints_table,
204
- key_filter=model_monitoring_constants.EventFieldType.MODEL,
210
+ key_filter=mlrun.common.schemas.model_monitoring.EventFieldType.MODEL,
205
211
  filtered_values=[model],
206
212
  )
207
213
  if function:
208
214
  query = self._filter_values(
209
215
  query=query,
210
216
  model_endpoints_table=self.model_endpoints_table,
211
- key_filter=model_monitoring_constants.EventFieldType.FUNCTION,
217
+ key_filter=mlrun.common.schemas.model_monitoring.EventFieldType.FUNCTION,
212
218
  filtered_values=[function],
213
219
  )
214
220
  if uids:
215
221
  query = self._filter_values(
216
222
  query=query,
217
223
  model_endpoints_table=self.model_endpoints_table,
218
- key_filter=model_monitoring_constants.EventFieldType.UID,
224
+ key_filter=mlrun.common.schemas.model_monitoring.EventFieldType.UID,
219
225
  filtered_values=uids,
220
226
  combined=False,
221
227
  )
222
228
  if top_level:
223
- node_ep = str(mlrun.common.model_monitoring.EndpointType.NODE_EP.value)
224
- router_ep = str(mlrun.common.model_monitoring.EndpointType.ROUTER.value)
229
+ node_ep = str(
230
+ mlrun.common.schemas.model_monitoring.EndpointType.NODE_EP.value
231
+ )
232
+ router_ep = str(
233
+ mlrun.common.schemas.model_monitoring.EndpointType.ROUTER.value
234
+ )
225
235
  endpoint_types = [node_ep, router_ep]
226
236
  query = self._filter_values(
227
237
  query=query,
228
238
  model_endpoints_table=self.model_endpoints_table,
229
- key_filter=model_monitoring_constants.EventFieldType.ENDPOINT_TYPE,
239
+ key_filter=mlrun.common.schemas.model_monitoring.EventFieldType.ENDPOINT_TYPE,
230
240
  filtered_values=endpoint_types,
231
241
  combined=False,
232
242
  )
@@ -303,7 +313,9 @@ class SQLModelEndpointStore(ModelEndpointStore):
303
313
 
304
314
  # Convert endpoint labels into dictionary
305
315
  endpoint_labels = json.loads(
306
- endpoint_dict.get(model_monitoring_constants.EventFieldType.LABELS)
316
+ endpoint_dict.get(
317
+ mlrun.common.schemas.model_monitoring.EventFieldType.LABELS
318
+ )
307
319
  )
308
320
 
309
321
  for label in labels:
@@ -331,7 +343,7 @@ class SQLModelEndpointStore(ModelEndpointStore):
331
343
  for endpoint_dict in endpoints:
332
344
  # Delete model endpoint record from SQL table
333
345
  self.delete_model_endpoint(
334
- endpoint_dict[model_monitoring_constants.EventFieldType.UID],
346
+ endpoint_dict[mlrun.common.schemas.model_monitoring.EventFieldType.UID],
335
347
  )
336
348
 
337
349
  def get_endpoint_real_time_metrics(