mlrun 1.9.0rc4__py3-none-any.whl → 1.9.0rc6__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/__main__.py +13 -3
- mlrun/artifacts/base.py +5 -5
- mlrun/artifacts/dataset.py +1 -1
- mlrun/artifacts/model.py +1 -1
- mlrun/artifacts/plots.py +2 -2
- mlrun/common/constants.py +7 -0
- mlrun/common/runtimes/constants.py +1 -1
- mlrun/common/schemas/artifact.py +1 -1
- mlrun/common/schemas/pipeline.py +1 -1
- mlrun/common/schemas/project.py +1 -1
- mlrun/common/schemas/runs.py +1 -1
- mlrun/config.py +7 -7
- mlrun/datastore/datastore.py +1 -1
- mlrun/datastore/datastore_profile.py +5 -5
- mlrun/datastore/sources.py +3 -3
- mlrun/datastore/targets.py +4 -4
- mlrun/datastore/utils.py +2 -2
- mlrun/db/base.py +7 -7
- mlrun/db/httpdb.py +19 -15
- mlrun/db/nopdb.py +1 -1
- mlrun/execution.py +1 -1
- mlrun/frameworks/_common/model_handler.py +2 -2
- mlrun/launcher/client.py +1 -1
- mlrun/model_monitoring/api.py +4 -4
- mlrun/model_monitoring/applications/_application_steps.py +3 -1
- mlrun/model_monitoring/applications/evidently/base.py +57 -107
- mlrun/model_monitoring/controller.py +26 -13
- mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +13 -5
- mlrun/model_monitoring/tracking_policy.py +1 -1
- mlrun/model_monitoring/writer.py +1 -1
- mlrun/projects/operations.py +3 -3
- mlrun/projects/project.py +68 -51
- mlrun/render.py +5 -9
- mlrun/run.py +2 -2
- mlrun/runtimes/base.py +5 -5
- mlrun/runtimes/kubejob.py +2 -2
- mlrun/runtimes/mounts.py +2 -0
- mlrun/runtimes/nuclio/function.py +2 -2
- mlrun/runtimes/nuclio/serving.py +4 -4
- mlrun/runtimes/utils.py +25 -8
- mlrun/utils/helpers.py +10 -4
- mlrun/utils/version/version.json +2 -2
- {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/METADATA +10 -10
- {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/RECORD +48 -48
- {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/WHEEL +1 -1
- {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/entry_points.txt +0 -0
- {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/licenses/LICENSE +0 -0
- {mlrun-1.9.0rc4.dist-info → mlrun-1.9.0rc6.dist-info}/top_level.txt +0 -0
mlrun/__main__.py
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
14
|
# See the License for the specific language governing permissions and
|
|
15
15
|
# limitations under the License.
|
|
16
|
+
import functools
|
|
17
|
+
import importlib.metadata
|
|
16
18
|
import json
|
|
17
19
|
import pathlib
|
|
18
20
|
import socket
|
|
@@ -25,12 +27,14 @@ from pprint import pprint
|
|
|
25
27
|
import click
|
|
26
28
|
import dotenv
|
|
27
29
|
import pandas as pd
|
|
30
|
+
import semver
|
|
28
31
|
import yaml
|
|
29
32
|
from tabulate import tabulate
|
|
30
33
|
|
|
31
34
|
import mlrun
|
|
32
35
|
import mlrun.common.constants as mlrun_constants
|
|
33
36
|
import mlrun.common.schemas
|
|
37
|
+
import mlrun.platforms
|
|
34
38
|
import mlrun.utils.helpers
|
|
35
39
|
from mlrun.common.helpers import parse_versioned_object_uri
|
|
36
40
|
from mlrun.runtimes.mounts import auto_mount as auto_mount_modifier
|
|
@@ -63,16 +67,22 @@ from .utils.version import Version
|
|
|
63
67
|
pd.set_option("mode.chained_assignment", None)
|
|
64
68
|
|
|
65
69
|
|
|
66
|
-
def validate_base_argument(ctx, param, value):
|
|
70
|
+
def validate_base_argument(ctx: click.Context, param: click.Parameter, value: str):
|
|
71
|
+
# click 8.2 expects the context to be passed to make_metavar
|
|
72
|
+
if semver.VersionInfo.parse(
|
|
73
|
+
importlib.metadata.version("click")
|
|
74
|
+
) < semver.VersionInfo.parse("8.2.0"):
|
|
75
|
+
metavar_func = functools.partial(param.make_metavar)
|
|
76
|
+
else:
|
|
77
|
+
metavar_func = functools.partial(param.make_metavar, ctx)
|
|
67
78
|
if value and value.startswith("-"):
|
|
68
79
|
raise click.BadParameter(
|
|
69
80
|
f"{param.human_readable_name} ({value}) cannot start with '-', ensure the command options are typed "
|
|
70
81
|
f"correctly. Preferably use '--' to separate options and arguments "
|
|
71
|
-
f"e.g. 'mlrun run --option1 --option2 -- {
|
|
82
|
+
f"e.g. 'mlrun run --option1 --option2 -- {metavar_func()} [--arg1|arg1] [--arg2|arg2]'",
|
|
72
83
|
ctx=ctx,
|
|
73
84
|
param=param,
|
|
74
85
|
)
|
|
75
|
-
|
|
76
86
|
return value
|
|
77
87
|
|
|
78
88
|
|
mlrun/artifacts/base.py
CHANGED
|
@@ -219,7 +219,7 @@ class Artifact(ModelObj):
|
|
|
219
219
|
project=None,
|
|
220
220
|
src_path: typing.Optional[str] = None,
|
|
221
221
|
# All params up until here are legacy params for compatibility with legacy artifacts.
|
|
222
|
-
# TODO: remove them in 1.
|
|
222
|
+
# TODO: remove them in 1.10.0.
|
|
223
223
|
metadata: ArtifactMetadata = None,
|
|
224
224
|
spec: ArtifactSpec = None,
|
|
225
225
|
):
|
|
@@ -235,7 +235,7 @@ class Artifact(ModelObj):
|
|
|
235
235
|
or src_path
|
|
236
236
|
):
|
|
237
237
|
warnings.warn(
|
|
238
|
-
"Artifact constructor parameters are deprecated and will be removed in 1.
|
|
238
|
+
"Artifact constructor parameters are deprecated in 1.7.0 and will be removed in 1.10.0. "
|
|
239
239
|
"Use the metadata and spec parameters instead.",
|
|
240
240
|
DeprecationWarning,
|
|
241
241
|
)
|
|
@@ -758,13 +758,13 @@ class LinkArtifact(Artifact):
|
|
|
758
758
|
link_tree=None,
|
|
759
759
|
project=None,
|
|
760
760
|
# All params up until here are legacy params for compatibility with legacy artifacts.
|
|
761
|
-
# TODO: remove them in 1.
|
|
761
|
+
# TODO: remove them in 1.10.0.
|
|
762
762
|
metadata: ArtifactMetadata = None,
|
|
763
763
|
spec: LinkArtifactSpec = None,
|
|
764
764
|
):
|
|
765
765
|
if key or target_path or link_iteration or link_key or link_tree or project:
|
|
766
766
|
warnings.warn(
|
|
767
|
-
"Artifact constructor parameters are deprecated and will be removed in 1.
|
|
767
|
+
"Artifact constructor parameters are deprecated in 1.7.0 and will be removed in 1.10.0. "
|
|
768
768
|
"Use the metadata and spec parameters instead.",
|
|
769
769
|
DeprecationWarning,
|
|
770
770
|
)
|
|
@@ -907,7 +907,7 @@ def convert_legacy_artifact_to_new_format(
|
|
|
907
907
|
artifact_key = f"{artifact_key}:{artifact_tag}"
|
|
908
908
|
# TODO: Remove once data migration v5 is obsolete
|
|
909
909
|
warnings.warn(
|
|
910
|
-
f"Converting legacy artifact '{artifact_key}' to new format. This will not be supported in MLRun 1.
|
|
910
|
+
f"Converting legacy artifact '{artifact_key}' to new format. This will not be supported in MLRun 1.10.0. "
|
|
911
911
|
f"Make sure to save the artifact/project in the new format.",
|
|
912
912
|
FutureWarning,
|
|
913
913
|
)
|
mlrun/artifacts/dataset.py
CHANGED
|
@@ -163,7 +163,7 @@ class DatasetArtifact(Artifact):
|
|
|
163
163
|
):
|
|
164
164
|
if key or format or target_path:
|
|
165
165
|
warnings.warn(
|
|
166
|
-
"Artifact constructor parameters are deprecated and will be removed in 1.
|
|
166
|
+
"Artifact constructor parameters are deprecated in 1.7.0 and will be removed in 1.10.0. "
|
|
167
167
|
"Use the metadata and spec parameters instead.",
|
|
168
168
|
DeprecationWarning,
|
|
169
169
|
)
|
mlrun/artifacts/model.py
CHANGED
|
@@ -152,7 +152,7 @@ class ModelArtifact(Artifact):
|
|
|
152
152
|
):
|
|
153
153
|
if key or body or format or target_path:
|
|
154
154
|
warnings.warn(
|
|
155
|
-
"Artifact constructor parameters are deprecated and will be removed in 1.
|
|
155
|
+
"Artifact constructor parameters are deprecated in 1.7.0 and will be removed in 1.10.0. "
|
|
156
156
|
"Use the metadata and spec parameters instead.",
|
|
157
157
|
DeprecationWarning,
|
|
158
158
|
)
|
mlrun/artifacts/plots.py
CHANGED
|
@@ -37,7 +37,7 @@ class PlotArtifact(Artifact):
|
|
|
37
37
|
):
|
|
38
38
|
if key or body or is_inline or target_path:
|
|
39
39
|
warnings.warn(
|
|
40
|
-
"Artifact constructor parameters are deprecated and will be removed in 1.
|
|
40
|
+
"Artifact constructor parameters are deprecated in 1.7.0 and will be removed in 1.10.0. "
|
|
41
41
|
"Use the metadata and spec parameters instead.",
|
|
42
42
|
DeprecationWarning,
|
|
43
43
|
)
|
|
@@ -96,7 +96,7 @@ class PlotlyArtifact(Artifact):
|
|
|
96
96
|
"""
|
|
97
97
|
if key or target_path:
|
|
98
98
|
warnings.warn(
|
|
99
|
-
"Artifact constructor parameters are deprecated and will be removed in 1.
|
|
99
|
+
"Artifact constructor parameters are deprecated in 1.7.0 and will be removed in 1.10.0. "
|
|
100
100
|
"Use the metadata and spec parameters instead.",
|
|
101
101
|
DeprecationWarning,
|
|
102
102
|
)
|
mlrun/common/constants.py
CHANGED
|
@@ -90,6 +90,13 @@ class MLRunInternalLabels:
|
|
|
90
90
|
if not key.startswith("__") and isinstance(value, str)
|
|
91
91
|
]
|
|
92
92
|
|
|
93
|
+
@staticmethod
|
|
94
|
+
def default_run_labels_to_enrich():
|
|
95
|
+
return [
|
|
96
|
+
MLRunInternalLabels.owner,
|
|
97
|
+
MLRunInternalLabels.v3io_user,
|
|
98
|
+
]
|
|
99
|
+
|
|
93
100
|
|
|
94
101
|
class DeployStatusTextKind(mlrun.common.types.StrEnum):
|
|
95
102
|
logs = "logs"
|
|
@@ -237,7 +237,7 @@ class RunStates:
|
|
|
237
237
|
}[pipeline_run_status]
|
|
238
238
|
|
|
239
239
|
|
|
240
|
-
# TODO: remove this class in 1.
|
|
240
|
+
# TODO: remove this class in 1.10.0 - use only MlrunInternalLabels
|
|
241
241
|
class RunLabels(enum.Enum):
|
|
242
242
|
owner = mlrun_constants.MLRunInternalLabels.owner
|
|
243
243
|
v3io_user = mlrun_constants.MLRunInternalLabels.v3io_user
|
mlrun/common/schemas/artifact.py
CHANGED
|
@@ -80,7 +80,7 @@ class ArtifactIdentifier(pydantic.v1.BaseModel):
|
|
|
80
80
|
|
|
81
81
|
@deprecated(
|
|
82
82
|
version="1.7.0",
|
|
83
|
-
reason="mlrun.common.schemas.ArtifactsFormat is deprecated and will be removed in 1.
|
|
83
|
+
reason="mlrun.common.schemas.ArtifactsFormat is deprecated and will be removed in 1.10.0. "
|
|
84
84
|
"Use mlrun.common.formatters.ArtifactFormat instead.",
|
|
85
85
|
category=FutureWarning,
|
|
86
86
|
)
|
mlrun/common/schemas/pipeline.py
CHANGED
|
@@ -22,7 +22,7 @@ import mlrun.common.types
|
|
|
22
22
|
|
|
23
23
|
@deprecated(
|
|
24
24
|
version="1.7.0",
|
|
25
|
-
reason="mlrun.common.schemas.PipelinesFormat is deprecated and will be removed in 1.
|
|
25
|
+
reason="mlrun.common.schemas.PipelinesFormat is deprecated and will be removed in 1.10.0. "
|
|
26
26
|
"Use mlrun.common.formatters.PipelineFormat instead.",
|
|
27
27
|
category=FutureWarning,
|
|
28
28
|
)
|
mlrun/common/schemas/project.py
CHANGED
|
@@ -26,7 +26,7 @@ from .object import ObjectKind, ObjectStatus
|
|
|
26
26
|
|
|
27
27
|
@deprecated(
|
|
28
28
|
version="1.7.0",
|
|
29
|
-
reason="mlrun.common.schemas.ProjectsFormat is deprecated and will be removed in 1.
|
|
29
|
+
reason="mlrun.common.schemas.ProjectsFormat is deprecated and will be removed in 1.10.0. "
|
|
30
30
|
"Use mlrun.common.formatters.ProjectFormat instead.",
|
|
31
31
|
category=FutureWarning,
|
|
32
32
|
)
|
mlrun/common/schemas/runs.py
CHANGED
|
@@ -28,7 +28,7 @@ class RunIdentifier(pydantic.v1.BaseModel):
|
|
|
28
28
|
|
|
29
29
|
@deprecated(
|
|
30
30
|
version="1.7.0",
|
|
31
|
-
reason="mlrun.common.schemas.RunsFormat is deprecated and will be removed in 1.
|
|
31
|
+
reason="mlrun.common.schemas.RunsFormat is deprecated and will be removed in 1.10.0. "
|
|
32
32
|
"Use mlrun.common.formatters.RunFormat instead.",
|
|
33
33
|
category=FutureWarning,
|
|
34
34
|
)
|
mlrun/config.py
CHANGED
|
@@ -79,7 +79,7 @@ default_config = {
|
|
|
79
79
|
# comma separated list of images that are in the specified images_registry, and therefore will be enriched with this
|
|
80
80
|
# registry when used. default to mlrun/* which means any image which is of the mlrun repository (mlrun/mlrun,
|
|
81
81
|
# mlrun/ml-base, etc...)
|
|
82
|
-
"images_to_enrich_registry": "^mlrun
|
|
82
|
+
"images_to_enrich_registry": "^mlrun/*,^python:3.(9|11)$",
|
|
83
83
|
"kfp_url": "",
|
|
84
84
|
"kfp_ttl": "14400", # KFP ttl in sec, after that completed PODs will be deleted
|
|
85
85
|
"kfp_image": "mlrun/mlrun-kfp", # image to use for KFP runner
|
|
@@ -286,7 +286,7 @@ default_config = {
|
|
|
286
286
|
"remote": "mlrun/mlrun",
|
|
287
287
|
"dask": "mlrun/ml-base",
|
|
288
288
|
"mpijob": "mlrun/mlrun",
|
|
289
|
-
"application": "python
|
|
289
|
+
"application": "python",
|
|
290
290
|
},
|
|
291
291
|
# see enrich_function_preemption_spec for more info,
|
|
292
292
|
# and mlrun.common.schemas.function.PreemptionModes for available options
|
|
@@ -482,7 +482,7 @@ default_config = {
|
|
|
482
482
|
"project_owners_cache_ttl": "30 seconds",
|
|
483
483
|
# access key to be used when the leader is iguazio and polling is done from it
|
|
484
484
|
"iguazio_access_key": "",
|
|
485
|
-
"iguazio_list_projects_default_page_size":
|
|
485
|
+
"iguazio_list_projects_default_page_size": 500,
|
|
486
486
|
"iguazio_client_job_cache_ttl": "20 minutes",
|
|
487
487
|
"nuclio_project_deletion_verification_timeout": "300 seconds",
|
|
488
488
|
"nuclio_project_deletion_verification_interval": "5 seconds",
|
|
@@ -591,17 +591,17 @@ default_config = {
|
|
|
591
591
|
},
|
|
592
592
|
"writer_stream_args": {
|
|
593
593
|
"v3io": {
|
|
594
|
-
"shard_count":
|
|
594
|
+
"shard_count": 4,
|
|
595
595
|
"retention_period_hours": 24,
|
|
596
|
-
"num_workers":
|
|
596
|
+
"num_workers": 4,
|
|
597
597
|
"min_replicas": 1,
|
|
598
598
|
"max_replicas": 1,
|
|
599
599
|
},
|
|
600
600
|
"kafka": {
|
|
601
|
-
"partition_count":
|
|
601
|
+
"partition_count": 4,
|
|
602
602
|
# TODO: add retention period configuration
|
|
603
603
|
"replication_factor": 1,
|
|
604
|
-
"num_workers":
|
|
604
|
+
"num_workers": 4,
|
|
605
605
|
"min_replicas": 1,
|
|
606
606
|
"max_replicas": 1,
|
|
607
607
|
},
|
mlrun/datastore/datastore.py
CHANGED
|
@@ -111,7 +111,7 @@ def schema_to_store(schema):
|
|
|
111
111
|
|
|
112
112
|
def uri_to_ipython(link):
|
|
113
113
|
schema, endpoint, parsed_url = parse_url(link)
|
|
114
|
-
if schema in [DB_SCHEMA, "memory"]:
|
|
114
|
+
if schema in [DB_SCHEMA, "memory", "ds"]:
|
|
115
115
|
return ""
|
|
116
116
|
return schema_to_store(schema).uri_to_ipython(endpoint, parsed_url.path)
|
|
117
117
|
|
|
@@ -165,9 +165,9 @@ class DatastoreProfileKafkaTarget(DatastoreProfile):
|
|
|
165
165
|
self.brokers = self.bootstrap_servers
|
|
166
166
|
self.bootstrap_servers = None
|
|
167
167
|
warnings.warn(
|
|
168
|
-
"'bootstrap_servers' parameter is deprecated in 1.7.0 and will be removed in 1.
|
|
168
|
+
"'bootstrap_servers' parameter is deprecated in 1.7.0 and will be removed in 1.10.0, "
|
|
169
169
|
"use 'brokers' instead.",
|
|
170
|
-
# TODO: Remove this in 1.
|
|
170
|
+
# TODO: Remove this in 1.10.0
|
|
171
171
|
FutureWarning,
|
|
172
172
|
)
|
|
173
173
|
|
|
@@ -255,7 +255,7 @@ class DatastoreProfileS3(DatastoreProfile):
|
|
|
255
255
|
def check_bucket(cls, v):
|
|
256
256
|
if not v:
|
|
257
257
|
warnings.warn(
|
|
258
|
-
"The 'bucket' attribute will be mandatory starting from version 1.
|
|
258
|
+
"The 'bucket' attribute will be mandatory starting from version 1.10",
|
|
259
259
|
FutureWarning,
|
|
260
260
|
stacklevel=2,
|
|
261
261
|
)
|
|
@@ -360,7 +360,7 @@ class DatastoreProfileGCS(DatastoreProfile):
|
|
|
360
360
|
def check_bucket(cls, v):
|
|
361
361
|
if not v:
|
|
362
362
|
warnings.warn(
|
|
363
|
-
"The 'bucket' attribute will be mandatory starting from version 1.
|
|
363
|
+
"The 'bucket' attribute will be mandatory starting from version 1.10",
|
|
364
364
|
FutureWarning,
|
|
365
365
|
stacklevel=2,
|
|
366
366
|
)
|
|
@@ -417,7 +417,7 @@ class DatastoreProfileAzureBlob(DatastoreProfile):
|
|
|
417
417
|
def check_container(cls, v):
|
|
418
418
|
if not v:
|
|
419
419
|
warnings.warn(
|
|
420
|
-
"The 'container' attribute will be mandatory starting from version 1.
|
|
420
|
+
"The 'container' attribute will be mandatory starting from version 1.10",
|
|
421
421
|
FutureWarning,
|
|
422
422
|
stacklevel=2,
|
|
423
423
|
)
|
mlrun/datastore/sources.py
CHANGED
|
@@ -794,12 +794,12 @@ class SnowflakeSource(BaseSourceDriver):
|
|
|
794
794
|
warehouse: Optional[str] = None,
|
|
795
795
|
**kwargs,
|
|
796
796
|
):
|
|
797
|
-
# TODO: Remove in 1.
|
|
797
|
+
# TODO: Remove in 1.10.0
|
|
798
798
|
if schema:
|
|
799
799
|
warnings.warn(
|
|
800
|
-
"schema is deprecated in 1.7.0, and will be removed in 1.
|
|
800
|
+
"schema is deprecated in 1.7.0, and will be removed in 1.10.0, please use db_schema"
|
|
801
801
|
)
|
|
802
|
-
db_schema = db_schema or schema # TODO: Remove in 1.
|
|
802
|
+
db_schema = db_schema or schema # TODO: Remove in 1.10.0
|
|
803
803
|
|
|
804
804
|
attributes = attributes or {}
|
|
805
805
|
if url:
|
mlrun/datastore/targets.py
CHANGED
|
@@ -443,8 +443,8 @@ class BaseStoreTarget(DataTargetBase):
|
|
|
443
443
|
self.credentials_prefix = credentials_prefix
|
|
444
444
|
if credentials_prefix:
|
|
445
445
|
warnings.warn(
|
|
446
|
-
"The 'credentials_prefix' parameter is deprecated and will be removed in "
|
|
447
|
-
"1.
|
|
446
|
+
"The 'credentials_prefix' parameter is deprecated in 1.7.0 and will be removed in "
|
|
447
|
+
"1.10.0. Please use datastore profiles instead.",
|
|
448
448
|
FutureWarning,
|
|
449
449
|
)
|
|
450
450
|
|
|
@@ -1671,7 +1671,7 @@ class KafkaTarget(BaseStoreTarget):
|
|
|
1671
1671
|
):
|
|
1672
1672
|
attrs = {}
|
|
1673
1673
|
|
|
1674
|
-
# TODO: Remove this in 1.
|
|
1674
|
+
# TODO: Remove this in 1.10.0
|
|
1675
1675
|
if bootstrap_servers:
|
|
1676
1676
|
if brokers:
|
|
1677
1677
|
raise mlrun.errors.MLRunInvalidArgumentError(
|
|
@@ -1679,7 +1679,7 @@ class KafkaTarget(BaseStoreTarget):
|
|
|
1679
1679
|
"'bootstrap_servers' parameter. Please use 'brokers' only."
|
|
1680
1680
|
)
|
|
1681
1681
|
warnings.warn(
|
|
1682
|
-
"'bootstrap_servers' parameter is deprecated in 1.7.0 and will be removed in 1.
|
|
1682
|
+
"'bootstrap_servers' parameter is deprecated in 1.7.0 and will be removed in 1.10.0, "
|
|
1683
1683
|
"use 'brokers' instead.",
|
|
1684
1684
|
FutureWarning,
|
|
1685
1685
|
)
|
mlrun/datastore/utils.py
CHANGED
|
@@ -176,8 +176,8 @@ def get_kafka_brokers_from_dict(options: dict, pop=False) -> typing.Optional[str
|
|
|
176
176
|
kafka_bootstrap_servers = get_or_pop("kafka_bootstrap_servers", None)
|
|
177
177
|
if kafka_bootstrap_servers:
|
|
178
178
|
warnings.warn(
|
|
179
|
-
"The 'kafka_bootstrap_servers' parameter is deprecated and will be removed in "
|
|
180
|
-
"1.
|
|
179
|
+
"The 'kafka_bootstrap_servers' parameter is deprecated in 1.7.0 and will be removed in "
|
|
180
|
+
"1.10.0. Please pass the 'kafka_brokers' parameter instead.",
|
|
181
181
|
FutureWarning,
|
|
182
182
|
)
|
|
183
183
|
return kafka_bootstrap_servers
|
mlrun/db/base.py
CHANGED
|
@@ -441,10 +441,10 @@ class RunDBInterface(ABC):
|
|
|
441
441
|
) -> dict:
|
|
442
442
|
pass
|
|
443
443
|
|
|
444
|
-
# TODO: remove in 1.
|
|
444
|
+
# TODO: remove in 1.10.0
|
|
445
445
|
@deprecated(
|
|
446
|
-
version="1.
|
|
447
|
-
reason="'list_features' will be removed in 1.
|
|
446
|
+
version="1.7.0",
|
|
447
|
+
reason="'list_features' will be removed in 1.10.0, use 'list_features_v2' instead",
|
|
448
448
|
category=FutureWarning,
|
|
449
449
|
)
|
|
450
450
|
@abstractmethod
|
|
@@ -469,10 +469,10 @@ class RunDBInterface(ABC):
|
|
|
469
469
|
) -> mlrun.common.schemas.FeaturesOutputV2:
|
|
470
470
|
pass
|
|
471
471
|
|
|
472
|
-
# TODO: remove in 1.
|
|
472
|
+
# TODO: remove in 1.10.0
|
|
473
473
|
@deprecated(
|
|
474
|
-
version="1.
|
|
475
|
-
reason="'list_entities' will be removed in 1.
|
|
474
|
+
version="1.7.0",
|
|
475
|
+
reason="'list_entities' will be removed in 1.10.0, use 'list_entities_v2' instead",
|
|
476
476
|
category=FutureWarning,
|
|
477
477
|
)
|
|
478
478
|
@abstractmethod
|
|
@@ -734,7 +734,7 @@ class RunDBInterface(ABC):
|
|
|
734
734
|
labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
|
|
735
735
|
start: Optional[datetime.datetime] = None,
|
|
736
736
|
end: Optional[datetime.datetime] = None,
|
|
737
|
-
tsdb_metrics: bool =
|
|
737
|
+
tsdb_metrics: bool = False,
|
|
738
738
|
metric_list: Optional[list[str]] = None,
|
|
739
739
|
top_level: bool = False,
|
|
740
740
|
uids: Optional[list[str]] = None,
|
mlrun/db/httpdb.py
CHANGED
|
@@ -21,7 +21,7 @@ import typing
|
|
|
21
21
|
import warnings
|
|
22
22
|
from copy import deepcopy
|
|
23
23
|
from datetime import datetime, timedelta
|
|
24
|
-
from os import path, remove
|
|
24
|
+
from os import environ, path, remove
|
|
25
25
|
from typing import Literal, Optional, Union
|
|
26
26
|
from urllib.parse import urlparse
|
|
27
27
|
|
|
@@ -129,7 +129,9 @@ class HTTPRunDB(RunDBInterface):
|
|
|
129
129
|
self._wait_for_background_task_terminal_state_retry_interval = 3
|
|
130
130
|
self._wait_for_project_deletion_interval = 3
|
|
131
131
|
self.client_version = version.Version().get()["version"]
|
|
132
|
-
self.python_version =
|
|
132
|
+
self.python_version = environ.get("MLRUN_PYTHON_VERSION") or str(
|
|
133
|
+
version.Version().get_python_version()
|
|
134
|
+
)
|
|
133
135
|
|
|
134
136
|
self._enrich_and_validate(url)
|
|
135
137
|
|
|
@@ -937,7 +939,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
937
939
|
|
|
938
940
|
:param name: Name of the run to retrieve.
|
|
939
941
|
:param uid: Unique ID of the run, or a list of run UIDs.
|
|
940
|
-
:param project: Project that the runs belongs to.
|
|
942
|
+
:param project: Project that the runs belongs to. If not specified, the default project will be used.
|
|
941
943
|
:param labels: Filter runs by label key-value pairs or key existence. This can be provided as:
|
|
942
944
|
- A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
|
|
943
945
|
or `{"label": None}` to check for key existence.
|
|
@@ -945,7 +947,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
945
947
|
or just `"label"` for key existence.
|
|
946
948
|
- A comma-separated string formatted as `"label1=value1,label2"` to match entities with
|
|
947
949
|
the specified key-value pairs or key existence.
|
|
948
|
-
:param state: Deprecated - List only runs whose state is specified (will be removed in 1.
|
|
950
|
+
:param state: Deprecated - List only runs whose state is specified (will be removed in 1.10.0)
|
|
949
951
|
:param states: List only runs whose state is one of the provided states.
|
|
950
952
|
:param sort: Whether to sort the result according to their start time. Otherwise, results will be
|
|
951
953
|
returned by their internal order in the DB (order will not be guaranteed).
|
|
@@ -1277,7 +1279,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
1277
1279
|
points to a run and is used to filter artifacts by the run that produced them when the artifact producer id
|
|
1278
1280
|
is a workflow id (artifact was created as part of a workflow).
|
|
1279
1281
|
:param format_: The format in which to return the artifacts. Default is 'full'.
|
|
1280
|
-
:param limit: Deprecated - Maximum number of artifacts to return (will be removed in 1.
|
|
1282
|
+
:param limit: Deprecated - Maximum number of artifacts to return (will be removed in 1.11.0).
|
|
1281
1283
|
:param partition_by: Field to group results by. When `partition_by` is specified, the `partition_sort_by`
|
|
1282
1284
|
parameter must be provided as well.
|
|
1283
1285
|
:param rows_per_partition: How many top rows (per sorting defined by `partition_sort_by` and `partition_order`)
|
|
@@ -2221,18 +2223,20 @@ class HTTPRunDB(RunDBInterface):
|
|
|
2221
2223
|
elif pipe_file.endswith(".zip"):
|
|
2222
2224
|
headers = {"content-type": "application/zip"}
|
|
2223
2225
|
else:
|
|
2224
|
-
raise ValueError("pipeline file must be .yaml or .zip")
|
|
2226
|
+
raise ValueError("'pipeline' file must be .yaml or .zip")
|
|
2225
2227
|
if arguments:
|
|
2226
2228
|
if not isinstance(arguments, dict):
|
|
2227
|
-
raise ValueError("arguments must be dict type")
|
|
2229
|
+
raise ValueError("'arguments' must be dict type")
|
|
2228
2230
|
headers[mlrun.common.schemas.HeaderNames.pipeline_arguments] = str(
|
|
2229
2231
|
arguments
|
|
2230
2232
|
)
|
|
2231
2233
|
|
|
2232
2234
|
if not path.isfile(pipe_file):
|
|
2233
|
-
raise OSError(f"
|
|
2235
|
+
raise OSError(f"File {pipe_file} doesnt exist")
|
|
2234
2236
|
with open(pipe_file, "rb") as fp:
|
|
2235
2237
|
data = fp.read()
|
|
2238
|
+
if not data:
|
|
2239
|
+
raise ValueError("The compiled pipe file is empty")
|
|
2236
2240
|
if not isinstance(pipeline, str):
|
|
2237
2241
|
remove(pipe_file)
|
|
2238
2242
|
|
|
@@ -3767,7 +3771,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3767
3771
|
labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
|
|
3768
3772
|
start: Optional[datetime] = None,
|
|
3769
3773
|
end: Optional[datetime] = None,
|
|
3770
|
-
tsdb_metrics: bool =
|
|
3774
|
+
tsdb_metrics: bool = False,
|
|
3771
3775
|
metric_list: Optional[list[str]] = None,
|
|
3772
3776
|
top_level: bool = False,
|
|
3773
3777
|
uids: Optional[list[str]] = None,
|
|
@@ -3889,8 +3893,8 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3889
3893
|
attributes_keys = list(attributes.keys())
|
|
3890
3894
|
attributes["name"] = name
|
|
3891
3895
|
attributes["project"] = project
|
|
3892
|
-
attributes["
|
|
3893
|
-
attributes["
|
|
3896
|
+
attributes["function_name"] = function_name or None
|
|
3897
|
+
attributes["function_tag"] = function_tag or None
|
|
3894
3898
|
attributes["uid"] = endpoint_id or None
|
|
3895
3899
|
model_endpoint = mlrun.common.schemas.ModelEndpoint.from_flat_dict(attributes)
|
|
3896
3900
|
path = f"projects/{project}/model-endpoints"
|
|
@@ -5100,9 +5104,9 @@ class HTTPRunDB(RunDBInterface):
|
|
|
5100
5104
|
labels = self._parse_labels(labels)
|
|
5101
5105
|
|
|
5102
5106
|
if limit:
|
|
5103
|
-
# TODO: Remove this in 1.
|
|
5107
|
+
# TODO: Remove this in 1.11.0
|
|
5104
5108
|
warnings.warn(
|
|
5105
|
-
"'limit' is deprecated and will be removed in 1.
|
|
5109
|
+
"'limit' is deprecated and will be removed in 1.11.0. Use 'page' and 'page_size' instead.",
|
|
5106
5110
|
FutureWarning,
|
|
5107
5111
|
)
|
|
5108
5112
|
|
|
@@ -5242,9 +5246,9 @@ class HTTPRunDB(RunDBInterface):
|
|
|
5242
5246
|
)
|
|
5243
5247
|
|
|
5244
5248
|
if state:
|
|
5245
|
-
# TODO: Remove this in 1.
|
|
5249
|
+
# TODO: Remove this in 1.10.0
|
|
5246
5250
|
warnings.warn(
|
|
5247
|
-
"'state' is deprecated and will be removed in 1.
|
|
5251
|
+
"'state' is deprecated in 1.7.0 and will be removed in 1.10.0. Use 'states' instead.",
|
|
5248
5252
|
FutureWarning,
|
|
5249
5253
|
)
|
|
5250
5254
|
|
mlrun/db/nopdb.py
CHANGED
|
@@ -631,7 +631,7 @@ class NopDB(RunDBInterface):
|
|
|
631
631
|
labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
|
|
632
632
|
start: Optional[datetime.datetime] = None,
|
|
633
633
|
end: Optional[datetime.datetime] = None,
|
|
634
|
-
tsdb_metrics: bool =
|
|
634
|
+
tsdb_metrics: bool = False,
|
|
635
635
|
metric_list: Optional[list[str]] = None,
|
|
636
636
|
top_level: bool = False,
|
|
637
637
|
uids: Optional[list[str]] = None,
|
mlrun/execution.py
CHANGED
|
@@ -976,7 +976,7 @@ class MLClientCtx:
|
|
|
976
976
|
def get_cached_artifact(self, key):
|
|
977
977
|
"""Return a logged artifact from cache (for potential updates)"""
|
|
978
978
|
warnings.warn(
|
|
979
|
-
"get_cached_artifact is deprecated in 1.8.0 and will be removed in 1.
|
|
979
|
+
"get_cached_artifact is deprecated in 1.8.0 and will be removed in 1.11.0. Use get_artifact instead.",
|
|
980
980
|
FutureWarning,
|
|
981
981
|
)
|
|
982
982
|
return self.get_artifact(key)
|
|
@@ -690,10 +690,10 @@ class ModelHandler(ABC, Generic[CommonTypes.ModelType, CommonTypes.IOSampleType]
|
|
|
690
690
|
}
|
|
691
691
|
self._registered_artifacts = {}
|
|
692
692
|
|
|
693
|
-
# Get the model artifact. If the model was logged during this run, use the
|
|
693
|
+
# Get the model artifact. If the model was logged during this run, use the artifact, otherwise use the
|
|
694
694
|
# user's given model path:
|
|
695
695
|
model_artifact = (
|
|
696
|
-
self._context.
|
|
696
|
+
self._context.get_artifact(self._model_name)
|
|
697
697
|
if self._is_logged
|
|
698
698
|
else self._model_path
|
|
699
699
|
)
|
mlrun/launcher/client.py
CHANGED
|
@@ -72,7 +72,7 @@ class ClientBaseLauncher(launcher.BaseLauncher, abc.ABC):
|
|
|
72
72
|
):
|
|
73
73
|
run.metadata.labels[mlrun_constants.MLRunInternalLabels.kind] = runtime.kind
|
|
74
74
|
mlrun.runtimes.utils.enrich_run_labels(
|
|
75
|
-
run.metadata.labels, [
|
|
75
|
+
run.metadata.labels, [mlrun_constants.MLRunInternalLabels.owner]
|
|
76
76
|
)
|
|
77
77
|
if run.spec.output_path:
|
|
78
78
|
run.spec.output_path = run.spec.output_path.replace(
|
mlrun/model_monitoring/api.py
CHANGED
|
@@ -181,7 +181,7 @@ def record_results(
|
|
|
181
181
|
if drift_threshold is not None or possible_drift_threshold is not None:
|
|
182
182
|
warnings.warn(
|
|
183
183
|
"Custom drift threshold arguments are deprecated since version "
|
|
184
|
-
"1.7.0 and have no effect. They will be removed in version 1.
|
|
184
|
+
"1.7.0 and have no effect. They will be removed in version 1.10.0.\n"
|
|
185
185
|
"To enable the default histogram data drift application, run:\n"
|
|
186
186
|
"`project.enable_model_monitoring()`.",
|
|
187
187
|
FutureWarning,
|
|
@@ -189,7 +189,7 @@ def record_results(
|
|
|
189
189
|
if trigger_monitoring_job is not False:
|
|
190
190
|
warnings.warn(
|
|
191
191
|
"`trigger_monitoring_job` argument is deprecated since version "
|
|
192
|
-
"1.7.0 and has no effect. It will be removed in version 1.
|
|
192
|
+
"1.7.0 and has no effect. It will be removed in version 1.10.0.\n"
|
|
193
193
|
"To enable the default histogram data drift application, run:\n"
|
|
194
194
|
"`project.enable_model_monitoring()`.",
|
|
195
195
|
FutureWarning,
|
|
@@ -197,13 +197,13 @@ def record_results(
|
|
|
197
197
|
if artifacts_tag != "":
|
|
198
198
|
warnings.warn(
|
|
199
199
|
"`artifacts_tag` argument is deprecated since version "
|
|
200
|
-
"1.7.0 and has no effect. It will be removed in version 1.
|
|
200
|
+
"1.7.0 and has no effect. It will be removed in version 1.10.0.",
|
|
201
201
|
FutureWarning,
|
|
202
202
|
)
|
|
203
203
|
if default_batch_image != "mlrun/mlrun":
|
|
204
204
|
warnings.warn(
|
|
205
205
|
"`default_batch_image` argument is deprecated since version "
|
|
206
|
-
"1.7.0 and has no effect. It will be removed in version 1.
|
|
206
|
+
"1.7.0 and has no effect. It will be removed in version 1.10.0.",
|
|
207
207
|
FutureWarning,
|
|
208
208
|
)
|
|
209
209
|
|
|
@@ -96,7 +96,9 @@ class _PushToMonitoringWriter(StepToDict):
|
|
|
96
96
|
logger.debug(
|
|
97
97
|
"Pushing data to output stream", writer_event=str(writer_event)
|
|
98
98
|
)
|
|
99
|
-
self.output_stream.push(
|
|
99
|
+
self.output_stream.push(
|
|
100
|
+
[writer_event], partition_key=application_context.endpoint_id
|
|
101
|
+
)
|
|
100
102
|
logger.debug("Pushed data to output stream successfully")
|
|
101
103
|
|
|
102
104
|
def _lazy_init(self):
|