mlrun 1.7.0rc20__py3-none-any.whl → 1.7.0rc28__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 (92) hide show
  1. mlrun/__main__.py +10 -8
  2. mlrun/alerts/alert.py +55 -18
  3. mlrun/api/schemas/__init__.py +3 -3
  4. mlrun/artifacts/manager.py +26 -0
  5. mlrun/common/constants.py +3 -2
  6. mlrun/common/formatters/__init__.py +1 -0
  7. mlrun/common/formatters/artifact.py +26 -3
  8. mlrun/common/formatters/base.py +44 -9
  9. mlrun/common/formatters/function.py +12 -7
  10. mlrun/common/formatters/run.py +26 -0
  11. mlrun/common/helpers.py +11 -0
  12. mlrun/common/schemas/__init__.py +4 -0
  13. mlrun/common/schemas/alert.py +5 -9
  14. mlrun/common/schemas/api_gateway.py +64 -16
  15. mlrun/common/schemas/artifact.py +11 -0
  16. mlrun/common/schemas/constants.py +3 -0
  17. mlrun/common/schemas/feature_store.py +58 -28
  18. mlrun/common/schemas/model_monitoring/constants.py +21 -12
  19. mlrun/common/schemas/model_monitoring/model_endpoints.py +0 -12
  20. mlrun/common/schemas/pipeline.py +16 -0
  21. mlrun/common/schemas/project.py +17 -0
  22. mlrun/common/schemas/runs.py +17 -0
  23. mlrun/common/schemas/schedule.py +1 -1
  24. mlrun/common/types.py +6 -0
  25. mlrun/config.py +17 -25
  26. mlrun/datastore/azure_blob.py +2 -1
  27. mlrun/datastore/datastore.py +3 -3
  28. mlrun/datastore/google_cloud_storage.py +6 -2
  29. mlrun/datastore/snowflake_utils.py +3 -1
  30. mlrun/datastore/sources.py +26 -11
  31. mlrun/datastore/store_resources.py +2 -0
  32. mlrun/datastore/targets.py +68 -16
  33. mlrun/db/base.py +83 -2
  34. mlrun/db/httpdb.py +280 -63
  35. mlrun/db/nopdb.py +60 -3
  36. mlrun/errors.py +5 -3
  37. mlrun/execution.py +28 -13
  38. mlrun/feature_store/feature_vector.py +8 -0
  39. mlrun/feature_store/retrieval/spark_merger.py +13 -2
  40. mlrun/launcher/local.py +4 -0
  41. mlrun/launcher/remote.py +1 -0
  42. mlrun/model.py +32 -3
  43. mlrun/model_monitoring/api.py +7 -52
  44. mlrun/model_monitoring/applications/base.py +5 -7
  45. mlrun/model_monitoring/applications/histogram_data_drift.py +1 -1
  46. mlrun/model_monitoring/db/stores/__init__.py +37 -24
  47. mlrun/model_monitoring/db/stores/base/store.py +40 -1
  48. mlrun/model_monitoring/db/stores/sqldb/sql_store.py +42 -87
  49. mlrun/model_monitoring/db/stores/v3io_kv/kv_store.py +27 -35
  50. mlrun/model_monitoring/db/tsdb/__init__.py +15 -15
  51. mlrun/model_monitoring/db/tsdb/base.py +1 -14
  52. mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py +22 -18
  53. mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +86 -56
  54. mlrun/model_monitoring/helpers.py +34 -9
  55. mlrun/model_monitoring/stream_processing.py +12 -11
  56. mlrun/model_monitoring/writer.py +11 -11
  57. mlrun/projects/operations.py +5 -0
  58. mlrun/projects/pipelines.py +35 -21
  59. mlrun/projects/project.py +216 -107
  60. mlrun/render.py +10 -5
  61. mlrun/run.py +15 -5
  62. mlrun/runtimes/__init__.py +2 -0
  63. mlrun/runtimes/base.py +17 -4
  64. mlrun/runtimes/daskjob.py +8 -1
  65. mlrun/runtimes/databricks_job/databricks_runtime.py +1 -0
  66. mlrun/runtimes/local.py +23 -4
  67. mlrun/runtimes/nuclio/application/application.py +0 -2
  68. mlrun/runtimes/nuclio/function.py +31 -2
  69. mlrun/runtimes/nuclio/serving.py +9 -6
  70. mlrun/runtimes/pod.py +5 -29
  71. mlrun/runtimes/remotesparkjob.py +8 -2
  72. mlrun/serving/__init__.py +8 -1
  73. mlrun/serving/routers.py +75 -59
  74. mlrun/serving/server.py +11 -0
  75. mlrun/serving/states.py +80 -8
  76. mlrun/serving/utils.py +19 -11
  77. mlrun/serving/v2_serving.py +66 -39
  78. mlrun/utils/helpers.py +91 -11
  79. mlrun/utils/logger.py +36 -2
  80. mlrun/utils/notifications/notification/base.py +43 -7
  81. mlrun/utils/notifications/notification/git.py +21 -0
  82. mlrun/utils/notifications/notification/slack.py +9 -14
  83. mlrun/utils/notifications/notification/webhook.py +41 -1
  84. mlrun/utils/notifications/notification_pusher.py +3 -9
  85. mlrun/utils/regex.py +9 -0
  86. mlrun/utils/version/version.json +2 -2
  87. {mlrun-1.7.0rc20.dist-info → mlrun-1.7.0rc28.dist-info}/METADATA +16 -9
  88. {mlrun-1.7.0rc20.dist-info → mlrun-1.7.0rc28.dist-info}/RECORD +92 -91
  89. {mlrun-1.7.0rc20.dist-info → mlrun-1.7.0rc28.dist-info}/WHEEL +1 -1
  90. {mlrun-1.7.0rc20.dist-info → mlrun-1.7.0rc28.dist-info}/LICENSE +0 -0
  91. {mlrun-1.7.0rc20.dist-info → mlrun-1.7.0rc28.dist-info}/entry_points.txt +0 -0
  92. {mlrun-1.7.0rc20.dist-info → mlrun-1.7.0rc28.dist-info}/top_level.txt +0 -0
@@ -22,8 +22,7 @@ import uuid
22
22
 
23
23
  import mlrun_pipelines.common.models
24
24
  import mlrun_pipelines.patcher
25
- from kfp.compiler import compiler
26
- from mlrun_pipelines.helpers import new_pipe_metadata
25
+ import mlrun_pipelines.utils
27
26
 
28
27
  import mlrun
29
28
  import mlrun.common.runtimes.constants
@@ -220,9 +219,10 @@ class _PipelineContext:
220
219
  force_run_local = mlrun.mlconf.force_run_local
221
220
  if force_run_local is None or force_run_local == "auto":
222
221
  force_run_local = not mlrun.mlconf.is_api_running_on_k8s()
223
- kfp_url = mlrun.mlconf.resolve_kfp_url()
224
- if not kfp_url:
222
+ if not mlrun.mlconf.kfp_url:
223
+ logger.debug("Kubeflow pipeline URL is not set, running locally")
225
224
  force_run_local = True
225
+
226
226
  if self.workflow:
227
227
  force_run_local = force_run_local or self.workflow.run_local
228
228
 
@@ -444,6 +444,7 @@ class _PipelineRunner(abc.ABC):
444
444
  namespace=None,
445
445
  source=None,
446
446
  notifications: list[mlrun.model.Notification] = None,
447
+ send_start_notification: bool = True,
447
448
  ) -> _PipelineRunStatus:
448
449
  pass
449
450
 
@@ -501,13 +502,14 @@ class _KFPRunner(_PipelineRunner):
501
502
  functions,
502
503
  secrets=project._secrets,
503
504
  )
504
- artifact_path = artifact_path or project.spec.artifact_path
505
-
506
- conf = new_pipe_metadata(
507
- artifact_path=artifact_path,
505
+ mlrun_pipelines.utils.compile_pipeline(
506
+ artifact_path=artifact_path or project.spec.artifact_path,
508
507
  cleanup_ttl=workflow_spec.cleanup_ttl,
508
+ ops=None,
509
+ pipeline=pipeline,
510
+ pipe_file=target,
511
+ type_check=True,
509
512
  )
510
- compiler.Compiler().compile(pipeline, target, pipeline_conf=conf)
511
513
  workflow_spec.clear_tmp()
512
514
  pipeline_context.clear()
513
515
 
@@ -523,6 +525,7 @@ class _KFPRunner(_PipelineRunner):
523
525
  namespace=None,
524
526
  source=None,
525
527
  notifications: list[mlrun.model.Notification] = None,
528
+ send_start_notification: bool = True,
526
529
  ) -> _PipelineRunStatus:
527
530
  pipeline_context.set(project, workflow_spec)
528
531
  workflow_handler = _PipelineRunner._get_handler(
@@ -571,13 +574,13 @@ class _KFPRunner(_PipelineRunner):
571
574
  func_name=func.metadata.name,
572
575
  exc_info=err_to_str(exc),
573
576
  )
574
-
575
- project.notifiers.push_pipeline_start_message(
576
- project.metadata.name,
577
- project.get_param("commit_id", None),
578
- run_id,
579
- True,
580
- )
577
+ if send_start_notification:
578
+ project.notifiers.push_pipeline_start_message(
579
+ project.metadata.name,
580
+ project.get_param("commit_id", None),
581
+ run_id,
582
+ True,
583
+ )
581
584
  pipeline_context.clear()
582
585
  return _PipelineRunStatus(run_id, cls, project=project, workflow=workflow_spec)
583
586
 
@@ -668,6 +671,7 @@ class _LocalRunner(_PipelineRunner):
668
671
  namespace=None,
669
672
  source=None,
670
673
  notifications: list[mlrun.model.Notification] = None,
674
+ send_start_notification: bool = True,
671
675
  ) -> _PipelineRunStatus:
672
676
  pipeline_context.set(project, workflow_spec)
673
677
  workflow_handler = _PipelineRunner._get_handler(
@@ -688,9 +692,11 @@ class _LocalRunner(_PipelineRunner):
688
692
  original_source = project.spec.source
689
693
  project.set_source(source=source)
690
694
  pipeline_context.workflow_artifact_path = artifact_path
691
- project.notifiers.push_pipeline_start_message(
692
- project.metadata.name, pipeline_id=workflow_id
693
- )
695
+
696
+ if send_start_notification:
697
+ project.notifiers.push_pipeline_start_message(
698
+ project.metadata.name, pipeline_id=workflow_id
699
+ )
694
700
  err = None
695
701
  try:
696
702
  workflow_handler(**workflow_spec.args)
@@ -758,13 +764,21 @@ class _RemoteRunner(_PipelineRunner):
758
764
  namespace: str = None,
759
765
  source: str = None,
760
766
  notifications: list[mlrun.model.Notification] = None,
767
+ send_start_notification: bool = True,
761
768
  ) -> typing.Optional[_PipelineRunStatus]:
762
769
  workflow_name = normalize_workflow_name(name=name, project_name=project.name)
763
770
  workflow_id = None
764
771
 
765
772
  # for start message, fallback to old notification behavior
766
- for notification in notifications or []:
767
- project.notifiers.add_notification(notification.kind, notification.params)
773
+ if send_start_notification:
774
+ for notification in notifications or []:
775
+ project.notifiers.add_notification(
776
+ notification.kind, notification.params
777
+ )
778
+ # if a notification with `when=running` is provided, it will be used explicitly and others
779
+ # will be ignored
780
+ if "running" in notification.when:
781
+ break
768
782
 
769
783
  # The returned engine for this runner is the engine of the workflow.
770
784
  # In this way wait_for_completion/get_run_status would be executed by the correct pipeline runner.