mlrun 1.7.0rc4__py3-none-any.whl → 1.7.2__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/__init__.py +11 -1
- mlrun/__main__.py +39 -121
- mlrun/{datastore/helpers.py → alerts/__init__.py} +2 -5
- mlrun/alerts/alert.py +248 -0
- mlrun/api/schemas/__init__.py +4 -3
- mlrun/artifacts/__init__.py +8 -3
- mlrun/artifacts/base.py +39 -254
- mlrun/artifacts/dataset.py +9 -190
- mlrun/artifacts/manager.py +73 -46
- mlrun/artifacts/model.py +30 -158
- mlrun/artifacts/plots.py +23 -380
- mlrun/common/constants.py +73 -1
- mlrun/common/db/sql_session.py +3 -2
- mlrun/common/formatters/__init__.py +21 -0
- mlrun/common/formatters/artifact.py +46 -0
- mlrun/common/formatters/base.py +113 -0
- mlrun/common/formatters/feature_set.py +44 -0
- mlrun/common/formatters/function.py +46 -0
- mlrun/common/formatters/pipeline.py +53 -0
- mlrun/common/formatters/project.py +51 -0
- mlrun/common/formatters/run.py +29 -0
- mlrun/common/helpers.py +11 -1
- mlrun/{runtimes → common/runtimes}/constants.py +32 -4
- mlrun/common/schemas/__init__.py +31 -4
- mlrun/common/schemas/alert.py +202 -0
- mlrun/common/schemas/api_gateway.py +196 -0
- mlrun/common/schemas/artifact.py +28 -1
- mlrun/common/schemas/auth.py +13 -2
- mlrun/common/schemas/client_spec.py +2 -1
- mlrun/common/schemas/common.py +7 -4
- mlrun/common/schemas/constants.py +3 -0
- mlrun/common/schemas/feature_store.py +58 -28
- mlrun/common/schemas/frontend_spec.py +8 -0
- mlrun/common/schemas/function.py +11 -0
- mlrun/common/schemas/hub.py +7 -9
- mlrun/common/schemas/model_monitoring/__init__.py +21 -4
- mlrun/common/schemas/model_monitoring/constants.py +136 -42
- mlrun/common/schemas/model_monitoring/grafana.py +9 -5
- mlrun/common/schemas/model_monitoring/model_endpoints.py +89 -41
- mlrun/common/schemas/notification.py +69 -12
- mlrun/{runtimes/mpijob/v1alpha1.py → common/schemas/pagination.py} +10 -13
- mlrun/common/schemas/pipeline.py +7 -0
- mlrun/common/schemas/project.py +67 -16
- mlrun/common/schemas/runs.py +17 -0
- mlrun/common/schemas/schedule.py +1 -1
- mlrun/common/schemas/workflow.py +10 -2
- mlrun/common/types.py +14 -1
- mlrun/config.py +233 -58
- mlrun/data_types/data_types.py +11 -1
- mlrun/data_types/spark.py +5 -4
- mlrun/data_types/to_pandas.py +75 -34
- mlrun/datastore/__init__.py +8 -10
- mlrun/datastore/alibaba_oss.py +131 -0
- mlrun/datastore/azure_blob.py +131 -43
- mlrun/datastore/base.py +107 -47
- mlrun/datastore/datastore.py +17 -7
- mlrun/datastore/datastore_profile.py +91 -7
- mlrun/datastore/dbfs_store.py +3 -7
- mlrun/datastore/filestore.py +1 -3
- mlrun/datastore/google_cloud_storage.py +92 -32
- mlrun/datastore/hdfs.py +5 -0
- mlrun/datastore/inmem.py +6 -3
- mlrun/datastore/redis.py +3 -2
- mlrun/datastore/s3.py +30 -12
- mlrun/datastore/snowflake_utils.py +45 -0
- mlrun/datastore/sources.py +274 -59
- mlrun/datastore/spark_utils.py +30 -0
- mlrun/datastore/store_resources.py +9 -7
- mlrun/datastore/storeytargets.py +151 -0
- mlrun/datastore/targets.py +387 -119
- mlrun/datastore/utils.py +68 -5
- mlrun/datastore/v3io.py +28 -50
- mlrun/db/auth_utils.py +152 -0
- mlrun/db/base.py +245 -20
- mlrun/db/factory.py +1 -4
- mlrun/db/httpdb.py +909 -231
- mlrun/db/nopdb.py +279 -14
- mlrun/errors.py +35 -5
- mlrun/execution.py +111 -38
- mlrun/feature_store/__init__.py +0 -2
- mlrun/feature_store/api.py +46 -53
- mlrun/feature_store/common.py +6 -11
- mlrun/feature_store/feature_set.py +48 -23
- mlrun/feature_store/feature_vector.py +13 -2
- mlrun/feature_store/ingestion.py +7 -6
- mlrun/feature_store/retrieval/base.py +9 -4
- mlrun/feature_store/retrieval/dask_merger.py +2 -0
- mlrun/feature_store/retrieval/job.py +13 -4
- mlrun/feature_store/retrieval/local_merger.py +2 -0
- mlrun/feature_store/retrieval/spark_merger.py +24 -32
- mlrun/feature_store/steps.py +38 -19
- mlrun/features.py +6 -14
- mlrun/frameworks/_common/plan.py +3 -3
- mlrun/frameworks/_dl_common/loggers/tensorboard_logger.py +7 -12
- mlrun/frameworks/_ml_common/plan.py +1 -1
- mlrun/frameworks/auto_mlrun/auto_mlrun.py +2 -2
- mlrun/frameworks/lgbm/__init__.py +1 -1
- mlrun/frameworks/lgbm/callbacks/callback.py +2 -4
- mlrun/frameworks/lgbm/model_handler.py +1 -1
- mlrun/frameworks/parallel_coordinates.py +4 -4
- mlrun/frameworks/pytorch/__init__.py +2 -2
- mlrun/frameworks/sklearn/__init__.py +1 -1
- mlrun/frameworks/sklearn/mlrun_interface.py +13 -3
- mlrun/frameworks/tf_keras/__init__.py +5 -2
- mlrun/frameworks/tf_keras/callbacks/logging_callback.py +1 -1
- mlrun/frameworks/tf_keras/mlrun_interface.py +2 -2
- mlrun/frameworks/xgboost/__init__.py +1 -1
- mlrun/k8s_utils.py +57 -12
- mlrun/launcher/__init__.py +1 -1
- mlrun/launcher/base.py +6 -5
- mlrun/launcher/client.py +13 -11
- mlrun/launcher/factory.py +1 -1
- mlrun/launcher/local.py +15 -5
- mlrun/launcher/remote.py +10 -3
- mlrun/lists.py +6 -2
- mlrun/model.py +297 -48
- mlrun/model_monitoring/__init__.py +1 -1
- mlrun/model_monitoring/api.py +152 -357
- mlrun/model_monitoring/applications/__init__.py +10 -0
- mlrun/model_monitoring/applications/_application_steps.py +190 -0
- mlrun/model_monitoring/applications/base.py +108 -0
- mlrun/model_monitoring/applications/context.py +341 -0
- mlrun/model_monitoring/{evidently_application.py → applications/evidently_base.py} +27 -22
- mlrun/model_monitoring/applications/histogram_data_drift.py +227 -91
- mlrun/model_monitoring/applications/results.py +99 -0
- mlrun/model_monitoring/controller.py +130 -303
- mlrun/model_monitoring/{stores/models/sqlite.py → db/__init__.py} +5 -10
- mlrun/model_monitoring/db/stores/__init__.py +136 -0
- mlrun/model_monitoring/db/stores/base/__init__.py +15 -0
- mlrun/model_monitoring/db/stores/base/store.py +213 -0
- mlrun/model_monitoring/db/stores/sqldb/__init__.py +13 -0
- mlrun/model_monitoring/db/stores/sqldb/models/__init__.py +71 -0
- mlrun/model_monitoring/db/stores/sqldb/models/base.py +190 -0
- mlrun/model_monitoring/db/stores/sqldb/models/mysql.py +103 -0
- mlrun/model_monitoring/{stores/models/mysql.py → db/stores/sqldb/models/sqlite.py} +19 -13
- mlrun/model_monitoring/db/stores/sqldb/sql_store.py +659 -0
- mlrun/model_monitoring/db/stores/v3io_kv/__init__.py +13 -0
- mlrun/model_monitoring/db/stores/v3io_kv/kv_store.py +726 -0
- mlrun/model_monitoring/db/tsdb/__init__.py +105 -0
- mlrun/model_monitoring/db/tsdb/base.py +448 -0
- mlrun/model_monitoring/db/tsdb/helpers.py +30 -0
- mlrun/model_monitoring/db/tsdb/tdengine/__init__.py +15 -0
- mlrun/model_monitoring/db/tsdb/tdengine/schemas.py +298 -0
- mlrun/model_monitoring/db/tsdb/tdengine/stream_graph_steps.py +42 -0
- mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py +522 -0
- mlrun/model_monitoring/db/tsdb/v3io/__init__.py +15 -0
- mlrun/model_monitoring/db/tsdb/v3io/stream_graph_steps.py +158 -0
- mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +849 -0
- mlrun/model_monitoring/features_drift_table.py +34 -22
- mlrun/model_monitoring/helpers.py +177 -39
- mlrun/model_monitoring/model_endpoint.py +3 -2
- mlrun/model_monitoring/stream_processing.py +165 -398
- mlrun/model_monitoring/tracking_policy.py +7 -1
- mlrun/model_monitoring/writer.py +161 -125
- mlrun/package/packagers/default_packager.py +2 -2
- mlrun/package/packagers_manager.py +1 -0
- mlrun/package/utils/_formatter.py +2 -2
- mlrun/platforms/__init__.py +11 -10
- mlrun/platforms/iguazio.py +67 -228
- mlrun/projects/__init__.py +6 -1
- mlrun/projects/operations.py +47 -20
- mlrun/projects/pipelines.py +396 -249
- mlrun/projects/project.py +1176 -406
- mlrun/render.py +28 -22
- mlrun/run.py +208 -181
- mlrun/runtimes/__init__.py +76 -11
- mlrun/runtimes/base.py +54 -24
- mlrun/runtimes/daskjob.py +9 -2
- mlrun/runtimes/databricks_job/databricks_runtime.py +1 -0
- mlrun/runtimes/databricks_job/databricks_wrapper.py +1 -1
- mlrun/runtimes/funcdoc.py +1 -29
- mlrun/runtimes/kubejob.py +34 -128
- mlrun/runtimes/local.py +39 -10
- mlrun/runtimes/mpijob/__init__.py +0 -20
- mlrun/runtimes/mpijob/abstract.py +8 -8
- mlrun/runtimes/mpijob/v1.py +1 -1
- mlrun/runtimes/nuclio/__init__.py +1 -0
- mlrun/runtimes/nuclio/api_gateway.py +769 -0
- mlrun/runtimes/nuclio/application/__init__.py +15 -0
- mlrun/runtimes/nuclio/application/application.py +758 -0
- mlrun/runtimes/nuclio/application/reverse_proxy.go +95 -0
- mlrun/runtimes/nuclio/function.py +188 -68
- mlrun/runtimes/nuclio/serving.py +57 -60
- mlrun/runtimes/pod.py +191 -58
- mlrun/runtimes/remotesparkjob.py +11 -8
- mlrun/runtimes/sparkjob/spark3job.py +17 -18
- mlrun/runtimes/utils.py +40 -73
- mlrun/secrets.py +6 -2
- mlrun/serving/__init__.py +8 -1
- mlrun/serving/remote.py +2 -3
- mlrun/serving/routers.py +89 -64
- mlrun/serving/server.py +54 -26
- mlrun/serving/states.py +187 -56
- mlrun/serving/utils.py +19 -11
- mlrun/serving/v2_serving.py +136 -63
- mlrun/track/tracker.py +2 -1
- mlrun/track/trackers/mlflow_tracker.py +5 -0
- mlrun/utils/async_http.py +26 -6
- mlrun/utils/db.py +18 -0
- mlrun/utils/helpers.py +375 -105
- mlrun/utils/http.py +2 -2
- mlrun/utils/logger.py +75 -9
- mlrun/utils/notifications/notification/__init__.py +14 -10
- mlrun/utils/notifications/notification/base.py +48 -0
- mlrun/utils/notifications/notification/console.py +2 -0
- mlrun/utils/notifications/notification/git.py +24 -1
- mlrun/utils/notifications/notification/ipython.py +2 -0
- mlrun/utils/notifications/notification/slack.py +96 -21
- mlrun/utils/notifications/notification/webhook.py +63 -2
- mlrun/utils/notifications/notification_pusher.py +146 -16
- mlrun/utils/regex.py +9 -0
- mlrun/utils/retryer.py +3 -2
- mlrun/utils/v3io_clients.py +2 -3
- mlrun/utils/version/version.json +2 -2
- mlrun-1.7.2.dist-info/METADATA +390 -0
- mlrun-1.7.2.dist-info/RECORD +351 -0
- {mlrun-1.7.0rc4.dist-info → mlrun-1.7.2.dist-info}/WHEEL +1 -1
- mlrun/feature_store/retrieval/conversion.py +0 -271
- mlrun/kfpops.py +0 -868
- mlrun/model_monitoring/application.py +0 -310
- mlrun/model_monitoring/batch.py +0 -974
- mlrun/model_monitoring/controller_handler.py +0 -37
- mlrun/model_monitoring/prometheus.py +0 -216
- mlrun/model_monitoring/stores/__init__.py +0 -111
- mlrun/model_monitoring/stores/kv_model_endpoint_store.py +0 -574
- mlrun/model_monitoring/stores/model_endpoint_store.py +0 -145
- mlrun/model_monitoring/stores/models/__init__.py +0 -27
- mlrun/model_monitoring/stores/models/base.py +0 -84
- mlrun/model_monitoring/stores/sql_model_endpoint_store.py +0 -382
- mlrun/platforms/other.py +0 -305
- mlrun-1.7.0rc4.dist-info/METADATA +0 -269
- mlrun-1.7.0rc4.dist-info/RECORD +0 -321
- {mlrun-1.7.0rc4.dist-info → mlrun-1.7.2.dist-info}/LICENSE +0 -0
- {mlrun-1.7.0rc4.dist-info → mlrun-1.7.2.dist-info}/entry_points.txt +0 -0
- {mlrun-1.7.0rc4.dist-info → mlrun-1.7.2.dist-info}/top_level.txt +0 -0
mlrun/platforms/other.py
DELETED
|
@@ -1,305 +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
|
-
|
|
18
|
-
import kfp.dsl
|
|
19
|
-
|
|
20
|
-
import mlrun
|
|
21
|
-
from mlrun.config import config
|
|
22
|
-
from mlrun.errors import MLRunInvalidArgumentError
|
|
23
|
-
from mlrun.utils.helpers import logger
|
|
24
|
-
|
|
25
|
-
from .iguazio import mount_v3io
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def mount_pvc(pvc_name=None, volume_name="pipeline", volume_mount_path="/mnt/pipeline"):
|
|
29
|
-
"""
|
|
30
|
-
Modifier function to apply to a Container Op to simplify volume, volume mount addition and
|
|
31
|
-
enable better reuse of volumes, volume claims across container ops.
|
|
32
|
-
|
|
33
|
-
Usage::
|
|
34
|
-
|
|
35
|
-
train = train_op(...)
|
|
36
|
-
train.apply(mount_pvc('claim-name', 'pipeline', '/mnt/pipeline'))
|
|
37
|
-
"""
|
|
38
|
-
if "MLRUN_PVC_MOUNT" in os.environ:
|
|
39
|
-
mount = os.environ.get("MLRUN_PVC_MOUNT")
|
|
40
|
-
items = mount.split(":")
|
|
41
|
-
if len(items) != 2:
|
|
42
|
-
raise MLRunInvalidArgumentError(
|
|
43
|
-
"MLRUN_PVC_MOUNT should include <pvc-name>:<mount-path>"
|
|
44
|
-
)
|
|
45
|
-
pvc_name = items[0]
|
|
46
|
-
volume_mount_path = items[1]
|
|
47
|
-
|
|
48
|
-
if not pvc_name:
|
|
49
|
-
raise MLRunInvalidArgumentError(
|
|
50
|
-
"No PVC name: use the pvc_name parameter or configure the MLRUN_PVC_MOUNT environment variable"
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
def _mount_pvc(task):
|
|
54
|
-
from kubernetes import client as k8s_client
|
|
55
|
-
|
|
56
|
-
local_pvc = k8s_client.V1PersistentVolumeClaimVolumeSource(claim_name=pvc_name)
|
|
57
|
-
return task.add_volume(
|
|
58
|
-
k8s_client.V1Volume(name=volume_name, persistent_volume_claim=local_pvc)
|
|
59
|
-
).add_volume_mount(
|
|
60
|
-
k8s_client.V1VolumeMount(mount_path=volume_mount_path, name=volume_name)
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
return _mount_pvc
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
def auto_mount(pvc_name="", volume_mount_path="", volume_name=None):
|
|
67
|
-
"""choose the mount based on env variables and params
|
|
68
|
-
|
|
69
|
-
volume will be selected by the following order:
|
|
70
|
-
- k8s PVC volume when both pvc_name and volume_mount_path are set
|
|
71
|
-
- k8s PVC volume when env var is set: MLRUN_PVC_MOUNT=<pvc-name>:<mount-path>
|
|
72
|
-
- k8s PVC volume if it's configured as the auto mount type
|
|
73
|
-
- iguazio v3io volume when V3IO_ACCESS_KEY and V3IO_USERNAME env vars are set
|
|
74
|
-
"""
|
|
75
|
-
if pvc_name and volume_mount_path:
|
|
76
|
-
return mount_pvc(
|
|
77
|
-
pvc_name=pvc_name,
|
|
78
|
-
volume_mount_path=volume_mount_path,
|
|
79
|
-
volume_name=volume_name or "shared-persistency",
|
|
80
|
-
)
|
|
81
|
-
if "MLRUN_PVC_MOUNT" in os.environ:
|
|
82
|
-
return mount_pvc(
|
|
83
|
-
volume_name=volume_name or "shared-persistency",
|
|
84
|
-
)
|
|
85
|
-
# In the case of MLRun-kit when working remotely, no env variables will be defined but auto-mount
|
|
86
|
-
# parameters may still be declared - use them in that case.
|
|
87
|
-
if config.storage.auto_mount_type == "pvc":
|
|
88
|
-
return mount_pvc(**config.get_storage_auto_mount_params())
|
|
89
|
-
if "V3IO_ACCESS_KEY" in os.environ:
|
|
90
|
-
return mount_v3io(name=volume_name or "v3io")
|
|
91
|
-
|
|
92
|
-
raise ValueError("failed to auto mount, need to set env vars")
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
def mount_secret(secret_name, mount_path, volume_name="secret", items=None):
|
|
96
|
-
"""Modifier function to mount kubernetes secret as files(s)
|
|
97
|
-
|
|
98
|
-
:param secret_name: k8s secret name
|
|
99
|
-
:param mount_path: path to mount inside the container
|
|
100
|
-
:param volume_name: unique volume name
|
|
101
|
-
:param items: If unspecified, each key-value pair in the Data field
|
|
102
|
-
of the referenced Secret will be projected into the
|
|
103
|
-
volume as a file whose name is the key and content is
|
|
104
|
-
the value.
|
|
105
|
-
If specified, the listed keys will be projected into
|
|
106
|
-
the specified paths, and unlisted keys will not be
|
|
107
|
-
present.
|
|
108
|
-
"""
|
|
109
|
-
|
|
110
|
-
def _mount_secret(task):
|
|
111
|
-
from kubernetes import client as k8s_client
|
|
112
|
-
|
|
113
|
-
vol = k8s_client.V1SecretVolumeSource(secret_name=secret_name, items=items)
|
|
114
|
-
return task.add_volume(
|
|
115
|
-
k8s_client.V1Volume(name=volume_name, secret=vol)
|
|
116
|
-
).add_volume_mount(
|
|
117
|
-
k8s_client.V1VolumeMount(mount_path=mount_path, name=volume_name)
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
return _mount_secret
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
def mount_configmap(configmap_name, mount_path, volume_name="configmap", items=None):
|
|
124
|
-
"""Modifier function to mount kubernetes configmap as files(s)
|
|
125
|
-
|
|
126
|
-
:param configmap_name: k8s configmap name
|
|
127
|
-
:param mount_path: path to mount inside the container
|
|
128
|
-
:param volume_name: unique volume name
|
|
129
|
-
:param items: If unspecified, each key-value pair in the Data field
|
|
130
|
-
of the referenced Configmap will be projected into the
|
|
131
|
-
volume as a file whose name is the key and content is
|
|
132
|
-
the value.
|
|
133
|
-
If specified, the listed keys will be projected into
|
|
134
|
-
the specified paths, and unlisted keys will not be
|
|
135
|
-
present.
|
|
136
|
-
"""
|
|
137
|
-
|
|
138
|
-
def _mount_configmap(task):
|
|
139
|
-
from kubernetes import client as k8s_client
|
|
140
|
-
|
|
141
|
-
vol = k8s_client.V1ConfigMapVolumeSource(name=configmap_name, items=items)
|
|
142
|
-
return task.add_volume(
|
|
143
|
-
k8s_client.V1Volume(name=volume_name, config_map=vol)
|
|
144
|
-
).add_volume_mount(
|
|
145
|
-
k8s_client.V1VolumeMount(mount_path=mount_path, name=volume_name)
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
return _mount_configmap
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
def mount_hostpath(host_path, mount_path, volume_name="hostpath"):
|
|
152
|
-
"""Modifier function to mount kubernetes configmap as files(s)
|
|
153
|
-
|
|
154
|
-
:param host_path: host path
|
|
155
|
-
:param mount_path: path to mount inside the container
|
|
156
|
-
:param volume_name: unique volume name
|
|
157
|
-
"""
|
|
158
|
-
|
|
159
|
-
def _mount_hostpath(task):
|
|
160
|
-
from kubernetes import client as k8s_client
|
|
161
|
-
|
|
162
|
-
return task.add_volume(
|
|
163
|
-
k8s_client.V1Volume(
|
|
164
|
-
name=volume_name,
|
|
165
|
-
host_path=k8s_client.V1HostPathVolumeSource(path=host_path, type=""),
|
|
166
|
-
)
|
|
167
|
-
).add_volume_mount(
|
|
168
|
-
k8s_client.V1VolumeMount(mount_path=mount_path, name=volume_name)
|
|
169
|
-
)
|
|
170
|
-
|
|
171
|
-
return _mount_hostpath
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
def mount_s3(
|
|
175
|
-
secret_name=None,
|
|
176
|
-
aws_access_key="",
|
|
177
|
-
aws_secret_key="",
|
|
178
|
-
endpoint_url=None,
|
|
179
|
-
prefix="",
|
|
180
|
-
aws_region=None,
|
|
181
|
-
non_anonymous=False,
|
|
182
|
-
):
|
|
183
|
-
"""Modifier function to add s3 env vars or secrets to container
|
|
184
|
-
|
|
185
|
-
**Warning:**
|
|
186
|
-
Using this function to configure AWS credentials will expose these credentials in the pod spec of the runtime
|
|
187
|
-
created. It is recommended to use the `secret_name` parameter, or set the credentials as project-secrets and avoid
|
|
188
|
-
using this function.
|
|
189
|
-
|
|
190
|
-
:param secret_name: kubernetes secret name (storing the access/secret keys)
|
|
191
|
-
:param aws_access_key: AWS_ACCESS_KEY_ID value. If this parameter is not specified and AWS_ACCESS_KEY_ID env.
|
|
192
|
-
variable is defined, the value will be taken from the env. variable
|
|
193
|
-
:param aws_secret_key: AWS_SECRET_ACCESS_KEY value. If this parameter is not specified and AWS_SECRET_ACCESS_KEY
|
|
194
|
-
env. variable is defined, the value will be taken from the env. variable
|
|
195
|
-
:param endpoint_url: s3 endpoint address (for non AWS s3)
|
|
196
|
-
:param prefix: string prefix to add before the env var name (for working with multiple s3 data stores)
|
|
197
|
-
:param aws_region: amazon region
|
|
198
|
-
:param non_anonymous: force the S3 API to use non-anonymous connection, even if no credentials are provided
|
|
199
|
-
(for authenticating externally, such as through IAM instance-roles)
|
|
200
|
-
"""
|
|
201
|
-
|
|
202
|
-
if secret_name and (aws_access_key or aws_secret_key):
|
|
203
|
-
raise mlrun.errors.MLRunInvalidArgumentError(
|
|
204
|
-
"can use k8s_secret for credentials or specify them (aws_access_key, aws_secret_key) not both"
|
|
205
|
-
)
|
|
206
|
-
|
|
207
|
-
if not secret_name and (
|
|
208
|
-
aws_access_key
|
|
209
|
-
or os.environ.get(prefix + "AWS_ACCESS_KEY_ID")
|
|
210
|
-
or aws_secret_key
|
|
211
|
-
or os.environ.get(prefix + "AWS_SECRET_ACCESS_KEY")
|
|
212
|
-
):
|
|
213
|
-
logger.warning(
|
|
214
|
-
"it is recommended to use k8s secret (specify secret_name), "
|
|
215
|
-
"specifying the aws_access_key/aws_secret_key directly is unsafe"
|
|
216
|
-
)
|
|
217
|
-
|
|
218
|
-
def _use_s3_cred(container_op):
|
|
219
|
-
from os import environ
|
|
220
|
-
|
|
221
|
-
from kubernetes import client as k8s_client
|
|
222
|
-
|
|
223
|
-
_access_key = aws_access_key or environ.get(prefix + "AWS_ACCESS_KEY_ID")
|
|
224
|
-
_secret_key = aws_secret_key or environ.get(prefix + "AWS_SECRET_ACCESS_KEY")
|
|
225
|
-
_endpoint_url = endpoint_url or environ.get(prefix + "S3_ENDPOINT_URL")
|
|
226
|
-
|
|
227
|
-
container = container_op.container
|
|
228
|
-
if _endpoint_url:
|
|
229
|
-
container.add_env_variable(
|
|
230
|
-
k8s_client.V1EnvVar(name=prefix + "S3_ENDPOINT_URL", value=endpoint_url)
|
|
231
|
-
)
|
|
232
|
-
if aws_region:
|
|
233
|
-
container.add_env_variable(
|
|
234
|
-
k8s_client.V1EnvVar(name=prefix + "AWS_REGION", value=aws_region)
|
|
235
|
-
)
|
|
236
|
-
if non_anonymous:
|
|
237
|
-
container.add_env_variable(
|
|
238
|
-
k8s_client.V1EnvVar(name=prefix + "S3_NON_ANONYMOUS", value="true")
|
|
239
|
-
)
|
|
240
|
-
|
|
241
|
-
if secret_name:
|
|
242
|
-
container.add_env_variable(
|
|
243
|
-
k8s_client.V1EnvVar(
|
|
244
|
-
name=prefix + "AWS_ACCESS_KEY_ID",
|
|
245
|
-
value_from=k8s_client.V1EnvVarSource(
|
|
246
|
-
secret_key_ref=k8s_client.V1SecretKeySelector(
|
|
247
|
-
name=secret_name, key="AWS_ACCESS_KEY_ID"
|
|
248
|
-
)
|
|
249
|
-
),
|
|
250
|
-
)
|
|
251
|
-
).add_env_variable(
|
|
252
|
-
k8s_client.V1EnvVar(
|
|
253
|
-
name=prefix + "AWS_SECRET_ACCESS_KEY",
|
|
254
|
-
value_from=k8s_client.V1EnvVarSource(
|
|
255
|
-
secret_key_ref=k8s_client.V1SecretKeySelector(
|
|
256
|
-
name=secret_name, key="AWS_SECRET_ACCESS_KEY"
|
|
257
|
-
)
|
|
258
|
-
),
|
|
259
|
-
)
|
|
260
|
-
)
|
|
261
|
-
|
|
262
|
-
else:
|
|
263
|
-
return container_op.add_env_variable(
|
|
264
|
-
k8s_client.V1EnvVar(
|
|
265
|
-
name=prefix + "AWS_ACCESS_KEY_ID", value=_access_key
|
|
266
|
-
)
|
|
267
|
-
).add_env_variable(
|
|
268
|
-
k8s_client.V1EnvVar(
|
|
269
|
-
name=prefix + "AWS_SECRET_ACCESS_KEY", value=_secret_key
|
|
270
|
-
)
|
|
271
|
-
)
|
|
272
|
-
|
|
273
|
-
return _use_s3_cred
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
def set_env_variables(env_vars_dict: dict[str, str] = None, **kwargs):
|
|
277
|
-
"""
|
|
278
|
-
Modifier function to apply a set of environment variables to a runtime. Variables may be passed
|
|
279
|
-
as either a dictionary of name-value pairs, or as arguments to the function.
|
|
280
|
-
See `KubeResource.apply` for more information on modifiers.
|
|
281
|
-
|
|
282
|
-
Usage::
|
|
283
|
-
|
|
284
|
-
function.apply(set_env_variables({"ENV1": "value1", "ENV2": "value2"}))
|
|
285
|
-
or
|
|
286
|
-
function.apply(set_env_variables(ENV1=value1, ENV2=value2))
|
|
287
|
-
|
|
288
|
-
:param env_vars_dict: dictionary of env. variables
|
|
289
|
-
:param kwargs: environment variables passed as args
|
|
290
|
-
"""
|
|
291
|
-
|
|
292
|
-
env_data = env_vars_dict.copy() if env_vars_dict else {}
|
|
293
|
-
for key, value in kwargs.items():
|
|
294
|
-
env_data[key] = value
|
|
295
|
-
|
|
296
|
-
def _set_env_variables(container_op: kfp.dsl.ContainerOp):
|
|
297
|
-
from kubernetes import client as k8s_client
|
|
298
|
-
|
|
299
|
-
for _key, _value in env_data.items():
|
|
300
|
-
container_op.container.add_env_variable(
|
|
301
|
-
k8s_client.V1EnvVar(name=_key, value=_value)
|
|
302
|
-
)
|
|
303
|
-
return container_op
|
|
304
|
-
|
|
305
|
-
return _set_env_variables
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: mlrun
|
|
3
|
-
Version: 1.7.0rc4
|
|
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
|
|
30
|
-
Requires-Dist: nest-asyncio ~=1.0
|
|
31
|
-
Requires-Dist: ipython ~=8.10
|
|
32
|
-
Requires-Dist: nuclio-jupyter ~=0.9.16
|
|
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.2
|
|
40
|
-
Requires-Dist: pydantic >=1.10.8,~=1.10
|
|
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.7.5
|
|
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: orjson ~=3.9
|
|
54
|
-
Provides-Extra: all
|
|
55
|
-
Requires-Dist: adlfs ==2023.9.0 ; extra == 'all'
|
|
56
|
-
Requires-Dist: aiobotocore <2.8,>=2.5.0 ; extra == 'all'
|
|
57
|
-
Requires-Dist: avro ~=1.11 ; extra == 'all'
|
|
58
|
-
Requires-Dist: azure-core ~=1.24 ; extra == 'all'
|
|
59
|
-
Requires-Dist: azure-identity ~=1.5 ; extra == 'all'
|
|
60
|
-
Requires-Dist: azure-keyvault-secrets ~=4.2 ; extra == 'all'
|
|
61
|
-
Requires-Dist: bokeh >=2.4.2,~=2.4 ; extra == 'all'
|
|
62
|
-
Requires-Dist: boto3 <1.29.0,>=1.28.0 ; extra == 'all'
|
|
63
|
-
Requires-Dist: dask ~=2023.9.0 ; extra == 'all'
|
|
64
|
-
Requires-Dist: databricks-sdk ~=0.13.0 ; extra == 'all'
|
|
65
|
-
Requires-Dist: distributed ~=2023.9.0 ; extra == 'all'
|
|
66
|
-
Requires-Dist: gcsfs ==2023.9.2 ; extra == 'all'
|
|
67
|
-
Requires-Dist: google-cloud-bigquery[bqstorage,pandas] ==3.14.1 ; extra == 'all'
|
|
68
|
-
Requires-Dist: google-cloud-storage ==2.14.0 ; extra == 'all'
|
|
69
|
-
Requires-Dist: google-cloud ==0.34 ; extra == 'all'
|
|
70
|
-
Requires-Dist: graphviz ~=0.20.0 ; extra == 'all'
|
|
71
|
-
Requires-Dist: kafka-python ~=2.0 ; extra == 'all'
|
|
72
|
-
Requires-Dist: mlflow ~=2.8 ; extra == 'all'
|
|
73
|
-
Requires-Dist: msrest ~=0.6.21 ; extra == 'all'
|
|
74
|
-
Requires-Dist: plotly <5.12.0,~=5.4 ; extra == 'all'
|
|
75
|
-
Requires-Dist: pyopenssl >=23 ; extra == 'all'
|
|
76
|
-
Requires-Dist: redis ~=4.3 ; extra == 'all'
|
|
77
|
-
Requires-Dist: s3fs ==2023.9.2 ; extra == 'all'
|
|
78
|
-
Requires-Dist: sqlalchemy ~=1.4 ; extra == 'all'
|
|
79
|
-
Provides-Extra: api
|
|
80
|
-
Requires-Dist: uvicorn ~=0.27.1 ; extra == 'api'
|
|
81
|
-
Requires-Dist: dask-kubernetes ~=0.11.0 ; extra == 'api'
|
|
82
|
-
Requires-Dist: apscheduler <4,>=3.10.3 ; extra == 'api'
|
|
83
|
-
Requires-Dist: objgraph ~=3.6 ; extra == 'api'
|
|
84
|
-
Requires-Dist: igz-mgmt ~=0.1.0 ; extra == 'api'
|
|
85
|
-
Requires-Dist: humanfriendly ~=10.0 ; extra == 'api'
|
|
86
|
-
Requires-Dist: fastapi ~=0.110.0 ; extra == 'api'
|
|
87
|
-
Requires-Dist: sqlalchemy ~=1.4 ; extra == 'api'
|
|
88
|
-
Requires-Dist: pymysql ~=1.0 ; extra == 'api'
|
|
89
|
-
Requires-Dist: alembic ~=1.9 ; extra == 'api'
|
|
90
|
-
Requires-Dist: timelength ~=1.1 ; extra == 'api'
|
|
91
|
-
Provides-Extra: azure-blob-storage
|
|
92
|
-
Requires-Dist: msrest ~=0.6.21 ; extra == 'azure-blob-storage'
|
|
93
|
-
Requires-Dist: azure-core ~=1.24 ; extra == 'azure-blob-storage'
|
|
94
|
-
Requires-Dist: adlfs ==2023.9.0 ; extra == 'azure-blob-storage'
|
|
95
|
-
Requires-Dist: pyopenssl >=23 ; extra == 'azure-blob-storage'
|
|
96
|
-
Provides-Extra: azure-key-vault
|
|
97
|
-
Requires-Dist: azure-identity ~=1.5 ; extra == 'azure-key-vault'
|
|
98
|
-
Requires-Dist: azure-keyvault-secrets ~=4.2 ; extra == 'azure-key-vault'
|
|
99
|
-
Requires-Dist: pyopenssl >=23 ; extra == 'azure-key-vault'
|
|
100
|
-
Provides-Extra: bokeh
|
|
101
|
-
Requires-Dist: bokeh >=2.4.2,~=2.4 ; extra == 'bokeh'
|
|
102
|
-
Provides-Extra: complete
|
|
103
|
-
Requires-Dist: adlfs ==2023.9.0 ; extra == 'complete'
|
|
104
|
-
Requires-Dist: aiobotocore <2.8,>=2.5.0 ; extra == 'complete'
|
|
105
|
-
Requires-Dist: avro ~=1.11 ; extra == 'complete'
|
|
106
|
-
Requires-Dist: azure-core ~=1.24 ; extra == 'complete'
|
|
107
|
-
Requires-Dist: azure-identity ~=1.5 ; extra == 'complete'
|
|
108
|
-
Requires-Dist: azure-keyvault-secrets ~=4.2 ; extra == 'complete'
|
|
109
|
-
Requires-Dist: boto3 <1.29.0,>=1.28.0 ; extra == 'complete'
|
|
110
|
-
Requires-Dist: dask ~=2023.9.0 ; extra == 'complete'
|
|
111
|
-
Requires-Dist: databricks-sdk ~=0.13.0 ; extra == 'complete'
|
|
112
|
-
Requires-Dist: distributed ~=2023.9.0 ; extra == 'complete'
|
|
113
|
-
Requires-Dist: gcsfs ==2023.9.2 ; extra == 'complete'
|
|
114
|
-
Requires-Dist: google-cloud-bigquery[bqstorage,pandas] ==3.14.1 ; extra == 'complete'
|
|
115
|
-
Requires-Dist: graphviz ~=0.20.0 ; extra == 'complete'
|
|
116
|
-
Requires-Dist: kafka-python ~=2.0 ; extra == 'complete'
|
|
117
|
-
Requires-Dist: mlflow ~=2.8 ; extra == 'complete'
|
|
118
|
-
Requires-Dist: msrest ~=0.6.21 ; extra == 'complete'
|
|
119
|
-
Requires-Dist: plotly <5.12.0,~=5.4 ; extra == 'complete'
|
|
120
|
-
Requires-Dist: pyopenssl >=23 ; extra == 'complete'
|
|
121
|
-
Requires-Dist: redis ~=4.3 ; extra == 'complete'
|
|
122
|
-
Requires-Dist: s3fs ==2023.9.2 ; extra == 'complete'
|
|
123
|
-
Requires-Dist: sqlalchemy ~=1.4 ; extra == 'complete'
|
|
124
|
-
Provides-Extra: complete-api
|
|
125
|
-
Requires-Dist: adlfs ==2023.9.0 ; extra == 'complete-api'
|
|
126
|
-
Requires-Dist: aiobotocore <2.8,>=2.5.0 ; extra == 'complete-api'
|
|
127
|
-
Requires-Dist: alembic ~=1.9 ; extra == 'complete-api'
|
|
128
|
-
Requires-Dist: apscheduler <4,>=3.10.3 ; extra == 'complete-api'
|
|
129
|
-
Requires-Dist: avro ~=1.11 ; extra == 'complete-api'
|
|
130
|
-
Requires-Dist: azure-core ~=1.24 ; extra == 'complete-api'
|
|
131
|
-
Requires-Dist: azure-identity ~=1.5 ; extra == 'complete-api'
|
|
132
|
-
Requires-Dist: azure-keyvault-secrets ~=4.2 ; extra == 'complete-api'
|
|
133
|
-
Requires-Dist: boto3 <1.29.0,>=1.28.0 ; extra == 'complete-api'
|
|
134
|
-
Requires-Dist: dask-kubernetes ~=0.11.0 ; extra == 'complete-api'
|
|
135
|
-
Requires-Dist: dask ~=2023.9.0 ; extra == 'complete-api'
|
|
136
|
-
Requires-Dist: databricks-sdk ~=0.13.0 ; extra == 'complete-api'
|
|
137
|
-
Requires-Dist: distributed ~=2023.9.0 ; extra == 'complete-api'
|
|
138
|
-
Requires-Dist: fastapi ~=0.110.0 ; extra == 'complete-api'
|
|
139
|
-
Requires-Dist: gcsfs ==2023.9.2 ; extra == 'complete-api'
|
|
140
|
-
Requires-Dist: google-cloud-bigquery[bqstorage,pandas] ==3.14.1 ; extra == 'complete-api'
|
|
141
|
-
Requires-Dist: graphviz ~=0.20.0 ; extra == 'complete-api'
|
|
142
|
-
Requires-Dist: humanfriendly ~=10.0 ; extra == 'complete-api'
|
|
143
|
-
Requires-Dist: igz-mgmt ~=0.1.0 ; extra == 'complete-api'
|
|
144
|
-
Requires-Dist: kafka-python ~=2.0 ; extra == 'complete-api'
|
|
145
|
-
Requires-Dist: mlflow ~=2.8 ; extra == 'complete-api'
|
|
146
|
-
Requires-Dist: msrest ~=0.6.21 ; extra == 'complete-api'
|
|
147
|
-
Requires-Dist: objgraph ~=3.6 ; extra == 'complete-api'
|
|
148
|
-
Requires-Dist: plotly <5.12.0,~=5.4 ; extra == 'complete-api'
|
|
149
|
-
Requires-Dist: pymysql ~=1.0 ; extra == 'complete-api'
|
|
150
|
-
Requires-Dist: pyopenssl >=23 ; extra == 'complete-api'
|
|
151
|
-
Requires-Dist: redis ~=4.3 ; extra == 'complete-api'
|
|
152
|
-
Requires-Dist: s3fs ==2023.9.2 ; extra == 'complete-api'
|
|
153
|
-
Requires-Dist: sqlalchemy ~=1.4 ; extra == 'complete-api'
|
|
154
|
-
Requires-Dist: timelength ~=1.1 ; extra == 'complete-api'
|
|
155
|
-
Requires-Dist: uvicorn ~=0.27.1 ; extra == 'complete-api'
|
|
156
|
-
Provides-Extra: dask
|
|
157
|
-
Requires-Dist: dask ~=2023.9.0 ; extra == 'dask'
|
|
158
|
-
Requires-Dist: distributed ~=2023.9.0 ; extra == 'dask'
|
|
159
|
-
Provides-Extra: databricks-sdk
|
|
160
|
-
Requires-Dist: databricks-sdk ~=0.13.0 ; extra == 'databricks-sdk'
|
|
161
|
-
Provides-Extra: google-cloud
|
|
162
|
-
Requires-Dist: google-cloud-storage ==2.14.0 ; extra == 'google-cloud'
|
|
163
|
-
Requires-Dist: google-cloud-bigquery[bqstorage,pandas] ==3.14.1 ; extra == 'google-cloud'
|
|
164
|
-
Requires-Dist: google-cloud ==0.34 ; extra == 'google-cloud'
|
|
165
|
-
Provides-Extra: google-cloud-bigquery
|
|
166
|
-
Requires-Dist: google-cloud-bigquery[bqstorage,pandas] ==3.14.1 ; extra == 'google-cloud-bigquery'
|
|
167
|
-
Provides-Extra: google-cloud-storage
|
|
168
|
-
Requires-Dist: gcsfs ==2023.9.2 ; extra == 'google-cloud-storage'
|
|
169
|
-
Provides-Extra: graphviz
|
|
170
|
-
Requires-Dist: graphviz ~=0.20.0 ; extra == 'graphviz'
|
|
171
|
-
Provides-Extra: kafka
|
|
172
|
-
Requires-Dist: kafka-python ~=2.0 ; extra == 'kafka'
|
|
173
|
-
Requires-Dist: avro ~=1.11 ; extra == 'kafka'
|
|
174
|
-
Provides-Extra: mlflow
|
|
175
|
-
Requires-Dist: mlflow ~=2.8 ; extra == 'mlflow'
|
|
176
|
-
Provides-Extra: plotly
|
|
177
|
-
Requires-Dist: plotly <5.12.0,~=5.4 ; extra == 'plotly'
|
|
178
|
-
Provides-Extra: redis
|
|
179
|
-
Requires-Dist: redis ~=4.3 ; extra == 'redis'
|
|
180
|
-
Provides-Extra: s3
|
|
181
|
-
Requires-Dist: boto3 <1.29.0,>=1.28.0 ; extra == 's3'
|
|
182
|
-
Requires-Dist: aiobotocore <2.8,>=2.5.0 ; extra == 's3'
|
|
183
|
-
Requires-Dist: s3fs ==2023.9.2 ; extra == 's3'
|
|
184
|
-
Provides-Extra: sqlalchemy
|
|
185
|
-
Requires-Dist: sqlalchemy ~=1.4 ; extra == 'sqlalchemy'
|
|
186
|
-
|
|
187
|
-
<a id="top"></a>
|
|
188
|
-
[](https://github.com/mlrun/mlrun/actions/workflows/build.yaml?query=branch%3Adevelopment)
|
|
189
|
-
[](https://opensource.org/licenses/Apache-2.0)
|
|
190
|
-
[](https://pypi.python.org/pypi/mlrun/)
|
|
191
|
-
[](https://mlrun.readthedocs.io/en/latest/?badge=latest)
|
|
192
|
-
[](https://github.com/astral-sh/ruff)
|
|
193
|
-

|
|
194
|
-

|
|
195
|
-
[](https://mlopslive.slack.com)
|
|
196
|
-
|
|
197
|
-
<p align="left"><img src="https://github.com/mlrun/mlrun/raw/development/docs/_static/images/MLRun-logo.png" alt="MLRun logo" width="150"/></p>
|
|
198
|
-
|
|
199
|
-
# Using MLRun
|
|
200
|
-
|
|
201
|
-
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.
|
|
202
|
-
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.
|
|
203
|
-
|
|
204
|
-
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).
|
|
205
|
-
|
|
206
|
-
This page explains how MLRun addresses the [**MLOps Tasks**](#mlops-tasks) and the [**MLRun core components**](#core-components).
|
|
207
|
-
|
|
208
|
-
<a id="mlops-tasks"></a>
|
|
209
|
-
## MLOps tasks
|
|
210
|
-
|
|
211
|
-
<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>
|
|
212
|
-
|
|
213
|
-
The [**MLOps development workflow**](https://docs.mlrun.org/en/latest/mlops-dev-flow.html) section describes the different tasks and stages in detail.
|
|
214
|
-
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).
|
|
215
|
-
|
|
216
|
-
### Project management and CI/CD automation
|
|
217
|
-
|
|
218
|
-
In MLRun the assets, metadata, and services (data, functions, jobs, artifacts, models, secrets, etc.) are organized into projects.
|
|
219
|
-
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.
|
|
220
|
-
Project access can be restricted to a set of users and roles.
|
|
221
|
-
|
|
222
|
-
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).
|
|
223
|
-
|
|
224
|
-
### Ingest and process data
|
|
225
|
-
|
|
226
|
-
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.
|
|
227
|
-
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.
|
|
228
|
-
|
|
229
|
-
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).
|
|
230
|
-
|
|
231
|
-
### Develop and train models
|
|
232
|
-
|
|
233
|
-
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.
|
|
234
|
-
|
|
235
|
-
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).
|
|
236
|
-
|
|
237
|
-
### Deploy models and applications
|
|
238
|
-
|
|
239
|
-
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.
|
|
240
|
-
|
|
241
|
-
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).
|
|
242
|
-
|
|
243
|
-
### Monitor and alert
|
|
244
|
-
|
|
245
|
-
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.
|
|
246
|
-
|
|
247
|
-
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).
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
<a id="core-components"></a>
|
|
251
|
-
## MLRun core components
|
|
252
|
-
|
|
253
|
-
<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>
|
|
254
|
-
|
|
255
|
-
MLRun includes the following major components:
|
|
256
|
-
|
|
257
|
-
[**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.
|
|
258
|
-
|
|
259
|
-
[**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.).
|
|
260
|
-
|
|
261
|
-
[**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.
|
|
262
|
-
|
|
263
|
-
[**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.
|
|
264
|
-
|
|
265
|
-
[**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.
|
|
266
|
-
|
|
267
|
-
[**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.
|
|
268
|
-
|
|
269
|
-
[**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.
|