mlrun 1.8.0rc53__py3-none-any.whl → 1.8.0rc55__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.

@@ -88,13 +88,18 @@ class ModelEndpointParser(abc.ABC, BaseModel):
88
88
 
89
89
  @classmethod
90
90
  def from_flat_dict(
91
- cls, endpoint_dict: dict, json_parse_values: Optional[list] = None
91
+ cls,
92
+ endpoint_dict: dict,
93
+ json_parse_values: Optional[list] = None,
94
+ validate: bool = True,
92
95
  ) -> "ModelEndpointParser":
93
96
  """Create a `ModelEndpointParser` object from an endpoint dictionary
94
97
 
95
98
  :param endpoint_dict: Model endpoint dictionary.
96
99
  :param json_parse_values: List of dictionary keys with a JSON string value that will be parsed into a
97
100
  dictionary using json.loads().
101
+ :param validate: Whether to validate the flattened dictionary.
102
+ Skip validation to optimize performance when it is safe to do so.
98
103
  """
99
104
  if json_parse_values is None:
100
105
  json_parse_values = cls.json_parse_values()
@@ -103,6 +108,7 @@ class ModelEndpointParser(abc.ABC, BaseModel):
103
108
  model_class=cls,
104
109
  flattened_dictionary=endpoint_dict,
105
110
  json_parse_values=json_parse_values,
111
+ validate=validate,
106
112
  )
107
113
 
108
114
 
@@ -213,17 +219,27 @@ class ModelEndpoint(BaseModel):
213
219
  return flatten_dict
214
220
 
215
221
  @classmethod
216
- def from_flat_dict(cls, endpoint_dict: dict) -> "ModelEndpoint":
222
+ def from_flat_dict(
223
+ cls, endpoint_dict: dict, validate: bool = True
224
+ ) -> "ModelEndpoint":
217
225
  """Create a `ModelEndpoint` object from an endpoint flattened dictionary. Because the provided dictionary
218
226
  is flattened, we pass it as is to the subclasses without splitting the keys into spec, metadata, and status.
219
227
 
220
228
  :param endpoint_dict: Model endpoint dictionary.
229
+ :param validate: Whether to validate the flattened dictionary.
230
+ Skip validation to optimize performance when it is safe to do so.
221
231
  """
222
232
 
223
233
  return cls(
224
- metadata=ModelEndpointMetadata.from_flat_dict(endpoint_dict=endpoint_dict),
225
- spec=ModelEndpointSpec.from_flat_dict(endpoint_dict=endpoint_dict),
226
- status=ModelEndpointStatus.from_flat_dict(endpoint_dict=endpoint_dict),
234
+ metadata=ModelEndpointMetadata.from_flat_dict(
235
+ endpoint_dict=endpoint_dict, validate=validate
236
+ ),
237
+ spec=ModelEndpointSpec.from_flat_dict(
238
+ endpoint_dict=endpoint_dict, validate=validate
239
+ ),
240
+ status=ModelEndpointStatus.from_flat_dict(
241
+ endpoint_dict=endpoint_dict, validate=validate
242
+ ),
227
243
  )
228
244
 
229
245
  def get(self, field, default=None):
@@ -311,7 +327,10 @@ class ModelEndpointMonitoringMetricNoData(_ModelEndpointMonitoringMetricValuesBa
311
327
 
312
328
 
313
329
  def _mapping_attributes(
314
- model_class: type[Model], flattened_dictionary: dict, json_parse_values: list
330
+ model_class: type[Model],
331
+ flattened_dictionary: dict,
332
+ json_parse_values: list,
333
+ validate: bool = True,
315
334
  ) -> Model:
316
335
  """Generate a `BaseModel` object with the provided dictionary attributes.
317
336
 
@@ -319,8 +338,10 @@ def _mapping_attributes(
319
338
  :param flattened_dictionary: Flattened dictionary that contains the model endpoint attributes.
320
339
  :param json_parse_values: List of dictionary keys with a JSON string value that will be parsed into a
321
340
  dictionary using json.loads().
341
+ :param validate: Whether to validate the flattened dictionary.
342
+ Skip validation to optimize performance when it is safe to do so.
322
343
  """
323
- # Get the fields of the provided base model object. These fields will be used to filter to relevent keys
344
+ # Get the fields of the provided base model object. These fields will be used to filter to relevant keys
324
345
  # from the flattened dictionary.
325
346
  wanted_keys = model_class.__fields__.keys()
326
347
 
@@ -338,7 +359,10 @@ def _mapping_attributes(
338
359
  else:
339
360
  dict_to_parse[field_key] = None
340
361
 
341
- return model_class.parse_obj(dict_to_parse)
362
+ if validate:
363
+ return model_class.parse_obj(dict_to_parse)
364
+
365
+ return model_class.construct(**dict_to_parse)
342
366
 
343
367
 
344
368
  def _json_loads_if_not_none(field: Any) -> Any:
mlrun/config.py CHANGED
@@ -591,17 +591,17 @@ default_config = {
591
591
  },
592
592
  "writer_stream_args": {
593
593
  "v3io": {
594
- "shard_count": 1,
594
+ "shard_count": 4,
595
595
  "retention_period_hours": 24,
596
- "num_workers": 1,
596
+ "num_workers": 4,
597
597
  "min_replicas": 1,
598
598
  "max_replicas": 1,
599
599
  },
600
600
  "kafka": {
601
- "partition_count": 1,
601
+ "partition_count": 4,
602
602
  # TODO: add retention period configuration
603
603
  "replication_factor": 1,
604
- "num_workers": 1,
604
+ "num_workers": 4,
605
605
  "min_replicas": 1,
606
606
  "max_replicas": 1,
607
607
  },
mlrun/db/base.py CHANGED
@@ -735,6 +735,7 @@ class RunDBInterface(ABC):
735
735
  start: Optional[datetime.datetime] = None,
736
736
  end: Optional[datetime.datetime] = None,
737
737
  tsdb_metrics: bool = True,
738
+ metric_list: Optional[list[str]] = None,
738
739
  top_level: bool = False,
739
740
  uids: Optional[list[str]] = None,
740
741
  latest_only: bool = False,
@@ -750,6 +751,7 @@ class RunDBInterface(ABC):
750
751
  function_tag: Optional[str] = None,
751
752
  endpoint_id: Optional[str] = None,
752
753
  tsdb_metrics: bool = True,
754
+ metric_list: Optional[list[str]] = None,
753
755
  feature_analysis: bool = False,
754
756
  ) -> mlrun.common.schemas.ModelEndpoint:
755
757
  pass
mlrun/db/httpdb.py CHANGED
@@ -3584,7 +3584,7 @@ class HTTPRunDB(RunDBInterface):
3584
3584
  params = {
3585
3585
  "type": type,
3586
3586
  "endpoint-id": endpoint_ids,
3587
- "events_format": events_format,
3587
+ "events-format": events_format,
3588
3588
  }
3589
3589
  error_message = (
3590
3590
  f"Failed to get model monitoring metrics,"
@@ -3720,7 +3720,7 @@ class HTTPRunDB(RunDBInterface):
3720
3720
  path=path,
3721
3721
  body=model_endpoint.json(),
3722
3722
  params={
3723
- "creation_strategy": creation_strategy,
3723
+ "creation-strategy": creation_strategy,
3724
3724
  },
3725
3725
  )
3726
3726
  return mlrun.common.schemas.ModelEndpoint(**response.json())
@@ -3750,9 +3750,9 @@ class HTTPRunDB(RunDBInterface):
3750
3750
  method=mlrun.common.types.HTTPMethod.DELETE,
3751
3751
  path=path,
3752
3752
  params={
3753
- "function_name": function_name,
3754
- "function_tag": function_tag,
3755
- "endpoint_id": endpoint_id,
3753
+ "function-name": function_name,
3754
+ "function-tag": function_tag,
3755
+ "endpoint-id": endpoint_id,
3756
3756
  },
3757
3757
  )
3758
3758
 
@@ -3768,6 +3768,7 @@ class HTTPRunDB(RunDBInterface):
3768
3768
  start: Optional[datetime] = None,
3769
3769
  end: Optional[datetime] = None,
3770
3770
  tsdb_metrics: bool = True,
3771
+ metric_list: Optional[list[str]] = None,
3771
3772
  top_level: bool = False,
3772
3773
  uids: Optional[list[str]] = None,
3773
3774
  latest_only: bool = False,
@@ -3785,6 +3786,9 @@ class HTTPRunDB(RunDBInterface):
3785
3786
  :param start: The start time to filter by.Corresponding to the `created` field.
3786
3787
  :param end: The end time to filter by. Corresponding to the `created` field.
3787
3788
  :param tsdb_metrics: Whether to include metrics from the time series DB.
3789
+ :param metric_list: List of metrics to include from the time series DB. Defaults to all metrics.
3790
+ If tsdb_metrics=False, this parameter will be ignored and no tsdb metrics
3791
+ will be included.
3788
3792
  :param top_level: Whether to return only top level model endpoints.
3789
3793
  :param uids: A list of unique ids to filter by.
3790
3794
  :param latest_only: Whether to return only the latest model endpoint version.
@@ -3799,17 +3803,18 @@ class HTTPRunDB(RunDBInterface):
3799
3803
  path=path,
3800
3804
  params={
3801
3805
  "name": names,
3802
- "model_name": model_name,
3803
- "model_tag": model_tag,
3804
- "function_name": function_name,
3805
- "function_tag": function_tag,
3806
+ "model-name": model_name,
3807
+ "model-tag": model_tag,
3808
+ "function-name": function_name,
3809
+ "function-tag": function_tag,
3806
3810
  "label": labels,
3807
3811
  "start": datetime_to_iso(start),
3808
3812
  "end": datetime_to_iso(end),
3809
- "tsdb_metrics": tsdb_metrics,
3813
+ "tsdb-metrics": tsdb_metrics,
3814
+ "metric": metric_list,
3810
3815
  "top-level": top_level,
3811
3816
  "uid": uids,
3812
- "latest_only": latest_only,
3817
+ "latest-only": latest_only,
3813
3818
  },
3814
3819
  )
3815
3820
 
@@ -3823,6 +3828,7 @@ class HTTPRunDB(RunDBInterface):
3823
3828
  function_tag: Optional[str] = None,
3824
3829
  endpoint_id: Optional[str] = None,
3825
3830
  tsdb_metrics: bool = True,
3831
+ metric_list: Optional[list[str]] = None,
3826
3832
  feature_analysis: bool = False,
3827
3833
  ) -> mlrun.common.schemas.ModelEndpoint:
3828
3834
  """
@@ -3834,6 +3840,9 @@ class HTTPRunDB(RunDBInterface):
3834
3840
  :param function_tag: The tag of the function
3835
3841
  :param endpoint_id: The id of the endpoint
3836
3842
  :param tsdb_metrics: Whether to include metrics from the time series DB.
3843
+ :param metric_list: List of metrics to include from the time series DB. Defaults to all metrics.
3844
+ If tsdb_metrics=False, this parameter will be ignored and no tsdb metrics
3845
+ will be included.
3837
3846
  :param feature_analysis: Whether to include feature analysis data (feature_stats,
3838
3847
  current_stats & drift_measures).
3839
3848
 
@@ -3847,11 +3856,12 @@ class HTTPRunDB(RunDBInterface):
3847
3856
  method=mlrun.common.types.HTTPMethod.GET,
3848
3857
  path=path,
3849
3858
  params={
3850
- "function_name": function_name,
3851
- "function_tag": function_tag,
3852
- "endpoint_id": endpoint_id,
3853
- "tsdb_metrics": tsdb_metrics,
3854
- "feature_analysis": feature_analysis,
3859
+ "function-name": function_name,
3860
+ "function-tag": function_tag,
3861
+ "endpoint-id": endpoint_id,
3862
+ "tsdb-metrics": tsdb_metrics,
3863
+ "metric": metric_list,
3864
+ "feature-analysis": feature_analysis,
3855
3865
  },
3856
3866
  )
3857
3867
 
@@ -3879,8 +3889,8 @@ class HTTPRunDB(RunDBInterface):
3879
3889
  attributes_keys = list(attributes.keys())
3880
3890
  attributes["name"] = name
3881
3891
  attributes["project"] = project
3882
- attributes["function_name"] = function_name or None
3883
- attributes["function_tag"] = function_tag or None
3892
+ attributes["function-name"] = function_name or None
3893
+ attributes["function-tag"] = function_tag or None
3884
3894
  attributes["uid"] = endpoint_id or None
3885
3895
  model_endpoint = mlrun.common.schemas.ModelEndpoint.from_flat_dict(attributes)
3886
3896
  path = f"projects/{project}/model-endpoints"
mlrun/db/nopdb.py CHANGED
@@ -632,6 +632,7 @@ class NopDB(RunDBInterface):
632
632
  start: Optional[datetime.datetime] = None,
633
633
  end: Optional[datetime.datetime] = None,
634
634
  tsdb_metrics: bool = True,
635
+ metric_list: Optional[list[str]] = None,
635
636
  top_level: bool = False,
636
637
  uids: Optional[list[str]] = None,
637
638
  latest_only: bool = False,
@@ -646,6 +647,7 @@ class NopDB(RunDBInterface):
646
647
  function_tag: Optional[str] = None,
647
648
  endpoint_id: Optional[str] = None,
648
649
  tsdb_metrics: bool = True,
650
+ metric_list: Optional[list[str]] = None,
649
651
  feature_analysis: bool = False,
650
652
  ) -> mlrun.common.schemas.ModelEndpoint:
651
653
  pass
@@ -96,7 +96,9 @@ class _PushToMonitoringWriter(StepToDict):
96
96
  logger.debug(
97
97
  "Pushing data to output stream", writer_event=str(writer_event)
98
98
  )
99
- self.output_stream.push([writer_event])
99
+ self.output_stream.push(
100
+ [writer_event], partition_key=application_context.endpoint_id
101
+ )
100
102
  logger.debug("Pushed data to output stream successfully")
101
103
 
102
104
  def _lazy_init(self):
@@ -673,7 +673,9 @@ class MonitoringApplicationController:
673
673
  """
674
674
  logger.info("Starting monitoring controller chief")
675
675
  applications_names = []
676
- endpoints = self.project_obj.list_model_endpoints(tsdb_metrics=True).endpoints
676
+ endpoints = self.project_obj.list_model_endpoints(
677
+ metric_list=["last_request"]
678
+ ).endpoints
677
679
  if not endpoints:
678
680
  logger.info("No model endpoints found", project=self.project)
679
681
  return
@@ -332,6 +332,7 @@ class TSDBConnector(ABC):
332
332
  model_endpoint_objects: list[mlrun.common.schemas.ModelEndpoint],
333
333
  project: str,
334
334
  run_in_threadpool: Callable,
335
+ metric_list: Optional[list[str]] = None,
335
336
  ) -> list[mlrun.common.schemas.ModelEndpoint]:
336
337
  raise NotImplementedError()
337
338
 
@@ -12,7 +12,6 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- import asyncio
16
15
  from datetime import datetime, timedelta
17
16
  from threading import Lock
18
17
  from typing import Callable, Final, Literal, Optional, Union
@@ -908,6 +907,7 @@ class TDEngineConnector(TSDBConnector):
908
907
  model_endpoint_objects: list[mlrun.common.schemas.ModelEndpoint],
909
908
  project: str,
910
909
  run_in_threadpool: Callable,
910
+ metric_list: Optional[list[str]] = None,
911
911
  ) -> list[mlrun.common.schemas.ModelEndpoint]:
912
912
  """
913
913
  Add basic metrics to the model endpoint object.
@@ -916,24 +916,28 @@ class TDEngineConnector(TSDBConnector):
916
916
  be filled with the relevant basic metrics.
917
917
  :param project: The name of the project.
918
918
  :param run_in_threadpool: A function that runs another function in a thread pool.
919
+ :param metric_list: List of metrics to include from the time series DB. Defaults to all metrics.
919
920
 
920
921
  :return: A list of `ModelEndpointMonitoringMetric` objects.
921
922
  """
922
923
 
923
924
  uids = [mep.metadata.uid for mep in model_endpoint_objects]
924
- coroutines = [
925
- run_in_threadpool(self.get_error_count, endpoint_ids=uids),
926
- run_in_threadpool(self.get_last_request, endpoint_ids=uids),
927
- run_in_threadpool(self.get_avg_latency, endpoint_ids=uids),
928
- run_in_threadpool(self.get_drift_status, endpoint_ids=uids),
929
- ]
930
-
931
- (
932
- error_count_df,
933
- last_request_df,
934
- avg_latency_df,
935
- drift_status_df,
936
- ) = await asyncio.gather(*coroutines)
925
+
926
+ metric_name_to_function = {
927
+ "error_count": self.get_error_count,
928
+ "last_request": self.get_last_request,
929
+ "avg_latency": self.get_avg_latency,
930
+ "result_status": self.get_drift_status,
931
+ }
932
+ if metric_list is not None:
933
+ for metric_name in list(metric_name_to_function):
934
+ if metric_name not in metric_list:
935
+ del metric_name_to_function[metric_name]
936
+
937
+ metric_name_to_df = {
938
+ metric_name: function(endpoint_ids=uids)
939
+ for metric_name, function in metric_name_to_function.items()
940
+ }
937
941
 
938
942
  def add_metrics(
939
943
  mep: mlrun.common.schemas.ModelEndpoint,
@@ -955,12 +959,7 @@ class TDEngineConnector(TSDBConnector):
955
959
  map(
956
960
  lambda mep: add_metrics(
957
961
  mep=mep,
958
- df_dictionary={
959
- "error_count": error_count_df,
960
- "last_request": last_request_df,
961
- "avg_latency": avg_latency_df,
962
- "result_status": drift_status_df,
963
- },
962
+ df_dictionary=metric_name_to_df,
964
963
  ),
965
964
  model_endpoint_objects,
966
965
  )
@@ -1085,6 +1085,7 @@ class V3IOTSDBConnector(TSDBConnector):
1085
1085
  model_endpoint_objects: list[mlrun.common.schemas.ModelEndpoint],
1086
1086
  project: str,
1087
1087
  run_in_threadpool: Callable,
1088
+ metric_list: Optional[list[str]] = None,
1088
1089
  ) -> list[mlrun.common.schemas.ModelEndpoint]:
1089
1090
  """
1090
1091
  Fetch basic metrics from V3IO TSDB and add them to MEP objects.
@@ -1093,6 +1094,7 @@ class V3IOTSDBConnector(TSDBConnector):
1093
1094
  be filled with the relevant basic metrics.
1094
1095
  :param project: The name of the project.
1095
1096
  :param run_in_threadpool: A function that runs another function in a thread pool.
1097
+ :param metric_list: List of metrics to include from the time series DB. Defaults to all metrics.
1096
1098
 
1097
1099
  :return: A list of `ModelEndpointMonitoringMetric` objects.
1098
1100
  """
@@ -1104,15 +1106,27 @@ class V3IOTSDBConnector(TSDBConnector):
1104
1106
  uids.append(uid)
1105
1107
  model_endpoint_objects_by_uid[uid] = model_endpoint_object
1106
1108
 
1107
- error_count_res = await run_in_threadpool(
1108
- self.get_error_count, endpoint_ids=uids, get_raw=True
1109
- )
1110
- avg_latency_res = await run_in_threadpool(
1111
- self.get_avg_latency, endpoint_ids=uids, get_raw=True
1112
- )
1113
- drift_status_res = await run_in_threadpool(
1114
- self.get_drift_status, endpoint_ids=uids, get_raw=True
1115
- )
1109
+ metric_name_to_function_and_column_name = {
1110
+ "error_count": (self.get_error_count, "count(error_count)"),
1111
+ "avg_latency": (self.get_avg_latency, "avg(latency)"),
1112
+ "result_status": (self.get_drift_status, "max(result_status)"),
1113
+ }
1114
+ if metric_list is not None:
1115
+ for metric_name in list(metric_name_to_function_and_column_name):
1116
+ if metric_name not in metric_list:
1117
+ del metric_name_to_function_and_column_name[metric_name]
1118
+
1119
+ metric_name_to_result = {}
1120
+
1121
+ for metric_name, (
1122
+ function,
1123
+ _,
1124
+ ) in metric_name_to_function_and_column_name.items():
1125
+ metric_name_to_result[metric_name] = await run_in_threadpool(
1126
+ function,
1127
+ endpoint_ids=uids,
1128
+ get_raw=True,
1129
+ )
1116
1130
 
1117
1131
  def add_metric(
1118
1132
  metric: str,
@@ -1128,26 +1142,16 @@ class V3IOTSDBConnector(TSDBConnector):
1128
1142
  if mep and value is not None and not math.isnan(value):
1129
1143
  setattr(mep.status, metric, value)
1130
1144
 
1131
- add_metric(
1132
- "error_count",
1133
- "count(error_count)",
1134
- error_count_res,
1135
- )
1136
-
1137
- add_metric(
1138
- "avg_latency",
1139
- "avg(latency)",
1140
- avg_latency_res,
1141
- )
1142
- add_metric(
1143
- "result_status",
1144
- "max(result_status)",
1145
- drift_status_res,
1146
- )
1147
-
1148
- self._enrich_mep_with_last_request(
1149
- model_endpoint_objects_by_uid=model_endpoint_objects_by_uid
1150
- )
1145
+ for metric_name, result in metric_name_to_result.items():
1146
+ add_metric(
1147
+ metric_name,
1148
+ metric_name_to_function_and_column_name[metric_name][1],
1149
+ result,
1150
+ )
1151
+ if metric_list is None or "last_request" in metric_list:
1152
+ self._enrich_mep_with_last_request(
1153
+ model_endpoint_objects_by_uid=model_endpoint_objects_by_uid
1154
+ )
1151
1155
 
1152
1156
  return list(model_endpoint_objects_by_uid.values())
1153
1157
 
mlrun/projects/project.py CHANGED
@@ -3796,6 +3796,7 @@ class MlrunProject(ModelObj):
3796
3796
  uids: Optional[list[str]] = None,
3797
3797
  latest_only: bool = False,
3798
3798
  tsdb_metrics: bool = True,
3799
+ metric_list: Optional[list[str]] = None,
3799
3800
  ) -> mlrun.common.schemas.ModelEndpointList:
3800
3801
  """
3801
3802
  Returns a list of `ModelEndpoint` objects. Each `ModelEndpoint` object represents the current state of a
@@ -3825,10 +3826,15 @@ class MlrunProject(ModelObj):
3825
3826
  or just `"label"` for key existence.
3826
3827
  - A comma-separated string formatted as `"label1=value1,label2"` to match entities with
3827
3828
  the specified key-value pairs or key existence.
3828
- :param start: The start time to filter by.Corresponding to the `created` field.
3829
- :param end: The end time to filter by. Corresponding to the `created` field.
3830
- :param top_level: if true will return only routers and endpoint that are NOT children of any router
3831
- :param uids: if passed will return a list `ModelEndpoint` object with uid in uids
3829
+ :param start: The start time to filter by.Corresponding to the `created` field.
3830
+ :param end: The end time to filter by. Corresponding to the `created` field.
3831
+ :param top_level: If true will return only routers and endpoint that are NOT children of any router.
3832
+ :param uids: If passed will return a list `ModelEndpoint` object with uid in uids.
3833
+ :param tsdb_metrics: When True, the time series metrics will be added to the output
3834
+ of the resulting.
3835
+ :param metric_list: List of metrics to include from the time series DB. Defaults to all metrics.
3836
+ If tsdb_metrics=False, this parameter will be ignored and no tsdb metrics
3837
+ will be included.
3832
3838
 
3833
3839
  :returns: Returns a list of `ModelEndpoint` objects.
3834
3840
  """
@@ -3847,6 +3853,7 @@ class MlrunProject(ModelObj):
3847
3853
  uids=uids,
3848
3854
  latest_only=latest_only,
3849
3855
  tsdb_metrics=tsdb_metrics,
3856
+ metric_list=metric_list,
3850
3857
  )
3851
3858
 
3852
3859
  def run_function(
@@ -1000,7 +1000,7 @@ class RemoteRuntime(KubeResource):
1000
1000
  else:
1001
1001
  http_client_kwargs["json"] = body
1002
1002
  try:
1003
- logger.info("Invoking function", method=method, path=path)
1003
+ logger.debug("Invoking function", method=method, path=path)
1004
1004
  if not getattr(self, "_http_session", None):
1005
1005
  self._http_session = requests.Session()
1006
1006
  resp = self._http_session.request(
@@ -16,6 +16,7 @@ import re
16
16
  import typing
17
17
 
18
18
  import aiohttp
19
+ import orjson
19
20
 
20
21
  import mlrun.common.schemas
21
22
  import mlrun.lists
@@ -86,9 +87,14 @@ class WebhookNotification(NotificationBase):
86
87
  # we automatically handle it as `ssl=None` for their convenience.
87
88
  verify_ssl = verify_ssl and None if url.startswith("https") else None
88
89
 
89
- async with aiohttp.ClientSession() as session:
90
+ async with aiohttp.ClientSession(
91
+ json_serialize=self._encoder,
92
+ ) as session:
90
93
  response = await getattr(session, method)(
91
- url, headers=headers, json=request_body, ssl=verify_ssl
94
+ url,
95
+ headers=headers,
96
+ json=request_body,
97
+ ssl=verify_ssl,
92
98
  )
93
99
  response.raise_for_status()
94
100
 
@@ -128,3 +134,13 @@ class WebhookNotification(NotificationBase):
128
134
  )
129
135
 
130
136
  return override_body
137
+
138
+ @property
139
+ def _encoder(self):
140
+ return lambda body: orjson.dumps(
141
+ body,
142
+ option=orjson.OPT_NAIVE_UTC
143
+ | orjson.OPT_SERIALIZE_NUMPY
144
+ | orjson.OPT_NON_STR_KEYS
145
+ | orjson.OPT_SORT_KEYS,
146
+ ).decode()
@@ -1,4 +1,4 @@
1
1
  {
2
- "git_commit": "bcd5b00b8d8aa1764320930cd71911bb702f987b",
3
- "version": "1.8.0-rc53"
2
+ "git_commit": "3b941a1d577b40febe419e448b3b4da3cc85d127",
3
+ "version": "1.8.0-rc55"
4
4
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mlrun
3
- Version: 1.8.0rc53
3
+ Version: 1.8.0rc55
4
4
  Summary: Tracking and config of machine learning runs
5
5
  Home-page: https://github.com/mlrun/mlrun
6
6
  Author: Yaron Haviv
@@ -1,6 +1,6 @@
1
1
  mlrun/__init__.py,sha256=Cqm9U9eCEdLpMejhU2BEhubu0mHL71igJJIwYa738EA,7450
2
2
  mlrun/__main__.py,sha256=0NDzPf9VFRO8KFfGgb8mkGUPIDS285aASV8Hbxs-ND0,45920
3
- mlrun/config.py,sha256=yfG69T-Gnu3Nps2tq_xKHM6C4d7ok7ulhHDo-1mJrSk,72126
3
+ mlrun/config.py,sha256=sYNeLy-LztiWnmfGmM-LMcGEDv6PM_8b7e_YjIcoDzs,72126
4
4
  mlrun/errors.py,sha256=LkcbXTLANGdsgo2CRX2pdbyNmt--lMsjGv0XZMgP-Nc,8222
5
5
  mlrun/execution.py,sha256=FUktsD3puSFjc3LZJU35b-OmFBrBPBNntViCLQVuwnk,50008
6
6
  mlrun/features.py,sha256=ReBaNGsBYXqcbgI012n-SO_j6oHIbk_Vpv0CGPXbUmo,15842
@@ -75,7 +75,7 @@ mlrun/common/schemas/workflow.py,sha256=6u9niXfXpV-_c2rZL97gFIdAnOfM5WK-OCbrM5Kk
75
75
  mlrun/common/schemas/model_monitoring/__init__.py,sha256=SxHG-GIdcTEuFxpKzkUdT9zKaU5Xqz9qF1uCwXvZ2z8,1709
76
76
  mlrun/common/schemas/model_monitoring/constants.py,sha256=wbNe_n5wX98gD1XQ6jmt97Jh59S9GsE54UBPZl9Pg20,12570
77
77
  mlrun/common/schemas/model_monitoring/grafana.py,sha256=THQlLfPBevBksta8p5OaIsBaJtsNSXexLvHrDxOaVns,2095
78
- mlrun/common/schemas/model_monitoring/model_endpoints.py,sha256=O0i-pvzcXJVgf9E_tNcudDTa1xLaJchzPGfZZ8MNdD4,11482
78
+ mlrun/common/schemas/model_monitoring/model_endpoints.py,sha256=YYFai89qBTnKM8dSUncVD25uwz8QdcTLrEb7vMefyTc,12391
79
79
  mlrun/data_types/__init__.py,sha256=wdxGS1PTnaKXiNZ7PYGxxo86OifHH7NYoArIjDJksLA,1054
80
80
  mlrun/data_types/data_types.py,sha256=0_oKLC6-sXL2_nnaDMP_HSXB3fD1nJAG4J2Jq6sGNNw,4998
81
81
  mlrun/data_types/infer.py,sha256=Ogp3rsENVkjU0GDaGa9J1vjGrvMxgzwbSEuG51nt61E,6477
@@ -108,10 +108,10 @@ mlrun/datastore/wasbfs/__init__.py,sha256=s5Ul-0kAhYqFjKDR2X0O2vDGDbLQQduElb32Ev
108
108
  mlrun/datastore/wasbfs/fs.py,sha256=ge8NK__5vTcFT-krI155_8RDUywQw4SIRX6BWATXy9Q,6299
109
109
  mlrun/db/__init__.py,sha256=WqJ4x8lqJ7ZoKbhEyFqkYADd9P6E3citckx9e9ZLcIU,1163
110
110
  mlrun/db/auth_utils.py,sha256=hpg8D2r82oN0BWabuWN04BTNZ7jYMAF242YSUpK7LFM,5211
111
- mlrun/db/base.py,sha256=Uo28PyTRkauFLGHZPF6IkDbF-WyEA03GObC3su87Pr8,30716
111
+ mlrun/db/base.py,sha256=4ILHlN9vMw3n78qiiTJ1997ykgDKKqxDkLl7lHVVKJg,30814
112
112
  mlrun/db/factory.py,sha256=yP2vVmveUE7LYTCHbS6lQIxP9rW--zdISWuPd_I3d_4,2111
113
- mlrun/db/httpdb.py,sha256=l4qdr7MWfLHuq3gV5fHQspLbAxXbJinGlN0kO-sqftA,231598
114
- mlrun/db/nopdb.py,sha256=TwyU1B6Z4S6n5iu6pftxRqimhvroz1PnPwFhAoXxr4c,27098
113
+ mlrun/db/httpdb.py,sha256=if4W3yiBq3NMjzQU2GdS1ToBnKGxj601T-sIS2zx1og,232337
114
+ mlrun/db/nopdb.py,sha256=4TujePdRef5WpZY-TiGL9BmXphilNAypKREiGnqnKtg,27196
115
115
  mlrun/feature_store/__init__.py,sha256=SlI845bWt6xX34SXunHHqhmFAR9-5v2ak8N-qpcAPGo,1328
116
116
  mlrun/feature_store/api.py,sha256=qKj5Tk6prTab6XWatWhBuPRVp0eJEctoxRMN2wz48vA,32168
117
117
  mlrun/feature_store/common.py,sha256=Z7USI-d1fo0iwBMsqMBtJflJfyuiV3BLoDXQPSAoBAs,12826
@@ -219,14 +219,14 @@ mlrun/launcher/local.py,sha256=775HY-8S9LFUX5ubGXrLO0N1lVh8bn-DHFmNYuNqQPA,11451
219
219
  mlrun/launcher/remote.py,sha256=rLJW4UAnUT5iUb4BsGBOAV3K4R29a0X4lFtRkVKlyYU,7709
220
220
  mlrun/model_monitoring/__init__.py,sha256=ELy7njEtZnz09Dc6PGZSFFEGtnwI15bJNWM3Pj4_YIs,753
221
221
  mlrun/model_monitoring/api.py,sha256=LU58dzE4QZiMH23lgiqfI__3m2E3eEZP-DQe2ioUSwM,28317
222
- mlrun/model_monitoring/controller.py,sha256=m4Zx_NQ0C-A7WtjBoXnqBmS11RRtLvBaFgbFbIgrdVc,36847
222
+ mlrun/model_monitoring/controller.py,sha256=V5eLOIYsVB6SYMlDQD3--FEW2qN133D1J5I61yzMDn0,36880
223
223
  mlrun/model_monitoring/features_drift_table.py,sha256=c6GpKtpOJbuT1u5uMWDL_S-6N4YPOmlktWMqPme3KFY,25308
224
224
  mlrun/model_monitoring/helpers.py,sha256=8QsoYRPOVSnR3Lcv99m4XYrp_cR6hSqBUflYSOkJmFQ,21019
225
225
  mlrun/model_monitoring/stream_processing.py,sha256=Gu3TQzYoNjbreZYI73-F49QpYrod9RZOyGSgininBsA,33373
226
226
  mlrun/model_monitoring/tracking_policy.py,sha256=PBIGrUYWrwcE5gwXupBIVzOb0QRRwPJsgQm_yLGQxB4,5595
227
227
  mlrun/model_monitoring/writer.py,sha256=ibbhvfSHb8Reqlb7RGFEAUNM4iTyK1gk8-2m46mP6VM,8428
228
228
  mlrun/model_monitoring/applications/__init__.py,sha256=xDBxkBjl-whHSG_4t1mLkxiypLH-fzn8TmAW9Mjo2uI,759
229
- mlrun/model_monitoring/applications/_application_steps.py,sha256=PxULZznKW66Oq-fKaraOAbsTuGnV0zgXh6_91wX3KUo,8367
229
+ mlrun/model_monitoring/applications/_application_steps.py,sha256=mjuBVqa7KY_Ymoo8DzddthUpBZyfio2e4O5ce-d-2eY,8444
230
230
  mlrun/model_monitoring/applications/base.py,sha256=f73LycKUG85invl6l7V4MRiRd1bx8jmepayrpwpr3c0,25131
231
231
  mlrun/model_monitoring/applications/context.py,sha256=VfyPCIdO4z73uqFcJs87jzSI4PatX5N5Xicg8Ye1Bag,16968
232
232
  mlrun/model_monitoring/applications/histogram_data_drift.py,sha256=2qgfFmrpHf-x0_EaHD-0T28piwSQzw-HH71aV1GwbZs,15389
@@ -237,15 +237,15 @@ mlrun/model_monitoring/db/__init__.py,sha256=r47xPGZpIfMuv8J3PQCZTSqVPMhUta4sSJC
237
237
  mlrun/model_monitoring/db/_schedules.py,sha256=RWn4wtKsIXg668gMLpxO9I8GlkxvPSaA5y7w-wFDcgE,9048
238
238
  mlrun/model_monitoring/db/_stats.py,sha256=VVMWLMqG3Us3ozBkLaokJF22Ewv8WKmVE1-OvS_g9vA,6943
239
239
  mlrun/model_monitoring/db/tsdb/__init__.py,sha256=4S86V_Ot_skE16SLkw0WwsaAUB0ECH6SoJdp-TIu6s8,4645
240
- mlrun/model_monitoring/db/tsdb/base.py,sha256=55lZfKmAWPW_Zi8DJhGib6euYhRhNxEpj528_rfh9Ww,26894
240
+ mlrun/model_monitoring/db/tsdb/base.py,sha256=g3IYIu45F296JDLaAedZw2h-vvsQPsEsYzALfT7_d60,26943
241
241
  mlrun/model_monitoring/db/tsdb/helpers.py,sha256=0oUXc4aUkYtP2SGP6jTb3uPPKImIUsVsrb9otX9a7O4,1189
242
242
  mlrun/model_monitoring/db/tsdb/tdengine/__init__.py,sha256=vgBdsKaXUURKqIf3M0y4sRatmSVA4CQiJs7J5dcVBkQ,620
243
243
  mlrun/model_monitoring/db/tsdb/tdengine/schemas.py,sha256=EslhaR65jfeNdD5Ibk-3Hb4e5r5qYPfHb9rTChX3sG0,12689
244
244
  mlrun/model_monitoring/db/tsdb/tdengine/stream_graph_steps.py,sha256=Uadj0UvAmln2MxDWod-kAzau1uNlqZh981rPhbUH_5M,2857
245
- mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py,sha256=rpE-RB5sqe5GAkd9MZB4JFzSP1skxs0loC5hhAkNgKk,38747
245
+ mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py,sha256=utQsSsTWKLku30sXqq-ZbSP5yP2dghAiOkbVufK3aoQ,38797
246
246
  mlrun/model_monitoring/db/tsdb/v3io/__init__.py,sha256=aL3bfmQsUQ-sbvKGdNihFj8gLCK3mSys0qDcXtYOwgc,616
247
247
  mlrun/model_monitoring/db/tsdb/v3io/stream_graph_steps.py,sha256=_-zo9relCDtjGgievxAcAP9gVN9nDWs8BzGtFwTjb9M,6284
248
- mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py,sha256=IzdThNwWMBWo0D0VzXV-WVvGg-z7Y9e8ke8_LYJTeVA,46214
248
+ mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py,sha256=YltUZBPNJbaqOQljiOcVBZBjSYpGxIPcnA7tUiLqvr8,46806
249
249
  mlrun/model_monitoring/metrics/__init__.py,sha256=6CsTXAxeLbbf8yfCADTaxmiavqwrLEdYFJ-qc5kgDAY,569
250
250
  mlrun/model_monitoring/metrics/histogram_distance.py,sha256=E9_WIl2vd6qNvoHVHoFcnuQk3ekbFWOdi8aU7sHrfk4,4724
251
251
  mlrun/package/__init__.py,sha256=v7VDyK9kDOOuDvFo4oiGV2fx-vM1KL7fdN9pGLakhUQ,7008
@@ -270,7 +270,7 @@ mlrun/platforms/iguazio.py,sha256=6VBTq8eQ3mzT96tzjYhAtcMQ2VjF4x8LpIPW5DAcX2Q,13
270
270
  mlrun/projects/__init__.py,sha256=0Krf0WIKfnZa71WthYOg0SoaTodGg3sV_hK3f_OlTPI,1220
271
271
  mlrun/projects/operations.py,sha256=TzPbTYBgmYrjxTKP_wOtBJYFFFwDCQtaVvF1Snr0TfM,20029
272
272
  mlrun/projects/pipelines.py,sha256=wud7ezeEmhIJvfYE_wzQbA4ygEfGXHtbOtoOpan6poY,48556
273
- mlrun/projects/project.py,sha256=WsNZUz_k52llBI5rLBwJeGuIzSlAapVXBQfCL7NVI8E,235765
273
+ mlrun/projects/project.py,sha256=COaV9EQTmoE6_gatZFqaxaYTqdU-CWDaED7i-BATU7c,236260
274
274
  mlrun/runtimes/__init__.py,sha256=J9Sy2HiyMlztNv6VUurMzF5H2XzttNil8nRsWDsqLyg,8923
275
275
  mlrun/runtimes/base.py,sha256=EL14Kmc1vWEjnBPJwLj5hHC6CtRAQHJLmohCD3sFEHo,37855
276
276
  mlrun/runtimes/daskjob.py,sha256=JwuGvOiPsxEDHHMMUS4Oie4hLlYYIZwihAl6DjroTY0,19521
@@ -292,7 +292,7 @@ mlrun/runtimes/mpijob/abstract.py,sha256=JGMjcJ4dvpJbctF6psU9UvYyNCutMxTMgBQeTlz
292
292
  mlrun/runtimes/mpijob/v1.py,sha256=1XQZC7AIMGX_AQCbApcwpH8I7y39-v0v2O35MvxjXoo,3213
293
293
  mlrun/runtimes/nuclio/__init__.py,sha256=gx1kizzKv8pGT5TNloN1js1hdbxqDw3rM90sLVYVffY,794
294
294
  mlrun/runtimes/nuclio/api_gateway.py,sha256=vH9ClKVP4Mb24rvA67xPuAvAhX-gAv6vVtjVxyplhdc,26969
295
- mlrun/runtimes/nuclio/function.py,sha256=8wzAFYCpSs0KoGPSN6DC19smSfYh8dVqDUhpicr8sJ0,54540
295
+ mlrun/runtimes/nuclio/function.py,sha256=mJ719djvzin7ee9QKoD-DIItuOUvTgrDHhzHgr1Q5zI,54541
296
296
  mlrun/runtimes/nuclio/nuclio.py,sha256=sLK8KdGO1LbftlL3HqPZlFOFTAAuxJACZCVl1c0Ha6E,2942
297
297
  mlrun/runtimes/nuclio/serving.py,sha256=d0nzPALUYXO4fKFFhxW3hY-_NU-ZhBLWXa2vWIetBRI,33434
298
298
  mlrun/runtimes/nuclio/application/__init__.py,sha256=rRs5vasy_G9IyoTpYIjYDafGoL6ifFBKgBtsXn31Atw,614
@@ -338,13 +338,13 @@ mlrun/utils/notifications/notification/git.py,sha256=t2lqRrPRBO4awf_uhxJreH9Cpcb
338
338
  mlrun/utils/notifications/notification/ipython.py,sha256=9uZvI1uOLFaNuAsfJPXmL3l6dOzFoWdBK5GYNYFAfks,2282
339
339
  mlrun/utils/notifications/notification/mail.py,sha256=ZyJ3eqd8simxffQmXzqd3bgbAqp1vij7C6aRJ9h2mgs,6012
340
340
  mlrun/utils/notifications/notification/slack.py,sha256=eQvmctTh6wIG5xVOesLLV9S1-UUCu5UEQ9JIJOor3ts,7183
341
- mlrun/utils/notifications/notification/webhook.py,sha256=NeyIMSBojjjTJaUHmPbxMByp34GxYkl1-16NqzU27fU,4943
341
+ mlrun/utils/notifications/notification/webhook.py,sha256=zxh8CAlbPnTazsk6r05X5TKwqUZVOH5KBU2fJbzQlG4,5330
342
342
  mlrun/utils/version/__init__.py,sha256=7kkrB7hEZ3cLXoWj1kPoDwo4MaswsI2JVOBpbKgPAgc,614
343
- mlrun/utils/version/version.json,sha256=YCYIErwYFdphdt1gyALt7AHS4gIIpRRcqXFuVI9m-WI,89
343
+ mlrun/utils/version/version.json,sha256=uGWC8p0f3GV14zi6vIEuExlx7M_nQbyFGSfe0CccBo0,89
344
344
  mlrun/utils/version/version.py,sha256=eEW0tqIAkU9Xifxv8Z9_qsYnNhn3YH7NRAfM-pPLt1g,1878
345
- mlrun-1.8.0rc53.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
346
- mlrun-1.8.0rc53.dist-info/METADATA,sha256=-5Z1uO9gV8K4ND_J8XANiJPSNmsMvnyr1ZAZeenopEE,26009
347
- mlrun-1.8.0rc53.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
348
- mlrun-1.8.0rc53.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
349
- mlrun-1.8.0rc53.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
350
- mlrun-1.8.0rc53.dist-info/RECORD,,
345
+ mlrun-1.8.0rc55.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
346
+ mlrun-1.8.0rc55.dist-info/METADATA,sha256=yAY1-rwKAxNl2yJh7mfkg4z5rrgQ9XBPWPztSLswSNc,26009
347
+ mlrun-1.8.0rc55.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
348
+ mlrun-1.8.0rc55.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
349
+ mlrun-1.8.0rc55.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
350
+ mlrun-1.8.0rc55.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5