mlrun 1.10.0rc18__py3-none-any.whl → 1.11.0rc16__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 +24 -3
- mlrun/__main__.py +0 -4
- mlrun/artifacts/dataset.py +2 -2
- mlrun/artifacts/document.py +6 -1
- mlrun/artifacts/llm_prompt.py +21 -15
- mlrun/artifacts/model.py +3 -3
- mlrun/artifacts/plots.py +1 -1
- mlrun/{model_monitoring/db/tsdb/tdengine → auth}/__init__.py +2 -3
- mlrun/auth/nuclio.py +89 -0
- mlrun/auth/providers.py +429 -0
- mlrun/auth/utils.py +415 -0
- mlrun/common/constants.py +14 -0
- mlrun/common/model_monitoring/helpers.py +123 -0
- mlrun/common/runtimes/constants.py +28 -0
- mlrun/common/schemas/__init__.py +14 -3
- mlrun/common/schemas/alert.py +2 -2
- mlrun/common/schemas/api_gateway.py +3 -0
- mlrun/common/schemas/auth.py +12 -10
- mlrun/common/schemas/client_spec.py +4 -0
- mlrun/common/schemas/constants.py +25 -0
- mlrun/common/schemas/frontend_spec.py +1 -8
- mlrun/common/schemas/function.py +34 -0
- mlrun/common/schemas/hub.py +33 -20
- mlrun/common/schemas/model_monitoring/__init__.py +2 -1
- mlrun/common/schemas/model_monitoring/constants.py +12 -15
- mlrun/common/schemas/model_monitoring/functions.py +13 -4
- mlrun/common/schemas/model_monitoring/model_endpoints.py +11 -0
- mlrun/common/schemas/pipeline.py +1 -1
- mlrun/common/schemas/secret.py +17 -2
- mlrun/common/secrets.py +95 -1
- mlrun/common/types.py +10 -10
- mlrun/config.py +69 -19
- mlrun/data_types/infer.py +2 -2
- mlrun/datastore/__init__.py +12 -5
- mlrun/datastore/azure_blob.py +162 -47
- mlrun/datastore/base.py +274 -10
- mlrun/datastore/datastore.py +7 -2
- mlrun/datastore/datastore_profile.py +84 -22
- mlrun/datastore/model_provider/huggingface_provider.py +225 -41
- mlrun/datastore/model_provider/mock_model_provider.py +87 -0
- mlrun/datastore/model_provider/model_provider.py +206 -74
- mlrun/datastore/model_provider/openai_provider.py +226 -66
- mlrun/datastore/s3.py +39 -18
- mlrun/datastore/sources.py +1 -1
- mlrun/datastore/store_resources.py +4 -4
- mlrun/datastore/storeytargets.py +17 -12
- mlrun/datastore/targets.py +1 -1
- mlrun/datastore/utils.py +25 -6
- mlrun/datastore/v3io.py +1 -1
- mlrun/db/base.py +63 -32
- mlrun/db/httpdb.py +373 -153
- mlrun/db/nopdb.py +54 -21
- mlrun/errors.py +4 -2
- mlrun/execution.py +66 -25
- mlrun/feature_store/api.py +1 -1
- mlrun/feature_store/common.py +1 -1
- mlrun/feature_store/feature_vector_utils.py +1 -1
- mlrun/feature_store/steps.py +8 -6
- mlrun/frameworks/_common/utils.py +3 -3
- mlrun/frameworks/_dl_common/loggers/logger.py +1 -1
- mlrun/frameworks/_dl_common/loggers/tensorboard_logger.py +2 -1
- mlrun/frameworks/_ml_common/loggers/mlrun_logger.py +1 -1
- mlrun/frameworks/_ml_common/utils.py +2 -1
- mlrun/frameworks/auto_mlrun/auto_mlrun.py +4 -3
- mlrun/frameworks/lgbm/mlrun_interfaces/mlrun_interface.py +2 -1
- mlrun/frameworks/onnx/dataset.py +2 -1
- mlrun/frameworks/onnx/mlrun_interface.py +2 -1
- mlrun/frameworks/pytorch/callbacks/logging_callback.py +5 -4
- mlrun/frameworks/pytorch/callbacks/mlrun_logging_callback.py +2 -1
- mlrun/frameworks/pytorch/callbacks/tensorboard_logging_callback.py +2 -1
- mlrun/frameworks/pytorch/utils.py +2 -1
- mlrun/frameworks/sklearn/metric.py +2 -1
- mlrun/frameworks/tf_keras/callbacks/logging_callback.py +5 -4
- mlrun/frameworks/tf_keras/callbacks/mlrun_logging_callback.py +2 -1
- mlrun/frameworks/tf_keras/callbacks/tensorboard_logging_callback.py +2 -1
- mlrun/hub/__init__.py +52 -0
- mlrun/hub/base.py +142 -0
- mlrun/hub/module.py +172 -0
- mlrun/hub/step.py +113 -0
- mlrun/k8s_utils.py +105 -16
- mlrun/launcher/base.py +15 -7
- mlrun/launcher/local.py +4 -1
- mlrun/model.py +14 -4
- mlrun/model_monitoring/__init__.py +0 -1
- mlrun/model_monitoring/api.py +65 -28
- mlrun/model_monitoring/applications/__init__.py +1 -1
- mlrun/model_monitoring/applications/base.py +299 -128
- mlrun/model_monitoring/applications/context.py +2 -4
- mlrun/model_monitoring/controller.py +132 -58
- mlrun/model_monitoring/db/_schedules.py +38 -29
- mlrun/model_monitoring/db/_stats.py +6 -16
- mlrun/model_monitoring/db/tsdb/__init__.py +9 -7
- mlrun/model_monitoring/db/tsdb/base.py +29 -9
- mlrun/model_monitoring/db/tsdb/preaggregate.py +234 -0
- mlrun/model_monitoring/db/tsdb/stream_graph_steps.py +63 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/queries/timescaledb_metrics_queries.py +414 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/queries/timescaledb_predictions_queries.py +376 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/queries/timescaledb_results_queries.py +590 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/timescaledb_connection.py +434 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/timescaledb_connector.py +541 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/timescaledb_operations.py +808 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/timescaledb_schema.py +502 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/timescaledb_stream.py +163 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/timescaledb_stream_graph_steps.py +60 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/utils/timescaledb_dataframe_processor.py +141 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/utils/timescaledb_query_builder.py +585 -0
- mlrun/model_monitoring/db/tsdb/timescaledb/writer_graph_steps.py +73 -0
- mlrun/model_monitoring/db/tsdb/v3io/stream_graph_steps.py +20 -9
- mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +235 -51
- mlrun/model_monitoring/features_drift_table.py +2 -1
- mlrun/model_monitoring/helpers.py +30 -6
- mlrun/model_monitoring/stream_processing.py +34 -28
- mlrun/model_monitoring/writer.py +224 -4
- mlrun/package/__init__.py +2 -1
- mlrun/platforms/__init__.py +0 -43
- mlrun/platforms/iguazio.py +8 -4
- mlrun/projects/operations.py +17 -11
- mlrun/projects/pipelines.py +2 -2
- mlrun/projects/project.py +187 -123
- mlrun/run.py +95 -21
- mlrun/runtimes/__init__.py +2 -186
- mlrun/runtimes/base.py +103 -25
- mlrun/runtimes/constants.py +225 -0
- mlrun/runtimes/daskjob.py +5 -2
- mlrun/runtimes/databricks_job/databricks_runtime.py +2 -1
- mlrun/runtimes/local.py +5 -2
- mlrun/runtimes/mounts.py +20 -2
- mlrun/runtimes/nuclio/__init__.py +12 -7
- mlrun/runtimes/nuclio/api_gateway.py +36 -6
- mlrun/runtimes/nuclio/application/application.py +339 -40
- mlrun/runtimes/nuclio/function.py +222 -72
- mlrun/runtimes/nuclio/serving.py +132 -42
- mlrun/runtimes/pod.py +213 -21
- mlrun/runtimes/utils.py +49 -9
- mlrun/secrets.py +99 -14
- mlrun/serving/__init__.py +2 -0
- mlrun/serving/remote.py +84 -11
- mlrun/serving/routers.py +26 -44
- mlrun/serving/server.py +138 -51
- mlrun/serving/serving_wrapper.py +6 -2
- mlrun/serving/states.py +997 -283
- mlrun/serving/steps.py +62 -0
- mlrun/serving/system_steps.py +149 -95
- mlrun/serving/v2_serving.py +9 -10
- mlrun/track/trackers/mlflow_tracker.py +29 -31
- mlrun/utils/helpers.py +292 -94
- mlrun/utils/http.py +9 -2
- mlrun/utils/notifications/notification/base.py +18 -0
- mlrun/utils/notifications/notification/git.py +3 -5
- mlrun/utils/notifications/notification/mail.py +39 -16
- mlrun/utils/notifications/notification/slack.py +2 -4
- mlrun/utils/notifications/notification/webhook.py +2 -5
- mlrun/utils/notifications/notification_pusher.py +3 -3
- mlrun/utils/version/version.json +2 -2
- mlrun/utils/version/version.py +3 -4
- {mlrun-1.10.0rc18.dist-info → mlrun-1.11.0rc16.dist-info}/METADATA +63 -74
- {mlrun-1.10.0rc18.dist-info → mlrun-1.11.0rc16.dist-info}/RECORD +161 -143
- mlrun/api/schemas/__init__.py +0 -259
- mlrun/db/auth_utils.py +0 -152
- mlrun/model_monitoring/db/tsdb/tdengine/schemas.py +0 -344
- mlrun/model_monitoring/db/tsdb/tdengine/stream_graph_steps.py +0 -75
- mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connection.py +0 -281
- mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py +0 -1266
- {mlrun-1.10.0rc18.dist-info → mlrun-1.11.0rc16.dist-info}/WHEEL +0 -0
- {mlrun-1.10.0rc18.dist-info → mlrun-1.11.0rc16.dist-info}/entry_points.txt +0 -0
- {mlrun-1.10.0rc18.dist-info → mlrun-1.11.0rc16.dist-info}/licenses/LICENSE +0 -0
- {mlrun-1.10.0rc18.dist-info → mlrun-1.11.0rc16.dist-info}/top_level.txt +0 -0
mlrun/datastore/utils.py
CHANGED
|
@@ -190,12 +190,12 @@ def validate_additional_filters(additional_filters):
|
|
|
190
190
|
for filter_tuple in additional_filters:
|
|
191
191
|
if filter_tuple == () or filter_tuple == []:
|
|
192
192
|
continue
|
|
193
|
-
if not isinstance(filter_tuple,
|
|
193
|
+
if not isinstance(filter_tuple, list | tuple):
|
|
194
194
|
raise mlrun.errors.MLRunInvalidArgumentError(
|
|
195
195
|
f"mlrun supports additional_filters only as a list of tuples."
|
|
196
196
|
f" Current additional_filters: {additional_filters}"
|
|
197
197
|
)
|
|
198
|
-
if isinstance(filter_tuple[0],
|
|
198
|
+
if isinstance(filter_tuple[0], list | tuple):
|
|
199
199
|
raise mlrun.errors.MLRunInvalidArgumentError(
|
|
200
200
|
f"additional_filters does not support nested list inside filter tuples except in -in- logic."
|
|
201
201
|
f" Current filter_tuple: {filter_tuple}."
|
|
@@ -208,7 +208,7 @@ def validate_additional_filters(additional_filters):
|
|
|
208
208
|
col_name, op, value = filter_tuple
|
|
209
209
|
if isinstance(value, float) and math.isnan(value):
|
|
210
210
|
raise mlrun.errors.MLRunInvalidArgumentError(nan_error_message)
|
|
211
|
-
elif isinstance(value,
|
|
211
|
+
elif isinstance(value, list | tuple):
|
|
212
212
|
for sub_value in value:
|
|
213
213
|
if isinstance(sub_value, float) and math.isnan(sub_value):
|
|
214
214
|
raise mlrun.errors.MLRunInvalidArgumentError(nan_error_message)
|
|
@@ -320,7 +320,13 @@ def parse_url(url):
|
|
|
320
320
|
parsed_url = urlparse(url)
|
|
321
321
|
schema = parsed_url.scheme.lower()
|
|
322
322
|
endpoint = parsed_url.hostname
|
|
323
|
-
|
|
323
|
+
|
|
324
|
+
# Special handling for WASBS URLs to preserve container information
|
|
325
|
+
if schema in ["wasbs", "wasb"] and parsed_url.netloc and "@" in parsed_url.netloc:
|
|
326
|
+
# For wasbs://container@host format, preserve the full netloc as endpoint
|
|
327
|
+
# This allows the datastore to extract container later
|
|
328
|
+
endpoint = parsed_url.netloc
|
|
329
|
+
elif endpoint:
|
|
324
330
|
# HACK - urlparse returns the hostname after in lower case - we want the original case:
|
|
325
331
|
# the hostname is a substring of the netloc, in which it's the original case, so we find the indexes of the
|
|
326
332
|
# hostname in the netloc and take it from there
|
|
@@ -331,11 +337,24 @@ def parse_url(url):
|
|
|
331
337
|
endpoint = netloc[
|
|
332
338
|
hostname_index_in_netloc : hostname_index_in_netloc + len(lower_hostname)
|
|
333
339
|
]
|
|
334
|
-
|
|
335
|
-
|
|
340
|
+
if parsed_url.port:
|
|
341
|
+
endpoint += f":{parsed_url.port}"
|
|
336
342
|
return schema, endpoint, parsed_url
|
|
337
343
|
|
|
338
344
|
|
|
339
345
|
def accepts_param(func: callable, param_name):
|
|
340
346
|
sig = inspect.signature(func)
|
|
341
347
|
return param_name in sig.parameters
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
def parse_s3_bucket_and_key(s3_path: str) -> tuple[str, str]:
|
|
351
|
+
try:
|
|
352
|
+
path_parts = s3_path.replace("s3://", "").split("/")
|
|
353
|
+
bucket = path_parts.pop(0)
|
|
354
|
+
key = "/".join(path_parts)
|
|
355
|
+
except Exception as exc:
|
|
356
|
+
raise mlrun.errors.MLRunInvalidArgumentError(
|
|
357
|
+
"failed to parse s3 bucket and key"
|
|
358
|
+
) from exc
|
|
359
|
+
|
|
360
|
+
return bucket, key
|
mlrun/datastore/v3io.py
CHANGED
|
@@ -57,7 +57,7 @@ class V3ioStore(DataStore):
|
|
|
57
57
|
self.auth = None
|
|
58
58
|
self.token = token
|
|
59
59
|
if token:
|
|
60
|
-
self.headers = {
|
|
60
|
+
self.headers = {mlrun.common.schemas.HeaderNames.v3io_session_key: token}
|
|
61
61
|
elif username and password:
|
|
62
62
|
self.headers = basic_auth_header(username, password)
|
|
63
63
|
|
mlrun/db/base.py
CHANGED
|
@@ -16,8 +16,6 @@ import datetime
|
|
|
16
16
|
from abc import ABC, abstractmethod
|
|
17
17
|
from typing import Literal, Optional, Union
|
|
18
18
|
|
|
19
|
-
from deprecated import deprecated
|
|
20
|
-
|
|
21
19
|
import mlrun.alerts
|
|
22
20
|
import mlrun.common
|
|
23
21
|
import mlrun.common.formatters
|
|
@@ -190,7 +188,6 @@ class RunDBInterface(ABC):
|
|
|
190
188
|
tree: Optional[str] = None,
|
|
191
189
|
parent: Optional[str] = None,
|
|
192
190
|
format_: mlrun.common.formatters.ArtifactFormat = mlrun.common.formatters.ArtifactFormat.full,
|
|
193
|
-
limit: Optional[int] = None,
|
|
194
191
|
partition_by: Optional[
|
|
195
192
|
Union[mlrun.common.schemas.ArtifactPartitionByField, str]
|
|
196
193
|
] = None,
|
|
@@ -445,23 +442,6 @@ class RunDBInterface(ABC):
|
|
|
445
442
|
) -> dict:
|
|
446
443
|
pass
|
|
447
444
|
|
|
448
|
-
# TODO: remove in 1.10.0
|
|
449
|
-
@deprecated(
|
|
450
|
-
version="1.7.0",
|
|
451
|
-
reason="'list_features' will be removed in 1.10.0, use 'list_features_v2' instead",
|
|
452
|
-
category=FutureWarning,
|
|
453
|
-
)
|
|
454
|
-
@abstractmethod
|
|
455
|
-
def list_features(
|
|
456
|
-
self,
|
|
457
|
-
project: str,
|
|
458
|
-
name: Optional[str] = None,
|
|
459
|
-
tag: Optional[str] = None,
|
|
460
|
-
entities: Optional[list[str]] = None,
|
|
461
|
-
labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
|
|
462
|
-
) -> mlrun.common.schemas.FeaturesOutput:
|
|
463
|
-
pass
|
|
464
|
-
|
|
465
445
|
@abstractmethod
|
|
466
446
|
def list_features_v2(
|
|
467
447
|
self,
|
|
@@ -694,17 +674,6 @@ class RunDBInterface(ABC):
|
|
|
694
674
|
):
|
|
695
675
|
pass
|
|
696
676
|
|
|
697
|
-
@abstractmethod
|
|
698
|
-
def create_user_secrets(
|
|
699
|
-
self,
|
|
700
|
-
user: str,
|
|
701
|
-
provider: Union[
|
|
702
|
-
str, mlrun.common.schemas.SecretProviderName
|
|
703
|
-
] = mlrun.common.schemas.SecretProviderName.vault,
|
|
704
|
-
secrets: Optional[dict] = None,
|
|
705
|
-
):
|
|
706
|
-
pass
|
|
707
|
-
|
|
708
677
|
@abstractmethod
|
|
709
678
|
def create_model_endpoint(
|
|
710
679
|
self,
|
|
@@ -741,7 +710,9 @@ class RunDBInterface(ABC):
|
|
|
741
710
|
tsdb_metrics: bool = False,
|
|
742
711
|
metric_list: Optional[list[str]] = None,
|
|
743
712
|
top_level: bool = False,
|
|
744
|
-
|
|
713
|
+
modes: Optional[
|
|
714
|
+
Union[mm_constants.EndpointMode, list[mm_constants.EndpointMode]]
|
|
715
|
+
] = None,
|
|
745
716
|
uids: Optional[list[str]] = None,
|
|
746
717
|
latest_only: bool = False,
|
|
747
718
|
) -> mlrun.common.schemas.ModelEndpointList:
|
|
@@ -793,6 +764,7 @@ class RunDBInterface(ABC):
|
|
|
793
764
|
item_name: Optional[str] = None,
|
|
794
765
|
tag: Optional[str] = None,
|
|
795
766
|
version: Optional[str] = None,
|
|
767
|
+
item_type: mlrun.common.schemas.hub.HubSourceType = mlrun.common.schemas.hub.HubSourceType.functions,
|
|
796
768
|
):
|
|
797
769
|
pass
|
|
798
770
|
|
|
@@ -811,6 +783,7 @@ class RunDBInterface(ABC):
|
|
|
811
783
|
version: Optional[str] = None,
|
|
812
784
|
tag: Optional[str] = None,
|
|
813
785
|
force_refresh: bool = False,
|
|
786
|
+
object_type: mlrun.common.schemas.hub.HubSourceType = mlrun.common.schemas.hub.HubSourceType.functions,
|
|
814
787
|
):
|
|
815
788
|
pass
|
|
816
789
|
|
|
@@ -822,6 +795,19 @@ class RunDBInterface(ABC):
|
|
|
822
795
|
version: Optional[str] = None,
|
|
823
796
|
tag: str = "latest",
|
|
824
797
|
force_refresh: bool = False,
|
|
798
|
+
item_type: mlrun.common.schemas.hub.HubSourceType = mlrun.common.schemas.hub.HubSourceType.functions,
|
|
799
|
+
):
|
|
800
|
+
pass
|
|
801
|
+
|
|
802
|
+
@abstractmethod
|
|
803
|
+
def get_hub_asset(
|
|
804
|
+
self,
|
|
805
|
+
source_name: str,
|
|
806
|
+
item_name: str,
|
|
807
|
+
asset_name: str,
|
|
808
|
+
version: Optional[str] = None,
|
|
809
|
+
tag: str = "latest",
|
|
810
|
+
item_type: mlrun.common.schemas.hub.HubSourceType = mlrun.common.schemas.hub.HubSourceType.functions,
|
|
825
811
|
):
|
|
826
812
|
pass
|
|
827
813
|
|
|
@@ -1130,6 +1116,15 @@ class RunDBInterface(ABC):
|
|
|
1130
1116
|
) -> None:
|
|
1131
1117
|
pass
|
|
1132
1118
|
|
|
1119
|
+
@abstractmethod
|
|
1120
|
+
def delete_model_monitoring_metrics(
|
|
1121
|
+
self,
|
|
1122
|
+
project: str,
|
|
1123
|
+
application_name: str,
|
|
1124
|
+
endpoint_ids: Optional[list[str]] = None,
|
|
1125
|
+
) -> None:
|
|
1126
|
+
pass
|
|
1127
|
+
|
|
1133
1128
|
@abstractmethod
|
|
1134
1129
|
def get_monitoring_function_summaries(
|
|
1135
1130
|
self,
|
|
@@ -1166,3 +1161,39 @@ class RunDBInterface(ABC):
|
|
|
1166
1161
|
end: Optional[datetime.datetime] = None,
|
|
1167
1162
|
) -> mlrun.common.schemas.model_monitoring.ModelEndpointDriftValues:
|
|
1168
1163
|
pass
|
|
1164
|
+
|
|
1165
|
+
@abstractmethod
|
|
1166
|
+
def store_secret_token(
|
|
1167
|
+
self,
|
|
1168
|
+
secret_token: mlrun.common.schemas.SecretToken,
|
|
1169
|
+
log_warning: bool = True,
|
|
1170
|
+
force: bool = False,
|
|
1171
|
+
) -> mlrun.common.schemas.StoreSecretTokensResponse:
|
|
1172
|
+
pass
|
|
1173
|
+
|
|
1174
|
+
@abstractmethod
|
|
1175
|
+
def store_secret_tokens(
|
|
1176
|
+
self,
|
|
1177
|
+
secret_tokens: list[mlrun.common.schemas.SecretToken],
|
|
1178
|
+
log_warning: bool = True,
|
|
1179
|
+
force: bool = False,
|
|
1180
|
+
) -> mlrun.common.schemas.StoreSecretTokensResponse:
|
|
1181
|
+
pass
|
|
1182
|
+
|
|
1183
|
+
@abstractmethod
|
|
1184
|
+
def list_secret_tokens(
|
|
1185
|
+
self,
|
|
1186
|
+
) -> mlrun.common.schemas.ListSecretTokensResponse:
|
|
1187
|
+
pass
|
|
1188
|
+
|
|
1189
|
+
@abstractmethod
|
|
1190
|
+
def revoke_secret_token(self, token_name: str) -> None:
|
|
1191
|
+
pass
|
|
1192
|
+
|
|
1193
|
+
@abstractmethod
|
|
1194
|
+
def get_secret_token(
|
|
1195
|
+
self,
|
|
1196
|
+
token_name: str,
|
|
1197
|
+
username: Optional[str] = None,
|
|
1198
|
+
) -> mlrun.common.schemas.SecretToken:
|
|
1199
|
+
pass
|