mlrun 1.10.0rc1__py3-none-any.whl → 1.10.0rc3__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 +2 -2
- mlrun/__main__.py +15 -4
- mlrun/artifacts/base.py +6 -6
- mlrun/artifacts/dataset.py +1 -1
- mlrun/artifacts/document.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/__init__.py +1 -0
- 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/common/schemas/serving.py +17 -0
- mlrun/config.py +4 -4
- mlrun/datastore/datastore_profile.py +7 -57
- mlrun/datastore/sources.py +24 -16
- mlrun/datastore/store_resources.py +3 -3
- mlrun/datastore/targets.py +5 -5
- mlrun/datastore/utils.py +21 -6
- mlrun/db/base.py +7 -7
- mlrun/db/httpdb.py +88 -76
- mlrun/db/nopdb.py +1 -1
- mlrun/errors.py +29 -1
- mlrun/execution.py +9 -0
- mlrun/feature_store/common.py +5 -5
- mlrun/feature_store/feature_set.py +10 -6
- mlrun/feature_store/feature_vector.py +8 -6
- mlrun/launcher/base.py +1 -1
- mlrun/launcher/client.py +1 -1
- mlrun/lists.py +1 -1
- mlrun/model_monitoring/__init__.py +0 -1
- mlrun/model_monitoring/api.py +0 -44
- mlrun/model_monitoring/applications/evidently/base.py +57 -107
- mlrun/model_monitoring/controller.py +27 -14
- mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +13 -5
- mlrun/model_monitoring/writer.py +1 -4
- mlrun/projects/operations.py +3 -3
- mlrun/projects/project.py +114 -52
- mlrun/render.py +5 -9
- mlrun/run.py +10 -10
- mlrun/runtimes/base.py +7 -7
- mlrun/runtimes/kubejob.py +2 -2
- mlrun/runtimes/nuclio/function.py +3 -3
- mlrun/runtimes/nuclio/serving.py +13 -23
- mlrun/runtimes/utils.py +25 -8
- mlrun/serving/__init__.py +5 -1
- mlrun/serving/server.py +39 -3
- mlrun/serving/states.py +176 -10
- mlrun/utils/helpers.py +10 -4
- mlrun/utils/version/version.json +2 -2
- {mlrun-1.10.0rc1.dist-info → mlrun-1.10.0rc3.dist-info}/METADATA +27 -15
- {mlrun-1.10.0rc1.dist-info → mlrun-1.10.0rc3.dist-info}/RECORD +58 -59
- {mlrun-1.10.0rc1.dist-info → mlrun-1.10.0rc3.dist-info}/WHEEL +1 -1
- mlrun/model_monitoring/tracking_policy.py +0 -124
- {mlrun-1.10.0rc1.dist-info → mlrun-1.10.0rc3.dist-info}/entry_points.txt +0 -0
- {mlrun-1.10.0rc1.dist-info → mlrun-1.10.0rc3.dist-info}/licenses/LICENSE +0 -0
- {mlrun-1.10.0rc1.dist-info → mlrun-1.10.0rc3.dist-info}/top_level.txt +0 -0
mlrun/projects/project.py
CHANGED
|
@@ -30,6 +30,7 @@ from copy import deepcopy
|
|
|
30
30
|
from os import environ, makedirs, path
|
|
31
31
|
from typing import Callable, Optional, Union, cast
|
|
32
32
|
|
|
33
|
+
import deprecated
|
|
33
34
|
import dotenv
|
|
34
35
|
import git
|
|
35
36
|
import git.exc
|
|
@@ -277,7 +278,7 @@ def new_project(
|
|
|
277
278
|
for key, val in parameters.items():
|
|
278
279
|
project.spec.params[key] = val
|
|
279
280
|
|
|
280
|
-
|
|
281
|
+
_set_as_current_active_project(project)
|
|
281
282
|
|
|
282
283
|
if save and mlrun.mlconf.dbpath:
|
|
283
284
|
if overwrite:
|
|
@@ -450,7 +451,7 @@ def load_project(
|
|
|
450
451
|
if sync_functions:
|
|
451
452
|
project.sync_functions(save=to_save)
|
|
452
453
|
|
|
453
|
-
|
|
454
|
+
_set_as_current_active_project(project)
|
|
454
455
|
|
|
455
456
|
return project
|
|
456
457
|
|
|
@@ -470,7 +471,7 @@ def get_or_create_project(
|
|
|
470
471
|
allow_cross_project: Optional[bool] = None,
|
|
471
472
|
) -> "MlrunProject":
|
|
472
473
|
"""Load a project from MLRun DB, or create/import if it does not exist.
|
|
473
|
-
The project will become the
|
|
474
|
+
The project will become the active project for the current session.
|
|
474
475
|
|
|
475
476
|
MLRun looks for a project.yaml file with project definition and objects in the project root path
|
|
476
477
|
and use it to initialize the project, in addition it runs the project_setup.py file (if it exists)
|
|
@@ -756,10 +757,10 @@ def _project_instance_from_struct(struct, name, allow_cross_project):
|
|
|
756
757
|
)
|
|
757
758
|
|
|
758
759
|
if allow_cross_project is None:
|
|
759
|
-
# TODO: Remove this warning in version 1.
|
|
760
|
+
# TODO: Remove this warning in version 1.10.0 and also fix cli to support allow_cross_project
|
|
760
761
|
warnings.warn(
|
|
761
762
|
f"Project {name=} is different than specified on the context's project yaml. "
|
|
762
|
-
"This behavior is deprecated and will not be supported from version 1.
|
|
763
|
+
"This behavior is deprecated and will not be supported from version 1.10.0."
|
|
763
764
|
)
|
|
764
765
|
logger.warn(error_message)
|
|
765
766
|
elif allow_cross_project:
|
|
@@ -2478,9 +2479,9 @@ class MlrunProject(ModelObj):
|
|
|
2478
2479
|
:param fetch_credentials_from_sys_config: If true, fetch the credentials from the system configuration.
|
|
2479
2480
|
"""
|
|
2480
2481
|
if default_controller_image != "mlrun/mlrun":
|
|
2481
|
-
# TODO: Remove this in 1.
|
|
2482
|
+
# TODO: Remove this in 1.10.0
|
|
2482
2483
|
warnings.warn(
|
|
2483
|
-
"'default_controller_image' is deprecated and will be removed in 1.
|
|
2484
|
+
"'default_controller_image' is deprecated in 1.7.0 and will be removed in 1.10.0, "
|
|
2484
2485
|
"use 'image' instead",
|
|
2485
2486
|
FutureWarning,
|
|
2486
2487
|
)
|
|
@@ -2860,6 +2861,20 @@ class MlrunProject(ModelObj):
|
|
|
2860
2861
|
|
|
2861
2862
|
self.spec.set_function(name, function_object, func)
|
|
2862
2863
|
|
|
2864
|
+
# TODO: Remove this in 1.11.0
|
|
2865
|
+
@deprecated.deprecated(
|
|
2866
|
+
version="1.8.0",
|
|
2867
|
+
reason="'remove_function' is deprecated and will be removed in 1.11.0. "
|
|
2868
|
+
"Please use `delete_function` instead.",
|
|
2869
|
+
category=FutureWarning,
|
|
2870
|
+
)
|
|
2871
|
+
def remove_function(self, name):
|
|
2872
|
+
"""remove the specified function from the project
|
|
2873
|
+
|
|
2874
|
+
:param name: name of the function (under the project)
|
|
2875
|
+
"""
|
|
2876
|
+
self.spec.remove_function(name)
|
|
2877
|
+
|
|
2863
2878
|
def delete_function(self, name, delete_from_db=False):
|
|
2864
2879
|
"""deletes the specified function from the project
|
|
2865
2880
|
|
|
@@ -2877,9 +2892,9 @@ class MlrunProject(ModelObj):
|
|
|
2877
2892
|
|
|
2878
2893
|
:param name: name of the model-monitoring-function/s (under the project)
|
|
2879
2894
|
"""
|
|
2880
|
-
# TODO: Remove this in 1.
|
|
2895
|
+
# TODO: Remove this in 1.10.0
|
|
2881
2896
|
warnings.warn(
|
|
2882
|
-
"'remove_model_monitoring_function' is deprecated and will be removed in 1.
|
|
2897
|
+
"'remove_model_monitoring_function' is deprecated in 1.7.0 and will be removed in 1.10.0. "
|
|
2883
2898
|
"Please use `delete_model_monitoring_function` instead.",
|
|
2884
2899
|
FutureWarning,
|
|
2885
2900
|
)
|
|
@@ -3695,7 +3710,7 @@ class MlrunProject(ModelObj):
|
|
|
3695
3710
|
brokers=["<kafka-broker-ip-address>:9094"],
|
|
3696
3711
|
topics=[], # Keep the topics list empty
|
|
3697
3712
|
## SASL is supported
|
|
3698
|
-
# sasl_user="
|
|
3713
|
+
# sasl_user="<kafka-sasl-user>",
|
|
3699
3714
|
# sasl_pass="<kafka-sasl-password>",
|
|
3700
3715
|
)
|
|
3701
3716
|
project.register_datastore_profile(stream_profile)
|
|
@@ -3728,6 +3743,29 @@ class MlrunProject(ModelObj):
|
|
|
3728
3743
|
|
|
3729
3744
|
In the V3IO datastore, you must provide an explicit access key to the stream, but not to the TSDB.
|
|
3730
3745
|
|
|
3746
|
+
An external Confluent Kafka stream is also supported. Here is an example:
|
|
3747
|
+
|
|
3748
|
+
.. code-block:: python
|
|
3749
|
+
|
|
3750
|
+
from mlrun.datastore.datastore_profile import DatastoreProfileKafkaSource
|
|
3751
|
+
|
|
3752
|
+
stream_profile = DatastoreProfileKafkaSource(
|
|
3753
|
+
name="confluent-kafka",
|
|
3754
|
+
brokers=["<server-domain-start>.confluent.cloud:9092"],
|
|
3755
|
+
topics=[],
|
|
3756
|
+
sasl_user="<API-key>",
|
|
3757
|
+
sasl_pass="<API-secret>",
|
|
3758
|
+
kwargs_public={
|
|
3759
|
+
"security_protocol": "SASL_SSL",
|
|
3760
|
+
"api_version_auto_timeout_ms": 15_000, # 15 seconds
|
|
3761
|
+
"tls": {"enable": True},
|
|
3762
|
+
"new_topic": {"replication_factor": 3},
|
|
3763
|
+
},
|
|
3764
|
+
)
|
|
3765
|
+
|
|
3766
|
+
The replication factor and timeout configuration might need to be adjusted according to your Confluent cluster
|
|
3767
|
+
type and settings.
|
|
3768
|
+
|
|
3731
3769
|
:param tsdb_profile_name: The datastore profile name of the time-series database to be used in model
|
|
3732
3770
|
monitoring. The supported profiles are:
|
|
3733
3771
|
|
|
@@ -3781,7 +3819,7 @@ class MlrunProject(ModelObj):
|
|
|
3781
3819
|
top_level: bool = False,
|
|
3782
3820
|
uids: Optional[list[str]] = None,
|
|
3783
3821
|
latest_only: bool = False,
|
|
3784
|
-
tsdb_metrics: bool =
|
|
3822
|
+
tsdb_metrics: bool = False,
|
|
3785
3823
|
metric_list: Optional[list[str]] = None,
|
|
3786
3824
|
) -> mlrun.common.schemas.ModelEndpointList:
|
|
3787
3825
|
"""
|
|
@@ -4003,8 +4041,10 @@ class MlrunProject(ModelObj):
|
|
|
4003
4041
|
e.g. builder_env={"GIT_TOKEN": token}, does not work yet in KFP
|
|
4004
4042
|
:param overwrite_build_params: Overwrite existing build configuration (currently applies to
|
|
4005
4043
|
requirements and commands)
|
|
4044
|
+
|
|
4006
4045
|
* False: The new params are merged with the existing
|
|
4007
4046
|
* True: The existing params are replaced by the new ones
|
|
4047
|
+
|
|
4008
4048
|
:param extra_args: A string containing additional builder arguments in the format of command-line options,
|
|
4009
4049
|
e.g. extra_args="--skip-tls-verify --build-arg A=val"
|
|
4010
4050
|
:param force_build: force building the image, even when no changes were made
|
|
@@ -4055,8 +4095,10 @@ class MlrunProject(ModelObj):
|
|
|
4055
4095
|
:param requirements_file: requirements file to install on the built image
|
|
4056
4096
|
:param overwrite_build_params: Overwrite existing build configuration (currently applies to
|
|
4057
4097
|
requirements and commands)
|
|
4098
|
+
|
|
4058
4099
|
* False: The new params are merged with the existing
|
|
4059
4100
|
* True: The existing params are replaced by the new ones
|
|
4101
|
+
|
|
4060
4102
|
:param builder_env: Kaniko builder pod env vars dict (for config/credentials)
|
|
4061
4103
|
e.g. builder_env={"GIT_TOKEN": token}, does not work yet in KFP
|
|
4062
4104
|
:param extra_args: A string containing additional builder arguments in the format of command-line options,
|
|
@@ -4065,9 +4107,9 @@ class MlrunProject(ModelObj):
|
|
|
4065
4107
|
(by default `/home/mlrun_code`)
|
|
4066
4108
|
"""
|
|
4067
4109
|
if not overwrite_build_params:
|
|
4068
|
-
# TODO: change overwrite_build_params default to True in 1.
|
|
4110
|
+
# TODO: change overwrite_build_params default to True in 1.10.0
|
|
4069
4111
|
warnings.warn(
|
|
4070
|
-
"The `overwrite_build_params` parameter default will change from 'False' to 'True' in 1.
|
|
4112
|
+
"The `overwrite_build_params` parameter default will change from 'False' to 'True' in 1.10.0.",
|
|
4071
4113
|
mlrun.utils.OverwriteBuildParamsWarning,
|
|
4072
4114
|
)
|
|
4073
4115
|
default_image_name = mlrun.mlconf.default_project_image_name.format(
|
|
@@ -4128,8 +4170,10 @@ class MlrunProject(ModelObj):
|
|
|
4128
4170
|
e.g. builder_env={"GIT_TOKEN": token}, does not work yet in KFP
|
|
4129
4171
|
:param overwrite_build_params: Overwrite existing build configuration (currently applies to
|
|
4130
4172
|
requirements and commands)
|
|
4173
|
+
|
|
4131
4174
|
* False: The new params are merged with the existing
|
|
4132
4175
|
* True: The existing params are replaced by the new ones
|
|
4176
|
+
|
|
4133
4177
|
:param extra_args: A string containing additional builder arguments in the format of command-line options,
|
|
4134
4178
|
e.g. extra_args="--skip-tls-verify --build-arg A=val"
|
|
4135
4179
|
:param target_dir: Path on the image where source code would be extracted (by default `/home/mlrun_code`)
|
|
@@ -4142,9 +4186,9 @@ class MlrunProject(ModelObj):
|
|
|
4142
4186
|
)
|
|
4143
4187
|
|
|
4144
4188
|
if not overwrite_build_params:
|
|
4145
|
-
# TODO: change overwrite_build_params default to True in 1.
|
|
4189
|
+
# TODO: change overwrite_build_params default to True in 1.10.0
|
|
4146
4190
|
warnings.warn(
|
|
4147
|
-
"The `overwrite_build_params` parameter default will change from 'False' to 'True' in 1.
|
|
4191
|
+
"The `overwrite_build_params` parameter default will change from 'False' to 'True' in 1.10.0.",
|
|
4148
4192
|
mlrun.utils.OverwriteBuildParamsWarning,
|
|
4149
4193
|
)
|
|
4150
4194
|
|
|
@@ -4307,12 +4351,14 @@ class MlrunProject(ModelObj):
|
|
|
4307
4351
|
``my_Name_1`` or ``surname``.
|
|
4308
4352
|
:param tag: Return artifacts assigned this tag.
|
|
4309
4353
|
:param labels: Filter artifacts by label key-value pairs or key existence. This can be provided as:
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4354
|
+
|
|
4355
|
+
- A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
|
|
4356
|
+
or `{"label": None}` to check for key existence.
|
|
4357
|
+
- A list of strings formatted as `"label=value"` to match specific label key-value pairs,
|
|
4358
|
+
or just `"label"` for key existence.
|
|
4359
|
+
- A comma-separated string formatted as `"label1=value1,label2"` to match entities with
|
|
4360
|
+
the specified key-value pairs or key existence.
|
|
4361
|
+
|
|
4316
4362
|
:param since: Not in use in :py:class:`HTTPRunDB`.
|
|
4317
4363
|
:param until: Not in use in :py:class:`HTTPRunDB`.
|
|
4318
4364
|
:param iter: Return artifacts from a specific iteration (where ``iter=0`` means the root iteration). If
|
|
@@ -4323,7 +4369,7 @@ class MlrunProject(ModelObj):
|
|
|
4323
4369
|
:param kind: Return artifacts of the requested kind.
|
|
4324
4370
|
:param category: Return artifacts of the requested category.
|
|
4325
4371
|
:param tree: Return artifacts of the requested tree.
|
|
4326
|
-
:param limit: Maximum number of artifacts to return.
|
|
4372
|
+
:param limit: Deprecated - Maximum number of artifacts to return (will be removed in 1.11.0).
|
|
4327
4373
|
:param format_: The format in which to return the artifacts. Default is 'full'.
|
|
4328
4374
|
:param partition_by: Field to group results by. When `partition_by` is specified, the `partition_sort_by`
|
|
4329
4375
|
parameter must be provided as well.
|
|
@@ -4334,6 +4380,14 @@ class MlrunProject(ModelObj):
|
|
|
4334
4380
|
:param partition_order: Order of sorting within partitions - `asc` or `desc`. Default is `desc`.
|
|
4335
4381
|
"""
|
|
4336
4382
|
db = mlrun.db.get_run_db(secrets=self._secrets)
|
|
4383
|
+
|
|
4384
|
+
if limit:
|
|
4385
|
+
# TODO: Remove this in 1.11.0
|
|
4386
|
+
warnings.warn(
|
|
4387
|
+
"'limit' is deprecated and will be removed in 1.11.0. Use 'page' and 'page_size' instead.",
|
|
4388
|
+
FutureWarning,
|
|
4389
|
+
)
|
|
4390
|
+
|
|
4337
4391
|
return db.list_artifacts(
|
|
4338
4392
|
name,
|
|
4339
4393
|
self.metadata.name,
|
|
@@ -4446,12 +4500,14 @@ class MlrunProject(ModelObj):
|
|
|
4446
4500
|
``my_Name_1`` or ``surname``.
|
|
4447
4501
|
:param tag: Return artifacts assigned this tag.
|
|
4448
4502
|
:param labels: Filter model artifacts by label key-value pairs or key existence. This can be provided as:
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4503
|
+
|
|
4504
|
+
- A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
|
|
4505
|
+
or `{"label": None}` to check for key existence.
|
|
4506
|
+
- A list of strings formatted as `"label=value"` to match specific label key-value pairs,
|
|
4507
|
+
or just `"label"` for key existence.
|
|
4508
|
+
- A comma-separated string formatted as `"label1=value1,label2"` to match entities with
|
|
4509
|
+
the specified key-value pairs or key existence.
|
|
4510
|
+
|
|
4455
4511
|
:param since: Not in use in :py:class:`HTTPRunDB`.
|
|
4456
4512
|
:param until: Not in use in :py:class:`HTTPRunDB`.
|
|
4457
4513
|
:param iter: Return artifacts from a specific iteration (where ``iter=0`` means the root iteration). If
|
|
@@ -4460,7 +4516,7 @@ class MlrunProject(ModelObj):
|
|
|
4460
4516
|
artifacts generated from a hyper-param run. If only a single iteration exists, will return the artifact
|
|
4461
4517
|
from that iteration. If using ``best_iter``, the ``iter`` parameter must not be used.
|
|
4462
4518
|
:param tree: Return artifacts of the requested tree.
|
|
4463
|
-
:param limit: Maximum number of artifacts to return.
|
|
4519
|
+
:param limit: Deprecated - Maximum number of artifacts to return (will be removed in 1.11.0).
|
|
4464
4520
|
:param format_: The format in which to return the artifacts. Default is 'full'.
|
|
4465
4521
|
"""
|
|
4466
4522
|
db = mlrun.db.get_run_db(secrets=self._secrets)
|
|
@@ -4557,12 +4613,14 @@ class MlrunProject(ModelObj):
|
|
|
4557
4613
|
:param name: Return only functions with a specific name.
|
|
4558
4614
|
:param tag: Return function versions with specific tags. To return only tagged functions, set tag to ``"*"``.
|
|
4559
4615
|
:param labels: Filter functions by label key-value pairs or key existence. This can be provided as:
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4616
|
+
|
|
4617
|
+
- A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
|
|
4618
|
+
or `{"label": None}` to check for key existence.
|
|
4619
|
+
- A list of strings formatted as `"label=value"` to match specific label key-value pairs,
|
|
4620
|
+
or just `"label"` for key existence.
|
|
4621
|
+
- A comma-separated string formatted as `"label1=value1,label2"` to match entities with
|
|
4622
|
+
the specified key-value pairs or key existence.
|
|
4623
|
+
|
|
4566
4624
|
:param kind: Return functions of the specified kind. If not provided, all function kinds will be returned.
|
|
4567
4625
|
:param format_: The format in which to return the functions. Default is 'full'.
|
|
4568
4626
|
:returns: List of function objects.
|
|
@@ -4656,12 +4714,14 @@ class MlrunProject(ModelObj):
|
|
|
4656
4714
|
:param name: Return only functions with a specific name.
|
|
4657
4715
|
:param tag: Return function versions with specific tags.
|
|
4658
4716
|
:param labels: Filter functions by label key-value pairs or key existence. This can be provided as:
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4717
|
+
|
|
4718
|
+
- A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
|
|
4719
|
+
or `{"label": None}` to check for key existence.
|
|
4720
|
+
- A list of strings formatted as `"label=value"` to match specific label key-value pairs,
|
|
4721
|
+
or just `"label"` for key existence.
|
|
4722
|
+
- A comma-separated string formatted as `"label1=value1,label2"` to match entities with
|
|
4723
|
+
the specified key-value pairs or key existence.
|
|
4724
|
+
|
|
4665
4725
|
:returns: List of function objects.
|
|
4666
4726
|
"""
|
|
4667
4727
|
|
|
@@ -4717,17 +4777,19 @@ class MlrunProject(ModelObj):
|
|
|
4717
4777
|
:param name: Name of the run to retrieve.
|
|
4718
4778
|
:param uid: Unique ID of the run.
|
|
4719
4779
|
:param labels: Filter runs by label key-value pairs or key existence. This can be provided as:
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4780
|
+
|
|
4781
|
+
- A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
|
|
4782
|
+
or `{"label": None}` to check for key existence.
|
|
4783
|
+
- A list of strings formatted as `"label=value"` to match specific label key-value pairs,
|
|
4784
|
+
or just `"label"` for key existence.
|
|
4785
|
+
- A comma-separated string formatted as `"label1=value1,label2"` to match entities with
|
|
4786
|
+
the specified key-value pairs or key existence.
|
|
4787
|
+
|
|
4726
4788
|
:param state: Deprecated - List only runs whose state is specified.
|
|
4727
4789
|
:param states: List only runs whose state is one of the provided states.
|
|
4728
4790
|
:param sort: Whether to sort the result according to their start time. Otherwise, results will be
|
|
4729
4791
|
returned by their internal order in the DB (order will not be guaranteed).
|
|
4730
|
-
:param last: Deprecated - currently not used (will be removed in 1.
|
|
4792
|
+
:param last: Deprecated - currently not used (will be removed in 1.10.0).
|
|
4731
4793
|
:param iter: If ``True`` return runs from all iterations. Otherwise, return only runs whose ``iter`` is 0.
|
|
4732
4794
|
:param start_time_from: Filter by run start time in ``[start_time_from, start_time_to]``.
|
|
4733
4795
|
:param start_time_to: Filter by run start time in ``[start_time_from, start_time_to]``.
|
|
@@ -4738,9 +4800,9 @@ class MlrunProject(ModelObj):
|
|
|
4738
4800
|
:param end_time_to: Filter by run end time in ``[end_time_from, end_time_to]``.
|
|
4739
4801
|
"""
|
|
4740
4802
|
if state:
|
|
4741
|
-
# TODO: Remove this in 1.
|
|
4803
|
+
# TODO: Remove this in 1.10.0
|
|
4742
4804
|
warnings.warn(
|
|
4743
|
-
"'state' is deprecated and will be removed in 1.
|
|
4805
|
+
"'state' is deprecated in 1.7.0 and will be removed in 1.10.0. Use 'states' instead.",
|
|
4744
4806
|
FutureWarning,
|
|
4745
4807
|
)
|
|
4746
4808
|
|
|
@@ -5398,8 +5460,8 @@ class MlrunProject(ModelObj):
|
|
|
5398
5460
|
return os.getenv("V3IO_USERNAME") or self.spec.owner
|
|
5399
5461
|
|
|
5400
5462
|
|
|
5401
|
-
def
|
|
5402
|
-
mlrun.mlconf.
|
|
5463
|
+
def _set_as_current_active_project(project: MlrunProject):
|
|
5464
|
+
mlrun.mlconf.active_project = project.metadata.name
|
|
5403
5465
|
pipeline_context.set(project)
|
|
5404
5466
|
|
|
5405
5467
|
|
mlrun/render.py
CHANGED
|
@@ -361,9 +361,6 @@ def get_tblframe(df, display, classes=None):
|
|
|
361
361
|
return ipython_display(html, display)
|
|
362
362
|
|
|
363
363
|
|
|
364
|
-
uid_template = '<div title="{}"><a href="{}/{}/{}/jobs/monitor/{}/overview" target="_blank" >...{}</a></div>'
|
|
365
|
-
|
|
366
|
-
|
|
367
364
|
def runs_to_html(
|
|
368
365
|
df: pd.DataFrame,
|
|
369
366
|
display: bool = True,
|
|
@@ -379,15 +376,14 @@ def runs_to_html(
|
|
|
379
376
|
df["results"] = df["results"].apply(dict_html)
|
|
380
377
|
df["start"] = df["start"].apply(time_str)
|
|
381
378
|
df["parameters"] = df["parameters"].apply(dict_html)
|
|
379
|
+
uid_template = '<div title="{}"><a href="{}" target="_blank" >...{}</a></div>'
|
|
380
|
+
|
|
382
381
|
if config.resolve_ui_url():
|
|
383
382
|
df["uid"] = df.apply(
|
|
384
383
|
lambda x: uid_template.format(
|
|
385
|
-
x
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
x.project,
|
|
389
|
-
x.uid,
|
|
390
|
-
x.uid[-8:],
|
|
384
|
+
x["uid"],
|
|
385
|
+
mlrun.utils.get_run_url(x["project"], x["uid"], x["name"]),
|
|
386
|
+
x["uid"][-8:],
|
|
391
387
|
),
|
|
392
388
|
axis=1,
|
|
393
389
|
)
|
mlrun/run.py
CHANGED
|
@@ -223,7 +223,7 @@ def get_or_create_ctx(
|
|
|
223
223
|
:param spec: dictionary holding run spec
|
|
224
224
|
:param with_env: look for context in environment vars, default True
|
|
225
225
|
:param rundb: path/url to the metadata and artifact database
|
|
226
|
-
:param project: project to initiate the context in (by default `mlrun.mlconf.
|
|
226
|
+
:param project: project to initiate the context in (by default `mlrun.mlconf.active_project`)
|
|
227
227
|
:param upload_artifacts: when using local context (not as part of a job/run), upload artifacts to the
|
|
228
228
|
system default artifact path location
|
|
229
229
|
:param labels: (deprecated - use spec instead) dict of the context labels.
|
|
@@ -261,7 +261,7 @@ def get_or_create_ctx(
|
|
|
261
261
|
"""
|
|
262
262
|
if labels:
|
|
263
263
|
warnings.warn(
|
|
264
|
-
"The `labels` argument is deprecated and will be removed in 1.
|
|
264
|
+
"The `labels` argument is deprecated in 1.7.0 and will be removed in 1.10.0. "
|
|
265
265
|
"Please use `spec` instead, e.g.:\n"
|
|
266
266
|
"spec={'metadata': {'labels': {'key': 'value'}}}",
|
|
267
267
|
FutureWarning,
|
|
@@ -298,7 +298,7 @@ def get_or_create_ctx(
|
|
|
298
298
|
newspec = {}
|
|
299
299
|
if upload_artifacts:
|
|
300
300
|
artifact_path = mlrun.utils.helpers.template_artifact_path(
|
|
301
|
-
mlconf.artifact_path, project or mlconf.
|
|
301
|
+
mlconf.artifact_path, project or mlconf.active_project
|
|
302
302
|
)
|
|
303
303
|
update_in(newspec, ["spec", RunKeys.output_path], artifact_path)
|
|
304
304
|
|
|
@@ -312,7 +312,7 @@ def get_or_create_ctx(
|
|
|
312
312
|
logger.info(f"Logging run results to: {out}")
|
|
313
313
|
|
|
314
314
|
newspec["metadata"]["project"] = (
|
|
315
|
-
newspec["metadata"].get("project") or project or mlconf.
|
|
315
|
+
newspec["metadata"].get("project") or project or mlconf.active_project
|
|
316
316
|
)
|
|
317
317
|
|
|
318
318
|
newspec["metadata"].setdefault("labels", {})
|
|
@@ -369,9 +369,9 @@ def import_function(url="", secrets=None, db="", project=None, new_name=None):
|
|
|
369
369
|
url, is_hub_uri = extend_hub_uri_if_needed(url)
|
|
370
370
|
runtime = import_function_to_dict(url, secrets)
|
|
371
371
|
function = new_function(runtime=runtime)
|
|
372
|
-
project = project or mlrun.mlconf.
|
|
372
|
+
project = project or mlrun.mlconf.active_project
|
|
373
373
|
# When we're importing from the hub we want to assign to a target project, otherwise any store on it will
|
|
374
|
-
# simply default to the
|
|
374
|
+
# simply default to the active project
|
|
375
375
|
if project and is_hub_uri:
|
|
376
376
|
function.metadata.project = project
|
|
377
377
|
if new_name:
|
|
@@ -464,7 +464,7 @@ def new_function(
|
|
|
464
464
|
f = new_function().run(task, handler=myfunction)
|
|
465
465
|
|
|
466
466
|
:param name: function name
|
|
467
|
-
:param project: function project (none for
|
|
467
|
+
:param project: function project (none for the active project)
|
|
468
468
|
:param tag: function version tag (none for 'latest')
|
|
469
469
|
|
|
470
470
|
:param kind: runtime type (local, job, nuclio, spark, mpijob, dask, ..)
|
|
@@ -523,7 +523,7 @@ def new_function(
|
|
|
523
523
|
|
|
524
524
|
runner.metadata.name = name
|
|
525
525
|
runner.metadata.project = (
|
|
526
|
-
runner.metadata.project or project or mlconf.
|
|
526
|
+
runner.metadata.project or project or mlconf.active_project
|
|
527
527
|
)
|
|
528
528
|
if tag:
|
|
529
529
|
runner.metadata.tag = tag
|
|
@@ -640,7 +640,7 @@ def code_to_function(
|
|
|
640
640
|
Learn more about :doc:`../../concepts/functions-overview`
|
|
641
641
|
|
|
642
642
|
:param name: function name, typically best to use hyphen-case
|
|
643
|
-
:param project: project used to namespace the function, defaults to
|
|
643
|
+
:param project: project used to namespace the function, defaults to the active project
|
|
644
644
|
:param tag: function tag to track multiple versions of the same function, defaults to 'latest'
|
|
645
645
|
:param filename: path to .py/.ipynb file, defaults to current jupyter notebook
|
|
646
646
|
:param handler: The default function handler to call for the job or nuclio function, in batch functions
|
|
@@ -729,7 +729,7 @@ def code_to_function(
|
|
|
729
729
|
fn.spec.volume_mounts.append(vol.get("volumeMount"))
|
|
730
730
|
|
|
731
731
|
fn.spec.description = description
|
|
732
|
-
fn.metadata.project = project or mlconf.
|
|
732
|
+
fn.metadata.project = project or mlconf.active_project
|
|
733
733
|
fn.metadata.tag = tag
|
|
734
734
|
fn.metadata.categories = categories
|
|
735
735
|
fn.metadata.labels = labels or fn.metadata.labels
|
mlrun/runtimes/base.py
CHANGED
|
@@ -148,10 +148,10 @@ class FunctionSpec(ModelObj):
|
|
|
148
148
|
|
|
149
149
|
@property
|
|
150
150
|
def clone_target_dir(self):
|
|
151
|
-
# TODO: remove this property in 1.
|
|
151
|
+
# TODO: remove this property in 1.10.0
|
|
152
152
|
if self.build.source_code_target_dir:
|
|
153
153
|
warnings.warn(
|
|
154
|
-
"The clone_target_dir attribute is deprecated in 1.6.2 and will be removed in 1.
|
|
154
|
+
"The clone_target_dir attribute is deprecated in 1.6.2 and will be removed in 1.10.0. "
|
|
155
155
|
"Use spec.build.source_code_target_dir instead.",
|
|
156
156
|
FutureWarning,
|
|
157
157
|
)
|
|
@@ -159,10 +159,10 @@ class FunctionSpec(ModelObj):
|
|
|
159
159
|
|
|
160
160
|
@clone_target_dir.setter
|
|
161
161
|
def clone_target_dir(self, clone_target_dir):
|
|
162
|
-
# TODO: remove this property in 1.
|
|
162
|
+
# TODO: remove this property in 1.10.0
|
|
163
163
|
if clone_target_dir:
|
|
164
164
|
warnings.warn(
|
|
165
|
-
"The clone_target_dir attribute is deprecated in 1.6.2 and will be removed in 1.
|
|
165
|
+
"The clone_target_dir attribute is deprecated in 1.6.2 and will be removed in 1.10.0. "
|
|
166
166
|
"Use spec.build.source_code_target_dir instead.",
|
|
167
167
|
FutureWarning,
|
|
168
168
|
)
|
|
@@ -470,14 +470,14 @@ class BaseRuntime(ModelObj):
|
|
|
470
470
|
:return: Dictionary with all the variables that could be parsed
|
|
471
471
|
"""
|
|
472
472
|
runtime_env = {
|
|
473
|
-
"
|
|
473
|
+
"MLRUN_ACTIVE_PROJECT": self.metadata.project or config.active_project
|
|
474
474
|
}
|
|
475
475
|
if runobj:
|
|
476
476
|
runtime_env["MLRUN_EXEC_CONFIG"] = runobj.to_json(
|
|
477
477
|
exclude_notifications_params=True
|
|
478
478
|
)
|
|
479
479
|
if runobj.metadata.project:
|
|
480
|
-
runtime_env["
|
|
480
|
+
runtime_env["MLRUN_ACTIVE_PROJECT"] = runobj.metadata.project
|
|
481
481
|
if runobj.spec.verbose:
|
|
482
482
|
runtime_env["MLRUN_LOG_LEVEL"] = "DEBUG"
|
|
483
483
|
if config.httpdb.api_url:
|
|
@@ -499,7 +499,7 @@ class BaseRuntime(ModelObj):
|
|
|
499
499
|
def _store_function(self, runspec, meta, db):
|
|
500
500
|
meta.labels["kind"] = self.kind
|
|
501
501
|
mlrun.runtimes.utils.enrich_run_labels(
|
|
502
|
-
meta.labels, [
|
|
502
|
+
meta.labels, [mlrun_constants.MLRunInternalLabels.owner]
|
|
503
503
|
)
|
|
504
504
|
if runspec.spec.output_path:
|
|
505
505
|
runspec.spec.output_path = runspec.spec.output_path.replace(
|
mlrun/runtimes/kubejob.py
CHANGED
|
@@ -114,9 +114,9 @@ class KubejobRuntime(KubeResource):
|
|
|
114
114
|
e.g. builder_env={"GIT_TOKEN": token}
|
|
115
115
|
"""
|
|
116
116
|
if not overwrite:
|
|
117
|
-
# TODO: change overwrite default to True in 1.
|
|
117
|
+
# TODO: change overwrite default to True in 1.10.0
|
|
118
118
|
warnings.warn(
|
|
119
|
-
"The `overwrite` parameter default will change from 'False' to 'True' in 1.
|
|
119
|
+
"The `overwrite` parameter default will change from 'False' to 'True' in 1.10.0.",
|
|
120
120
|
mlrun.utils.OverwriteBuildParamsWarning,
|
|
121
121
|
)
|
|
122
122
|
image = mlrun.utils.helpers.remove_image_protocol_prefix(image)
|
|
@@ -623,9 +623,9 @@ class RemoteRuntime(KubeResource):
|
|
|
623
623
|
:param force_build: set True for force building the image
|
|
624
624
|
"""
|
|
625
625
|
if auth_info:
|
|
626
|
-
# TODO: remove in 1.
|
|
626
|
+
# TODO: remove in 1.10.0
|
|
627
627
|
warnings.warn(
|
|
628
|
-
"'auth_info' is deprecated for nuclio runtimes in 1.7.0 and will be removed in 1.
|
|
628
|
+
"'auth_info' is deprecated for nuclio runtimes in 1.7.0 and will be removed in 1.10.0",
|
|
629
629
|
FutureWarning,
|
|
630
630
|
)
|
|
631
631
|
|
|
@@ -833,7 +833,7 @@ class RemoteRuntime(KubeResource):
|
|
|
833
833
|
def _get_runtime_env(self):
|
|
834
834
|
# for runtime specific env var enrichment (before deploy)
|
|
835
835
|
runtime_env = {
|
|
836
|
-
"
|
|
836
|
+
"MLRUN_ACTIVE_PROJECT": self.metadata.project or mlconf.active_project,
|
|
837
837
|
}
|
|
838
838
|
if mlconf.httpdb.api_url:
|
|
839
839
|
runtime_env["MLRUN_DBPATH"] = mlconf.httpdb.api_url
|