mlrun 1.7.0rc53__py3-none-any.whl → 1.7.0rc57__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/errors.py CHANGED
@@ -140,7 +140,13 @@ def err_to_str(err):
140
140
  error_strings.append(err_msg)
141
141
  err = err.__cause__
142
142
 
143
- return ", caused by: ".join(error_strings)
143
+ err_msg = ", caused by: ".join(error_strings)
144
+
145
+ # in case the error string is longer than 32k, we truncate it
146
+ # the truncation takes the first 16k, then the last 16k characters
147
+ if len(err_msg) > 32_000:
148
+ err_msg = err_msg[:16_000] + "...truncated..." + err_msg[-16_000:]
149
+ return err_msg
144
150
 
145
151
 
146
152
  # Specific Errors
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  import json
16
+ import traceback
16
17
  from typing import Any, Optional, Union
17
18
 
18
19
  import mlrun.common.schemas.alert as alert_objects
@@ -161,7 +162,10 @@ class _ApplicationErrorHandler(StepToDict):
161
162
  :param event: Application event.
162
163
  """
163
164
 
164
- logger.error(f"Error in application step: {event}")
165
+ exception_with_trace = "".join(
166
+ traceback.format_exception(None, event.error, event.error.__traceback__)
167
+ )
168
+ logger.error(f"Error in application step: {exception_with_trace}")
165
169
 
166
170
  event_data = alert_objects.Event(
167
171
  kind=alert_objects.EventKind.MM_APP_FAILED,
@@ -11,7 +11,6 @@
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
-
15
14
  import concurrent.futures
16
15
  import datetime
17
16
  import json
@@ -25,7 +24,9 @@ import nuclio
25
24
  import mlrun
26
25
  import mlrun.common.schemas.model_monitoring.constants as mm_constants
27
26
  import mlrun.data_types.infer
27
+ import mlrun.feature_store as fstore
28
28
  import mlrun.model_monitoring.db.stores
29
+ from mlrun.config import config as mlconf
29
30
  from mlrun.datastore import get_stream_pusher
30
31
  from mlrun.errors import err_to_str
31
32
  from mlrun.model_monitoring.helpers import (
@@ -286,9 +287,9 @@ class MonitoringApplicationController:
286
287
  )
287
288
 
288
289
  self.model_monitoring_access_key = self._get_model_monitoring_access_key()
289
- self.tsdb_connector = mlrun.model_monitoring.get_tsdb_connector(
290
- project=self.project
291
- )
290
+ self.storage_options = None
291
+ if mlconf.artifact_path.startswith("s3://"):
292
+ self.storage_options = mlrun.mlconf.get_s3_storage_options()
292
293
 
293
294
  @staticmethod
294
295
  def _get_model_monitoring_access_key() -> Optional[str]:
@@ -375,7 +376,7 @@ class MonitoringApplicationController:
375
376
  batch_window_generator=self._batch_window_generator,
376
377
  project=self.project,
377
378
  model_monitoring_access_key=self.model_monitoring_access_key,
378
- tsdb_connector=self.tsdb_connector,
379
+ storage_options=self.storage_options,
379
380
  )
380
381
 
381
382
  @classmethod
@@ -386,7 +387,7 @@ class MonitoringApplicationController:
386
387
  batch_window_generator: _BatchWindowGenerator,
387
388
  project: str,
388
389
  model_monitoring_access_key: str,
389
- tsdb_connector: mlrun.model_monitoring.db.tsdb.TSDBConnector,
390
+ storage_options: Optional[dict] = None,
390
391
  ) -> None:
391
392
  """
392
393
  Process a model endpoint and trigger the monitoring applications. This function running on different process
@@ -398,11 +399,13 @@ class MonitoringApplicationController:
398
399
  :param batch_window_generator: (_BatchWindowGenerator) An object that generates _BatchWindow objects.
399
400
  :param project: (str) Project name.
400
401
  :param model_monitoring_access_key: (str) Access key to apply the model monitoring process.
401
- :param tsdb_connector: (mlrun.model_monitoring.db.tsdb.TSDBConnector) TSDB connector
402
+ :param storage_options: (dict) Storage options for reading the infer parquet files.
402
403
  """
403
404
  endpoint_id = endpoint[mm_constants.EventFieldType.UID]
404
- # if false the endpoint represent batch infer step.
405
405
  has_stream = endpoint[mm_constants.EventFieldType.STREAM_PATH] != ""
406
+ m_fs = fstore.get_feature_set(
407
+ endpoint[mm_constants.EventFieldType.FEATURE_SET_URI]
408
+ )
406
409
  try:
407
410
  for application in applications_names:
408
411
  batch_window = batch_window_generator.get_batch_window(
@@ -415,12 +418,13 @@ class MonitoringApplicationController:
415
418
  )
416
419
 
417
420
  for start_infer_time, end_infer_time in batch_window.get_intervals():
418
- prediction_metric = tsdb_connector.read_predictions(
419
- endpoint_id=endpoint_id,
420
- start=start_infer_time,
421
- end=end_infer_time,
421
+ df = m_fs.to_dataframe(
422
+ start_time=start_infer_time,
423
+ end_time=end_infer_time,
424
+ time_column=mm_constants.EventFieldType.TIMESTAMP,
425
+ storage_options=storage_options,
422
426
  )
423
- if not prediction_metric.data and has_stream:
427
+ if len(df) == 0:
424
428
  logger.info(
425
429
  "No data found for the given interval",
426
430
  start=start_infer_time,
@@ -442,6 +446,7 @@ class MonitoringApplicationController:
442
446
  applications_names=[application],
443
447
  model_monitoring_access_key=model_monitoring_access_key,
444
448
  )
449
+
445
450
  except Exception:
446
451
  logger.exception(
447
452
  "Encountered an exception",
@@ -1,4 +1,4 @@
1
1
  {
2
- "git_commit": "c3604c1dbd2ea9a9732f698c20b66417322a6a71",
3
- "version": "1.7.0-rc53"
2
+ "git_commit": "e4ec8c2f525543b258cc0c190f2cf29d49f22032",
3
+ "version": "1.7.0-rc57"
4
4
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mlrun
3
- Version: 1.7.0rc53
3
+ Version: 1.7.0rc57
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,7 +1,7 @@
1
1
  mlrun/__init__.py,sha256=y08M1JcKXy5-9_5WaI9fn5aV5BxIQ5QkbduJK0OxWbA,7470
2
2
  mlrun/__main__.py,sha256=mC_Izs4kuHUHQi88QJFLN22n1kbygGM0wAirjNt7uj4,45938
3
3
  mlrun/config.py,sha256=NJG59Rl_5-mwgCdPDboRhjHD1ujW9ITYL7gtCbSMkM8,67308
4
- mlrun/errors.py,sha256=nY23dns_kTzbOrelJf0FyxLw5mglv7jo4Sx3efKS9Fs,7798
4
+ mlrun/errors.py,sha256=G8GP4_wb3v2UEbiAS8OlamC7nYJNzbSvQ3sViZlyYhk,8063
5
5
  mlrun/execution.py,sha256=nXvvN8euzjuxhJouJD8VxfK0keTTA6UoMrcD_17AL-4,44252
6
6
  mlrun/features.py,sha256=m17K_3l9Jktwb9dOwlHLTAPTlemsWrRF7dJhXUX0iJU,15429
7
7
  mlrun/k8s_utils.py,sha256=mRQMs6NzPq36vx1n5_2BfFapXysc8wv3NcrZ77_2ANA,8949
@@ -213,7 +213,7 @@ mlrun/launcher/local.py,sha256=pP9-ZrNL8OnNDEiXTAKAZQnmLpS_mCc2v-mJw329eks,11269
213
213
  mlrun/launcher/remote.py,sha256=tGICSfWtvUHeR31mbzy6gqHejmDxjPUgjtxXTWhRubg,7699
214
214
  mlrun/model_monitoring/__init__.py,sha256=dm5_j0_pwqrdzFwTaEtGnKfv2nVpNaM56nBI-oqLbNU,879
215
215
  mlrun/model_monitoring/api.py,sha256=2EHCzB_5sCDgalYPkrFbI01cSO7LVWBv9yWoooJ-a0g,28106
216
- mlrun/model_monitoring/controller.py,sha256=dvqEyoE-iCd2jqDeoUpcrQFUeoTME58i3Wa2MhYi57k,20444
216
+ mlrun/model_monitoring/controller.py,sha256=m2Z2Nwqj3A3byxrV6PAbkqzT0AsNxmlNqOk61nNJxOc,20637
217
217
  mlrun/model_monitoring/features_drift_table.py,sha256=c6GpKtpOJbuT1u5uMWDL_S-6N4YPOmlktWMqPme3KFY,25308
218
218
  mlrun/model_monitoring/helpers.py,sha256=KsbSH0kEjCPajvLUpv3q5GWyvx0bZj-JkghGJlzbLZI,12757
219
219
  mlrun/model_monitoring/model_endpoint.py,sha256=7VX0cBATqLsA4sSinDzouf41ndxqh2mf5bO9BW0G5Z4,4017
@@ -221,7 +221,7 @@ mlrun/model_monitoring/stream_processing.py,sha256=0eu1Gq1Obq87LFno6eIZ55poXoFae
221
221
  mlrun/model_monitoring/tracking_policy.py,sha256=sQq956akAQpntkrJwIgFWcEq-JpyVcg0FxgNa4h3V70,5502
222
222
  mlrun/model_monitoring/writer.py,sha256=TrBwngRmdwr67De71UCcCFsJOfcqQe8jDp0vkBvGf0o,10177
223
223
  mlrun/model_monitoring/applications/__init__.py,sha256=QYvzgCutFdAkzqKPD3mvkX_3c1X4tzd-kW8ojUOE9ic,889
224
- mlrun/model_monitoring/applications/_application_steps.py,sha256=fvZbtat7eXe5mo927_jyhq4BqWCapKZn7OVjptepIAI,7055
224
+ mlrun/model_monitoring/applications/_application_steps.py,sha256=i6gyVaZHif0xEWl60QoU4VJCJx5-KRVdR1djUKuLBjI,7222
225
225
  mlrun/model_monitoring/applications/base.py,sha256=uzc14lFlwTJnL0p2VBCzmp-CNoHd73cK_Iz0YHC1KAs,4380
226
226
  mlrun/model_monitoring/applications/context.py,sha256=vOZ_ZgUuy5UsNe22-puJSt7TB32HiZtqBdN1hegykuQ,12436
227
227
  mlrun/model_monitoring/applications/evidently_base.py,sha256=FSzmoDZP8EiSQ3tq5RmU7kJ6edh8bWaKQh0rBORjODY,5099
@@ -341,11 +341,11 @@ mlrun/utils/notifications/notification/ipython.py,sha256=ZtVL30B_Ha0VGoo4LxO-voT
341
341
  mlrun/utils/notifications/notification/slack.py,sha256=wqpFGr5BTvFO5KuUSzFfxsgmyU1Ohq7fbrGeNe9TXOk,7006
342
342
  mlrun/utils/notifications/notification/webhook.py,sha256=cb9w1Mc8ENfJBdgan7iiVHK9eVls4-R3tUxmXM-P-8I,4746
343
343
  mlrun/utils/version/__init__.py,sha256=7kkrB7hEZ3cLXoWj1kPoDwo4MaswsI2JVOBpbKgPAgc,614
344
- mlrun/utils/version/version.json,sha256=z11pCZaTqkSjSqpZnkcIcIDUvDrPsaypee2mtTI33uk,89
344
+ mlrun/utils/version/version.json,sha256=2gLjdFu6FTXJq5Qo9gVAozN80SS7B7ymDVVut5IiECM,89
345
345
  mlrun/utils/version/version.py,sha256=eEW0tqIAkU9Xifxv8Z9_qsYnNhn3YH7NRAfM-pPLt1g,1878
346
- mlrun-1.7.0rc53.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
347
- mlrun-1.7.0rc53.dist-info/METADATA,sha256=Ev6wRXaEWvw4BAczs0elYgVKH46NAI5uRPB0evISkHg,24485
348
- mlrun-1.7.0rc53.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
349
- mlrun-1.7.0rc53.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
350
- mlrun-1.7.0rc53.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
351
- mlrun-1.7.0rc53.dist-info/RECORD,,
346
+ mlrun-1.7.0rc57.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
347
+ mlrun-1.7.0rc57.dist-info/METADATA,sha256=X8t8a2srkg8jb147WeKPA5In1ZAZz73qd6_tuoR1New,24485
348
+ mlrun-1.7.0rc57.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
349
+ mlrun-1.7.0rc57.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
350
+ mlrun-1.7.0rc57.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
351
+ mlrun-1.7.0rc57.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.1.0)
2
+ Generator: setuptools (75.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5