mlrun 1.5.0rc1__py3-none-any.whl → 1.5.0rc2__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 -35
- mlrun/__main__.py +1 -40
- mlrun/api/api/api.py +6 -0
- mlrun/api/api/endpoints/feature_store.py +0 -4
- mlrun/api/api/endpoints/files.py +14 -2
- mlrun/api/api/endpoints/functions.py +6 -1
- mlrun/api/api/endpoints/logs.py +17 -3
- mlrun/api/api/endpoints/pipelines.py +1 -5
- mlrun/api/api/endpoints/projects.py +88 -0
- mlrun/api/api/endpoints/runs.py +48 -6
- mlrun/api/api/endpoints/workflows.py +355 -0
- mlrun/api/api/utils.py +1 -1
- mlrun/api/crud/__init__.py +1 -0
- mlrun/api/crud/client_spec.py +3 -0
- mlrun/api/crud/model_monitoring/deployment.py +36 -7
- mlrun/api/crud/model_monitoring/grafana.py +1 -1
- mlrun/api/crud/model_monitoring/helpers.py +32 -2
- mlrun/api/crud/model_monitoring/model_endpoints.py +27 -5
- mlrun/api/crud/notifications.py +9 -4
- mlrun/api/crud/pipelines.py +4 -9
- mlrun/api/crud/runtime_resources.py +4 -3
- mlrun/api/crud/secrets.py +21 -0
- mlrun/api/crud/workflows.py +352 -0
- mlrun/api/db/base.py +16 -1
- mlrun/api/db/sqldb/db.py +97 -16
- mlrun/api/launcher.py +26 -7
- mlrun/api/main.py +3 -4
- mlrun/{mlutils → api/rundb}/__init__.py +2 -6
- mlrun/{db → api/rundb}/sqldb.py +35 -83
- mlrun/api/runtime_handlers/__init__.py +56 -0
- mlrun/api/runtime_handlers/base.py +1247 -0
- mlrun/api/runtime_handlers/daskjob.py +209 -0
- mlrun/api/runtime_handlers/kubejob.py +37 -0
- mlrun/api/runtime_handlers/mpijob.py +147 -0
- mlrun/api/runtime_handlers/remotesparkjob.py +29 -0
- mlrun/api/runtime_handlers/sparkjob.py +148 -0
- mlrun/api/utils/builder.py +1 -4
- mlrun/api/utils/clients/chief.py +14 -0
- mlrun/api/utils/scheduler.py +98 -15
- mlrun/api/utils/singletons/db.py +4 -0
- mlrun/artifacts/manager.py +1 -2
- mlrun/common/schemas/__init__.py +6 -0
- mlrun/common/schemas/auth.py +4 -1
- mlrun/common/schemas/client_spec.py +1 -1
- mlrun/common/schemas/model_monitoring/__init__.py +1 -0
- mlrun/common/schemas/model_monitoring/constants.py +11 -0
- mlrun/common/schemas/project.py +1 -0
- mlrun/common/schemas/runs.py +1 -8
- mlrun/common/schemas/schedule.py +1 -8
- mlrun/common/schemas/workflow.py +54 -0
- mlrun/config.py +42 -40
- mlrun/datastore/sources.py +1 -1
- mlrun/db/__init__.py +4 -68
- mlrun/db/base.py +12 -0
- mlrun/db/factory.py +65 -0
- mlrun/db/httpdb.py +175 -19
- mlrun/db/nopdb.py +4 -2
- mlrun/execution.py +4 -2
- mlrun/feature_store/__init__.py +1 -0
- mlrun/feature_store/api.py +1 -2
- mlrun/feature_store/feature_set.py +0 -10
- mlrun/feature_store/feature_vector.py +340 -2
- mlrun/feature_store/ingestion.py +5 -10
- mlrun/feature_store/retrieval/base.py +118 -104
- mlrun/feature_store/retrieval/dask_merger.py +17 -10
- mlrun/feature_store/retrieval/job.py +4 -1
- mlrun/feature_store/retrieval/local_merger.py +18 -18
- mlrun/feature_store/retrieval/spark_merger.py +21 -14
- mlrun/feature_store/retrieval/storey_merger.py +21 -15
- mlrun/kfpops.py +3 -9
- mlrun/launcher/base.py +3 -3
- mlrun/launcher/client.py +3 -2
- mlrun/launcher/factory.py +16 -13
- mlrun/lists.py +0 -11
- mlrun/model.py +9 -15
- mlrun/model_monitoring/helpers.py +15 -25
- mlrun/model_monitoring/model_monitoring_batch.py +72 -4
- mlrun/model_monitoring/prometheus.py +219 -0
- mlrun/model_monitoring/stores/__init__.py +15 -9
- mlrun/model_monitoring/stores/sql_model_endpoint_store.py +3 -1
- mlrun/model_monitoring/stream_processing.py +181 -29
- mlrun/package/packager.py +6 -8
- mlrun/package/packagers/default_packager.py +121 -10
- mlrun/platforms/__init__.py +0 -2
- mlrun/platforms/iguazio.py +0 -56
- mlrun/projects/pipelines.py +57 -158
- mlrun/projects/project.py +6 -32
- mlrun/render.py +1 -1
- mlrun/run.py +2 -124
- mlrun/runtimes/__init__.py +6 -42
- mlrun/runtimes/base.py +26 -1241
- mlrun/runtimes/daskjob.py +2 -198
- mlrun/runtimes/function.py +16 -5
- mlrun/runtimes/kubejob.py +5 -29
- mlrun/runtimes/mpijob/__init__.py +2 -2
- mlrun/runtimes/mpijob/abstract.py +10 -1
- mlrun/runtimes/mpijob/v1.py +0 -76
- mlrun/runtimes/mpijob/v1alpha1.py +1 -74
- mlrun/runtimes/nuclio.py +3 -2
- mlrun/runtimes/pod.py +0 -10
- mlrun/runtimes/remotesparkjob.py +1 -15
- mlrun/runtimes/serving.py +1 -1
- mlrun/runtimes/sparkjob/__init__.py +0 -1
- mlrun/runtimes/sparkjob/abstract.py +4 -131
- mlrun/serving/states.py +1 -1
- mlrun/utils/db.py +0 -2
- mlrun/utils/helpers.py +19 -13
- mlrun/utils/notifications/notification_pusher.py +5 -25
- mlrun/utils/regex.py +7 -2
- mlrun/utils/version/version.json +2 -2
- {mlrun-1.5.0rc1.dist-info → mlrun-1.5.0rc2.dist-info}/METADATA +24 -23
- {mlrun-1.5.0rc1.dist-info → mlrun-1.5.0rc2.dist-info}/RECORD +116 -107
- {mlrun-1.5.0rc1.dist-info → mlrun-1.5.0rc2.dist-info}/WHEEL +1 -1
- mlrun/mlutils/data.py +0 -160
- mlrun/mlutils/models.py +0 -78
- mlrun/mlutils/plots.py +0 -902
- {mlrun-1.5.0rc1.dist-info → mlrun-1.5.0rc2.dist-info}/LICENSE +0 -0
- {mlrun-1.5.0rc1.dist-info → mlrun-1.5.0rc2.dist-info}/entry_points.txt +0 -0
- {mlrun-1.5.0rc1.dist-info → mlrun-1.5.0rc2.dist-info}/top_level.txt +0 -0
|
@@ -14,21 +14,15 @@
|
|
|
14
14
|
import os.path
|
|
15
15
|
import typing
|
|
16
16
|
from copy import deepcopy
|
|
17
|
-
from datetime import datetime
|
|
18
|
-
from typing import Dict, Optional, Tuple
|
|
19
17
|
|
|
20
18
|
from kubernetes import client
|
|
21
19
|
from kubernetes.client.rest import ApiException
|
|
22
|
-
from sqlalchemy.orm import Session
|
|
23
20
|
|
|
21
|
+
import mlrun.db
|
|
24
22
|
import mlrun.errors
|
|
25
23
|
import mlrun.utils.regex
|
|
26
|
-
from mlrun.api.db.base import DBInterface
|
|
27
24
|
from mlrun.config import config
|
|
28
|
-
from mlrun.db import get_run_db
|
|
29
25
|
from mlrun.errors import err_to_str
|
|
30
|
-
from mlrun.runtimes.base import BaseRuntimeHandler
|
|
31
|
-
from mlrun.runtimes.constants import RunStates, SparkApplicationStates
|
|
32
26
|
|
|
33
27
|
from ...execution import MLClientCtx
|
|
34
28
|
from ...model import RunObject
|
|
@@ -41,7 +35,7 @@ from ...utils import (
|
|
|
41
35
|
verify_field_regex,
|
|
42
36
|
verify_list_and_update_in,
|
|
43
37
|
)
|
|
44
|
-
from ..base import RunError
|
|
38
|
+
from ..base import RunError
|
|
45
39
|
from ..kubejob import KubejobRuntime
|
|
46
40
|
from ..pod import KubeResourceSpec
|
|
47
41
|
from ..utils import get_item_name, get_k8s
|
|
@@ -242,7 +236,7 @@ class AbstractSparkRuntime(KubejobRuntime):
|
|
|
242
236
|
sj.with_driver_requests(cpu=1, mem="512m")
|
|
243
237
|
|
|
244
238
|
sj.deploy()
|
|
245
|
-
get_run_db().delete_function(name=sj.metadata.name)
|
|
239
|
+
mlrun.db.get_run_db().delete_function(name=sj.metadata.name)
|
|
246
240
|
|
|
247
241
|
def _is_using_gpu(self):
|
|
248
242
|
driver_limits = self.spec.driver_resources.get("limits")
|
|
@@ -292,7 +286,7 @@ class AbstractSparkRuntime(KubejobRuntime):
|
|
|
292
286
|
:return True if the function is ready (deployed)
|
|
293
287
|
"""
|
|
294
288
|
# connect will populate the config from the server config
|
|
295
|
-
get_run_db()
|
|
289
|
+
mlrun.db.get_run_db()
|
|
296
290
|
if not self.spec.build.base_image:
|
|
297
291
|
self.spec.build.base_image = self._default_image
|
|
298
292
|
return super().deploy(
|
|
@@ -841,124 +835,3 @@ with ctx:
|
|
|
841
835
|
@spec.setter
|
|
842
836
|
def spec(self, spec):
|
|
843
837
|
raise NotImplementedError()
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
class SparkRuntimeHandler(BaseRuntimeHandler):
|
|
847
|
-
kind = "spark"
|
|
848
|
-
class_modes = {
|
|
849
|
-
RuntimeClassMode.run: "spark",
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
def _resolve_crd_object_status_info(
|
|
853
|
-
self, db: DBInterface, db_session: Session, crd_object
|
|
854
|
-
) -> Tuple[bool, Optional[datetime], Optional[str]]:
|
|
855
|
-
state = crd_object.get("status", {}).get("applicationState", {}).get("state")
|
|
856
|
-
in_terminal_state = state in SparkApplicationStates.terminal_states()
|
|
857
|
-
desired_run_state = SparkApplicationStates.spark_application_state_to_run_state(
|
|
858
|
-
state
|
|
859
|
-
)
|
|
860
|
-
completion_time = None
|
|
861
|
-
if in_terminal_state:
|
|
862
|
-
if crd_object.get("status", {}).get("terminationTime"):
|
|
863
|
-
completion_time = datetime.fromisoformat(
|
|
864
|
-
crd_object.get("status", {})
|
|
865
|
-
.get("terminationTime")
|
|
866
|
-
.replace("Z", "+00:00")
|
|
867
|
-
)
|
|
868
|
-
else:
|
|
869
|
-
last_submission_attempt_time = crd_object.get("status", {}).get(
|
|
870
|
-
"lastSubmissionAttemptTime"
|
|
871
|
-
)
|
|
872
|
-
if last_submission_attempt_time:
|
|
873
|
-
last_submission_attempt_time = last_submission_attempt_time.replace(
|
|
874
|
-
"Z", "+00:00"
|
|
875
|
-
)
|
|
876
|
-
completion_time = datetime.fromisoformat(
|
|
877
|
-
last_submission_attempt_time
|
|
878
|
-
)
|
|
879
|
-
return in_terminal_state, completion_time, desired_run_state
|
|
880
|
-
|
|
881
|
-
def _update_ui_url(
|
|
882
|
-
self,
|
|
883
|
-
db: DBInterface,
|
|
884
|
-
db_session: Session,
|
|
885
|
-
project: str,
|
|
886
|
-
uid: str,
|
|
887
|
-
crd_object,
|
|
888
|
-
run: Dict = None,
|
|
889
|
-
):
|
|
890
|
-
app_state = (
|
|
891
|
-
crd_object.get("status", {}).get("applicationState", {}).get("state")
|
|
892
|
-
)
|
|
893
|
-
state = SparkApplicationStates.spark_application_state_to_run_state(app_state)
|
|
894
|
-
ui_url = None
|
|
895
|
-
if state == RunStates.running:
|
|
896
|
-
ui_url = (
|
|
897
|
-
crd_object.get("status", {})
|
|
898
|
-
.get("driverInfo", {})
|
|
899
|
-
.get("webUIIngressAddress")
|
|
900
|
-
)
|
|
901
|
-
db_ui_url = run.get("status", {}).get("ui_url")
|
|
902
|
-
if db_ui_url == ui_url:
|
|
903
|
-
return
|
|
904
|
-
run.setdefault("status", {})["ui_url"] = ui_url
|
|
905
|
-
db.store_run(db_session, run, uid, project)
|
|
906
|
-
|
|
907
|
-
@staticmethod
|
|
908
|
-
def _are_resources_coupled_to_run_object() -> bool:
|
|
909
|
-
return True
|
|
910
|
-
|
|
911
|
-
@staticmethod
|
|
912
|
-
def _get_object_label_selector(object_id: str) -> str:
|
|
913
|
-
return f"mlrun/uid={object_id}"
|
|
914
|
-
|
|
915
|
-
@staticmethod
|
|
916
|
-
def _get_main_runtime_resource_label_selector() -> str:
|
|
917
|
-
"""
|
|
918
|
-
There are some runtimes which might have multiple k8s resources attached to a one runtime, in this case
|
|
919
|
-
we don't want to pull logs from all but rather only for the "driver"/"launcher" etc
|
|
920
|
-
:return: the label selector
|
|
921
|
-
"""
|
|
922
|
-
return "spark-role=driver"
|
|
923
|
-
|
|
924
|
-
@staticmethod
|
|
925
|
-
def _get_crd_info() -> Tuple[str, str, str]:
|
|
926
|
-
return (
|
|
927
|
-
AbstractSparkRuntime.group,
|
|
928
|
-
AbstractSparkRuntime.version,
|
|
929
|
-
AbstractSparkRuntime.plural,
|
|
930
|
-
)
|
|
931
|
-
|
|
932
|
-
def _delete_extra_resources(
|
|
933
|
-
self,
|
|
934
|
-
db: DBInterface,
|
|
935
|
-
db_session: Session,
|
|
936
|
-
namespace: str,
|
|
937
|
-
deleted_resources: typing.List[Dict],
|
|
938
|
-
label_selector: str = None,
|
|
939
|
-
force: bool = False,
|
|
940
|
-
grace_period: int = None,
|
|
941
|
-
):
|
|
942
|
-
"""
|
|
943
|
-
Handling config maps deletion
|
|
944
|
-
"""
|
|
945
|
-
uids = []
|
|
946
|
-
for crd_dict in deleted_resources:
|
|
947
|
-
uid = crd_dict["metadata"].get("labels", {}).get("mlrun/uid", None)
|
|
948
|
-
uids.append(uid)
|
|
949
|
-
|
|
950
|
-
config_maps = get_k8s().v1api.list_namespaced_config_map(
|
|
951
|
-
namespace, label_selector=label_selector
|
|
952
|
-
)
|
|
953
|
-
for config_map in config_maps.items:
|
|
954
|
-
try:
|
|
955
|
-
uid = config_map.metadata.labels.get("mlrun/uid", None)
|
|
956
|
-
if force or uid in uids:
|
|
957
|
-
get_k8s().v1api.delete_namespaced_config_map(
|
|
958
|
-
config_map.metadata.name, namespace
|
|
959
|
-
)
|
|
960
|
-
logger.info(f"Deleted config map: {config_map.metadata.name}")
|
|
961
|
-
except ApiException as exc:
|
|
962
|
-
# ignore error if config map is already removed
|
|
963
|
-
if exc.status != 404:
|
|
964
|
-
raise
|
mlrun/serving/states.py
CHANGED
|
@@ -1516,7 +1516,7 @@ def _init_async_objects(context, steps):
|
|
|
1516
1516
|
source_args = context.get_param("source_args", {})
|
|
1517
1517
|
default_source = storey.SyncEmitSource(
|
|
1518
1518
|
context=context,
|
|
1519
|
-
explicit_ack=mlrun.mlconf.
|
|
1519
|
+
explicit_ack=mlrun.mlconf.is_explicit_ack(),
|
|
1520
1520
|
**source_args,
|
|
1521
1521
|
)
|
|
1522
1522
|
return default_source, wait_for_result
|
mlrun/utils/db.py
CHANGED
mlrun/utils/helpers.py
CHANGED
|
@@ -35,13 +35,13 @@ import pandas
|
|
|
35
35
|
import semver
|
|
36
36
|
import yaml
|
|
37
37
|
from dateutil import parser
|
|
38
|
-
from deprecated import deprecated
|
|
39
38
|
from pandas._libs.tslibs.timestamps import Timedelta, Timestamp
|
|
40
39
|
from yaml.representer import RepresenterError
|
|
41
40
|
|
|
42
41
|
import mlrun
|
|
43
42
|
import mlrun.common.schemas
|
|
44
43
|
import mlrun.errors
|
|
44
|
+
import mlrun.utils.regex
|
|
45
45
|
import mlrun.utils.version.version
|
|
46
46
|
from mlrun.errors import err_to_str
|
|
47
47
|
|
|
@@ -238,6 +238,17 @@ def validate_artifact_key_name(
|
|
|
238
238
|
)
|
|
239
239
|
|
|
240
240
|
|
|
241
|
+
def validate_v3io_stream_consumer_group(
|
|
242
|
+
value: str, raise_on_failure: bool = True
|
|
243
|
+
) -> bool:
|
|
244
|
+
return mlrun.utils.helpers.verify_field_regex(
|
|
245
|
+
"consumerGroup",
|
|
246
|
+
value,
|
|
247
|
+
mlrun.utils.regex.v3io_stream_consumer_group,
|
|
248
|
+
raise_on_failure=raise_on_failure,
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
|
|
241
252
|
def get_regex_list_as_string(regex_list: List) -> str:
|
|
242
253
|
"""
|
|
243
254
|
This function is used to combine a list of regex strings into a single regex,
|
|
@@ -753,18 +764,6 @@ def new_pipe_metadata(
|
|
|
753
764
|
return conf
|
|
754
765
|
|
|
755
766
|
|
|
756
|
-
# TODO: remove in 1.5.0
|
|
757
|
-
@deprecated(
|
|
758
|
-
version="1.3.0",
|
|
759
|
-
reason="'new_pipe_meta' will be removed in 1.5.0",
|
|
760
|
-
category=FutureWarning,
|
|
761
|
-
)
|
|
762
|
-
def new_pipe_meta(artifact_path=None, ttl=None, *args):
|
|
763
|
-
return new_pipe_metadata(
|
|
764
|
-
artifact_path=artifact_path, cleanup_ttl=ttl, op_transformers=args
|
|
765
|
-
)
|
|
766
|
-
|
|
767
|
-
|
|
768
767
|
def _convert_python_package_version_to_image_tag(version: typing.Optional[str]):
|
|
769
768
|
return (
|
|
770
769
|
version.replace("+", "-").replace("0.0.0-", "") if version is not None else None
|
|
@@ -1445,3 +1444,10 @@ class DeprecationHelper(object):
|
|
|
1445
1444
|
def __getattr__(self, attr):
|
|
1446
1445
|
self._warn()
|
|
1447
1446
|
return getattr(self._new_target, attr)
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
def normalize_workflow_name(name, project_name):
|
|
1450
|
+
workflow_name = (
|
|
1451
|
+
name.lstrip(project_name).lstrip("-") if project_name in name else name
|
|
1452
|
+
)
|
|
1453
|
+
return workflow_name
|
|
@@ -20,10 +20,9 @@ from concurrent.futures import ThreadPoolExecutor
|
|
|
20
20
|
|
|
21
21
|
from fastapi.concurrency import run_in_threadpool
|
|
22
22
|
|
|
23
|
-
import mlrun.api.db.base
|
|
24
|
-
import mlrun.api.db.session
|
|
25
23
|
import mlrun.common.schemas
|
|
26
24
|
import mlrun.config
|
|
25
|
+
import mlrun.db.base
|
|
27
26
|
import mlrun.lists
|
|
28
27
|
import mlrun.model
|
|
29
28
|
import mlrun.utils.helpers
|
|
@@ -63,10 +62,7 @@ class NotificationPusher(object):
|
|
|
63
62
|
if self._should_notify(run, notification):
|
|
64
63
|
self._load_notification(run, notification)
|
|
65
64
|
|
|
66
|
-
def push(
|
|
67
|
-
self,
|
|
68
|
-
db: mlrun.api.db.base.DBInterface = None,
|
|
69
|
-
):
|
|
65
|
+
def push(self):
|
|
70
66
|
"""
|
|
71
67
|
Asynchronously push notifications for all runs in the initialized runs list (if they should be pushed).
|
|
72
68
|
When running from a sync environment, the notifications will be pushed asynchronously however the function will
|
|
@@ -82,7 +78,6 @@ class NotificationPusher(object):
|
|
|
82
78
|
notification_data[0],
|
|
83
79
|
notification_data[1],
|
|
84
80
|
notification_data[2],
|
|
85
|
-
db,
|
|
86
81
|
)
|
|
87
82
|
|
|
88
83
|
async def _async_push():
|
|
@@ -93,7 +88,6 @@ class NotificationPusher(object):
|
|
|
93
88
|
notification_data[0],
|
|
94
89
|
notification_data[1],
|
|
95
90
|
notification_data[2],
|
|
96
|
-
db,
|
|
97
91
|
)
|
|
98
92
|
)
|
|
99
93
|
|
|
@@ -200,7 +194,6 @@ class NotificationPusher(object):
|
|
|
200
194
|
notification: NotificationBase,
|
|
201
195
|
run: mlrun.model.RunObject,
|
|
202
196
|
notification_object: mlrun.model.Notification,
|
|
203
|
-
db: mlrun.api.db.base.DBInterface,
|
|
204
197
|
):
|
|
205
198
|
message, severity, runs = self._prepare_notification_args(
|
|
206
199
|
run, notification_object
|
|
@@ -213,7 +206,6 @@ class NotificationPusher(object):
|
|
|
213
206
|
try:
|
|
214
207
|
notification.push(message, severity, runs)
|
|
215
208
|
self._update_notification_status(
|
|
216
|
-
db,
|
|
217
209
|
run.metadata.uid,
|
|
218
210
|
run.metadata.project,
|
|
219
211
|
notification_object,
|
|
@@ -222,7 +214,6 @@ class NotificationPusher(object):
|
|
|
222
214
|
)
|
|
223
215
|
except Exception as exc:
|
|
224
216
|
self._update_notification_status(
|
|
225
|
-
db,
|
|
226
217
|
run.metadata.uid,
|
|
227
218
|
run.metadata.project,
|
|
228
219
|
notification_object,
|
|
@@ -235,7 +226,6 @@ class NotificationPusher(object):
|
|
|
235
226
|
notification: NotificationBase,
|
|
236
227
|
run: mlrun.model.RunObject,
|
|
237
228
|
notification_object: mlrun.model.Notification,
|
|
238
|
-
db: mlrun.api.db.base.DBInterface,
|
|
239
229
|
):
|
|
240
230
|
message, severity, runs = self._prepare_notification_args(
|
|
241
231
|
run, notification_object
|
|
@@ -250,7 +240,6 @@ class NotificationPusher(object):
|
|
|
250
240
|
|
|
251
241
|
await run_in_threadpool(
|
|
252
242
|
self._update_notification_status,
|
|
253
|
-
db,
|
|
254
243
|
run.metadata.uid,
|
|
255
244
|
run.metadata.project,
|
|
256
245
|
notification_object,
|
|
@@ -260,7 +249,6 @@ class NotificationPusher(object):
|
|
|
260
249
|
except Exception as exc:
|
|
261
250
|
await run_in_threadpool(
|
|
262
251
|
self._update_notification_status,
|
|
263
|
-
db,
|
|
264
252
|
run.metadata.uid,
|
|
265
253
|
run.metadata.project,
|
|
266
254
|
notification_object,
|
|
@@ -270,30 +258,22 @@ class NotificationPusher(object):
|
|
|
270
258
|
|
|
271
259
|
@staticmethod
|
|
272
260
|
def _update_notification_status(
|
|
273
|
-
db: mlrun.api.db.base.DBInterface,
|
|
274
261
|
run_uid: str,
|
|
275
262
|
project: str,
|
|
276
263
|
notification: mlrun.model.Notification,
|
|
277
264
|
status: str = None,
|
|
278
265
|
sent_time: typing.Optional[datetime.datetime] = None,
|
|
279
266
|
):
|
|
280
|
-
|
|
281
|
-
# nothing to update if not running as api
|
|
282
|
-
# note, the notification mechanism may run "locally" for certain runtimes
|
|
283
|
-
if not mlrun.config.is_running_as_api():
|
|
284
|
-
return
|
|
285
|
-
|
|
286
|
-
# TODO: move to api side
|
|
287
|
-
db_session = mlrun.api.db.session.create_session()
|
|
267
|
+
db = mlrun.get_run_db()
|
|
288
268
|
notification.status = status or notification.status
|
|
289
269
|
notification.sent_time = sent_time or notification.sent_time
|
|
290
270
|
|
|
291
|
-
#
|
|
271
|
+
# There is no need to mask the params as the secrets are already loaded
|
|
292
272
|
db.store_run_notifications(
|
|
293
|
-
db_session,
|
|
294
273
|
[notification],
|
|
295
274
|
run_uid,
|
|
296
275
|
project,
|
|
276
|
+
mask_params=False,
|
|
297
277
|
)
|
|
298
278
|
|
|
299
279
|
|
mlrun/utils/regex.py
CHANGED
|
@@ -72,8 +72,8 @@ sparkjob_name = label_value + sprakjob_length + sparkjob_service_name
|
|
|
72
72
|
# A project name have the following restrictions:
|
|
73
73
|
# It should be a valid Nuclio Project CRD name which is dns 1123 subdomain
|
|
74
74
|
# It should be a valid k8s label value since Nuclio use the project name in labels of resources
|
|
75
|
-
# It should be a valid namespace name (
|
|
76
|
-
# of the 3 restrictions, dns 1123 label is
|
|
75
|
+
# It should be a valid namespace name (because we plan to map it to one) which is dns 1123 label
|
|
76
|
+
# of the 3 restrictions, dns 1123 label is strictest, so we enforce only it
|
|
77
77
|
project_name = dns_1123_label
|
|
78
78
|
|
|
79
79
|
# Special characters are not permitted in tag names because they can be included in the url and cause problems.
|
|
@@ -83,3 +83,8 @@ tag_name = label_value
|
|
|
83
83
|
secret_key = k8s_secret_and_config_map_key
|
|
84
84
|
|
|
85
85
|
artifact_key = [r"[^\/\\]+$"]
|
|
86
|
+
|
|
87
|
+
# must not start with _
|
|
88
|
+
# must be alphanumeric or _
|
|
89
|
+
# max 256 length
|
|
90
|
+
v3io_stream_consumer_group = [r"^(?!_)[a-zA-Z0-9_]{1,256}$"]
|
mlrun/utils/version/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mlrun
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.0rc2
|
|
4
4
|
Summary: Tracking and config of machine learning runs
|
|
5
5
|
Home-page: https://github.com/mlrun/mlrun
|
|
6
6
|
Author: Yaron Haviv
|
|
@@ -48,11 +48,12 @@ Requires-Dist: semver (~=2.13)
|
|
|
48
48
|
Requires-Dist: dask (~=2021.11.2)
|
|
49
49
|
Requires-Dist: distributed (~=2021.11.2)
|
|
50
50
|
Requires-Dist: kubernetes (~=12.0)
|
|
51
|
+
Requires-Dist: dependency-injector (~=4.41)
|
|
51
52
|
Requires-Dist: humanfriendly (~=9.2)
|
|
52
53
|
Requires-Dist: fastapi (~=0.95.2)
|
|
53
|
-
Requires-Dist: fsspec (~=2023.
|
|
54
|
+
Requires-Dist: fsspec (~=2023.6.0)
|
|
54
55
|
Requires-Dist: v3iofs (~=0.1.15)
|
|
55
|
-
Requires-Dist: storey (~=1.5.
|
|
56
|
+
Requires-Dist: storey (~=1.5.2)
|
|
56
57
|
Requires-Dist: deepdiff (~=5.0)
|
|
57
58
|
Requires-Dist: pymysql (~=1.0)
|
|
58
59
|
Requires-Dist: inflection (~=0.5.0)
|
|
@@ -61,16 +62,16 @@ Requires-Dist: setuptools (~=65.5)
|
|
|
61
62
|
Requires-Dist: deprecated (~=1.2)
|
|
62
63
|
Requires-Dist: jinja2 (~=3.1)
|
|
63
64
|
Provides-Extra: all
|
|
64
|
-
Requires-Dist: adlfs (~=
|
|
65
|
-
Requires-Dist: aiobotocore (~=2.
|
|
65
|
+
Requires-Dist: adlfs (~=2023.4.0) ; extra == 'all'
|
|
66
|
+
Requires-Dist: aiobotocore (~=2.5.2) ; extra == 'all'
|
|
66
67
|
Requires-Dist: avro (~=1.11) ; extra == 'all'
|
|
67
68
|
Requires-Dist: azure-core (~=1.24) ; extra == 'all'
|
|
68
69
|
Requires-Dist: azure-identity (~=1.5) ; extra == 'all'
|
|
69
70
|
Requires-Dist: azure-keyvault-secrets (~=4.2) ; extra == 'all'
|
|
70
71
|
Requires-Dist: azure-storage-blob (~=12.13) ; extra == 'all'
|
|
71
72
|
Requires-Dist: bokeh (>=2.4.2,~=2.4) ; extra == 'all'
|
|
72
|
-
Requires-Dist: boto3 (~=1.
|
|
73
|
-
Requires-Dist: gcsfs (~=2023.
|
|
73
|
+
Requires-Dist: boto3 (~=1.26.161) ; extra == 'all'
|
|
74
|
+
Requires-Dist: gcsfs (~=2023.6.0) ; extra == 'all'
|
|
74
75
|
Requires-Dist: google-cloud-bigquery[bqstorage,pandas] (~=3.2) ; extra == 'all'
|
|
75
76
|
Requires-Dist: google-cloud-storage (~=1.20) ; extra == 'all'
|
|
76
77
|
Requires-Dist: google-cloud (~=0.34) ; extra == 'all'
|
|
@@ -80,7 +81,7 @@ Requires-Dist: msrest (~=0.6.21) ; extra == 'all'
|
|
|
80
81
|
Requires-Dist: plotly (<5.12.0,~=5.4) ; extra == 'all'
|
|
81
82
|
Requires-Dist: pyopenssl (>=23) ; extra == 'all'
|
|
82
83
|
Requires-Dist: redis (~=4.3) ; extra == 'all'
|
|
83
|
-
Requires-Dist: s3fs (~=2023.
|
|
84
|
+
Requires-Dist: s3fs (~=2023.6.0) ; extra == 'all'
|
|
84
85
|
Provides-Extra: api
|
|
85
86
|
Requires-Dist: uvicorn (~=0.20.0) ; extra == 'api'
|
|
86
87
|
Requires-Dist: dask-kubernetes (~=0.11.0) ; extra == 'api'
|
|
@@ -92,7 +93,7 @@ Provides-Extra: azure-blob-storage
|
|
|
92
93
|
Requires-Dist: msrest (~=0.6.21) ; extra == 'azure-blob-storage'
|
|
93
94
|
Requires-Dist: azure-core (~=1.24) ; extra == 'azure-blob-storage'
|
|
94
95
|
Requires-Dist: azure-storage-blob (~=12.13) ; extra == 'azure-blob-storage'
|
|
95
|
-
Requires-Dist: adlfs (~=
|
|
96
|
+
Requires-Dist: adlfs (~=2023.4.0) ; extra == 'azure-blob-storage'
|
|
96
97
|
Requires-Dist: pyopenssl (>=23) ; extra == 'azure-blob-storage'
|
|
97
98
|
Provides-Extra: azure-key-vault
|
|
98
99
|
Requires-Dist: azure-identity (~=1.5) ; extra == 'azure-key-vault'
|
|
@@ -101,15 +102,15 @@ Requires-Dist: pyopenssl (>=23) ; extra == 'azure-key-vault'
|
|
|
101
102
|
Provides-Extra: bokeh
|
|
102
103
|
Requires-Dist: bokeh (>=2.4.2,~=2.4) ; extra == 'bokeh'
|
|
103
104
|
Provides-Extra: complete
|
|
104
|
-
Requires-Dist: adlfs (~=
|
|
105
|
-
Requires-Dist: aiobotocore (~=2.
|
|
105
|
+
Requires-Dist: adlfs (~=2023.4.0) ; extra == 'complete'
|
|
106
|
+
Requires-Dist: aiobotocore (~=2.5.2) ; extra == 'complete'
|
|
106
107
|
Requires-Dist: avro (~=1.11) ; extra == 'complete'
|
|
107
108
|
Requires-Dist: azure-core (~=1.24) ; extra == 'complete'
|
|
108
109
|
Requires-Dist: azure-identity (~=1.5) ; extra == 'complete'
|
|
109
110
|
Requires-Dist: azure-keyvault-secrets (~=4.2) ; extra == 'complete'
|
|
110
111
|
Requires-Dist: azure-storage-blob (~=12.13) ; extra == 'complete'
|
|
111
|
-
Requires-Dist: boto3 (~=1.
|
|
112
|
-
Requires-Dist: gcsfs (~=2023.
|
|
112
|
+
Requires-Dist: boto3 (~=1.26.161) ; extra == 'complete'
|
|
113
|
+
Requires-Dist: gcsfs (~=2023.6.0) ; extra == 'complete'
|
|
113
114
|
Requires-Dist: google-cloud-bigquery[bqstorage,pandas] (~=3.2) ; extra == 'complete'
|
|
114
115
|
Requires-Dist: graphviz (~=0.20.0) ; extra == 'complete'
|
|
115
116
|
Requires-Dist: kafka-python (~=2.0) ; extra == 'complete'
|
|
@@ -117,19 +118,19 @@ Requires-Dist: msrest (~=0.6.21) ; extra == 'complete'
|
|
|
117
118
|
Requires-Dist: plotly (<5.12.0,~=5.4) ; extra == 'complete'
|
|
118
119
|
Requires-Dist: pyopenssl (>=23) ; extra == 'complete'
|
|
119
120
|
Requires-Dist: redis (~=4.3) ; extra == 'complete'
|
|
120
|
-
Requires-Dist: s3fs (~=2023.
|
|
121
|
+
Requires-Dist: s3fs (~=2023.6.0) ; extra == 'complete'
|
|
121
122
|
Provides-Extra: complete-api
|
|
122
|
-
Requires-Dist: adlfs (~=
|
|
123
|
-
Requires-Dist: aiobotocore (~=2.
|
|
123
|
+
Requires-Dist: adlfs (~=2023.4.0) ; extra == 'complete-api'
|
|
124
|
+
Requires-Dist: aiobotocore (~=2.5.2) ; extra == 'complete-api'
|
|
124
125
|
Requires-Dist: apscheduler (~=3.6) ; extra == 'complete-api'
|
|
125
126
|
Requires-Dist: avro (~=1.11) ; extra == 'complete-api'
|
|
126
127
|
Requires-Dist: azure-core (~=1.24) ; extra == 'complete-api'
|
|
127
128
|
Requires-Dist: azure-identity (~=1.5) ; extra == 'complete-api'
|
|
128
129
|
Requires-Dist: azure-keyvault-secrets (~=4.2) ; extra == 'complete-api'
|
|
129
130
|
Requires-Dist: azure-storage-blob (~=12.13) ; extra == 'complete-api'
|
|
130
|
-
Requires-Dist: boto3 (~=1.
|
|
131
|
+
Requires-Dist: boto3 (~=1.26.161) ; extra == 'complete-api'
|
|
131
132
|
Requires-Dist: dask-kubernetes (~=0.11.0) ; extra == 'complete-api'
|
|
132
|
-
Requires-Dist: gcsfs (~=2023.
|
|
133
|
+
Requires-Dist: gcsfs (~=2023.6.0) ; extra == 'complete-api'
|
|
133
134
|
Requires-Dist: google-cloud-bigquery[bqstorage,pandas] (~=3.2) ; extra == 'complete-api'
|
|
134
135
|
Requires-Dist: graphviz (~=0.20.0) ; extra == 'complete-api'
|
|
135
136
|
Requires-Dist: igz-mgmt (~=0.0.10) ; extra == 'complete-api'
|
|
@@ -139,7 +140,7 @@ Requires-Dist: objgraph (~=3.5) ; extra == 'complete-api'
|
|
|
139
140
|
Requires-Dist: plotly (<5.12.0,~=5.4) ; extra == 'complete-api'
|
|
140
141
|
Requires-Dist: pyopenssl (>=23) ; extra == 'complete-api'
|
|
141
142
|
Requires-Dist: redis (~=4.3) ; extra == 'complete-api'
|
|
142
|
-
Requires-Dist: s3fs (~=2023.
|
|
143
|
+
Requires-Dist: s3fs (~=2023.6.0) ; extra == 'complete-api'
|
|
143
144
|
Requires-Dist: sqlite3-to-mysql (~=1.4) ; extra == 'complete-api'
|
|
144
145
|
Requires-Dist: uvicorn (~=0.20.0) ; extra == 'complete-api'
|
|
145
146
|
Provides-Extra: google-cloud
|
|
@@ -149,7 +150,7 @@ Requires-Dist: google-cloud (~=0.34) ; extra == 'google-cloud'
|
|
|
149
150
|
Provides-Extra: google-cloud-bigquery
|
|
150
151
|
Requires-Dist: google-cloud-bigquery[bqstorage,pandas] (~=3.2) ; extra == 'google-cloud-bigquery'
|
|
151
152
|
Provides-Extra: google-cloud-storage
|
|
152
|
-
Requires-Dist: gcsfs (~=2023.
|
|
153
|
+
Requires-Dist: gcsfs (~=2023.6.0) ; extra == 'google-cloud-storage'
|
|
153
154
|
Provides-Extra: graphviz
|
|
154
155
|
Requires-Dist: graphviz (~=0.20.0) ; extra == 'graphviz'
|
|
155
156
|
Provides-Extra: kafka
|
|
@@ -160,9 +161,9 @@ Requires-Dist: plotly (<5.12.0,~=5.4) ; extra == 'plotly'
|
|
|
160
161
|
Provides-Extra: redis
|
|
161
162
|
Requires-Dist: redis (~=4.3) ; extra == 'redis'
|
|
162
163
|
Provides-Extra: s3
|
|
163
|
-
Requires-Dist: boto3 (~=1.
|
|
164
|
-
Requires-Dist: aiobotocore (~=2.
|
|
165
|
-
Requires-Dist: s3fs (~=2023.
|
|
164
|
+
Requires-Dist: boto3 (~=1.26.161) ; extra == 's3'
|
|
165
|
+
Requires-Dist: aiobotocore (~=2.5.2) ; extra == 's3'
|
|
166
|
+
Requires-Dist: s3fs (~=2023.6.0) ; extra == 's3'
|
|
166
167
|
|
|
167
168
|
<a id="top"></a>
|
|
168
169
|
[](https://github.com/mlrun/mlrun/actions)
|