mlrun 1.8.0rc7__py3-none-any.whl → 1.8.0rc9__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/artifacts/base.py +9 -0
- mlrun/artifacts/document.py +3 -1
- mlrun/artifacts/manager.py +12 -5
- mlrun/datastore/store_resources.py +7 -2
- mlrun/datastore/vectorstore.py +32 -3
- mlrun/db/base.py +6 -2
- mlrun/db/httpdb.py +35 -8
- mlrun/db/nopdb.py +6 -2
- mlrun/model_monitoring/api.py +9 -0
- mlrun/model_monitoring/helpers.py +0 -1
- mlrun/model_monitoring/stream_processing.py +2 -2
- mlrun/projects/project.py +31 -20
- mlrun/runtimes/nuclio/serving.py +0 -2
- mlrun/serving/routers.py +2 -2
- mlrun/serving/v2_serving.py +36 -19
- mlrun/utils/helpers.py +9 -3
- mlrun/utils/regex.py +8 -1
- mlrun/utils/version/version.json +2 -2
- {mlrun-1.8.0rc7.dist-info → mlrun-1.8.0rc9.dist-info}/METADATA +1 -1
- {mlrun-1.8.0rc7.dist-info → mlrun-1.8.0rc9.dist-info}/RECORD +24 -24
- {mlrun-1.8.0rc7.dist-info → mlrun-1.8.0rc9.dist-info}/LICENSE +0 -0
- {mlrun-1.8.0rc7.dist-info → mlrun-1.8.0rc9.dist-info}/WHEEL +0 -0
- {mlrun-1.8.0rc7.dist-info → mlrun-1.8.0rc9.dist-info}/entry_points.txt +0 -0
- {mlrun-1.8.0rc7.dist-info → mlrun-1.8.0rc9.dist-info}/top_level.txt +0 -0
mlrun/artifacts/base.py
CHANGED
|
@@ -379,6 +379,7 @@ class Artifact(ModelObj):
|
|
|
379
379
|
iter=self.metadata.iter,
|
|
380
380
|
tree=tree,
|
|
381
381
|
tag=tag,
|
|
382
|
+
uid=self.uid,
|
|
382
383
|
)
|
|
383
384
|
return mlrun.datastore.get_store_uri(self._store_prefix, uri)
|
|
384
385
|
|
|
@@ -653,6 +654,14 @@ class Artifact(ModelObj):
|
|
|
653
654
|
def hash(self, hash):
|
|
654
655
|
self.metadata.hash = hash
|
|
655
656
|
|
|
657
|
+
@property
|
|
658
|
+
def uid(self):
|
|
659
|
+
return self.metadata.uid
|
|
660
|
+
|
|
661
|
+
@uid.setter
|
|
662
|
+
def uid(self, uid):
|
|
663
|
+
self.metadata.uid = uid
|
|
664
|
+
|
|
656
665
|
def generate_target_path(self, artifact_path, producer):
|
|
657
666
|
return generate_target_path(self, artifact_path, producer)
|
|
658
667
|
|
mlrun/artifacts/document.py
CHANGED
|
@@ -277,6 +277,7 @@ class DocumentArtifact(Artifact):
|
|
|
277
277
|
)
|
|
278
278
|
|
|
279
279
|
results = []
|
|
280
|
+
idx = 0
|
|
280
281
|
for document in documents:
|
|
281
282
|
if splitter:
|
|
282
283
|
texts = splitter.split_text(document.page_content)
|
|
@@ -293,13 +294,14 @@ class DocumentArtifact(Artifact):
|
|
|
293
294
|
self.get_target_path()
|
|
294
295
|
)
|
|
295
296
|
|
|
296
|
-
for
|
|
297
|
+
for text in texts:
|
|
297
298
|
metadata[self.METADATA_CHUNK_KEY] = str(idx)
|
|
298
299
|
doc = Document(
|
|
299
300
|
page_content=text,
|
|
300
301
|
metadata=metadata.copy(),
|
|
301
302
|
)
|
|
302
303
|
results.append(doc)
|
|
304
|
+
idx = idx + 1
|
|
303
305
|
return results
|
|
304
306
|
|
|
305
307
|
def collection_add(self, collection_id: str) -> None:
|
mlrun/artifacts/manager.py
CHANGED
|
@@ -306,7 +306,6 @@ class ArtifactManager:
|
|
|
306
306
|
item.target_path = target_path
|
|
307
307
|
|
|
308
308
|
item.before_log()
|
|
309
|
-
self.artifact_uris[key] = item.uri
|
|
310
309
|
|
|
311
310
|
if ((upload is None and item.kind != "dir") or upload) and not item.is_inline():
|
|
312
311
|
# before uploading the item, we want to ensure that its tags are valid,
|
|
@@ -315,7 +314,12 @@ class ArtifactManager:
|
|
|
315
314
|
item.upload(artifact_path=artifact_path)
|
|
316
315
|
|
|
317
316
|
if db_key:
|
|
318
|
-
self._log_to_db(db_key, project, producer.inputs, item)
|
|
317
|
+
artifact_uid = self._log_to_db(db_key, project, producer.inputs, item)
|
|
318
|
+
if artifact_uid is not None:
|
|
319
|
+
item.uid = artifact_uid
|
|
320
|
+
# Generate the artifact URI after logging to the database and retrieving the artifact UID, if available.
|
|
321
|
+
self.artifact_uris[key] = item.uri
|
|
322
|
+
|
|
319
323
|
size = str(item.size) or "?"
|
|
320
324
|
db_str = "Y" if (self.artifact_db and db_key) else "N"
|
|
321
325
|
logger.debug(
|
|
@@ -327,20 +331,21 @@ class ArtifactManager:
|
|
|
327
331
|
self.artifact_uris[item.key] = item.uri
|
|
328
332
|
self._log_to_db(item.db_key, producer.project, producer.inputs, item)
|
|
329
333
|
|
|
330
|
-
def _log_to_db(self, key, project, sources, item, tag=None):
|
|
334
|
+
def _log_to_db(self, key, project, sources, item, tag=None) -> typing.Optional[str]:
|
|
331
335
|
"""
|
|
332
336
|
log artifact to db
|
|
333
337
|
:param key: Identifying key of the artifact.
|
|
334
338
|
:param project: Project that the artifact belongs to.
|
|
335
|
-
:param sources: List of artifact sources ( Mainly passed from the producer.items ).
|
|
339
|
+
:param sources: List of artifact sources ( Mainly passed from the `producer.items` ).
|
|
336
340
|
:param item: The actual artifact to store.
|
|
337
341
|
:param tag: The name of the Tag of the artifact.
|
|
342
|
+
:return: The logged artifact uid.
|
|
338
343
|
"""
|
|
339
344
|
if self.artifact_db:
|
|
340
345
|
item.updated = None
|
|
341
346
|
if sources:
|
|
342
347
|
item.sources = [{"name": k, "path": str(v)} for k, v in sources.items()]
|
|
343
|
-
self.artifact_db.store_artifact(
|
|
348
|
+
artifact_item = self.artifact_db.store_artifact(
|
|
344
349
|
key,
|
|
345
350
|
item.to_dict(),
|
|
346
351
|
iter=item.iter,
|
|
@@ -348,6 +353,8 @@ class ArtifactManager:
|
|
|
348
353
|
project=project,
|
|
349
354
|
tree=item.tree,
|
|
350
355
|
)
|
|
356
|
+
if artifact_item:
|
|
357
|
+
return artifact_item.get("metadata", {}).get("uid")
|
|
351
358
|
|
|
352
359
|
def link_artifact(
|
|
353
360
|
self,
|
|
@@ -163,11 +163,16 @@ def get_store_resource(
|
|
|
163
163
|
return db.get_feature_vector(name, project, tag, uid)
|
|
164
164
|
|
|
165
165
|
elif StorePrefix.is_artifact(kind):
|
|
166
|
-
project, key, iteration, tag, tree = parse_artifact_uri(
|
|
166
|
+
project, key, iteration, tag, tree, uid = parse_artifact_uri(
|
|
167
167
|
uri, project or config.default_project
|
|
168
168
|
)
|
|
169
169
|
resource = db.read_artifact(
|
|
170
|
-
key,
|
|
170
|
+
key,
|
|
171
|
+
project=project,
|
|
172
|
+
tag=tag,
|
|
173
|
+
iter=iteration,
|
|
174
|
+
tree=tree,
|
|
175
|
+
uid=uid,
|
|
171
176
|
)
|
|
172
177
|
if resource.get("kind", "") == "link":
|
|
173
178
|
# todo: support other link types (not just iter, move this to the db/api layer
|
mlrun/datastore/vectorstore.py
CHANGED
|
@@ -14,11 +14,32 @@
|
|
|
14
14
|
|
|
15
15
|
import inspect
|
|
16
16
|
from collections.abc import Iterable
|
|
17
|
-
from typing import Union
|
|
17
|
+
from typing import Optional, Union
|
|
18
18
|
|
|
19
19
|
from mlrun.artifacts import DocumentArtifact
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
def _extract_collection_name(vectorstore: "VectorStore") -> str: # noqa: F821
|
|
23
|
+
# List of possible attribute names for collection name
|
|
24
|
+
possible_attributes = ["collection_name", "_collection_name"]
|
|
25
|
+
|
|
26
|
+
for attr in possible_attributes:
|
|
27
|
+
if hasattr(vectorstore, attr):
|
|
28
|
+
collection_name = getattr(vectorstore, attr)
|
|
29
|
+
if collection_name:
|
|
30
|
+
return collection_name
|
|
31
|
+
|
|
32
|
+
store_class = vectorstore.__class__.__name__.lower()
|
|
33
|
+
if store_class == "mongodbatlasvectorsearch":
|
|
34
|
+
return vectorstore.collection.name
|
|
35
|
+
|
|
36
|
+
# If we get here, we couldn't find a valid collection name
|
|
37
|
+
raise ValueError(
|
|
38
|
+
"Failed to extract collection name from the vector store. "
|
|
39
|
+
"Please provide the collection name explicitly. "
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
22
43
|
class VectorStoreCollection:
|
|
23
44
|
"""
|
|
24
45
|
A wrapper class for vector store collections with MLRun integration.
|
|
@@ -36,12 +57,17 @@ class VectorStoreCollection:
|
|
|
36
57
|
def __init__(
|
|
37
58
|
self,
|
|
38
59
|
mlrun_context: Union["MlrunProject", "MLClientCtx"], # noqa: F821
|
|
39
|
-
collection_name: str,
|
|
40
60
|
vector_store: "VectorStore", # noqa: F821
|
|
61
|
+
collection_name: Optional[str] = None,
|
|
41
62
|
):
|
|
42
63
|
self._collection_impl = vector_store
|
|
43
64
|
self._mlrun_context = mlrun_context
|
|
44
|
-
self.collection_name = collection_name
|
|
65
|
+
self.collection_name = collection_name or _extract_collection_name(vector_store)
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def __class__(self):
|
|
69
|
+
# Make isinstance() check the wrapped object's class
|
|
70
|
+
return self._collection_impl.__class__
|
|
45
71
|
|
|
46
72
|
def __getattr__(self, name):
|
|
47
73
|
# This method is called when an attribute is not found in the usual places
|
|
@@ -56,6 +82,9 @@ class VectorStoreCollection:
|
|
|
56
82
|
# Forward the attribute setting to _collection_impl
|
|
57
83
|
setattr(self._collection_impl, name, value)
|
|
58
84
|
|
|
85
|
+
def delete(self, *args, **kwargs):
|
|
86
|
+
self._collection_impl.delete(*args, **kwargs)
|
|
87
|
+
|
|
59
88
|
def add_documents(
|
|
60
89
|
self,
|
|
61
90
|
documents: list["Document"], # noqa: F821
|
mlrun/db/base.py
CHANGED
|
@@ -674,8 +674,9 @@ class RunDBInterface(ABC):
|
|
|
674
674
|
self,
|
|
675
675
|
name: str,
|
|
676
676
|
project: str,
|
|
677
|
-
function_name: str,
|
|
678
|
-
|
|
677
|
+
function_name: Optional[str] = None,
|
|
678
|
+
function_tag: Optional[str] = None,
|
|
679
|
+
endpoint_id: Optional[str] = None,
|
|
679
680
|
):
|
|
680
681
|
pass
|
|
681
682
|
|
|
@@ -685,6 +686,7 @@ class RunDBInterface(ABC):
|
|
|
685
686
|
project: str,
|
|
686
687
|
name: Optional[str] = None,
|
|
687
688
|
function_name: Optional[str] = None,
|
|
689
|
+
function_tag: Optional[str] = None,
|
|
688
690
|
model_name: Optional[str] = None,
|
|
689
691
|
labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
|
|
690
692
|
start: Optional[datetime.datetime] = None,
|
|
@@ -702,6 +704,7 @@ class RunDBInterface(ABC):
|
|
|
702
704
|
name: str,
|
|
703
705
|
project: str,
|
|
704
706
|
function_name: Optional[str] = None,
|
|
707
|
+
function_tag: Optional[str] = None,
|
|
705
708
|
endpoint_id: Optional[str] = None,
|
|
706
709
|
tsdb_metrics: bool = True,
|
|
707
710
|
feature_analysis: bool = False,
|
|
@@ -715,6 +718,7 @@ class RunDBInterface(ABC):
|
|
|
715
718
|
project: str,
|
|
716
719
|
attributes: dict,
|
|
717
720
|
function_name: Optional[str] = None,
|
|
721
|
+
function_tag: Optional[str] = None,
|
|
718
722
|
endpoint_id: Optional[str] = None,
|
|
719
723
|
) -> mlrun.common.schemas.ModelEndpoint:
|
|
720
724
|
pass
|
mlrun/db/httpdb.py
CHANGED
|
@@ -996,7 +996,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
996
996
|
tag=None,
|
|
997
997
|
project="",
|
|
998
998
|
tree=None,
|
|
999
|
-
):
|
|
999
|
+
) -> dict[str, str]:
|
|
1000
1000
|
"""Store an artifact in the DB.
|
|
1001
1001
|
|
|
1002
1002
|
:param key: Identifying key of the artifact.
|
|
@@ -1008,6 +1008,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
1008
1008
|
:param tag: Tag of the artifact.
|
|
1009
1009
|
:param project: Project that the artifact belongs to.
|
|
1010
1010
|
:param tree: The tree (producer id) which generated this artifact.
|
|
1011
|
+
:returns: The stored artifact dictionary.
|
|
1011
1012
|
"""
|
|
1012
1013
|
if uid:
|
|
1013
1014
|
warnings.warn(
|
|
@@ -1032,9 +1033,10 @@ class HTTPRunDB(RunDBInterface):
|
|
|
1032
1033
|
params["tree"] = tree
|
|
1033
1034
|
|
|
1034
1035
|
body = _as_json(artifact)
|
|
1035
|
-
self.api_call(
|
|
1036
|
+
response = self.api_call(
|
|
1036
1037
|
"PUT", endpoint_path, error, body=body, params=params, version="v2"
|
|
1037
1038
|
)
|
|
1039
|
+
return response.json()
|
|
1038
1040
|
|
|
1039
1041
|
def read_artifact(
|
|
1040
1042
|
self,
|
|
@@ -3601,8 +3603,9 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3601
3603
|
self,
|
|
3602
3604
|
name: str,
|
|
3603
3605
|
project: str,
|
|
3604
|
-
function_name: str,
|
|
3605
|
-
|
|
3606
|
+
function_name: Optional[str] = None,
|
|
3607
|
+
function_tag: Optional[str] = None,
|
|
3608
|
+
endpoint_id: Optional[str] = None,
|
|
3606
3609
|
):
|
|
3607
3610
|
"""
|
|
3608
3611
|
Deletes the DB record of a given model endpoint, project and endpoint_id are used for lookup
|
|
@@ -3610,15 +3613,19 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3610
3613
|
:param name: The name of the model endpoint
|
|
3611
3614
|
:param project: The name of the project
|
|
3612
3615
|
:param function_name: The name of the function
|
|
3616
|
+
:param function_tag: The tag of the function
|
|
3613
3617
|
:param endpoint_id: The id of the endpoint
|
|
3614
3618
|
"""
|
|
3615
|
-
|
|
3619
|
+
self._check_model_endpoint_representation(
|
|
3620
|
+
function_name, function_tag, endpoint_id
|
|
3621
|
+
)
|
|
3616
3622
|
path = f"projects/{project}/model-endpoints/{name}"
|
|
3617
3623
|
self.api_call(
|
|
3618
3624
|
method=mlrun.common.types.HTTPMethod.DELETE,
|
|
3619
3625
|
path=path,
|
|
3620
3626
|
params={
|
|
3621
3627
|
"function_name": function_name,
|
|
3628
|
+
"function_tag": function_tag,
|
|
3622
3629
|
"endpoint_id": endpoint_id,
|
|
3623
3630
|
},
|
|
3624
3631
|
)
|
|
@@ -3628,6 +3635,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3628
3635
|
project: str,
|
|
3629
3636
|
name: Optional[str] = None,
|
|
3630
3637
|
function_name: Optional[str] = None,
|
|
3638
|
+
function_tag: Optional[str] = None,
|
|
3631
3639
|
model_name: Optional[str] = None,
|
|
3632
3640
|
labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
|
|
3633
3641
|
start: Optional[datetime] = None,
|
|
@@ -3643,6 +3651,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3643
3651
|
:param project: The name of the project
|
|
3644
3652
|
:param name: The name of the model endpoint
|
|
3645
3653
|
:param function_name: The name of the function
|
|
3654
|
+
:param function_tag: The tag of the function
|
|
3646
3655
|
:param model_name: The name of the model
|
|
3647
3656
|
:param labels: A list of labels to filter by. (see mlrun.common.schemas.LabelsModel)
|
|
3648
3657
|
:param start: The start time to filter by.Corresponding to the `created` field.
|
|
@@ -3663,6 +3672,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3663
3672
|
"name": name,
|
|
3664
3673
|
"model_name": model_name,
|
|
3665
3674
|
"function_name": function_name,
|
|
3675
|
+
"function_tag": function_tag,
|
|
3666
3676
|
"label": labels,
|
|
3667
3677
|
"start": datetime_to_iso(start),
|
|
3668
3678
|
"end": datetime_to_iso(end),
|
|
@@ -3680,7 +3690,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3680
3690
|
name: str,
|
|
3681
3691
|
project: str,
|
|
3682
3692
|
function_name: Optional[str] = None,
|
|
3683
|
-
|
|
3693
|
+
function_tag: Optional[str] = None,
|
|
3684
3694
|
endpoint_id: Optional[str] = None,
|
|
3685
3695
|
tsdb_metrics: bool = True,
|
|
3686
3696
|
feature_analysis: bool = False,
|
|
@@ -3691,6 +3701,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3691
3701
|
:param name: The name of the model endpoint
|
|
3692
3702
|
:param project: The name of the project
|
|
3693
3703
|
:param function_name: The name of the function
|
|
3704
|
+
:param function_tag: The tag of the function
|
|
3694
3705
|
:param endpoint_id: The id of the endpoint
|
|
3695
3706
|
:param tsdb_metrics: Whether to include metrics from the time series DB.
|
|
3696
3707
|
:param feature_analysis: Whether to include feature analysis data (feature_stats,
|
|
@@ -3698,13 +3709,16 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3698
3709
|
|
|
3699
3710
|
:return: A `ModelEndpoint` object.
|
|
3700
3711
|
"""
|
|
3701
|
-
|
|
3712
|
+
self._check_model_endpoint_representation(
|
|
3713
|
+
function_name, function_tag, endpoint_id
|
|
3714
|
+
)
|
|
3702
3715
|
path = f"projects/{project}/model-endpoints/{name}"
|
|
3703
3716
|
response = self.api_call(
|
|
3704
3717
|
method=mlrun.common.types.HTTPMethod.GET,
|
|
3705
3718
|
path=path,
|
|
3706
3719
|
params={
|
|
3707
3720
|
"function_name": function_name,
|
|
3721
|
+
"function_tag": function_tag,
|
|
3708
3722
|
"endpoint_id": endpoint_id,
|
|
3709
3723
|
"tsdb_metrics": tsdb_metrics,
|
|
3710
3724
|
"feature_analysis": feature_analysis,
|
|
@@ -3719,6 +3733,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3719
3733
|
project: str,
|
|
3720
3734
|
attributes: dict,
|
|
3721
3735
|
function_name: Optional[str] = None,
|
|
3736
|
+
function_tag: Optional[str] = None,
|
|
3722
3737
|
endpoint_id: Optional[str] = None,
|
|
3723
3738
|
) -> mlrun.common.schemas.ModelEndpoint:
|
|
3724
3739
|
"""
|
|
@@ -3728,13 +3743,16 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3728
3743
|
:param project: The name of the project
|
|
3729
3744
|
:param attributes: The attributes to update
|
|
3730
3745
|
:param function_name: The name of the function
|
|
3746
|
+
:param function_tag: The tag of the function
|
|
3731
3747
|
:param endpoint_id: The id of the endpoint
|
|
3732
3748
|
:return: The updated `ModelEndpoint` object.
|
|
3733
3749
|
"""
|
|
3734
3750
|
attributes_keys = list(attributes.keys())
|
|
3735
3751
|
attributes["name"] = name
|
|
3736
3752
|
attributes["project"] = project
|
|
3737
|
-
attributes["
|
|
3753
|
+
attributes["function_name"] = function_name or None
|
|
3754
|
+
attributes["function_tag"] = function_tag or None
|
|
3755
|
+
attributes["uid"] = endpoint_id or None
|
|
3738
3756
|
model_endpoint = mlrun.common.schemas.ModelEndpoint.from_flat_dict(attributes)
|
|
3739
3757
|
path = f"projects/{project}/model-endpoints"
|
|
3740
3758
|
logger.info(
|
|
@@ -3753,6 +3771,15 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3753
3771
|
|
|
3754
3772
|
return mlrun.common.schemas.ModelEndpoint(**response.json())
|
|
3755
3773
|
|
|
3774
|
+
@staticmethod
|
|
3775
|
+
def _check_model_endpoint_representation(
|
|
3776
|
+
function_name: str, function_tag: str, uid: str
|
|
3777
|
+
):
|
|
3778
|
+
if not uid and not (function_name and function_tag):
|
|
3779
|
+
raise MLRunInvalidArgumentError(
|
|
3780
|
+
"Either endpoint_uid or function_name and function_tag must be provided"
|
|
3781
|
+
)
|
|
3782
|
+
|
|
3756
3783
|
def update_model_monitoring_controller(
|
|
3757
3784
|
self,
|
|
3758
3785
|
project: str,
|
mlrun/db/nopdb.py
CHANGED
|
@@ -582,8 +582,9 @@ class NopDB(RunDBInterface):
|
|
|
582
582
|
self,
|
|
583
583
|
name: str,
|
|
584
584
|
project: str,
|
|
585
|
-
function_name: str,
|
|
586
|
-
|
|
585
|
+
function_name: Optional[str] = None,
|
|
586
|
+
function_tag: Optional[str] = None,
|
|
587
|
+
endpoint_id: Optional[str] = None,
|
|
587
588
|
):
|
|
588
589
|
pass
|
|
589
590
|
|
|
@@ -592,6 +593,7 @@ class NopDB(RunDBInterface):
|
|
|
592
593
|
project: str,
|
|
593
594
|
name: Optional[str] = None,
|
|
594
595
|
function_name: Optional[str] = None,
|
|
596
|
+
function_tag: Optional[str] = None,
|
|
595
597
|
model_name: Optional[str] = None,
|
|
596
598
|
labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
|
|
597
599
|
start: Optional[datetime.datetime] = None,
|
|
@@ -608,6 +610,7 @@ class NopDB(RunDBInterface):
|
|
|
608
610
|
name: str,
|
|
609
611
|
project: str,
|
|
610
612
|
function_name: Optional[str] = None,
|
|
613
|
+
function_tag: Optional[str] = None,
|
|
611
614
|
endpoint_id: Optional[str] = None,
|
|
612
615
|
tsdb_metrics: bool = True,
|
|
613
616
|
feature_analysis: bool = False,
|
|
@@ -620,6 +623,7 @@ class NopDB(RunDBInterface):
|
|
|
620
623
|
project: str,
|
|
621
624
|
attributes: dict,
|
|
622
625
|
function_name: Optional[str] = None,
|
|
626
|
+
function_tag: Optional[str] = None,
|
|
623
627
|
endpoint_id: Optional[str] = None,
|
|
624
628
|
) -> mlrun.common.schemas.ModelEndpoint:
|
|
625
629
|
pass
|
mlrun/model_monitoring/api.py
CHANGED
|
@@ -622,4 +622,13 @@ def _create_model_monitoring_function_base(
|
|
|
622
622
|
project=project,
|
|
623
623
|
writer_application_name=mm_constants.MonitoringFunctionNames.WRITER,
|
|
624
624
|
)
|
|
625
|
+
|
|
626
|
+
def block_to_mock_server(*args, **kwargs) -> typing.NoReturn:
|
|
627
|
+
raise NotImplementedError(
|
|
628
|
+
"Model monitoring serving functions do not support `.to_mock_server`. "
|
|
629
|
+
"You may call your model monitoring application object logic via the `.evaluate` method."
|
|
630
|
+
)
|
|
631
|
+
|
|
632
|
+
func_obj.to_mock_server = block_to_mock_server # Until ML-7643 is implemented
|
|
633
|
+
|
|
625
634
|
return func_obj
|
|
@@ -318,7 +318,6 @@ def update_model_endpoint_last_request(
|
|
|
318
318
|
project=project,
|
|
319
319
|
endpoint_id=model_endpoint.metadata.uid,
|
|
320
320
|
name=model_endpoint.metadata.name,
|
|
321
|
-
function_name=model_endpoint.spec.function_name,
|
|
322
321
|
attributes={mm_constants.EventFieldType.LAST_REQUEST: current_request},
|
|
323
322
|
)
|
|
324
323
|
else: # model endpoint without any serving function - close the window "manually"
|
|
@@ -339,8 +339,8 @@ class ProcessEndpointEvent(mlrun.feature_store.steps.MapClass):
|
|
|
339
339
|
|
|
340
340
|
# In case this process fails, resume state from existing record
|
|
341
341
|
self.resume_state(
|
|
342
|
-
endpoint_id,
|
|
343
|
-
full_event.body.get(EventFieldType.MODEL),
|
|
342
|
+
endpoint_id=endpoint_id,
|
|
343
|
+
endpoint_name=full_event.body.get(EventFieldType.MODEL),
|
|
344
344
|
)
|
|
345
345
|
|
|
346
346
|
# Validate event fields
|
mlrun/projects/project.py
CHANGED
|
@@ -1870,13 +1870,13 @@ class MlrunProject(ModelObj):
|
|
|
1870
1870
|
|
|
1871
1871
|
def get_vector_store_collection(
|
|
1872
1872
|
self,
|
|
1873
|
-
collection_name: str,
|
|
1874
1873
|
vector_store: "VectorStore", # noqa: F821
|
|
1874
|
+
collection_name: Optional[str] = None,
|
|
1875
1875
|
) -> VectorStoreCollection:
|
|
1876
1876
|
return VectorStoreCollection(
|
|
1877
1877
|
self,
|
|
1878
|
-
collection_name,
|
|
1879
1878
|
vector_store,
|
|
1879
|
+
collection_name,
|
|
1880
1880
|
)
|
|
1881
1881
|
|
|
1882
1882
|
def log_document(
|
|
@@ -2117,10 +2117,9 @@ class MlrunProject(ModelObj):
|
|
|
2117
2117
|
|
|
2118
2118
|
def set_model_monitoring_function(
|
|
2119
2119
|
self,
|
|
2120
|
-
func: typing.Union[str, mlrun.runtimes.
|
|
2120
|
+
func: typing.Union[str, mlrun.runtimes.RemoteRuntime, None] = None,
|
|
2121
2121
|
application_class: typing.Union[
|
|
2122
|
-
str,
|
|
2123
|
-
mm_app.ModelMonitoringApplicationBase,
|
|
2122
|
+
str, mm_app.ModelMonitoringApplicationBase, None
|
|
2124
2123
|
] = None,
|
|
2125
2124
|
name: Optional[str] = None,
|
|
2126
2125
|
image: Optional[str] = None,
|
|
@@ -2130,7 +2129,7 @@ class MlrunProject(ModelObj):
|
|
|
2130
2129
|
requirements: Optional[typing.Union[str, list[str]]] = None,
|
|
2131
2130
|
requirements_file: str = "",
|
|
2132
2131
|
**application_kwargs,
|
|
2133
|
-
) -> mlrun.runtimes.
|
|
2132
|
+
) -> mlrun.runtimes.RemoteRuntime:
|
|
2134
2133
|
"""
|
|
2135
2134
|
Update or add a monitoring function to the project.
|
|
2136
2135
|
Note: to deploy the function after linking it to the project,
|
|
@@ -2142,7 +2141,8 @@ class MlrunProject(ModelObj):
|
|
|
2142
2141
|
name="myApp", application_class="MyApp", image="mlrun/mlrun"
|
|
2143
2142
|
)
|
|
2144
2143
|
|
|
2145
|
-
:param func:
|
|
2144
|
+
:param func: Remote function object or spec/code URL. :code:`None` refers to the current
|
|
2145
|
+
notebook.
|
|
2146
2146
|
:param name: Name of the function (under the project), can be specified with a tag to support
|
|
2147
2147
|
versions (e.g. myfunc:v1)
|
|
2148
2148
|
Default: job
|
|
@@ -2158,6 +2158,7 @@ class MlrunProject(ModelObj):
|
|
|
2158
2158
|
:param application_class: Name or an Instance of a class that implements the monitoring application.
|
|
2159
2159
|
:param application_kwargs: Additional keyword arguments to be passed to the
|
|
2160
2160
|
monitoring application's constructor.
|
|
2161
|
+
:returns: The model monitoring remote function object.
|
|
2161
2162
|
"""
|
|
2162
2163
|
(
|
|
2163
2164
|
resolved_function_name,
|
|
@@ -2195,7 +2196,7 @@ class MlrunProject(ModelObj):
|
|
|
2195
2196
|
requirements: Optional[typing.Union[str, list[str]]] = None,
|
|
2196
2197
|
requirements_file: str = "",
|
|
2197
2198
|
**application_kwargs,
|
|
2198
|
-
) -> mlrun.runtimes.
|
|
2199
|
+
) -> mlrun.runtimes.RemoteRuntime:
|
|
2199
2200
|
"""
|
|
2200
2201
|
Create a monitoring function object without setting it to the project
|
|
2201
2202
|
|
|
@@ -2205,7 +2206,7 @@ class MlrunProject(ModelObj):
|
|
|
2205
2206
|
application_class_name="MyApp", image="mlrun/mlrun", name="myApp"
|
|
2206
2207
|
)
|
|
2207
2208
|
|
|
2208
|
-
:param func:
|
|
2209
|
+
:param func: The function's code URL. :code:`None` refers to the current notebook.
|
|
2209
2210
|
:param name: Name of the function, can be specified with a tag to support
|
|
2210
2211
|
versions (e.g. myfunc:v1)
|
|
2211
2212
|
Default: job
|
|
@@ -2221,6 +2222,7 @@ class MlrunProject(ModelObj):
|
|
|
2221
2222
|
:param application_class: Name or an Instance of a class that implementing the monitoring application.
|
|
2222
2223
|
:param application_kwargs: Additional keyword arguments to be passed to the
|
|
2223
2224
|
monitoring application's constructor.
|
|
2225
|
+
:returns: The model monitoring remote function object.
|
|
2224
2226
|
"""
|
|
2225
2227
|
|
|
2226
2228
|
_, function_object, _ = self._instantiate_model_monitoring_function(
|
|
@@ -2253,7 +2255,7 @@ class MlrunProject(ModelObj):
|
|
|
2253
2255
|
requirements: typing.Union[str, list[str], None] = None,
|
|
2254
2256
|
requirements_file: str = "",
|
|
2255
2257
|
**application_kwargs,
|
|
2256
|
-
) -> tuple[str, mlrun.runtimes.
|
|
2258
|
+
) -> tuple[str, mlrun.runtimes.RemoteRuntime, dict]:
|
|
2257
2259
|
import mlrun.model_monitoring.api
|
|
2258
2260
|
|
|
2259
2261
|
kind = None
|
|
@@ -3550,11 +3552,13 @@ class MlrunProject(ModelObj):
|
|
|
3550
3552
|
name: Optional[str] = None,
|
|
3551
3553
|
model_name: Optional[str] = None,
|
|
3552
3554
|
function_name: Optional[str] = None,
|
|
3555
|
+
function_tag: Optional[str] = None,
|
|
3553
3556
|
labels: Optional[list[str]] = None,
|
|
3554
3557
|
start: Optional[datetime.datetime] = None,
|
|
3555
3558
|
end: Optional[datetime.datetime] = None,
|
|
3556
3559
|
top_level: bool = False,
|
|
3557
3560
|
uids: Optional[list[str]] = None,
|
|
3561
|
+
latest_only: bool = False,
|
|
3558
3562
|
) -> mlrun.common.schemas.ModelEndpointList:
|
|
3559
3563
|
"""
|
|
3560
3564
|
Returns a list of `ModelEndpoint` objects. Each `ModelEndpoint` object represents the current state of a
|
|
@@ -3562,10 +3566,11 @@ class MlrunProject(ModelObj):
|
|
|
3562
3566
|
1) name
|
|
3563
3567
|
2) model_name
|
|
3564
3568
|
3) function_name
|
|
3565
|
-
4)
|
|
3566
|
-
5)
|
|
3567
|
-
6)
|
|
3568
|
-
7)
|
|
3569
|
+
4) function_tag
|
|
3570
|
+
5) labels
|
|
3571
|
+
6) top level
|
|
3572
|
+
7) uids
|
|
3573
|
+
8) start and end time, corresponding to the `created` field.
|
|
3569
3574
|
By default, when no filters are applied, all available endpoints for the given project will be listed.
|
|
3570
3575
|
|
|
3571
3576
|
In addition, this functions provides a facade for listing endpoint related metrics. This facade is time-based
|
|
@@ -3574,6 +3579,7 @@ class MlrunProject(ModelObj):
|
|
|
3574
3579
|
:param name: The name of the model to filter by
|
|
3575
3580
|
:param model_name: The name of the model to filter by
|
|
3576
3581
|
:param function_name: The name of the function to filter by
|
|
3582
|
+
:param function_tag: The tag of the function to filter by
|
|
3577
3583
|
:param labels: Filter model endpoints by label key-value pairs or key existence. This can be provided as:
|
|
3578
3584
|
- A dictionary in the format `{"label": "value"}` to match specific label key-value pairs,
|
|
3579
3585
|
or `{"label": None}` to check for key existence.
|
|
@@ -3594,11 +3600,13 @@ class MlrunProject(ModelObj):
|
|
|
3594
3600
|
name=name,
|
|
3595
3601
|
model_name=model_name,
|
|
3596
3602
|
function_name=function_name,
|
|
3603
|
+
function_tag=function_tag,
|
|
3597
3604
|
labels=labels,
|
|
3598
3605
|
start=start,
|
|
3599
3606
|
end=end,
|
|
3600
3607
|
top_level=top_level,
|
|
3601
3608
|
uids=uids,
|
|
3609
|
+
latest_only=latest_only,
|
|
3602
3610
|
)
|
|
3603
3611
|
|
|
3604
3612
|
def run_function(
|
|
@@ -3984,18 +3992,21 @@ class MlrunProject(ModelObj):
|
|
|
3984
3992
|
mock=mock,
|
|
3985
3993
|
)
|
|
3986
3994
|
|
|
3987
|
-
def get_artifact(
|
|
3995
|
+
def get_artifact(
|
|
3996
|
+
self, key, tag=None, iter=None, tree=None, uid=None
|
|
3997
|
+
) -> typing.Optional[Artifact]:
|
|
3988
3998
|
"""Return an artifact object
|
|
3989
3999
|
|
|
3990
|
-
:param key:
|
|
3991
|
-
:param tag:
|
|
3992
|
-
:param iter:
|
|
3993
|
-
:param tree:
|
|
4000
|
+
:param key: Artifact key
|
|
4001
|
+
:param tag: Version tag
|
|
4002
|
+
:param iter: Iteration number (for hyper-param tasks)
|
|
4003
|
+
:param tree: The producer id (tree)
|
|
4004
|
+
:param uid: The artifact uid
|
|
3994
4005
|
:return: Artifact object
|
|
3995
4006
|
"""
|
|
3996
4007
|
db = mlrun.db.get_run_db(secrets=self._secrets)
|
|
3997
4008
|
artifact = db.read_artifact(
|
|
3998
|
-
key, tag, iter=iter, project=self.metadata.name, tree=tree
|
|
4009
|
+
key, tag, iter=iter, project=self.metadata.name, tree=tree, uid=uid
|
|
3999
4010
|
)
|
|
4000
4011
|
|
|
4001
4012
|
# in tests, if an artifact is not found, the db returns None
|
mlrun/runtimes/nuclio/serving.py
CHANGED
|
@@ -421,8 +421,6 @@ class ServingRuntime(RemoteRuntime):
|
|
|
421
421
|
class_name.model_path = model_path
|
|
422
422
|
key, state = params_to_step(class_name, key)
|
|
423
423
|
else:
|
|
424
|
-
if not model_path and not model_url:
|
|
425
|
-
raise ValueError("model_path or model_url must be provided")
|
|
426
424
|
class_name = class_name or self.spec.default_class
|
|
427
425
|
if class_name and not isinstance(class_name, str):
|
|
428
426
|
raise ValueError(
|
mlrun/serving/routers.py
CHANGED
|
@@ -1021,6 +1021,7 @@ def _init_endpoint_record(
|
|
|
1021
1021
|
project=graph_server.project,
|
|
1022
1022
|
name=voting_ensemble.name,
|
|
1023
1023
|
function_name=graph_server.function_name,
|
|
1024
|
+
function_tag=graph_server.function_tag or "latest",
|
|
1024
1025
|
)
|
|
1025
1026
|
except mlrun.errors.MLRunNotFoundError:
|
|
1026
1027
|
model_endpoint = None
|
|
@@ -1049,6 +1050,7 @@ def _init_endpoint_record(
|
|
|
1049
1050
|
name=voting_ensemble.name,
|
|
1050
1051
|
project=graph_server.project,
|
|
1051
1052
|
function_name=graph_server.function_name,
|
|
1053
|
+
function_tag=graph_server.function_tag or "latest",
|
|
1052
1054
|
function_uid=function_uid,
|
|
1053
1055
|
model_class=voting_ensemble.__class__.__name__,
|
|
1054
1056
|
)
|
|
@@ -1101,7 +1103,6 @@ def _init_endpoint_record(
|
|
|
1101
1103
|
model_endpoint = db.patch_model_endpoint(
|
|
1102
1104
|
project=model_endpoint.metadata.project,
|
|
1103
1105
|
name=model_endpoint.metadata.name,
|
|
1104
|
-
function_name=model_endpoint.spec.function_name,
|
|
1105
1106
|
endpoint_id=model_endpoint.metadata.uid,
|
|
1106
1107
|
attributes=attributes,
|
|
1107
1108
|
)
|
|
@@ -1121,7 +1122,6 @@ def _init_endpoint_record(
|
|
|
1121
1122
|
mlrun.get_run_db().patch_model_endpoint(
|
|
1122
1123
|
name=name,
|
|
1123
1124
|
project=graph_server.project,
|
|
1124
|
-
function_name=graph_server.function_name,
|
|
1125
1125
|
endpoint_id=uid,
|
|
1126
1126
|
attributes={
|
|
1127
1127
|
ModelEndpointSchema.ENDPOINT_TYPE: mlrun.common.schemas.model_monitoring.EndpointType.LEAF_EP
|
mlrun/serving/v2_serving.py
CHANGED
|
@@ -197,13 +197,15 @@ class V2ModelServer(StepToDict):
|
|
|
197
197
|
extra dataitems dictionary
|
|
198
198
|
|
|
199
199
|
"""
|
|
200
|
-
|
|
201
|
-
self.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
200
|
+
if self.model_path:
|
|
201
|
+
model_file, self.model_spec, extra_dataitems = mlrun.artifacts.get_model(
|
|
202
|
+
self.model_path, suffix
|
|
203
|
+
)
|
|
204
|
+
if self.model_spec and self.model_spec.parameters:
|
|
205
|
+
for key, value in self.model_spec.parameters.items():
|
|
206
|
+
self._params[key] = value
|
|
207
|
+
return model_file, extra_dataitems
|
|
208
|
+
return None, None
|
|
207
209
|
|
|
208
210
|
def load(self):
|
|
209
211
|
"""model loading function, see also .get_model() method"""
|
|
@@ -569,11 +571,22 @@ def _init_endpoint_record(
|
|
|
569
571
|
logger.info("Initializing endpoint records")
|
|
570
572
|
if not model.model_spec:
|
|
571
573
|
model.get_model()
|
|
574
|
+
if model.model_spec:
|
|
575
|
+
model_name = model.model_spec.metadata.key
|
|
576
|
+
model_uid = model.model_spec.metadata.uid
|
|
577
|
+
model_tag = model.model_spec.tag
|
|
578
|
+
model_labels = model.model_spec.labels # todo : check if we still need this
|
|
579
|
+
else:
|
|
580
|
+
model_name = None
|
|
581
|
+
model_uid = None
|
|
582
|
+
model_tag = None
|
|
583
|
+
model_labels = {}
|
|
572
584
|
try:
|
|
573
585
|
model_ep = mlrun.get_run_db().get_model_endpoint(
|
|
574
586
|
project=graph_server.project,
|
|
575
587
|
name=model.name,
|
|
576
588
|
function_name=graph_server.function_name,
|
|
589
|
+
function_tag=graph_server.function_tag or "latest",
|
|
577
590
|
)
|
|
578
591
|
except mlrun.errors.MLRunNotFoundError:
|
|
579
592
|
model_ep = None
|
|
@@ -595,16 +608,17 @@ def _init_endpoint_record(
|
|
|
595
608
|
name=model.name,
|
|
596
609
|
project=graph_server.project,
|
|
597
610
|
function_name=graph_server.function_name,
|
|
611
|
+
function_tag=graph_server.function_tag or "latest",
|
|
598
612
|
function_uid=function_uid,
|
|
599
|
-
model_name=
|
|
600
|
-
model_uid=
|
|
613
|
+
model_name=model_name,
|
|
614
|
+
model_uid=model_uid,
|
|
601
615
|
model_class=model.__class__.__name__,
|
|
602
|
-
model_tag=
|
|
616
|
+
model_tag=model_tag,
|
|
603
617
|
)
|
|
604
618
|
model_ep = mlrun.common.schemas.ModelEndpoint(
|
|
605
619
|
metadata=mlrun.common.schemas.ModelEndpointMetadata(
|
|
606
620
|
project=graph_server.project,
|
|
607
|
-
labels=
|
|
621
|
+
labels=model_labels,
|
|
608
622
|
name=model.name,
|
|
609
623
|
endpoint_type=mlrun.common.schemas.model_monitoring.EndpointType.NODE_EP,
|
|
610
624
|
),
|
|
@@ -612,8 +626,8 @@ def _init_endpoint_record(
|
|
|
612
626
|
function_name=graph_server.function_name,
|
|
613
627
|
function_uid=function_uid,
|
|
614
628
|
function_tag=graph_server.function_tag or "latest",
|
|
615
|
-
model_name=
|
|
616
|
-
model_uid=
|
|
629
|
+
model_name=model_name,
|
|
630
|
+
model_uid=model_uid,
|
|
617
631
|
model_class=model.__class__.__name__,
|
|
618
632
|
),
|
|
619
633
|
status=mlrun.common.schemas.ModelEndpointStatus(
|
|
@@ -623,16 +637,20 @@ def _init_endpoint_record(
|
|
|
623
637
|
),
|
|
624
638
|
)
|
|
625
639
|
db = mlrun.get_run_db()
|
|
626
|
-
db.create_model_endpoint(model_endpoint=model_ep)
|
|
640
|
+
model_ep = db.create_model_endpoint(model_endpoint=model_ep)
|
|
627
641
|
|
|
628
642
|
elif model_ep:
|
|
629
643
|
attributes = {}
|
|
630
644
|
if function_uid != model_ep.spec.function_uid:
|
|
631
645
|
attributes[ModelEndpointSchema.FUNCTION_UID] = function_uid
|
|
632
|
-
if
|
|
633
|
-
attributes[ModelEndpointSchema.MODEL_NAME] =
|
|
634
|
-
if
|
|
635
|
-
attributes[ModelEndpointSchema.MODEL_UID] =
|
|
646
|
+
if model_name != model_ep.spec.model_name:
|
|
647
|
+
attributes[ModelEndpointSchema.MODEL_NAME] = model_name
|
|
648
|
+
if model_uid != model_ep.spec.model_uid:
|
|
649
|
+
attributes[ModelEndpointSchema.MODEL_UID] = model_uid
|
|
650
|
+
if model_tag != model_ep.spec.model_tag:
|
|
651
|
+
attributes[ModelEndpointSchema.MODEL_TAG] = model_tag
|
|
652
|
+
if model_labels != model_ep.metadata.labels:
|
|
653
|
+
attributes[ModelEndpointSchema.LABELS] = model_labels
|
|
636
654
|
if model.__class__.__name__ != model_ep.spec.model_class:
|
|
637
655
|
attributes[ModelEndpointSchema.MODEL_CLASS] = model.__class__.__name__
|
|
638
656
|
if (
|
|
@@ -656,7 +674,6 @@ def _init_endpoint_record(
|
|
|
656
674
|
model_ep = db.patch_model_endpoint(
|
|
657
675
|
project=model_ep.metadata.project,
|
|
658
676
|
name=model_ep.metadata.name,
|
|
659
|
-
function_name=model_ep.spec.function_name,
|
|
660
677
|
endpoint_id=model_ep.metadata.uid,
|
|
661
678
|
attributes=attributes,
|
|
662
679
|
)
|
mlrun/utils/helpers.py
CHANGED
|
@@ -670,8 +670,8 @@ def dict_to_json(struct):
|
|
|
670
670
|
|
|
671
671
|
def parse_artifact_uri(uri, default_project=""):
|
|
672
672
|
"""
|
|
673
|
-
Parse artifact URI into project, key, tag, iter, tree
|
|
674
|
-
URI format: [<project>/]<key>[#<iter>][:<tag>][@<tree>]
|
|
673
|
+
Parse artifact URI into project, key, tag, iter, tree, uid
|
|
674
|
+
URI format: [<project>/]<key>[#<iter>][:<tag>][@<tree>][^<uid>]
|
|
675
675
|
|
|
676
676
|
:param uri: uri to parse
|
|
677
677
|
:param default_project: default project name if not in URI
|
|
@@ -681,6 +681,7 @@ def parse_artifact_uri(uri, default_project=""):
|
|
|
681
681
|
[2] = iteration
|
|
682
682
|
[3] = tag
|
|
683
683
|
[4] = tree
|
|
684
|
+
[5] = uid
|
|
684
685
|
"""
|
|
685
686
|
uri_pattern = mlrun.utils.regex.artifact_uri_pattern
|
|
686
687
|
match = re.match(uri_pattern, uri)
|
|
@@ -705,6 +706,7 @@ def parse_artifact_uri(uri, default_project=""):
|
|
|
705
706
|
iteration,
|
|
706
707
|
group_dict["tag"],
|
|
707
708
|
group_dict["tree"],
|
|
709
|
+
group_dict["uid"],
|
|
708
710
|
)
|
|
709
711
|
|
|
710
712
|
|
|
@@ -719,7 +721,9 @@ def generate_object_uri(project, name, tag=None, hash_key=None):
|
|
|
719
721
|
return uri
|
|
720
722
|
|
|
721
723
|
|
|
722
|
-
def generate_artifact_uri(
|
|
724
|
+
def generate_artifact_uri(
|
|
725
|
+
project, key, tag=None, iter=None, tree=None, uid=None
|
|
726
|
+
) -> str:
|
|
723
727
|
artifact_uri = f"{project}/{key}"
|
|
724
728
|
if iter is not None:
|
|
725
729
|
artifact_uri = f"{artifact_uri}#{iter}"
|
|
@@ -727,6 +731,8 @@ def generate_artifact_uri(project, key, tag=None, iter=None, tree=None):
|
|
|
727
731
|
artifact_uri = f"{artifact_uri}:{tag}"
|
|
728
732
|
if tree is not None:
|
|
729
733
|
artifact_uri = f"{artifact_uri}@{tree}"
|
|
734
|
+
if uid is not None:
|
|
735
|
+
artifact_uri = f"{artifact_uri}^{uid}"
|
|
730
736
|
return artifact_uri
|
|
731
737
|
|
|
732
738
|
|
mlrun/utils/regex.py
CHANGED
|
@@ -96,7 +96,14 @@ v3io_stream_consumer_group = [r"^(?!_)[a-zA-Z0-9_]{1,256}$"]
|
|
|
96
96
|
# URI patterns
|
|
97
97
|
run_uri_pattern = r"^(?P<project>.*)@(?P<uid>.*)\#(?P<iteration>.*?)(:(?P<tag>.*))?$"
|
|
98
98
|
|
|
99
|
-
artifact_uri_pattern =
|
|
99
|
+
artifact_uri_pattern = (
|
|
100
|
+
r"^((?P<project>.*)/)?" # Optional project
|
|
101
|
+
r"(?P<key>.*?)" # Key
|
|
102
|
+
r"(\#(?P<iteration>.*?))?" # Optional iteration
|
|
103
|
+
r"(:(?P<tag>.*?))?" # Optional tag
|
|
104
|
+
r"(@(?P<tree>.*?))?" # Optional tree
|
|
105
|
+
r"(\^(?P<uid>.*))?$" # Optional uid
|
|
106
|
+
)
|
|
100
107
|
|
|
101
108
|
artifact_producer_uri_pattern = (
|
|
102
109
|
r"^((?P<project>.*)/)?(?P<uid>.*?)(\-(?P<iteration>.*?))?$"
|
mlrun/utils/version/version.json
CHANGED
|
@@ -14,10 +14,10 @@ mlrun/alerts/__init__.py,sha256=0gtG1BG0DXxFrXegIkjbM1XEN4sP9ODo0ucXrNld1hU,601
|
|
|
14
14
|
mlrun/alerts/alert.py,sha256=mTROlDXzQw5gyWBFaUnykai3wpvjmgRmo28p0ytbzIU,15930
|
|
15
15
|
mlrun/api/schemas/__init__.py,sha256=fEWH4I8hr5AdRJ7yoW44RlFB6NHkYDxyomP5J6ct1z4,14248
|
|
16
16
|
mlrun/artifacts/__init__.py,sha256=5NRo_T5Hrltdssepx6Rs4-2vxuiYooF-OPFtjj0Jfow,1138
|
|
17
|
-
mlrun/artifacts/base.py,sha256=
|
|
17
|
+
mlrun/artifacts/base.py,sha256=nz2ZqC74JGfWN0M6_hOXXQj3bXSTxNp4eUgvWHVcdvY,29979
|
|
18
18
|
mlrun/artifacts/dataset.py,sha256=QTot5vCgLHatlIWwNnKbWdZ8HHTxaZ7wk4gWQDoqQ2k,16655
|
|
19
|
-
mlrun/artifacts/document.py,sha256=
|
|
20
|
-
mlrun/artifacts/manager.py,sha256=
|
|
19
|
+
mlrun/artifacts/document.py,sha256=qt4SP9apOuBQoMwcZbAG6-wLsyTwSGfsASEdrnx8-fc,12380
|
|
20
|
+
mlrun/artifacts/manager.py,sha256=bXb70mKF6wIGs7syCiFfGnjalqx4g9bO_J5DaVzUUKw,16163
|
|
21
21
|
mlrun/artifacts/model.py,sha256=jeOjUq_iZSHoNqlPyGgOz6acwje1Yqpg1yZwF9GbyG8,21615
|
|
22
22
|
mlrun/artifacts/plots.py,sha256=dS0mHGt1b20tN2JyEH9H5o5I0oMKZkzn3Uz_3Hf4WjU,4813
|
|
23
23
|
mlrun/common/__init__.py,sha256=xY3wHC4TEJgez7qtnn1pQvHosi8-5UJOCtyGBS7FcGE,571
|
|
@@ -97,20 +97,20 @@ mlrun/datastore/snowflake_utils.py,sha256=Wohvnlmq8j1d98RCaknll-iWdZZpSlCrKhUOEy
|
|
|
97
97
|
mlrun/datastore/sources.py,sha256=HQHbaAH7WdBGyeM1WYr3FS5MVSBXu93VOGmJ5At-gsw,49220
|
|
98
98
|
mlrun/datastore/spark_udf.py,sha256=NnnB3DZxZb-rqpRy7b-NC7QWXuuqFn3XkBDc86tU4mQ,1498
|
|
99
99
|
mlrun/datastore/spark_utils.py,sha256=_AsVoU5Ix_-W7Gyq8io8V-2GTk0m8THJNDP3WGGaWJY,2865
|
|
100
|
-
mlrun/datastore/store_resources.py,sha256=
|
|
100
|
+
mlrun/datastore/store_resources.py,sha256=PFOMrZ6KH6hBOb0PiO-cHx_kv0UpHu5P2t8_mrR-lS4,6842
|
|
101
101
|
mlrun/datastore/storeytargets.py,sha256=uNYG4nCBD3JIfa51CG4cDe9ryc9oIcqUdUXKvCPB6uE,5086
|
|
102
102
|
mlrun/datastore/targets.py,sha256=0RuprYSc95Uy-P_fk30d1dMGHDpgx7DAeydZEA3uR_k,80660
|
|
103
103
|
mlrun/datastore/utils.py,sha256=ZDAzz0W16_JcM6Q9h4RoMbdruM9eA6YGlA5dw8gW8Bw,7754
|
|
104
104
|
mlrun/datastore/v3io.py,sha256=QSYBORRLcJTeM9mt0EaWzyLcdmzrPkqrF7k5uLTam5U,8209
|
|
105
|
-
mlrun/datastore/vectorstore.py,sha256=
|
|
105
|
+
mlrun/datastore/vectorstore.py,sha256=Au2nckQV1qJ2ZT7oXGfZF7SsiZ0iwCkSGGMNYpvSLqE,9475
|
|
106
106
|
mlrun/datastore/wasbfs/__init__.py,sha256=s5Ul-0kAhYqFjKDR2X0O2vDGDbLQQduElb32Ev56Te4,1343
|
|
107
107
|
mlrun/datastore/wasbfs/fs.py,sha256=ge8NK__5vTcFT-krI155_8RDUywQw4SIRX6BWATXy9Q,6299
|
|
108
108
|
mlrun/db/__init__.py,sha256=WqJ4x8lqJ7ZoKbhEyFqkYADd9P6E3citckx9e9ZLcIU,1163
|
|
109
109
|
mlrun/db/auth_utils.py,sha256=hpg8D2r82oN0BWabuWN04BTNZ7jYMAF242YSUpK7LFM,5211
|
|
110
|
-
mlrun/db/base.py,sha256=
|
|
110
|
+
mlrun/db/base.py,sha256=asefMW3HtMXHEnbDO9XH-Ey4teY25V0pSifUoHbnE8Y,29267
|
|
111
111
|
mlrun/db/factory.py,sha256=yP2vVmveUE7LYTCHbS6lQIxP9rW--zdISWuPd_I3d_4,2111
|
|
112
|
-
mlrun/db/httpdb.py,sha256=
|
|
113
|
-
mlrun/db/nopdb.py,sha256=
|
|
112
|
+
mlrun/db/httpdb.py,sha256=lbFxfwZbGhJF7_Cv2vhfSFKAoo7x0U4xA8DV4zpWa6Y,224105
|
|
113
|
+
mlrun/db/nopdb.py,sha256=xJbTuB_GQg_bGvi_0YJjVqBHn-7DbCP6ExwQFLtsOSg,26275
|
|
114
114
|
mlrun/feature_store/__init__.py,sha256=AVnY2AFUNc2dKxLLUMx2K3Wo1eGviv0brDcYlDnmtf4,1506
|
|
115
115
|
mlrun/feature_store/api.py,sha256=qkojZpzqGAn3r9ww0ynBRKOs8ji8URaK4DSYD4SE-CE,50395
|
|
116
116
|
mlrun/feature_store/common.py,sha256=Z7USI-d1fo0iwBMsqMBtJflJfyuiV3BLoDXQPSAoBAs,12826
|
|
@@ -216,11 +216,11 @@ mlrun/launcher/factory.py,sha256=RW7mfzEFi8fR0M-4W1JQg1iq3_muUU6OTqT_3l4Ubrk,233
|
|
|
216
216
|
mlrun/launcher/local.py,sha256=9zNiuswHnSINDj4yYP2Vd192b5d4FUtSA8O2ICKjsKo,11279
|
|
217
217
|
mlrun/launcher/remote.py,sha256=rLJW4UAnUT5iUb4BsGBOAV3K4R29a0X4lFtRkVKlyYU,7709
|
|
218
218
|
mlrun/model_monitoring/__init__.py,sha256=RgXjrQSN7gZwo-URei3FNo3fE9wWlo1-wNhSVtNXbPA,784
|
|
219
|
-
mlrun/model_monitoring/api.py,sha256=
|
|
219
|
+
mlrun/model_monitoring/api.py,sha256=Zknu0LVsyYRfga4phfuUizYvYFYHvjzM2hlHqD8cSLM,28154
|
|
220
220
|
mlrun/model_monitoring/controller.py,sha256=dBfZQswF67vqeUFnmgsm9jU_5sOs9dLwMPEiYHG-Kk8,19786
|
|
221
221
|
mlrun/model_monitoring/features_drift_table.py,sha256=c6GpKtpOJbuT1u5uMWDL_S-6N4YPOmlktWMqPme3KFY,25308
|
|
222
|
-
mlrun/model_monitoring/helpers.py,sha256=
|
|
223
|
-
mlrun/model_monitoring/stream_processing.py,sha256=
|
|
222
|
+
mlrun/model_monitoring/helpers.py,sha256=cGK8ZQgzqW8-TAgpBF30HyHfDmeeSlogskHGxnE_Em8,16091
|
|
223
|
+
mlrun/model_monitoring/stream_processing.py,sha256=ltCVgo_b3yay16CUbqeGkRfzCHZSn14lVeBng5m9keY,31738
|
|
224
224
|
mlrun/model_monitoring/tracking_policy.py,sha256=PBIGrUYWrwcE5gwXupBIVzOb0QRRwPJsgQm_yLGQxB4,5595
|
|
225
225
|
mlrun/model_monitoring/writer.py,sha256=-47Z7oMr6q2ieJunZgkMK8d0IHZJhC3jxTBIxHgtSOk,10490
|
|
226
226
|
mlrun/model_monitoring/applications/__init__.py,sha256=QYvzgCutFdAkzqKPD3mvkX_3c1X4tzd-kW8ojUOE9ic,889
|
|
@@ -267,7 +267,7 @@ mlrun/platforms/iguazio.py,sha256=6VBTq8eQ3mzT96tzjYhAtcMQ2VjF4x8LpIPW5DAcX2Q,13
|
|
|
267
267
|
mlrun/projects/__init__.py,sha256=0Krf0WIKfnZa71WthYOg0SoaTodGg3sV_hK3f_OlTPI,1220
|
|
268
268
|
mlrun/projects/operations.py,sha256=VXUlMrouFTls-I-bMhdN5pPfQ34TR7bFQ-NUSWNvl84,20029
|
|
269
269
|
mlrun/projects/pipelines.py,sha256=YEaISS9HXGqk-JNxSYZuzioH9_orN_pDKjJUQPfs0y0,46886
|
|
270
|
-
mlrun/projects/project.py,sha256=
|
|
270
|
+
mlrun/projects/project.py,sha256=FDxkUEh2TgPj9kYsXUACoQcvwa9voeIbCVsdHH34y_E,224187
|
|
271
271
|
mlrun/runtimes/__init__.py,sha256=J9Sy2HiyMlztNv6VUurMzF5H2XzttNil8nRsWDsqLyg,8923
|
|
272
272
|
mlrun/runtimes/base.py,sha256=Yt2l7srrXjK783cunBEKH0yQxQZRH8lkedXNOXuLbbo,37841
|
|
273
273
|
mlrun/runtimes/daskjob.py,sha256=JwuGvOiPsxEDHHMMUS4Oie4hLlYYIZwihAl6DjroTY0,19521
|
|
@@ -291,7 +291,7 @@ mlrun/runtimes/nuclio/__init__.py,sha256=gx1kizzKv8pGT5TNloN1js1hdbxqDw3rM90sLVY
|
|
|
291
291
|
mlrun/runtimes/nuclio/api_gateway.py,sha256=vH9ClKVP4Mb24rvA67xPuAvAhX-gAv6vVtjVxyplhdc,26969
|
|
292
292
|
mlrun/runtimes/nuclio/function.py,sha256=ZXXHuPkQPgOewaGr9G3jLTQSFQHSJpLVFJ2bIA6bfpI,52287
|
|
293
293
|
mlrun/runtimes/nuclio/nuclio.py,sha256=sLK8KdGO1LbftlL3HqPZlFOFTAAuxJACZCVl1c0Ha6E,2942
|
|
294
|
-
mlrun/runtimes/nuclio/serving.py,sha256=
|
|
294
|
+
mlrun/runtimes/nuclio/serving.py,sha256=i8UPADxQVr5zO7HiO5GjVWbFSt4WMF219h8gE4YOaBA,30070
|
|
295
295
|
mlrun/runtimes/nuclio/application/__init__.py,sha256=rRs5vasy_G9IyoTpYIjYDafGoL6ifFBKgBtsXn31Atw,614
|
|
296
296
|
mlrun/runtimes/nuclio/application/application.py,sha256=HlEq4A6hbFqr3Ba3TL4m7nbmfMYI06Zb_NAKGjzkEFU,29242
|
|
297
297
|
mlrun/runtimes/nuclio/application/reverse_proxy.go,sha256=JIIYae6bXzCLf3jXuu49KWPQYoXr_FDQ2Rbo1OWKAd0,3150
|
|
@@ -300,13 +300,13 @@ mlrun/runtimes/sparkjob/spark3job.py,sha256=0ipkgAjDYDJDlcuvt379zonjhepCspsQQXMr
|
|
|
300
300
|
mlrun/serving/__init__.py,sha256=-SMRV3q_5cGVPDxRslXPU0zGYZIygs0cSj7WKlOJJUc,1163
|
|
301
301
|
mlrun/serving/merger.py,sha256=Sj2OUjPNLQrGZD_StMx8-j0kGyzKlp4QjTmDHmpJQLA,6185
|
|
302
302
|
mlrun/serving/remote.py,sha256=KBSC3Aw0H6fOlmwdnc37C1CtegCiI7MhkKAXgaxFESs,18158
|
|
303
|
-
mlrun/serving/routers.py,sha256=
|
|
303
|
+
mlrun/serving/routers.py,sha256=m9z0tJCm1xhLnBcbcOXHxS4CCluA_wUKajv1Jk3iOz0,56367
|
|
304
304
|
mlrun/serving/server.py,sha256=KtcK_fn57G4CLgtEvSeaxwA-kruhUxv28StV3HimvXE,22294
|
|
305
305
|
mlrun/serving/serving_wrapper.py,sha256=R670-S6PX_d5ER6jiHtRvacuPyFzQH0mEf2K0sBIIOM,836
|
|
306
306
|
mlrun/serving/states.py,sha256=DDNlyW0AQRgMfnXnYMBaXxF3gZQzxrAJipz_X6JMjjs,61604
|
|
307
307
|
mlrun/serving/utils.py,sha256=k2EIYDWHUGkE-IBI6T0UNT32fw-KySsccIJM_LObI00,4171
|
|
308
308
|
mlrun/serving/v1_serving.py,sha256=c6J_MtpE-Tqu00-6r4eJOCO6rUasHDal9W2eBIcrl50,11853
|
|
309
|
-
mlrun/serving/v2_serving.py,sha256=
|
|
309
|
+
mlrun/serving/v2_serving.py,sha256=3h3_BbwWcc7wvZuJcKg8gsGNRbsHZPzNiRoCz6_gRDs,27986
|
|
310
310
|
mlrun/track/__init__.py,sha256=yVXbT52fXvGKRlc_ByHqIVt7-9L3DRE634RSeQwgXtU,665
|
|
311
311
|
mlrun/track/tracker.py,sha256=CyTU6Qd3_5GGEJ_hpocOj71wvV65EuFYUjaYEUKAL6Q,3575
|
|
312
312
|
mlrun/track/tracker_manager.py,sha256=IYBl99I62IC6VCCmG1yt6JoHNOQXa53C4DURJ2sWgio,5726
|
|
@@ -318,10 +318,10 @@ mlrun/utils/azure_vault.py,sha256=IEFizrDGDbAaoWwDr1WoA88S_EZ0T--vjYtY-i0cvYQ,34
|
|
|
318
318
|
mlrun/utils/clones.py,sha256=y3zC9QS7z5mLuvyQ6vFd6sJnikbgtDwrBvieQq0sovY,7359
|
|
319
319
|
mlrun/utils/condition_evaluator.py,sha256=-nGfRmZzivn01rHTroiGY4rqEv8T1irMyhzxEei-sKc,1897
|
|
320
320
|
mlrun/utils/db.py,sha256=blQgkWMfFH9lcN4sgJQcPQgEETz2Dl_zwbVA0SslpFg,2186
|
|
321
|
-
mlrun/utils/helpers.py,sha256=
|
|
321
|
+
mlrun/utils/helpers.py,sha256=89EdKYHB1kzeZPlNumRPY9GfpcmcCitRYWkUj0O0G6Q,63293
|
|
322
322
|
mlrun/utils/http.py,sha256=t6FrXQstZm9xVVjxqIGiLzrwZNCR4CSienSOuVgNIcI,8706
|
|
323
323
|
mlrun/utils/logger.py,sha256=_v4UTv1-STzC2c6aAWAa0NNl9STQoBYbR3OHgAiL41s,14606
|
|
324
|
-
mlrun/utils/regex.py,sha256=
|
|
324
|
+
mlrun/utils/regex.py,sha256=IQqwPna6Z8J31xkTUduYbGk48GkQBUJFZSuxAWm1pzU,5162
|
|
325
325
|
mlrun/utils/retryer.py,sha256=GzDMeATklqxcKSLYaFYcqioh8e5cbWRxA1_XKrGR1A4,7570
|
|
326
326
|
mlrun/utils/singleton.py,sha256=p1Y-X0mPSs_At092GS-pZCA8CTR62HOqPU07_ZH6-To,869
|
|
327
327
|
mlrun/utils/v3io_clients.py,sha256=0aCFiQFBmgdSeLzJr_nEP6SG-zyieSgH8RdtcUq4dc0,1294
|
|
@@ -337,11 +337,11 @@ mlrun/utils/notifications/notification/mail.py,sha256=ZyJ3eqd8simxffQmXzqd3bgbAq
|
|
|
337
337
|
mlrun/utils/notifications/notification/slack.py,sha256=NKV4RFiY3gLsS8uPppgniPLyag8zJ9O1VhixoXkM7kw,7108
|
|
338
338
|
mlrun/utils/notifications/notification/webhook.py,sha256=lSGKCQMa-TstKbMpZnU5uQkW14tzIaqjBHDXUNh9dlU,4848
|
|
339
339
|
mlrun/utils/version/__init__.py,sha256=7kkrB7hEZ3cLXoWj1kPoDwo4MaswsI2JVOBpbKgPAgc,614
|
|
340
|
-
mlrun/utils/version/version.json,sha256=
|
|
340
|
+
mlrun/utils/version/version.json,sha256=o7a7tP023Va9hL6r0fRpV0ka-Do02LiXBAmy4ECxg4o,88
|
|
341
341
|
mlrun/utils/version/version.py,sha256=eEW0tqIAkU9Xifxv8Z9_qsYnNhn3YH7NRAfM-pPLt1g,1878
|
|
342
|
-
mlrun-1.8.
|
|
343
|
-
mlrun-1.8.
|
|
344
|
-
mlrun-1.8.
|
|
345
|
-
mlrun-1.8.
|
|
346
|
-
mlrun-1.8.
|
|
347
|
-
mlrun-1.8.
|
|
342
|
+
mlrun-1.8.0rc9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
343
|
+
mlrun-1.8.0rc9.dist-info/METADATA,sha256=tcz4gulsO8-BR9Adykf7AmvYN-b5SfQpbD4rQNWHEHA,24456
|
|
344
|
+
mlrun-1.8.0rc9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
345
|
+
mlrun-1.8.0rc9.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
|
|
346
|
+
mlrun-1.8.0rc9.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
|
|
347
|
+
mlrun-1.8.0rc9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|