mlrun 1.6.4rc7__py3-none-any.whl → 1.7.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.

Files changed (305) hide show
  1. mlrun/__init__.py +11 -1
  2. mlrun/__main__.py +40 -122
  3. mlrun/alerts/__init__.py +15 -0
  4. mlrun/alerts/alert.py +248 -0
  5. mlrun/api/schemas/__init__.py +5 -4
  6. mlrun/artifacts/__init__.py +8 -3
  7. mlrun/artifacts/base.py +47 -257
  8. mlrun/artifacts/dataset.py +11 -192
  9. mlrun/artifacts/manager.py +79 -47
  10. mlrun/artifacts/model.py +31 -159
  11. mlrun/artifacts/plots.py +23 -380
  12. mlrun/common/constants.py +74 -1
  13. mlrun/common/db/sql_session.py +5 -5
  14. mlrun/common/formatters/__init__.py +21 -0
  15. mlrun/common/formatters/artifact.py +45 -0
  16. mlrun/common/formatters/base.py +113 -0
  17. mlrun/common/formatters/feature_set.py +33 -0
  18. mlrun/common/formatters/function.py +46 -0
  19. mlrun/common/formatters/pipeline.py +53 -0
  20. mlrun/common/formatters/project.py +51 -0
  21. mlrun/common/formatters/run.py +29 -0
  22. mlrun/common/helpers.py +12 -3
  23. mlrun/common/model_monitoring/helpers.py +9 -5
  24. mlrun/{runtimes → common/runtimes}/constants.py +37 -9
  25. mlrun/common/schemas/__init__.py +31 -5
  26. mlrun/common/schemas/alert.py +202 -0
  27. mlrun/common/schemas/api_gateway.py +196 -0
  28. mlrun/common/schemas/artifact.py +25 -4
  29. mlrun/common/schemas/auth.py +16 -5
  30. mlrun/common/schemas/background_task.py +1 -1
  31. mlrun/common/schemas/client_spec.py +4 -2
  32. mlrun/common/schemas/common.py +7 -4
  33. mlrun/common/schemas/constants.py +3 -0
  34. mlrun/common/schemas/feature_store.py +74 -44
  35. mlrun/common/schemas/frontend_spec.py +15 -7
  36. mlrun/common/schemas/function.py +12 -1
  37. mlrun/common/schemas/hub.py +11 -18
  38. mlrun/common/schemas/memory_reports.py +2 -2
  39. mlrun/common/schemas/model_monitoring/__init__.py +20 -4
  40. mlrun/common/schemas/model_monitoring/constants.py +123 -42
  41. mlrun/common/schemas/model_monitoring/grafana.py +13 -9
  42. mlrun/common/schemas/model_monitoring/model_endpoints.py +101 -54
  43. mlrun/common/schemas/notification.py +71 -14
  44. mlrun/common/schemas/object.py +2 -2
  45. mlrun/{model_monitoring/controller_handler.py → common/schemas/pagination.py} +9 -12
  46. mlrun/common/schemas/pipeline.py +8 -1
  47. mlrun/common/schemas/project.py +69 -18
  48. mlrun/common/schemas/runs.py +7 -1
  49. mlrun/common/schemas/runtime_resource.py +8 -12
  50. mlrun/common/schemas/schedule.py +4 -4
  51. mlrun/common/schemas/tag.py +1 -2
  52. mlrun/common/schemas/workflow.py +12 -4
  53. mlrun/common/types.py +14 -1
  54. mlrun/config.py +154 -69
  55. mlrun/data_types/data_types.py +6 -1
  56. mlrun/data_types/spark.py +2 -2
  57. mlrun/data_types/to_pandas.py +67 -37
  58. mlrun/datastore/__init__.py +6 -8
  59. mlrun/datastore/alibaba_oss.py +131 -0
  60. mlrun/datastore/azure_blob.py +143 -42
  61. mlrun/datastore/base.py +102 -58
  62. mlrun/datastore/datastore.py +34 -13
  63. mlrun/datastore/datastore_profile.py +146 -20
  64. mlrun/datastore/dbfs_store.py +3 -7
  65. mlrun/datastore/filestore.py +1 -4
  66. mlrun/datastore/google_cloud_storage.py +97 -33
  67. mlrun/datastore/hdfs.py +56 -0
  68. mlrun/datastore/inmem.py +6 -3
  69. mlrun/datastore/redis.py +7 -2
  70. mlrun/datastore/s3.py +34 -12
  71. mlrun/datastore/snowflake_utils.py +45 -0
  72. mlrun/datastore/sources.py +303 -111
  73. mlrun/datastore/spark_utils.py +31 -2
  74. mlrun/datastore/store_resources.py +9 -7
  75. mlrun/datastore/storeytargets.py +151 -0
  76. mlrun/datastore/targets.py +453 -176
  77. mlrun/datastore/utils.py +72 -58
  78. mlrun/datastore/v3io.py +6 -1
  79. mlrun/db/base.py +274 -41
  80. mlrun/db/factory.py +1 -1
  81. mlrun/db/httpdb.py +893 -225
  82. mlrun/db/nopdb.py +291 -33
  83. mlrun/errors.py +36 -6
  84. mlrun/execution.py +115 -42
  85. mlrun/feature_store/__init__.py +0 -2
  86. mlrun/feature_store/api.py +65 -73
  87. mlrun/feature_store/common.py +7 -12
  88. mlrun/feature_store/feature_set.py +76 -55
  89. mlrun/feature_store/feature_vector.py +39 -31
  90. mlrun/feature_store/ingestion.py +7 -6
  91. mlrun/feature_store/retrieval/base.py +16 -11
  92. mlrun/feature_store/retrieval/dask_merger.py +2 -0
  93. mlrun/feature_store/retrieval/job.py +13 -4
  94. mlrun/feature_store/retrieval/local_merger.py +2 -0
  95. mlrun/feature_store/retrieval/spark_merger.py +24 -32
  96. mlrun/feature_store/steps.py +45 -34
  97. mlrun/features.py +11 -21
  98. mlrun/frameworks/_common/artifacts_library.py +9 -9
  99. mlrun/frameworks/_common/mlrun_interface.py +5 -5
  100. mlrun/frameworks/_common/model_handler.py +48 -48
  101. mlrun/frameworks/_common/plan.py +5 -6
  102. mlrun/frameworks/_common/producer.py +3 -4
  103. mlrun/frameworks/_common/utils.py +5 -5
  104. mlrun/frameworks/_dl_common/loggers/logger.py +6 -7
  105. mlrun/frameworks/_dl_common/loggers/mlrun_logger.py +9 -9
  106. mlrun/frameworks/_dl_common/loggers/tensorboard_logger.py +23 -47
  107. mlrun/frameworks/_ml_common/artifacts_library.py +1 -2
  108. mlrun/frameworks/_ml_common/loggers/logger.py +3 -4
  109. mlrun/frameworks/_ml_common/loggers/mlrun_logger.py +4 -5
  110. mlrun/frameworks/_ml_common/model_handler.py +24 -24
  111. mlrun/frameworks/_ml_common/pkl_model_server.py +2 -2
  112. mlrun/frameworks/_ml_common/plan.py +2 -2
  113. mlrun/frameworks/_ml_common/plans/calibration_curve_plan.py +2 -3
  114. mlrun/frameworks/_ml_common/plans/confusion_matrix_plan.py +2 -3
  115. mlrun/frameworks/_ml_common/plans/dataset_plan.py +3 -3
  116. mlrun/frameworks/_ml_common/plans/feature_importance_plan.py +3 -3
  117. mlrun/frameworks/_ml_common/plans/roc_curve_plan.py +4 -4
  118. mlrun/frameworks/_ml_common/utils.py +4 -4
  119. mlrun/frameworks/auto_mlrun/auto_mlrun.py +9 -9
  120. mlrun/frameworks/huggingface/model_server.py +4 -4
  121. mlrun/frameworks/lgbm/__init__.py +33 -33
  122. mlrun/frameworks/lgbm/callbacks/callback.py +2 -4
  123. mlrun/frameworks/lgbm/callbacks/logging_callback.py +4 -5
  124. mlrun/frameworks/lgbm/callbacks/mlrun_logging_callback.py +4 -5
  125. mlrun/frameworks/lgbm/mlrun_interfaces/booster_mlrun_interface.py +1 -3
  126. mlrun/frameworks/lgbm/mlrun_interfaces/mlrun_interface.py +6 -6
  127. mlrun/frameworks/lgbm/model_handler.py +10 -10
  128. mlrun/frameworks/lgbm/model_server.py +6 -6
  129. mlrun/frameworks/lgbm/utils.py +5 -5
  130. mlrun/frameworks/onnx/dataset.py +8 -8
  131. mlrun/frameworks/onnx/mlrun_interface.py +3 -3
  132. mlrun/frameworks/onnx/model_handler.py +6 -6
  133. mlrun/frameworks/onnx/model_server.py +7 -7
  134. mlrun/frameworks/parallel_coordinates.py +6 -6
  135. mlrun/frameworks/pytorch/__init__.py +18 -18
  136. mlrun/frameworks/pytorch/callbacks/callback.py +4 -5
  137. mlrun/frameworks/pytorch/callbacks/logging_callback.py +17 -17
  138. mlrun/frameworks/pytorch/callbacks/mlrun_logging_callback.py +11 -11
  139. mlrun/frameworks/pytorch/callbacks/tensorboard_logging_callback.py +23 -29
  140. mlrun/frameworks/pytorch/callbacks_handler.py +38 -38
  141. mlrun/frameworks/pytorch/mlrun_interface.py +20 -20
  142. mlrun/frameworks/pytorch/model_handler.py +17 -17
  143. mlrun/frameworks/pytorch/model_server.py +7 -7
  144. mlrun/frameworks/sklearn/__init__.py +13 -13
  145. mlrun/frameworks/sklearn/estimator.py +4 -4
  146. mlrun/frameworks/sklearn/metrics_library.py +14 -14
  147. mlrun/frameworks/sklearn/mlrun_interface.py +16 -9
  148. mlrun/frameworks/sklearn/model_handler.py +2 -2
  149. mlrun/frameworks/tf_keras/__init__.py +10 -7
  150. mlrun/frameworks/tf_keras/callbacks/logging_callback.py +15 -15
  151. mlrun/frameworks/tf_keras/callbacks/mlrun_logging_callback.py +11 -11
  152. mlrun/frameworks/tf_keras/callbacks/tensorboard_logging_callback.py +19 -23
  153. mlrun/frameworks/tf_keras/mlrun_interface.py +9 -11
  154. mlrun/frameworks/tf_keras/model_handler.py +14 -14
  155. mlrun/frameworks/tf_keras/model_server.py +6 -6
  156. mlrun/frameworks/xgboost/__init__.py +13 -13
  157. mlrun/frameworks/xgboost/model_handler.py +6 -6
  158. mlrun/k8s_utils.py +61 -17
  159. mlrun/launcher/__init__.py +1 -1
  160. mlrun/launcher/base.py +16 -15
  161. mlrun/launcher/client.py +13 -11
  162. mlrun/launcher/factory.py +1 -1
  163. mlrun/launcher/local.py +23 -13
  164. mlrun/launcher/remote.py +17 -10
  165. mlrun/lists.py +7 -6
  166. mlrun/model.py +478 -103
  167. mlrun/model_monitoring/__init__.py +1 -1
  168. mlrun/model_monitoring/api.py +163 -371
  169. mlrun/{runtimes/mpijob/v1alpha1.py → model_monitoring/applications/__init__.py} +9 -15
  170. mlrun/model_monitoring/applications/_application_steps.py +188 -0
  171. mlrun/model_monitoring/applications/base.py +108 -0
  172. mlrun/model_monitoring/applications/context.py +341 -0
  173. mlrun/model_monitoring/{evidently_application.py → applications/evidently_base.py} +27 -22
  174. mlrun/model_monitoring/applications/histogram_data_drift.py +354 -0
  175. mlrun/model_monitoring/applications/results.py +99 -0
  176. mlrun/model_monitoring/controller.py +131 -278
  177. mlrun/model_monitoring/db/__init__.py +18 -0
  178. mlrun/model_monitoring/db/stores/__init__.py +136 -0
  179. mlrun/model_monitoring/db/stores/base/__init__.py +15 -0
  180. mlrun/model_monitoring/db/stores/base/store.py +213 -0
  181. mlrun/model_monitoring/db/stores/sqldb/__init__.py +13 -0
  182. mlrun/model_monitoring/db/stores/sqldb/models/__init__.py +71 -0
  183. mlrun/model_monitoring/db/stores/sqldb/models/base.py +190 -0
  184. mlrun/model_monitoring/db/stores/sqldb/models/mysql.py +103 -0
  185. mlrun/model_monitoring/{stores/models/mysql.py → db/stores/sqldb/models/sqlite.py} +19 -13
  186. mlrun/model_monitoring/db/stores/sqldb/sql_store.py +659 -0
  187. mlrun/model_monitoring/db/stores/v3io_kv/__init__.py +13 -0
  188. mlrun/model_monitoring/db/stores/v3io_kv/kv_store.py +726 -0
  189. mlrun/model_monitoring/db/tsdb/__init__.py +105 -0
  190. mlrun/model_monitoring/db/tsdb/base.py +448 -0
  191. mlrun/model_monitoring/db/tsdb/helpers.py +30 -0
  192. mlrun/model_monitoring/db/tsdb/tdengine/__init__.py +15 -0
  193. mlrun/model_monitoring/db/tsdb/tdengine/schemas.py +279 -0
  194. mlrun/model_monitoring/db/tsdb/tdengine/stream_graph_steps.py +42 -0
  195. mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py +507 -0
  196. mlrun/model_monitoring/db/tsdb/v3io/__init__.py +15 -0
  197. mlrun/model_monitoring/db/tsdb/v3io/stream_graph_steps.py +158 -0
  198. mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +849 -0
  199. mlrun/model_monitoring/features_drift_table.py +134 -106
  200. mlrun/model_monitoring/helpers.py +199 -55
  201. mlrun/model_monitoring/metrics/__init__.py +13 -0
  202. mlrun/model_monitoring/metrics/histogram_distance.py +127 -0
  203. mlrun/model_monitoring/model_endpoint.py +3 -2
  204. mlrun/model_monitoring/stream_processing.py +131 -398
  205. mlrun/model_monitoring/tracking_policy.py +9 -2
  206. mlrun/model_monitoring/writer.py +161 -125
  207. mlrun/package/__init__.py +6 -6
  208. mlrun/package/context_handler.py +5 -5
  209. mlrun/package/packager.py +7 -7
  210. mlrun/package/packagers/default_packager.py +8 -8
  211. mlrun/package/packagers/numpy_packagers.py +15 -15
  212. mlrun/package/packagers/pandas_packagers.py +5 -5
  213. mlrun/package/packagers/python_standard_library_packagers.py +10 -10
  214. mlrun/package/packagers_manager.py +19 -23
  215. mlrun/package/utils/_formatter.py +6 -6
  216. mlrun/package/utils/_pickler.py +2 -2
  217. mlrun/package/utils/_supported_format.py +4 -4
  218. mlrun/package/utils/log_hint_utils.py +2 -2
  219. mlrun/package/utils/type_hint_utils.py +4 -9
  220. mlrun/platforms/__init__.py +11 -10
  221. mlrun/platforms/iguazio.py +24 -203
  222. mlrun/projects/operations.py +52 -25
  223. mlrun/projects/pipelines.py +191 -197
  224. mlrun/projects/project.py +1227 -400
  225. mlrun/render.py +16 -19
  226. mlrun/run.py +209 -184
  227. mlrun/runtimes/__init__.py +83 -15
  228. mlrun/runtimes/base.py +51 -35
  229. mlrun/runtimes/daskjob.py +17 -10
  230. mlrun/runtimes/databricks_job/databricks_cancel_task.py +1 -1
  231. mlrun/runtimes/databricks_job/databricks_runtime.py +8 -7
  232. mlrun/runtimes/databricks_job/databricks_wrapper.py +1 -1
  233. mlrun/runtimes/funcdoc.py +1 -29
  234. mlrun/runtimes/function_reference.py +1 -1
  235. mlrun/runtimes/kubejob.py +34 -128
  236. mlrun/runtimes/local.py +40 -11
  237. mlrun/runtimes/mpijob/__init__.py +0 -20
  238. mlrun/runtimes/mpijob/abstract.py +9 -10
  239. mlrun/runtimes/mpijob/v1.py +1 -1
  240. mlrun/{model_monitoring/stores/models/sqlite.py → runtimes/nuclio/__init__.py} +7 -9
  241. mlrun/runtimes/nuclio/api_gateway.py +769 -0
  242. mlrun/runtimes/nuclio/application/__init__.py +15 -0
  243. mlrun/runtimes/nuclio/application/application.py +758 -0
  244. mlrun/runtimes/nuclio/application/reverse_proxy.go +95 -0
  245. mlrun/runtimes/{function.py → nuclio/function.py} +200 -83
  246. mlrun/runtimes/{nuclio.py → nuclio/nuclio.py} +6 -6
  247. mlrun/runtimes/{serving.py → nuclio/serving.py} +65 -68
  248. mlrun/runtimes/pod.py +281 -101
  249. mlrun/runtimes/remotesparkjob.py +12 -9
  250. mlrun/runtimes/sparkjob/spark3job.py +67 -51
  251. mlrun/runtimes/utils.py +41 -75
  252. mlrun/secrets.py +9 -5
  253. mlrun/serving/__init__.py +8 -1
  254. mlrun/serving/remote.py +2 -7
  255. mlrun/serving/routers.py +85 -69
  256. mlrun/serving/server.py +69 -44
  257. mlrun/serving/states.py +209 -36
  258. mlrun/serving/utils.py +22 -14
  259. mlrun/serving/v1_serving.py +6 -7
  260. mlrun/serving/v2_serving.py +129 -54
  261. mlrun/track/tracker.py +2 -1
  262. mlrun/track/tracker_manager.py +3 -3
  263. mlrun/track/trackers/mlflow_tracker.py +6 -2
  264. mlrun/utils/async_http.py +6 -8
  265. mlrun/utils/azure_vault.py +1 -1
  266. mlrun/utils/clones.py +1 -2
  267. mlrun/utils/condition_evaluator.py +3 -3
  268. mlrun/utils/db.py +21 -3
  269. mlrun/utils/helpers.py +405 -225
  270. mlrun/utils/http.py +3 -6
  271. mlrun/utils/logger.py +112 -16
  272. mlrun/utils/notifications/notification/__init__.py +17 -13
  273. mlrun/utils/notifications/notification/base.py +50 -2
  274. mlrun/utils/notifications/notification/console.py +2 -0
  275. mlrun/utils/notifications/notification/git.py +24 -1
  276. mlrun/utils/notifications/notification/ipython.py +3 -1
  277. mlrun/utils/notifications/notification/slack.py +96 -21
  278. mlrun/utils/notifications/notification/webhook.py +59 -2
  279. mlrun/utils/notifications/notification_pusher.py +149 -30
  280. mlrun/utils/regex.py +9 -0
  281. mlrun/utils/retryer.py +208 -0
  282. mlrun/utils/singleton.py +1 -1
  283. mlrun/utils/v3io_clients.py +4 -6
  284. mlrun/utils/version/version.json +2 -2
  285. mlrun/utils/version/version.py +2 -6
  286. mlrun-1.7.0.dist-info/METADATA +378 -0
  287. mlrun-1.7.0.dist-info/RECORD +351 -0
  288. {mlrun-1.6.4rc7.dist-info → mlrun-1.7.0.dist-info}/WHEEL +1 -1
  289. mlrun/feature_store/retrieval/conversion.py +0 -273
  290. mlrun/kfpops.py +0 -868
  291. mlrun/model_monitoring/application.py +0 -310
  292. mlrun/model_monitoring/batch.py +0 -1095
  293. mlrun/model_monitoring/prometheus.py +0 -219
  294. mlrun/model_monitoring/stores/__init__.py +0 -111
  295. mlrun/model_monitoring/stores/kv_model_endpoint_store.py +0 -576
  296. mlrun/model_monitoring/stores/model_endpoint_store.py +0 -147
  297. mlrun/model_monitoring/stores/models/__init__.py +0 -27
  298. mlrun/model_monitoring/stores/models/base.py +0 -84
  299. mlrun/model_monitoring/stores/sql_model_endpoint_store.py +0 -384
  300. mlrun/platforms/other.py +0 -306
  301. mlrun-1.6.4rc7.dist-info/METADATA +0 -272
  302. mlrun-1.6.4rc7.dist-info/RECORD +0 -314
  303. {mlrun-1.6.4rc7.dist-info → mlrun-1.7.0.dist-info}/LICENSE +0 -0
  304. {mlrun-1.6.4rc7.dist-info → mlrun-1.7.0.dist-info}/entry_points.txt +0 -0
  305. {mlrun-1.6.4rc7.dist-info → mlrun-1.7.0.dist-info}/top_level.txt +0 -0
mlrun/platforms/other.py DELETED
@@ -1,306 +0,0 @@
1
- # Copyright 2023 Iguazio
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
15
- # this file is based on the code from kubeflow pipelines git
16
- import os
17
- from typing import Dict
18
-
19
- import kfp.dsl
20
-
21
- import mlrun
22
- from mlrun.config import config
23
- from mlrun.errors import MLRunInvalidArgumentError
24
- from mlrun.utils.helpers import logger
25
-
26
- from .iguazio import mount_v3io
27
-
28
-
29
- def mount_pvc(pvc_name=None, volume_name="pipeline", volume_mount_path="/mnt/pipeline"):
30
- """
31
- Modifier function to apply to a Container Op to simplify volume, volume mount addition and
32
- enable better reuse of volumes, volume claims across container ops.
33
-
34
- Usage::
35
-
36
- train = train_op(...)
37
- train.apply(mount_pvc('claim-name', 'pipeline', '/mnt/pipeline'))
38
- """
39
- if "MLRUN_PVC_MOUNT" in os.environ:
40
- mount = os.environ.get("MLRUN_PVC_MOUNT")
41
- items = mount.split(":")
42
- if len(items) != 2:
43
- raise MLRunInvalidArgumentError(
44
- "MLRUN_PVC_MOUNT should include <pvc-name>:<mount-path>"
45
- )
46
- pvc_name = items[0]
47
- volume_mount_path = items[1]
48
-
49
- if not pvc_name:
50
- raise MLRunInvalidArgumentError(
51
- "No PVC name: use the pvc_name parameter or configure the MLRUN_PVC_MOUNT environment variable"
52
- )
53
-
54
- def _mount_pvc(task):
55
- from kubernetes import client as k8s_client
56
-
57
- local_pvc = k8s_client.V1PersistentVolumeClaimVolumeSource(claim_name=pvc_name)
58
- return task.add_volume(
59
- k8s_client.V1Volume(name=volume_name, persistent_volume_claim=local_pvc)
60
- ).add_volume_mount(
61
- k8s_client.V1VolumeMount(mount_path=volume_mount_path, name=volume_name)
62
- )
63
-
64
- return _mount_pvc
65
-
66
-
67
- def auto_mount(pvc_name="", volume_mount_path="", volume_name=None):
68
- """choose the mount based on env variables and params
69
-
70
- volume will be selected by the following order:
71
- - k8s PVC volume when both pvc_name and volume_mount_path are set
72
- - k8s PVC volume when env var is set: MLRUN_PVC_MOUNT=<pvc-name>:<mount-path>
73
- - k8s PVC volume if it's configured as the auto mount type
74
- - iguazio v3io volume when V3IO_ACCESS_KEY and V3IO_USERNAME env vars are set
75
- """
76
- if pvc_name and volume_mount_path:
77
- return mount_pvc(
78
- pvc_name=pvc_name,
79
- volume_mount_path=volume_mount_path,
80
- volume_name=volume_name or "shared-persistency",
81
- )
82
- if "MLRUN_PVC_MOUNT" in os.environ:
83
- return mount_pvc(
84
- volume_name=volume_name or "shared-persistency",
85
- )
86
- # In the case of MLRun-kit when working remotely, no env variables will be defined but auto-mount
87
- # parameters may still be declared - use them in that case.
88
- if config.storage.auto_mount_type == "pvc":
89
- return mount_pvc(**config.get_storage_auto_mount_params())
90
- if "V3IO_ACCESS_KEY" in os.environ:
91
- return mount_v3io(name=volume_name or "v3io")
92
-
93
- raise ValueError("failed to auto mount, need to set env vars")
94
-
95
-
96
- def mount_secret(secret_name, mount_path, volume_name="secret", items=None):
97
- """Modifier function to mount kubernetes secret as files(s)
98
-
99
- :param secret_name: k8s secret name
100
- :param mount_path: path to mount inside the container
101
- :param volume_name: unique volume name
102
- :param items: If unspecified, each key-value pair in the Data field
103
- of the referenced Secret will be projected into the
104
- volume as a file whose name is the key and content is
105
- the value.
106
- If specified, the listed keys will be projected into
107
- the specified paths, and unlisted keys will not be
108
- present.
109
- """
110
-
111
- def _mount_secret(task):
112
- from kubernetes import client as k8s_client
113
-
114
- vol = k8s_client.V1SecretVolumeSource(secret_name=secret_name, items=items)
115
- return task.add_volume(
116
- k8s_client.V1Volume(name=volume_name, secret=vol)
117
- ).add_volume_mount(
118
- k8s_client.V1VolumeMount(mount_path=mount_path, name=volume_name)
119
- )
120
-
121
- return _mount_secret
122
-
123
-
124
- def mount_configmap(configmap_name, mount_path, volume_name="configmap", items=None):
125
- """Modifier function to mount kubernetes configmap as files(s)
126
-
127
- :param configmap_name: k8s configmap name
128
- :param mount_path: path to mount inside the container
129
- :param volume_name: unique volume name
130
- :param items: If unspecified, each key-value pair in the Data field
131
- of the referenced Configmap will be projected into the
132
- volume as a file whose name is the key and content is
133
- the value.
134
- If specified, the listed keys will be projected into
135
- the specified paths, and unlisted keys will not be
136
- present.
137
- """
138
-
139
- def _mount_configmap(task):
140
- from kubernetes import client as k8s_client
141
-
142
- vol = k8s_client.V1ConfigMapVolumeSource(name=configmap_name, items=items)
143
- return task.add_volume(
144
- k8s_client.V1Volume(name=volume_name, config_map=vol)
145
- ).add_volume_mount(
146
- k8s_client.V1VolumeMount(mount_path=mount_path, name=volume_name)
147
- )
148
-
149
- return _mount_configmap
150
-
151
-
152
- def mount_hostpath(host_path, mount_path, volume_name="hostpath"):
153
- """Modifier function to mount kubernetes configmap as files(s)
154
-
155
- :param host_path: host path
156
- :param mount_path: path to mount inside the container
157
- :param volume_name: unique volume name
158
- """
159
-
160
- def _mount_hostpath(task):
161
- from kubernetes import client as k8s_client
162
-
163
- return task.add_volume(
164
- k8s_client.V1Volume(
165
- name=volume_name,
166
- host_path=k8s_client.V1HostPathVolumeSource(path=host_path, type=""),
167
- )
168
- ).add_volume_mount(
169
- k8s_client.V1VolumeMount(mount_path=mount_path, name=volume_name)
170
- )
171
-
172
- return _mount_hostpath
173
-
174
-
175
- def mount_s3(
176
- secret_name=None,
177
- aws_access_key="",
178
- aws_secret_key="",
179
- endpoint_url=None,
180
- prefix="",
181
- aws_region=None,
182
- non_anonymous=False,
183
- ):
184
- """Modifier function to add s3 env vars or secrets to container
185
-
186
- **Warning:**
187
- Using this function to configure AWS credentials will expose these credentials in the pod spec of the runtime
188
- created. It is recommended to use the `secret_name` parameter, or set the credentials as project-secrets and avoid
189
- using this function.
190
-
191
- :param secret_name: kubernetes secret name (storing the access/secret keys)
192
- :param aws_access_key: AWS_ACCESS_KEY_ID value. If this parameter is not specified and AWS_ACCESS_KEY_ID env.
193
- variable is defined, the value will be taken from the env. variable
194
- :param aws_secret_key: AWS_SECRET_ACCESS_KEY value. If this parameter is not specified and AWS_SECRET_ACCESS_KEY
195
- env. variable is defined, the value will be taken from the env. variable
196
- :param endpoint_url: s3 endpoint address (for non AWS s3)
197
- :param prefix: string prefix to add before the env var name (for working with multiple s3 data stores)
198
- :param aws_region: amazon region
199
- :param non_anonymous: force the S3 API to use non-anonymous connection, even if no credentials are provided
200
- (for authenticating externally, such as through IAM instance-roles)
201
- """
202
-
203
- if secret_name and (aws_access_key or aws_secret_key):
204
- raise mlrun.errors.MLRunInvalidArgumentError(
205
- "can use k8s_secret for credentials or specify them (aws_access_key, aws_secret_key) not both"
206
- )
207
-
208
- if not secret_name and (
209
- aws_access_key
210
- or os.environ.get(prefix + "AWS_ACCESS_KEY_ID")
211
- or aws_secret_key
212
- or os.environ.get(prefix + "AWS_SECRET_ACCESS_KEY")
213
- ):
214
- logger.warning(
215
- "it is recommended to use k8s secret (specify secret_name), "
216
- "specifying the aws_access_key/aws_secret_key directly is unsafe"
217
- )
218
-
219
- def _use_s3_cred(container_op):
220
- from os import environ
221
-
222
- from kubernetes import client as k8s_client
223
-
224
- _access_key = aws_access_key or environ.get(prefix + "AWS_ACCESS_KEY_ID")
225
- _secret_key = aws_secret_key or environ.get(prefix + "AWS_SECRET_ACCESS_KEY")
226
- _endpoint_url = endpoint_url or environ.get(prefix + "S3_ENDPOINT_URL")
227
-
228
- container = container_op.container
229
- if _endpoint_url:
230
- container.add_env_variable(
231
- k8s_client.V1EnvVar(name=prefix + "S3_ENDPOINT_URL", value=endpoint_url)
232
- )
233
- if aws_region:
234
- container.add_env_variable(
235
- k8s_client.V1EnvVar(name=prefix + "AWS_REGION", value=aws_region)
236
- )
237
- if non_anonymous:
238
- container.add_env_variable(
239
- k8s_client.V1EnvVar(name=prefix + "S3_NON_ANONYMOUS", value="true")
240
- )
241
-
242
- if secret_name:
243
- container.add_env_variable(
244
- k8s_client.V1EnvVar(
245
- name=prefix + "AWS_ACCESS_KEY_ID",
246
- value_from=k8s_client.V1EnvVarSource(
247
- secret_key_ref=k8s_client.V1SecretKeySelector(
248
- name=secret_name, key="AWS_ACCESS_KEY_ID"
249
- )
250
- ),
251
- )
252
- ).add_env_variable(
253
- k8s_client.V1EnvVar(
254
- name=prefix + "AWS_SECRET_ACCESS_KEY",
255
- value_from=k8s_client.V1EnvVarSource(
256
- secret_key_ref=k8s_client.V1SecretKeySelector(
257
- name=secret_name, key="AWS_SECRET_ACCESS_KEY"
258
- )
259
- ),
260
- )
261
- )
262
-
263
- else:
264
- return container_op.add_env_variable(
265
- k8s_client.V1EnvVar(
266
- name=prefix + "AWS_ACCESS_KEY_ID", value=_access_key
267
- )
268
- ).add_env_variable(
269
- k8s_client.V1EnvVar(
270
- name=prefix + "AWS_SECRET_ACCESS_KEY", value=_secret_key
271
- )
272
- )
273
-
274
- return _use_s3_cred
275
-
276
-
277
- def set_env_variables(env_vars_dict: Dict[str, str] = None, **kwargs):
278
- """
279
- Modifier function to apply a set of environment variables to a runtime. Variables may be passed
280
- as either a dictionary of name-value pairs, or as arguments to the function.
281
- See `KubeResource.apply` for more information on modifiers.
282
-
283
- Usage::
284
-
285
- function.apply(set_env_variables({"ENV1": "value1", "ENV2": "value2"}))
286
- or
287
- function.apply(set_env_variables(ENV1=value1, ENV2=value2))
288
-
289
- :param env_vars_dict: dictionary of env. variables
290
- :param kwargs: environment variables passed as args
291
- """
292
-
293
- env_data = env_vars_dict.copy() if env_vars_dict else {}
294
- for key, value in kwargs.items():
295
- env_data[key] = value
296
-
297
- def _set_env_variables(container_op: kfp.dsl.ContainerOp):
298
- from kubernetes import client as k8s_client
299
-
300
- for _key, _value in env_data.items():
301
- container_op.container.add_env_variable(
302
- k8s_client.V1EnvVar(name=_key, value=_value)
303
- )
304
- return container_op
305
-
306
- return _set_env_variables
@@ -1,272 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: mlrun
3
- Version: 1.6.4rc7
4
- Summary: Tracking and config of machine learning runs
5
- Home-page: https://github.com/mlrun/mlrun
6
- Author: Yaron Haviv
7
- Author-email: yaronh@iguazio.com
8
- License: Apache License 2.0
9
- Keywords: mlrun,mlops,data-science,machine-learning,experiment-tracking
10
- Classifier: Development Status :: 4 - Beta
11
- Classifier: Intended Audience :: Developers
12
- Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Operating System :: POSIX :: Linux
14
- Classifier: Operating System :: Microsoft :: Windows
15
- Classifier: Operating System :: MacOS
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python
19
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
- Classifier: Topic :: Software Development :: Libraries
21
- Requires-Python: >=3.9, <3.12
22
- Description-Content-Type: text/markdown
23
- License-File: LICENSE
24
- Requires-Dist: urllib3 <1.27,>=1.26.9
25
- Requires-Dist: GitPython >=3.1.41,~=3.1
26
- Requires-Dist: aiohttp ~=3.9
27
- Requires-Dist: aiohttp-retry ~=2.8
28
- Requires-Dist: click ~=8.1
29
- Requires-Dist: kfp >=1.8.14,~=1.8
30
- Requires-Dist: nest-asyncio ~=1.0
31
- Requires-Dist: ipython ~=8.10
32
- Requires-Dist: nuclio-jupyter ~=0.9.15
33
- Requires-Dist: numpy <1.27.0,>=1.16.5
34
- Requires-Dist: pandas <2.2,>=1.2
35
- Requires-Dist: pyarrow <15,>=10.0
36
- Requires-Dist: pyyaml ~=5.1
37
- Requires-Dist: requests ~=2.31
38
- Requires-Dist: tabulate ~=0.8.6
39
- Requires-Dist: v3io ~=0.6.4
40
- Requires-Dist: pydantic <1.10.15,>=1.10.8
41
- Requires-Dist: mergedeep ~=1.3
42
- Requires-Dist: v3io-frames ~=0.10.12
43
- Requires-Dist: semver ~=3.0
44
- Requires-Dist: dependency-injector ~=4.41
45
- Requires-Dist: fsspec ==2023.9.2
46
- Requires-Dist: v3iofs ~=0.1.17
47
- Requires-Dist: storey ~=1.6.20
48
- Requires-Dist: inflection ~=0.5.0
49
- Requires-Dist: python-dotenv ~=0.17.0
50
- Requires-Dist: setuptools ~=69.1
51
- Requires-Dist: deprecated ~=1.2
52
- Requires-Dist: jinja2 >=3.1.3,~=3.1
53
- Requires-Dist: anyio ~=3.7
54
- Requires-Dist: orjson ~=3.9
55
- Provides-Extra: all
56
- Requires-Dist: adlfs ==2023.9.0 ; extra == 'all'
57
- Requires-Dist: aiobotocore <2.8,>=2.5.0 ; extra == 'all'
58
- Requires-Dist: avro ~=1.11 ; extra == 'all'
59
- Requires-Dist: azure-core ~=1.24 ; extra == 'all'
60
- Requires-Dist: azure-identity ~=1.5 ; extra == 'all'
61
- Requires-Dist: azure-keyvault-secrets ~=4.2 ; extra == 'all'
62
- Requires-Dist: bokeh >=2.4.2,~=2.4 ; extra == 'all'
63
- Requires-Dist: boto3 <1.29.0,>=1.28.0 ; extra == 'all'
64
- Requires-Dist: dask ~=2023.9.0 ; extra == 'all'
65
- Requires-Dist: databricks-sdk ~=0.13.0 ; extra == 'all'
66
- Requires-Dist: distributed ~=2023.9.0 ; extra == 'all'
67
- Requires-Dist: gcsfs ==2023.9.2 ; extra == 'all'
68
- Requires-Dist: google-cloud-bigquery[bqstorage,pandas] ==3.14.1 ; extra == 'all'
69
- Requires-Dist: google-cloud-storage ==2.14.0 ; extra == 'all'
70
- Requires-Dist: google-cloud ==0.34 ; extra == 'all'
71
- Requires-Dist: graphviz ~=0.20.0 ; extra == 'all'
72
- Requires-Dist: kafka-python ~=2.0 ; extra == 'all'
73
- Requires-Dist: mlflow ~=2.8 ; extra == 'all'
74
- Requires-Dist: msrest ~=0.6.21 ; extra == 'all'
75
- Requires-Dist: plotly <5.12.0,~=5.4 ; extra == 'all'
76
- Requires-Dist: pyopenssl >=23 ; extra == 'all'
77
- Requires-Dist: redis ~=4.3 ; extra == 'all'
78
- Requires-Dist: s3fs ==2023.9.2 ; extra == 'all'
79
- Requires-Dist: sqlalchemy ~=1.4 ; extra == 'all'
80
- Provides-Extra: api
81
- Requires-Dist: uvicorn ~=0.27.1 ; extra == 'api'
82
- Requires-Dist: dask-kubernetes ~=0.11.0 ; extra == 'api'
83
- Requires-Dist: apscheduler <4,>=3.10.3 ; extra == 'api'
84
- Requires-Dist: objgraph ~=3.6 ; extra == 'api'
85
- Requires-Dist: igz-mgmt ==0.1.0 ; extra == 'api'
86
- Requires-Dist: humanfriendly ~=10.0 ; extra == 'api'
87
- Requires-Dist: fastapi ~=0.110.0 ; extra == 'api'
88
- Requires-Dist: sqlalchemy ~=1.4 ; extra == 'api'
89
- Requires-Dist: pymysql ~=1.0 ; extra == 'api'
90
- Requires-Dist: alembic ~=1.9 ; extra == 'api'
91
- Requires-Dist: timelength ~=1.1 ; extra == 'api'
92
- Requires-Dist: memray ~=1.12 ; extra == 'api'
93
- Provides-Extra: azure-blob-storage
94
- Requires-Dist: msrest ~=0.6.21 ; extra == 'azure-blob-storage'
95
- Requires-Dist: azure-core ~=1.24 ; extra == 'azure-blob-storage'
96
- Requires-Dist: adlfs ==2023.9.0 ; extra == 'azure-blob-storage'
97
- Requires-Dist: pyopenssl >=23 ; extra == 'azure-blob-storage'
98
- Provides-Extra: azure-key-vault
99
- Requires-Dist: azure-identity ~=1.5 ; extra == 'azure-key-vault'
100
- Requires-Dist: azure-keyvault-secrets ~=4.2 ; extra == 'azure-key-vault'
101
- Requires-Dist: pyopenssl >=23 ; extra == 'azure-key-vault'
102
- Provides-Extra: bokeh
103
- Requires-Dist: bokeh >=2.4.2,~=2.4 ; extra == 'bokeh'
104
- Provides-Extra: complete
105
- Requires-Dist: adlfs ==2023.9.0 ; extra == 'complete'
106
- Requires-Dist: aiobotocore <2.8,>=2.5.0 ; extra == 'complete'
107
- Requires-Dist: avro ~=1.11 ; extra == 'complete'
108
- Requires-Dist: azure-core ~=1.24 ; extra == 'complete'
109
- Requires-Dist: azure-identity ~=1.5 ; extra == 'complete'
110
- Requires-Dist: azure-keyvault-secrets ~=4.2 ; extra == 'complete'
111
- Requires-Dist: boto3 <1.29.0,>=1.28.0 ; extra == 'complete'
112
- Requires-Dist: dask ~=2023.9.0 ; extra == 'complete'
113
- Requires-Dist: databricks-sdk ~=0.13.0 ; extra == 'complete'
114
- Requires-Dist: distributed ~=2023.9.0 ; extra == 'complete'
115
- Requires-Dist: gcsfs ==2023.9.2 ; extra == 'complete'
116
- Requires-Dist: google-cloud-bigquery[bqstorage,pandas] ==3.14.1 ; extra == 'complete'
117
- Requires-Dist: graphviz ~=0.20.0 ; extra == 'complete'
118
- Requires-Dist: kafka-python ~=2.0 ; extra == 'complete'
119
- Requires-Dist: mlflow ~=2.8 ; extra == 'complete'
120
- Requires-Dist: msrest ~=0.6.21 ; extra == 'complete'
121
- Requires-Dist: plotly <5.12.0,~=5.4 ; extra == 'complete'
122
- Requires-Dist: pyopenssl >=23 ; extra == 'complete'
123
- Requires-Dist: redis ~=4.3 ; extra == 'complete'
124
- Requires-Dist: s3fs ==2023.9.2 ; extra == 'complete'
125
- Requires-Dist: sqlalchemy ~=1.4 ; extra == 'complete'
126
- Provides-Extra: complete-api
127
- Requires-Dist: adlfs ==2023.9.0 ; extra == 'complete-api'
128
- Requires-Dist: aiobotocore <2.8,>=2.5.0 ; extra == 'complete-api'
129
- Requires-Dist: alembic ~=1.9 ; extra == 'complete-api'
130
- Requires-Dist: apscheduler <4,>=3.10.3 ; extra == 'complete-api'
131
- Requires-Dist: avro ~=1.11 ; extra == 'complete-api'
132
- Requires-Dist: azure-core ~=1.24 ; extra == 'complete-api'
133
- Requires-Dist: azure-identity ~=1.5 ; extra == 'complete-api'
134
- Requires-Dist: azure-keyvault-secrets ~=4.2 ; extra == 'complete-api'
135
- Requires-Dist: boto3 <1.29.0,>=1.28.0 ; extra == 'complete-api'
136
- Requires-Dist: dask-kubernetes ~=0.11.0 ; extra == 'complete-api'
137
- Requires-Dist: dask ~=2023.9.0 ; extra == 'complete-api'
138
- Requires-Dist: databricks-sdk ~=0.13.0 ; extra == 'complete-api'
139
- Requires-Dist: distributed ~=2023.9.0 ; extra == 'complete-api'
140
- Requires-Dist: fastapi ~=0.110.0 ; extra == 'complete-api'
141
- Requires-Dist: gcsfs ==2023.9.2 ; extra == 'complete-api'
142
- Requires-Dist: google-cloud-bigquery[bqstorage,pandas] ==3.14.1 ; extra == 'complete-api'
143
- Requires-Dist: graphviz ~=0.20.0 ; extra == 'complete-api'
144
- Requires-Dist: humanfriendly ~=10.0 ; extra == 'complete-api'
145
- Requires-Dist: igz-mgmt ==0.1.0 ; extra == 'complete-api'
146
- Requires-Dist: kafka-python ~=2.0 ; extra == 'complete-api'
147
- Requires-Dist: memray ~=1.12 ; extra == 'complete-api'
148
- Requires-Dist: mlflow ~=2.8 ; extra == 'complete-api'
149
- Requires-Dist: msrest ~=0.6.21 ; extra == 'complete-api'
150
- Requires-Dist: objgraph ~=3.6 ; extra == 'complete-api'
151
- Requires-Dist: plotly <5.12.0,~=5.4 ; extra == 'complete-api'
152
- Requires-Dist: pymysql ~=1.0 ; extra == 'complete-api'
153
- Requires-Dist: pyopenssl >=23 ; extra == 'complete-api'
154
- Requires-Dist: redis ~=4.3 ; extra == 'complete-api'
155
- Requires-Dist: s3fs ==2023.9.2 ; extra == 'complete-api'
156
- Requires-Dist: sqlalchemy ~=1.4 ; extra == 'complete-api'
157
- Requires-Dist: timelength ~=1.1 ; extra == 'complete-api'
158
- Requires-Dist: uvicorn ~=0.27.1 ; extra == 'complete-api'
159
- Provides-Extra: dask
160
- Requires-Dist: dask ~=2023.9.0 ; extra == 'dask'
161
- Requires-Dist: distributed ~=2023.9.0 ; extra == 'dask'
162
- Provides-Extra: databricks-sdk
163
- Requires-Dist: databricks-sdk ~=0.13.0 ; extra == 'databricks-sdk'
164
- Provides-Extra: google-cloud
165
- Requires-Dist: google-cloud-storage ==2.14.0 ; extra == 'google-cloud'
166
- Requires-Dist: google-cloud-bigquery[bqstorage,pandas] ==3.14.1 ; extra == 'google-cloud'
167
- Requires-Dist: google-cloud ==0.34 ; extra == 'google-cloud'
168
- Provides-Extra: google-cloud-bigquery
169
- Requires-Dist: google-cloud-bigquery[bqstorage,pandas] ==3.14.1 ; extra == 'google-cloud-bigquery'
170
- Provides-Extra: google-cloud-storage
171
- Requires-Dist: gcsfs ==2023.9.2 ; extra == 'google-cloud-storage'
172
- Provides-Extra: graphviz
173
- Requires-Dist: graphviz ~=0.20.0 ; extra == 'graphviz'
174
- Provides-Extra: kafka
175
- Requires-Dist: kafka-python ~=2.0 ; extra == 'kafka'
176
- Requires-Dist: avro ~=1.11 ; extra == 'kafka'
177
- Provides-Extra: mlflow
178
- Requires-Dist: mlflow ~=2.8 ; extra == 'mlflow'
179
- Provides-Extra: plotly
180
- Requires-Dist: plotly <5.12.0,~=5.4 ; extra == 'plotly'
181
- Provides-Extra: redis
182
- Requires-Dist: redis ~=4.3 ; extra == 'redis'
183
- Provides-Extra: s3
184
- Requires-Dist: boto3 <1.29.0,>=1.28.0 ; extra == 's3'
185
- Requires-Dist: aiobotocore <2.8,>=2.5.0 ; extra == 's3'
186
- Requires-Dist: s3fs ==2023.9.2 ; extra == 's3'
187
- Provides-Extra: sqlalchemy
188
- Requires-Dist: sqlalchemy ~=1.4 ; extra == 'sqlalchemy'
189
-
190
- <a id="top"></a>
191
- [![Build Status](https://github.com/mlrun/mlrun/actions/workflows/build.yaml/badge.svg?branch=development)](https://github.com/mlrun/mlrun/actions/workflows/build.yaml?query=branch%3Adevelopment)
192
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
193
- [![PyPI version fury.io](https://badge.fury.io/py/mlrun.svg)](https://pypi.python.org/pypi/mlrun/)
194
- [![Documentation](https://readthedocs.org/projects/mlrun/badge/?version=latest)](https://mlrun.readthedocs.io/en/latest/?badge=latest)
195
- [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
196
- ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/mlrun/mlrun)
197
- ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/mlrun/mlrun?sort=semver)
198
- [![Join MLOps Live](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://mlopslive.slack.com)
199
-
200
- <p align="left"><img src="https://github.com/mlrun/mlrun/raw/development/docs/_static/images/MLRun-logo.png" alt="MLRun logo" width="150"/></p>
201
-
202
- # Using MLRun
203
-
204
- MLRun is an open MLOps platform for quickly building and managing continuous ML applications across their lifecycle. MLRun integrates into your development and CI/CD environment and automates the delivery of production data, ML pipelines, and online applications, significantly reducing engineering efforts, time to production, and computation resources.
205
- With MLRun, you can choose any IDE on your local machine or on the cloud. MLRun breaks the silos between data, ML, software, and DevOps/MLOps teams, enabling collaboration and fast continuous improvements.
206
-
207
- Get started with MLRun [**Tutorials and Examples**](https://docs.mlrun.org/en/latest/tutorials/index.html), [**Installation and setup guide**](https://docs.mlrun.org/en/latest/install.html), or read about [**MLRun Architecture**](https://docs.mlrun.org/en/latest/architecture.html).
208
-
209
- This page explains how MLRun addresses the [**MLOps Tasks**](#mlops-tasks) and the [**MLRun core components**](#core-components).
210
-
211
- <a id="mlops-tasks"></a>
212
- ## MLOps tasks
213
-
214
- <p align="center"><img src="https://github.com/mlrun/mlrun/raw/development/docs/_static/images/mlops-task.png" alt="mlrun-tasks" width="800"/></p><br>
215
-
216
- The [**MLOps development workflow**](https://docs.mlrun.org/en/latest/mlops-dev-flow.html) section describes the different tasks and stages in detail.
217
- MLRun can be used to automate and orchestrate all the different tasks or just specific tasks (and integrate them with what you have already deployed).
218
-
219
- ### Project management and CI/CD automation
220
-
221
- In MLRun the assets, metadata, and services (data, functions, jobs, artifacts, models, secrets, etc.) are organized into projects.
222
- Projects can be imported/exported as a whole, mapped to git repositories or IDE projects (in PyCharm, VSCode, etc.), which enables versioning, collaboration, and CI/CD.
223
- Project access can be restricted to a set of users and roles.
224
-
225
- See: **Docs:** [Projects and Automation](https://docs.mlrun.org/en/latest/projects/project.html), [CI/CD Integration](https://docs.mlrun.org/en/latest/projects/ci-integration.html), **Tutorials:** [Quick start](https://docs.mlrun.org/en/latest/tutorials/01-mlrun-basics.html), [Automated ML Pipeline](https://docs.mlrun.org/en/latest/tutorials/04-pipeline.html), **Video:** [Quick start](https://youtu.be/xI8KVGLlj7Q).
226
-
227
- ### Ingest and process data
228
-
229
- MLRun provides abstract interfaces to various offline and online [**data sources**](https://docs.mlrun.org/en/latest/store/datastore.html), supports batch or realtime data processing at scale, data lineage and versioning, structured and unstructured data, and more.
230
- In addition, the MLRun [**Feature Store**](https://docs.mlrun.org/en/latest/feature-store/feature-store.html) automates the collection, transformation, storage, catalog, serving, and monitoring of data features across the ML lifecycle and enables feature reuse and sharing.
231
-
232
- See: **Docs:** [Ingest and process data](https://docs.mlrun.org/en/latest/data-prep/index.html), [Feature Store](https://docs.mlrun.org/en/latest/feature-store/feature-store.html), [Data & Artifacts](https://docs.mlrun.org/en/latest/concepts/data.html); **Tutorials:** [Quick start](https://docs.mlrun.org/en/latest/tutorials/01-mlrun-basics.html), [Feature Store](https://docs.mlrun.org/en/latest/feature-store/basic-demo.html).
233
-
234
- ### Develop and train models
235
-
236
- MLRun allows you to easily build ML pipelines that take data from various sources or the Feature Store and process it, train models at scale with multiple parameters, test models, tracks each experiments, register, version and deploy models, etc. MLRun provides scalable built-in or custom model training services, integrate with any framework and can work with 3rd party training/auto-ML services. You can also bring your own pre-trained model and use it in the pipeline.
237
-
238
- See: **Docs:** [Develop and train models](https://docs.mlrun.org/en/latest/development/index.html), [Model Training and Tracking](https://docs.mlrun.org/en/latest/development/model-training-tracking.html), [Batch Runs and Workflows](https://docs.mlrun.org/en/latest/concepts/runs-workflows.html); **Tutorials:** [Train, compare, and register models](https://docs.mlrun.org/en/latest/tutorials/02-model-training.html), [Automated ML Pipeline](https://docs.mlrun.org/en/latest/tutorials/04-pipeline.html); **Video:** [Train and compare models](https://youtu.be/bZgBsmLMdQo).
239
-
240
- ### Deploy models and applications
241
-
242
- MLRun rapidly deploys and manages production-grade real-time or batch application pipelines using elastic and resilient serverless functions. MLRun addresses the entire ML application: intercepting application/user requests, running data processing tasks, inferencing using one or more models, driving actions, and integrating with the application logic.
243
-
244
- See: **Docs:** [Deploy models and applications](https://docs.mlrun.org/en/latest/deployment/index.html), [Realtime Pipelines](https://docs.mlrun.org/en/latest/serving/serving-graph.html), [Batch Inference](https://docs.mlrun.org/en/latest/deployment/batch_inference.html), **Tutorials:** [Realtime Serving](https://docs.mlrun.org/en/latest/tutorials/03-model-serving.html), [Batch Inference](https://docs.mlrun.org/en/latest/tutorials/07-batch-infer.html), [Advanced Pipeline](https://docs.mlrun.org/en/latest/tutorials/07-batch-infer.html); **Video:** [Serving pre-trained models](https://youtu.be/OUjOus4dZfw).
245
-
246
- ### Monitor and alert
247
-
248
- Observability is built into the different MLRun objects (data, functions, jobs, models, pipelines, etc.), eliminating the need for complex integrations and code instrumentation. With MLRun, you can observe the application/model resource usage and model behavior (drift, performance, etc.), define custom app metrics, and trigger alerts or retraining jobs.
249
-
250
- See: **Docs:** [Monitor and alert](https://docs.mlrun.org/en/latest/monitoring/index.html), [Model Monitoring Overview](https://docs.mlrun.org/en/latest/monitoring/model-monitoring-deployment.html), **Tutorials:** [Model Monitoring & Drift Detection](https://docs.mlrun.org/en/latest/tutorials/05-model-monitoring.html).
251
-
252
-
253
- <a id="core-components"></a>
254
- ## MLRun core components
255
-
256
- <p align="center"><img src="https://github.com/mlrun/mlrun/raw/development/docs/_static/images/mlops-core.png" alt="mlrun-core" width="800"/></p><br>
257
-
258
- MLRun includes the following major components:
259
-
260
- [**Project Management:**](https://docs.mlrun.org/en/latest/projects/project.html) A service (API, SDK, DB, UI) that manages the different project assets (data, functions, jobs, workflows, secrets, etc.) and provides central control and metadata layer.
261
-
262
- [**Functions:**](https://docs.mlrun.org/en/latest/runtimes/functions.html) automatically deployed software package with one or more methods and runtime-specific attributes (such as image, libraries, command, arguments, resources, etc.).
263
-
264
- [**Data & Artifacts:**](https://docs.mlrun.org/en/latest/concepts/data.html) Glueless connectivity to various data sources, metadata management, catalog, and versioning for structures/unstructured artifacts.
265
-
266
- [**Feature Store:**](https://docs.mlrun.org/en/latest/feature-store/feature-store.html) automatically collects, prepares, catalogs, and serves production data features for development (offline) and real-time (online) deployment using minimal engineering effort.
267
-
268
- [**Batch Runs & Workflows:**](https://docs.mlrun.org/en/latest/concepts/runs-workflows.html) Execute one or more functions with specific parameters and collect, track, and compare all their results and artifacts.
269
-
270
- [**Real-Time Serving Pipeline:**](https://docs.mlrun.org/en/latest/serving/serving-graph.html) Rapid deployment of scalable data and ML pipelines using real-time serverless technology, including API handling, data preparation/enrichment, model serving, ensembles, driving and measuring actions, etc.
271
-
272
- [**Real-Time monitoring:**](https://docs.mlrun.org/en/latest/monitoring/index.html) monitors data, models, resources, and production components and provides a feedback loop for exploring production data, identifying drift, alerting on anomalies or data quality issues, triggering retraining jobs, measuring business impact, etc.