mlrun 1.10.0rc40__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 +3 -2
- mlrun/__main__.py +0 -4
- mlrun/artifacts/dataset.py +2 -2
- 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 +7 -0
- mlrun/common/model_monitoring/helpers.py +41 -4
- mlrun/common/runtimes/constants.py +28 -0
- mlrun/common/schemas/__init__.py +13 -3
- mlrun/common/schemas/alert.py +2 -2
- mlrun/common/schemas/api_gateway.py +3 -0
- mlrun/common/schemas/auth.py +10 -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 +24 -0
- mlrun/common/schemas/hub.py +3 -2
- mlrun/common/schemas/model_monitoring/__init__.py +1 -1
- mlrun/common/schemas/model_monitoring/constants.py +2 -2
- mlrun/common/schemas/secret.py +17 -2
- mlrun/common/secrets.py +95 -1
- mlrun/common/types.py +10 -10
- mlrun/config.py +53 -15
- mlrun/data_types/infer.py +2 -2
- mlrun/datastore/__init__.py +2 -3
- mlrun/datastore/base.py +274 -10
- mlrun/datastore/datastore.py +1 -1
- mlrun/datastore/datastore_profile.py +49 -17
- mlrun/datastore/model_provider/huggingface_provider.py +6 -2
- mlrun/datastore/model_provider/model_provider.py +2 -2
- mlrun/datastore/model_provider/openai_provider.py +2 -2
- mlrun/datastore/s3.py +15 -16
- mlrun/datastore/sources.py +1 -1
- mlrun/datastore/store_resources.py +4 -4
- mlrun/datastore/storeytargets.py +16 -10
- mlrun/datastore/targets.py +1 -1
- mlrun/datastore/utils.py +16 -3
- mlrun/datastore/v3io.py +1 -1
- mlrun/db/base.py +36 -12
- mlrun/db/httpdb.py +316 -101
- mlrun/db/nopdb.py +29 -11
- mlrun/errors.py +4 -2
- mlrun/execution.py +11 -12
- 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 +37 -0
- mlrun/hub/base.py +142 -0
- mlrun/hub/module.py +67 -76
- mlrun/hub/step.py +113 -0
- mlrun/launcher/base.py +2 -1
- mlrun/launcher/local.py +2 -1
- mlrun/model.py +12 -2
- mlrun/model_monitoring/__init__.py +0 -1
- mlrun/model_monitoring/api.py +2 -2
- mlrun/model_monitoring/applications/base.py +20 -6
- mlrun/model_monitoring/applications/context.py +1 -0
- mlrun/model_monitoring/controller.py +7 -17
- mlrun/model_monitoring/db/_schedules.py +2 -16
- mlrun/model_monitoring/db/_stats.py +2 -13
- mlrun/model_monitoring/db/tsdb/__init__.py +9 -7
- mlrun/model_monitoring/db/tsdb/base.py +2 -4
- 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 +4 -6
- mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +147 -79
- mlrun/model_monitoring/features_drift_table.py +2 -1
- mlrun/model_monitoring/helpers.py +2 -1
- mlrun/model_monitoring/stream_processing.py +18 -16
- mlrun/model_monitoring/writer.py +4 -3
- mlrun/package/__init__.py +2 -1
- mlrun/platforms/__init__.py +0 -44
- mlrun/platforms/iguazio.py +1 -1
- mlrun/projects/operations.py +11 -10
- mlrun/projects/project.py +81 -82
- mlrun/run.py +4 -7
- mlrun/runtimes/__init__.py +2 -204
- mlrun/runtimes/base.py +89 -21
- mlrun/runtimes/constants.py +225 -0
- mlrun/runtimes/daskjob.py +4 -2
- mlrun/runtimes/databricks_job/databricks_runtime.py +2 -1
- mlrun/runtimes/mounts.py +5 -0
- mlrun/runtimes/nuclio/__init__.py +12 -8
- mlrun/runtimes/nuclio/api_gateway.py +36 -6
- mlrun/runtimes/nuclio/application/application.py +200 -32
- mlrun/runtimes/nuclio/function.py +154 -49
- mlrun/runtimes/nuclio/serving.py +55 -42
- mlrun/runtimes/pod.py +59 -10
- mlrun/secrets.py +46 -2
- mlrun/serving/__init__.py +2 -0
- mlrun/serving/remote.py +5 -5
- mlrun/serving/routers.py +3 -3
- mlrun/serving/server.py +46 -43
- mlrun/serving/serving_wrapper.py +6 -2
- mlrun/serving/states.py +554 -207
- mlrun/serving/steps.py +1 -1
- mlrun/serving/system_steps.py +42 -33
- mlrun/track/trackers/mlflow_tracker.py +29 -31
- mlrun/utils/helpers.py +89 -16
- mlrun/utils/http.py +9 -2
- mlrun/utils/notifications/notification/git.py +1 -1
- mlrun/utils/notifications/notification/mail.py +39 -16
- mlrun/utils/notifications/notification_pusher.py +2 -2
- mlrun/utils/version/version.json +2 -2
- mlrun/utils/version/version.py +3 -4
- {mlrun-1.10.0rc40.dist-info → mlrun-1.11.0rc16.dist-info}/METADATA +39 -49
- {mlrun-1.10.0rc40.dist-info → mlrun-1.11.0rc16.dist-info}/RECORD +144 -130
- mlrun/db/auth_utils.py +0 -152
- mlrun/model_monitoring/db/tsdb/tdengine/schemas.py +0 -343
- 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 -1368
- mlrun/model_monitoring/db/tsdb/tdengine/writer_graph_steps.py +0 -51
- {mlrun-1.10.0rc40.dist-info → mlrun-1.11.0rc16.dist-info}/WHEEL +0 -0
- {mlrun-1.10.0rc40.dist-info → mlrun-1.11.0rc16.dist-info}/entry_points.txt +0 -0
- {mlrun-1.10.0rc40.dist-info → mlrun-1.11.0rc16.dist-info}/licenses/LICENSE +0 -0
- {mlrun-1.10.0rc40.dist-info → mlrun-1.11.0rc16.dist-info}/top_level.txt +0 -0
mlrun/datastore/storeytargets.py
CHANGED
|
@@ -18,11 +18,12 @@ from mergedeep import merge
|
|
|
18
18
|
from storey import V3ioDriver
|
|
19
19
|
|
|
20
20
|
import mlrun
|
|
21
|
+
import mlrun.common.model_monitoring.helpers
|
|
21
22
|
from mlrun.datastore.base import DataStore
|
|
22
23
|
from mlrun.datastore.datastore_profile import (
|
|
23
24
|
DatastoreProfileKafkaStream,
|
|
24
25
|
DatastoreProfileKafkaTarget,
|
|
25
|
-
|
|
26
|
+
DatastoreProfilePostgreSQL,
|
|
26
27
|
datastore_profile_read,
|
|
27
28
|
)
|
|
28
29
|
|
|
@@ -48,17 +49,22 @@ def get_url_and_storage_options(path, external_storage_options=None):
|
|
|
48
49
|
return url, DataStore._sanitize_options(storage_options)
|
|
49
50
|
|
|
50
51
|
|
|
51
|
-
class
|
|
52
|
+
class TimescaleDBStoreyTarget(storey.TimescaleDBTarget):
|
|
52
53
|
def __init__(self, *args, url: str, **kwargs):
|
|
53
54
|
if url.startswith("ds://"):
|
|
54
55
|
datastore_profile = datastore_profile_read(url)
|
|
55
|
-
if not isinstance(datastore_profile,
|
|
56
|
-
raise
|
|
57
|
-
f"Unexpected datastore profile type:{datastore_profile
|
|
58
|
-
"Only
|
|
56
|
+
if not isinstance(datastore_profile, DatastoreProfilePostgreSQL):
|
|
57
|
+
raise mlrun.errors.MLRunInvalidArgumentError(
|
|
58
|
+
f"Unexpected datastore profile type: {type(datastore_profile)}. "
|
|
59
|
+
"Only DatastoreProfilePostgreSQL is supported"
|
|
59
60
|
)
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
# Use the shared helper to determine the correct database name
|
|
62
|
+
# This ensures consistency with TimescaleDBConnector's database naming
|
|
63
|
+
database = mlrun.common.model_monitoring.helpers.get_tsdb_database_name(
|
|
64
|
+
datastore_profile.database
|
|
65
|
+
)
|
|
66
|
+
url = datastore_profile.dsn(database=database)
|
|
67
|
+
super().__init__(*args, dsn=url, **kwargs)
|
|
62
68
|
|
|
63
69
|
|
|
64
70
|
class StoreyTargetUtils:
|
|
@@ -137,7 +143,7 @@ class KafkaStoreyTarget(storey.KafkaTarget):
|
|
|
137
143
|
datastore_profile = datastore_profile_read(path)
|
|
138
144
|
if not isinstance(
|
|
139
145
|
datastore_profile,
|
|
140
|
-
|
|
146
|
+
DatastoreProfileKafkaStream | DatastoreProfileKafkaTarget,
|
|
141
147
|
):
|
|
142
148
|
raise mlrun.errors.MLRunInvalidArgumentError(
|
|
143
149
|
f"Unsupported datastore profile type: {type(datastore_profile)}"
|
|
@@ -174,7 +180,7 @@ class RedisNoSqlStoreyTarget(storey.NoSqlTarget):
|
|
|
174
180
|
endpoint, uri = mlrun.datastore.targets.RedisNoSqlTarget.get_server_endpoint(
|
|
175
181
|
path
|
|
176
182
|
)
|
|
177
|
-
kwargs["path"] = endpoint
|
|
183
|
+
kwargs["path"] = f"{endpoint}/{uri}"
|
|
178
184
|
super().__init__(*args, **kwargs)
|
|
179
185
|
|
|
180
186
|
|
mlrun/datastore/targets.py
CHANGED
|
@@ -532,7 +532,7 @@ class BaseStoreTarget(DataTargetBase):
|
|
|
532
532
|
if (
|
|
533
533
|
file_system.protocol == "file"
|
|
534
534
|
# fsspec 2023.10.0 changed protocol from "file" to ("file", "local")
|
|
535
|
-
or isinstance(file_system.protocol,
|
|
535
|
+
or isinstance(file_system.protocol, tuple | list)
|
|
536
536
|
and "file" in file_system.protocol
|
|
537
537
|
):
|
|
538
538
|
dir = os.path.dirname(target_path)
|
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)
|
|
@@ -345,3 +345,16 @@ def parse_url(url):
|
|
|
345
345
|
def accepts_param(func: callable, param_name):
|
|
346
346
|
sig = inspect.signature(func)
|
|
347
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
|
@@ -188,7 +188,6 @@ class RunDBInterface(ABC):
|
|
|
188
188
|
tree: Optional[str] = None,
|
|
189
189
|
parent: Optional[str] = None,
|
|
190
190
|
format_: mlrun.common.formatters.ArtifactFormat = mlrun.common.formatters.ArtifactFormat.full,
|
|
191
|
-
limit: Optional[int] = None,
|
|
192
191
|
partition_by: Optional[
|
|
193
192
|
Union[mlrun.common.schemas.ArtifactPartitionByField, str]
|
|
194
193
|
] = None,
|
|
@@ -675,17 +674,6 @@ class RunDBInterface(ABC):
|
|
|
675
674
|
):
|
|
676
675
|
pass
|
|
677
676
|
|
|
678
|
-
@abstractmethod
|
|
679
|
-
def create_user_secrets(
|
|
680
|
-
self,
|
|
681
|
-
user: str,
|
|
682
|
-
provider: Union[
|
|
683
|
-
str, mlrun.common.schemas.SecretProviderName
|
|
684
|
-
] = mlrun.common.schemas.SecretProviderName.vault,
|
|
685
|
-
secrets: Optional[dict] = None,
|
|
686
|
-
):
|
|
687
|
-
pass
|
|
688
|
-
|
|
689
677
|
@abstractmethod
|
|
690
678
|
def create_model_endpoint(
|
|
691
679
|
self,
|
|
@@ -1173,3 +1161,39 @@ class RunDBInterface(ABC):
|
|
|
1173
1161
|
end: Optional[datetime.datetime] = None,
|
|
1174
1162
|
) -> mlrun.common.schemas.model_monitoring.ModelEndpointDriftValues:
|
|
1175
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
|