mlrun 1.4.0rc25__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 +3 -41
- 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/frontend_spec.py +2 -1
- mlrun/api/api/endpoints/functions.py +95 -59
- mlrun/api/api/endpoints/grafana_proxy.py +9 -9
- mlrun/api/api/endpoints/logs.py +17 -3
- mlrun/api/api/endpoints/model_endpoints.py +3 -2
- 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/submit.py +2 -1
- mlrun/api/api/endpoints/workflows.py +355 -0
- mlrun/api/api/utils.py +3 -4
- mlrun/api/crud/__init__.py +1 -0
- mlrun/api/crud/client_spec.py +6 -2
- mlrun/api/crud/feature_store.py +5 -0
- mlrun/api/crud/model_monitoring/__init__.py +1 -0
- mlrun/api/crud/model_monitoring/deployment.py +497 -0
- mlrun/api/crud/model_monitoring/grafana.py +96 -42
- mlrun/api/crud/model_monitoring/helpers.py +159 -0
- mlrun/api/crud/model_monitoring/model_endpoints.py +202 -476
- mlrun/api/crud/notifications.py +9 -4
- mlrun/api/crud/pipelines.py +6 -11
- mlrun/api/crud/projects.py +2 -2
- mlrun/api/crud/runtime_resources.py +4 -3
- mlrun/api/crud/runtimes/nuclio/helpers.py +5 -1
- mlrun/api/crud/secrets.py +21 -0
- mlrun/api/crud/workflows.py +352 -0
- mlrun/api/db/base.py +16 -1
- mlrun/api/db/init_db.py +2 -4
- mlrun/api/db/session.py +1 -1
- mlrun/api/db/sqldb/db.py +129 -31
- mlrun/api/db/sqldb/models/models_mysql.py +15 -1
- mlrun/api/db/sqldb/models/models_sqlite.py +16 -2
- mlrun/api/launcher.py +38 -6
- mlrun/api/main.py +3 -2
- mlrun/api/rundb/__init__.py +13 -0
- mlrun/{db → api/rundb}/sqldb.py +36 -84
- 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/schemas/__init__.py +17 -6
- mlrun/api/utils/builder.py +1 -4
- mlrun/api/utils/clients/chief.py +14 -0
- mlrun/api/utils/clients/iguazio.py +33 -33
- mlrun/api/utils/clients/nuclio.py +2 -2
- mlrun/api/utils/periodic.py +9 -2
- mlrun/api/utils/projects/follower.py +14 -7
- mlrun/api/utils/projects/leader.py +2 -1
- mlrun/api/utils/projects/remotes/nop_follower.py +2 -2
- mlrun/api/utils/projects/remotes/nop_leader.py +2 -2
- mlrun/api/utils/runtimes/__init__.py +14 -0
- mlrun/api/utils/runtimes/nuclio.py +43 -0
- mlrun/api/utils/scheduler.py +98 -15
- mlrun/api/utils/singletons/db.py +5 -1
- mlrun/api/utils/singletons/project_member.py +4 -1
- mlrun/api/utils/singletons/scheduler.py +1 -1
- mlrun/artifacts/base.py +6 -6
- mlrun/artifacts/dataset.py +4 -4
- mlrun/artifacts/manager.py +2 -3
- mlrun/artifacts/model.py +2 -2
- mlrun/artifacts/plots.py +8 -8
- mlrun/common/db/__init__.py +14 -0
- mlrun/common/helpers.py +37 -0
- mlrun/{mlutils → common/model_monitoring}/__init__.py +3 -2
- mlrun/common/model_monitoring/helpers.py +69 -0
- mlrun/common/schemas/__init__.py +13 -1
- mlrun/common/schemas/auth.py +4 -1
- mlrun/common/schemas/client_spec.py +1 -1
- mlrun/common/schemas/function.py +17 -0
- mlrun/common/schemas/model_monitoring/__init__.py +48 -0
- mlrun/common/{model_monitoring.py → schemas/model_monitoring/constants.py} +11 -23
- mlrun/common/schemas/model_monitoring/grafana.py +55 -0
- mlrun/common/schemas/{model_endpoints.py → model_monitoring/model_endpoints.py} +32 -65
- mlrun/common/schemas/notification.py +1 -0
- mlrun/common/schemas/object.py +4 -0
- mlrun/common/schemas/project.py +1 -0
- mlrun/common/schemas/regex.py +1 -1
- mlrun/common/schemas/runs.py +1 -8
- mlrun/common/schemas/schedule.py +1 -8
- mlrun/common/schemas/workflow.py +54 -0
- mlrun/config.py +45 -42
- mlrun/datastore/__init__.py +21 -0
- mlrun/datastore/base.py +1 -1
- mlrun/datastore/datastore.py +9 -0
- mlrun/datastore/dbfs_store.py +168 -0
- mlrun/datastore/helpers.py +18 -0
- mlrun/datastore/sources.py +1 -0
- mlrun/datastore/store_resources.py +2 -5
- mlrun/datastore/v3io.py +1 -2
- mlrun/db/__init__.py +4 -68
- mlrun/db/base.py +12 -0
- mlrun/db/factory.py +65 -0
- mlrun/db/httpdb.py +175 -20
- 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/common.py +2 -1
- mlrun/feature_store/feature_set.py +1 -11
- 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 +22 -16
- mlrun/kfpops.py +3 -9
- mlrun/launcher/base.py +57 -53
- mlrun/launcher/client.py +5 -4
- mlrun/launcher/factory.py +24 -13
- mlrun/launcher/local.py +6 -6
- mlrun/launcher/remote.py +4 -4
- mlrun/lists.py +0 -11
- mlrun/model.py +11 -17
- mlrun/model_monitoring/__init__.py +2 -22
- mlrun/model_monitoring/features_drift_table.py +1 -1
- mlrun/model_monitoring/helpers.py +22 -210
- mlrun/model_monitoring/model_endpoint.py +1 -1
- mlrun/model_monitoring/model_monitoring_batch.py +127 -50
- mlrun/model_monitoring/prometheus.py +219 -0
- mlrun/model_monitoring/stores/__init__.py +16 -11
- mlrun/model_monitoring/stores/kv_model_endpoint_store.py +95 -23
- mlrun/model_monitoring/stores/models/mysql.py +47 -29
- mlrun/model_monitoring/stores/models/sqlite.py +47 -29
- mlrun/model_monitoring/stores/sql_model_endpoint_store.py +31 -19
- mlrun/model_monitoring/{stream_processing_fs.py → stream_processing.py} +206 -64
- mlrun/model_monitoring/tracking_policy.py +104 -0
- mlrun/package/packager.py +6 -8
- mlrun/package/packagers/default_packager.py +121 -10
- mlrun/package/packagers/numpy_packagers.py +1 -1
- mlrun/platforms/__init__.py +0 -2
- mlrun/platforms/iguazio.py +0 -56
- mlrun/projects/pipelines.py +53 -159
- mlrun/projects/project.py +10 -37
- mlrun/render.py +1 -1
- mlrun/run.py +8 -124
- mlrun/runtimes/__init__.py +6 -42
- mlrun/runtimes/base.py +29 -1249
- mlrun/runtimes/daskjob.py +2 -198
- mlrun/runtimes/funcdoc.py +0 -9
- mlrun/runtimes/function.py +25 -29
- mlrun/runtimes/kubejob.py +5 -29
- mlrun/runtimes/local.py +1 -1
- 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 +28 -18
- mlrun/runtimes/remotesparkjob.py +1 -15
- mlrun/runtimes/serving.py +14 -6
- mlrun/runtimes/sparkjob/__init__.py +0 -1
- mlrun/runtimes/sparkjob/abstract.py +4 -131
- mlrun/runtimes/utils.py +0 -26
- mlrun/serving/routers.py +7 -7
- mlrun/serving/server.py +11 -8
- mlrun/serving/states.py +7 -1
- mlrun/serving/v2_serving.py +6 -6
- mlrun/utils/helpers.py +23 -42
- mlrun/utils/notifications/notification/__init__.py +4 -0
- mlrun/utils/notifications/notification/webhook.py +61 -0
- mlrun/utils/notifications/notification_pusher.py +5 -25
- mlrun/utils/regex.py +7 -2
- mlrun/utils/version/version.json +2 -2
- {mlrun-1.4.0rc25.dist-info → mlrun-1.5.0rc2.dist-info}/METADATA +26 -25
- {mlrun-1.4.0rc25.dist-info → mlrun-1.5.0rc2.dist-info}/RECORD +180 -158
- {mlrun-1.4.0rc25.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/utils/model_monitoring.py +0 -249
- /mlrun/{api/db/sqldb/session.py → common/db/sql_session.py} +0 -0
- {mlrun-1.4.0rc25.dist-info → mlrun-1.5.0rc2.dist-info}/LICENSE +0 -0
- {mlrun-1.4.0rc25.dist-info → mlrun-1.5.0rc2.dist-info}/entry_points.txt +0 -0
- {mlrun-1.4.0rc25.dist-info → mlrun-1.5.0rc2.dist-info}/top_level.txt +0 -0
mlrun/db/httpdb.py
CHANGED
|
@@ -18,19 +18,19 @@ import tempfile
|
|
|
18
18
|
import time
|
|
19
19
|
import traceback
|
|
20
20
|
import typing
|
|
21
|
-
import warnings
|
|
22
21
|
from datetime import datetime
|
|
23
22
|
from os import path, remove
|
|
24
23
|
from typing import Dict, List, Optional, Union
|
|
24
|
+
from urllib.parse import urlparse
|
|
25
25
|
|
|
26
26
|
import kfp
|
|
27
27
|
import requests
|
|
28
28
|
import semver
|
|
29
29
|
|
|
30
30
|
import mlrun
|
|
31
|
-
import mlrun.api.utils.helpers
|
|
32
31
|
import mlrun.common.schemas
|
|
33
32
|
import mlrun.model_monitoring.model_endpoint
|
|
33
|
+
import mlrun.platforms
|
|
34
34
|
import mlrun.projects
|
|
35
35
|
from mlrun.errors import MLRunInvalidArgumentError, err_to_str
|
|
36
36
|
|
|
@@ -107,11 +107,7 @@ class HTTPRunDB(RunDBInterface):
|
|
|
107
107
|
r"\/?run\/.+\/.+",
|
|
108
108
|
]
|
|
109
109
|
|
|
110
|
-
def __init__(self,
|
|
111
|
-
self.base_url = base_url
|
|
112
|
-
self.user = user
|
|
113
|
-
self.password = password
|
|
114
|
-
self.token = token
|
|
110
|
+
def __init__(self, url):
|
|
115
111
|
self.server_version = ""
|
|
116
112
|
self.session = None
|
|
117
113
|
self._wait_for_project_terminal_state_retry_interval = 3
|
|
@@ -120,6 +116,33 @@ class HTTPRunDB(RunDBInterface):
|
|
|
120
116
|
self.client_version = version.Version().get()["version"]
|
|
121
117
|
self.python_version = str(version.Version().get_python_version())
|
|
122
118
|
|
|
119
|
+
self._enrich_and_validate(url)
|
|
120
|
+
|
|
121
|
+
def _enrich_and_validate(self, url):
|
|
122
|
+
parsed_url = urlparse(url)
|
|
123
|
+
scheme = parsed_url.scheme.lower()
|
|
124
|
+
if scheme not in ("http", "https"):
|
|
125
|
+
raise ValueError(
|
|
126
|
+
f"Invalid URL scheme {scheme} for HTTPRunDB, only http(s) is supported"
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
endpoint = parsed_url.hostname
|
|
130
|
+
if parsed_url.port:
|
|
131
|
+
endpoint += f":{parsed_url.port}"
|
|
132
|
+
base_url = f"{parsed_url.scheme}://{endpoint}{parsed_url.path}"
|
|
133
|
+
|
|
134
|
+
username = parsed_url.username or config.httpdb.user
|
|
135
|
+
password = parsed_url.password or config.httpdb.password
|
|
136
|
+
|
|
137
|
+
username, password, token = mlrun.platforms.add_or_refresh_credentials(
|
|
138
|
+
parsed_url.hostname, username, password, config.httpdb.token
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
self.base_url = base_url
|
|
142
|
+
self.user = username
|
|
143
|
+
self.password = password
|
|
144
|
+
self.token = token
|
|
145
|
+
|
|
123
146
|
def __repr__(self):
|
|
124
147
|
cls = self.__class__.__name__
|
|
125
148
|
return f"{cls}({self.base_url!r})"
|
|
@@ -416,6 +439,10 @@ class HTTPRunDB(RunDBInterface):
|
|
|
416
439
|
)
|
|
417
440
|
config.function = server_cfg.get("function") or config.function
|
|
418
441
|
config.httpdb.logs = server_cfg.get("logs") or config.httpdb.logs
|
|
442
|
+
config.model_endpoint_monitoring.store_type = (
|
|
443
|
+
server_cfg.get("model_endpoint_monitoring_store_type")
|
|
444
|
+
or config.model_endpoint_monitoring.store_type
|
|
445
|
+
)
|
|
419
446
|
|
|
420
447
|
except Exception as exc:
|
|
421
448
|
logger.warning(
|
|
@@ -1353,8 +1380,6 @@ class HTTPRunDB(RunDBInterface):
|
|
|
1353
1380
|
namespace=None,
|
|
1354
1381
|
artifact_path=None,
|
|
1355
1382
|
ops=None,
|
|
1356
|
-
# TODO: deprecated, remove in 1.5.0
|
|
1357
|
-
ttl=None,
|
|
1358
1383
|
cleanup_ttl=None,
|
|
1359
1384
|
):
|
|
1360
1385
|
"""Submit a KFP pipeline for execution.
|
|
@@ -1367,27 +1392,17 @@ class HTTPRunDB(RunDBInterface):
|
|
|
1367
1392
|
:param namespace: Kubernetes namespace to execute the pipeline in.
|
|
1368
1393
|
:param artifact_path: A path to artifacts used by this pipeline.
|
|
1369
1394
|
:param ops: Transformers to apply on all ops in the pipeline.
|
|
1370
|
-
:param ttl: pipeline cleanup ttl in secs (time to wait after workflow completion, at which point the workflow
|
|
1371
|
-
and all its resources are deleted) (deprecated, use cleanup_ttl instead)
|
|
1372
1395
|
:param cleanup_ttl: pipeline cleanup ttl in secs (time to wait after workflow completion, at which point the
|
|
1373
1396
|
workflow and all its resources are deleted)
|
|
1374
1397
|
"""
|
|
1375
1398
|
|
|
1376
|
-
if ttl:
|
|
1377
|
-
warnings.warn(
|
|
1378
|
-
"'ttl' is deprecated, use 'cleanup_ttl' instead. "
|
|
1379
|
-
"This will be removed in 1.5.0",
|
|
1380
|
-
# TODO: Remove this in 1.5.0
|
|
1381
|
-
FutureWarning,
|
|
1382
|
-
)
|
|
1383
|
-
|
|
1384
1399
|
if isinstance(pipeline, str):
|
|
1385
1400
|
pipe_file = pipeline
|
|
1386
1401
|
else:
|
|
1387
1402
|
pipe_file = tempfile.NamedTemporaryFile(suffix=".yaml", delete=False).name
|
|
1388
1403
|
conf = new_pipe_metadata(
|
|
1389
1404
|
artifact_path=artifact_path,
|
|
1390
|
-
cleanup_ttl=cleanup_ttl
|
|
1405
|
+
cleanup_ttl=cleanup_ttl,
|
|
1391
1406
|
op_transformers=ops,
|
|
1392
1407
|
)
|
|
1393
1408
|
kfp.compiler.Compiler().compile(
|
|
@@ -3085,6 +3100,146 @@ class HTTPRunDB(RunDBInterface):
|
|
|
3085
3100
|
},
|
|
3086
3101
|
)
|
|
3087
3102
|
|
|
3103
|
+
def store_run_notifications(
|
|
3104
|
+
self,
|
|
3105
|
+
notification_objects: typing.List[mlrun.model.Notification],
|
|
3106
|
+
run_uid: str,
|
|
3107
|
+
project: str = None,
|
|
3108
|
+
mask_params: bool = True,
|
|
3109
|
+
):
|
|
3110
|
+
"""
|
|
3111
|
+
For internal use.
|
|
3112
|
+
The notification mechanism may run "locally" for certain runtimes.
|
|
3113
|
+
However, the updates occur in the API so nothing to do here.
|
|
3114
|
+
"""
|
|
3115
|
+
pass
|
|
3116
|
+
|
|
3117
|
+
def submit_workflow(
|
|
3118
|
+
self,
|
|
3119
|
+
project: str,
|
|
3120
|
+
name: str,
|
|
3121
|
+
workflow_spec: Union[
|
|
3122
|
+
mlrun.projects.pipelines.WorkflowSpec,
|
|
3123
|
+
mlrun.common.schemas.WorkflowSpec,
|
|
3124
|
+
dict,
|
|
3125
|
+
],
|
|
3126
|
+
arguments: Optional[Dict] = None,
|
|
3127
|
+
artifact_path: Optional[str] = None,
|
|
3128
|
+
source: Optional[str] = None,
|
|
3129
|
+
run_name: Optional[str] = None,
|
|
3130
|
+
namespace: Optional[str] = None,
|
|
3131
|
+
):
|
|
3132
|
+
"""
|
|
3133
|
+
Submitting workflow for a remote execution.
|
|
3134
|
+
|
|
3135
|
+
:param project: project name
|
|
3136
|
+
:param name: workflow name
|
|
3137
|
+
:param workflow_spec: the workflow spec to execute
|
|
3138
|
+
:param arguments: arguments for the workflow
|
|
3139
|
+
:param artifact_path: artifact target path of the workflow
|
|
3140
|
+
:param source: source url of the project
|
|
3141
|
+
:param run_name: run name to override the default: 'workflow-runner-<workflow name>'
|
|
3142
|
+
:param namespace: kubernetes namespace if other than default
|
|
3143
|
+
|
|
3144
|
+
:returns: :py:class:`~mlrun.common.schemas.WorkflowResponse`.
|
|
3145
|
+
"""
|
|
3146
|
+
image = (
|
|
3147
|
+
workflow_spec.image
|
|
3148
|
+
if hasattr(workflow_spec, "image")
|
|
3149
|
+
else workflow_spec.get("image", None)
|
|
3150
|
+
)
|
|
3151
|
+
req = {
|
|
3152
|
+
"arguments": arguments,
|
|
3153
|
+
"artifact_path": artifact_path,
|
|
3154
|
+
"source": source,
|
|
3155
|
+
"run_name": run_name,
|
|
3156
|
+
"namespace": namespace,
|
|
3157
|
+
}
|
|
3158
|
+
if isinstance(workflow_spec, mlrun.common.schemas.WorkflowSpec):
|
|
3159
|
+
req["spec"] = workflow_spec.dict()
|
|
3160
|
+
elif isinstance(workflow_spec, mlrun.projects.pipelines.WorkflowSpec):
|
|
3161
|
+
req["spec"] = workflow_spec.to_dict()
|
|
3162
|
+
else:
|
|
3163
|
+
req["spec"] = workflow_spec
|
|
3164
|
+
req["spec"]["image"] = image
|
|
3165
|
+
response = self.api_call(
|
|
3166
|
+
"POST",
|
|
3167
|
+
f"projects/{project}/workflows/{name}/submit",
|
|
3168
|
+
json=req,
|
|
3169
|
+
)
|
|
3170
|
+
return mlrun.common.schemas.WorkflowResponse(**response.json())
|
|
3171
|
+
|
|
3172
|
+
def get_workflow_id(
|
|
3173
|
+
self,
|
|
3174
|
+
project: str,
|
|
3175
|
+
name: str,
|
|
3176
|
+
run_id: str,
|
|
3177
|
+
engine: str = "",
|
|
3178
|
+
):
|
|
3179
|
+
"""
|
|
3180
|
+
Retrieve workflow id from the uid of the workflow runner.
|
|
3181
|
+
|
|
3182
|
+
:param project: project name
|
|
3183
|
+
:param name: workflow name
|
|
3184
|
+
:param run_id: the id of the workflow runner - the job that runs the workflow
|
|
3185
|
+
:param engine: pipeline runner
|
|
3186
|
+
|
|
3187
|
+
:returns: :py:class:`~mlrun.common.schemas.GetWorkflowResponse`.
|
|
3188
|
+
"""
|
|
3189
|
+
params = {}
|
|
3190
|
+
if engine:
|
|
3191
|
+
params["engine"] = engine
|
|
3192
|
+
response = self.api_call(
|
|
3193
|
+
"GET",
|
|
3194
|
+
f"projects/{project}/workflows/{name}/runs/{run_id}",
|
|
3195
|
+
params=params,
|
|
3196
|
+
)
|
|
3197
|
+
return mlrun.common.schemas.GetWorkflowResponse(**response.json())
|
|
3198
|
+
|
|
3199
|
+
def load_project(
|
|
3200
|
+
self,
|
|
3201
|
+
name: str,
|
|
3202
|
+
url: str,
|
|
3203
|
+
secrets: Optional[Dict] = None,
|
|
3204
|
+
save_secrets: bool = True,
|
|
3205
|
+
) -> str:
|
|
3206
|
+
"""
|
|
3207
|
+
Loading a project remotely from the given source.
|
|
3208
|
+
:param name: project name
|
|
3209
|
+
:param url: git or tar.gz or .zip sources archive path e.g.:
|
|
3210
|
+
git://github.com/mlrun/demo-xgb-project.git
|
|
3211
|
+
http://mysite/archived-project.zip
|
|
3212
|
+
The git project should include the project yaml file.
|
|
3213
|
+
:param secrets: Secrets to store in project in order to load it from the provided url.
|
|
3214
|
+
For more information see :py:func:`mlrun.load_project` function.
|
|
3215
|
+
:param save_secrets: Whether to store secrets in the loaded project.
|
|
3216
|
+
Setting to False will cause waiting for the process completion.
|
|
3217
|
+
|
|
3218
|
+
:returns: The terminal state of load project process.
|
|
3219
|
+
"""
|
|
3220
|
+
params = {"url": url}
|
|
3221
|
+
body = None
|
|
3222
|
+
if secrets:
|
|
3223
|
+
provider = mlrun.common.schemas.SecretProviderName.kubernetes
|
|
3224
|
+
secrets_input = mlrun.common.schemas.SecretsData(
|
|
3225
|
+
provider=provider, secrets=secrets
|
|
3226
|
+
)
|
|
3227
|
+
body = secrets_input.dict()
|
|
3228
|
+
response = self.api_call(
|
|
3229
|
+
"POST", f"projects/{name}/load", params=params, body=dict_to_json(body)
|
|
3230
|
+
)
|
|
3231
|
+
response = response.json()
|
|
3232
|
+
run = mlrun.RunObject.from_dict(response["data"])
|
|
3233
|
+
state, _ = run.logs()
|
|
3234
|
+
|
|
3235
|
+
if secrets and not save_secrets:
|
|
3236
|
+
self.delete_project_secrets(project=name, secrets=list(secrets.keys()))
|
|
3237
|
+
if state != "completed":
|
|
3238
|
+
logger.error("Load project task failed, deleting project")
|
|
3239
|
+
self.delete_project(name, mlrun.common.schemas.DeletionStrategy.cascade)
|
|
3240
|
+
|
|
3241
|
+
return state
|
|
3242
|
+
|
|
3088
3243
|
|
|
3089
3244
|
def _as_json(obj):
|
|
3090
3245
|
fn = getattr(obj, "to_json", None)
|
mlrun/db/nopdb.py
CHANGED
|
@@ -31,7 +31,7 @@ class NopDB(RunDBInterface):
|
|
|
31
31
|
def __getattribute__(self, attr):
|
|
32
32
|
def nop(*args, **kwargs):
|
|
33
33
|
env_var_message = (
|
|
34
|
-
"MLRUN_DBPATH is
|
|
34
|
+
"MLRUN_DBPATH is misconfigured. Set this environment variable to the URL of the API "
|
|
35
35
|
"server in order to connect"
|
|
36
36
|
)
|
|
37
37
|
if config.httpdb.nop_db.raise_error:
|
|
@@ -45,7 +45,8 @@ class NopDB(RunDBInterface):
|
|
|
45
45
|
|
|
46
46
|
return
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
# ignore __class__ because __getattribute__ overrides the parent class's method and it spams logs
|
|
49
|
+
if attr in ["connect", "__class__"]:
|
|
49
50
|
return super().__getattribute__(attr)
|
|
50
51
|
else:
|
|
51
52
|
nop()
|
|
@@ -93,6 +94,7 @@ class NopDB(RunDBInterface):
|
|
|
93
94
|
mlrun.common.schemas.OrderType, str
|
|
94
95
|
] = mlrun.common.schemas.OrderType.desc,
|
|
95
96
|
max_partitions: int = 0,
|
|
97
|
+
with_notifications: bool = False,
|
|
96
98
|
):
|
|
97
99
|
pass
|
|
98
100
|
|
mlrun/execution.py
CHANGED
|
@@ -1038,8 +1038,10 @@ class MLClientCtx(object):
|
|
|
1038
1038
|
|
|
1039
1039
|
def _update_run(self, commit=False, message=""):
|
|
1040
1040
|
"""
|
|
1041
|
-
update the required fields in the run object
|
|
1042
|
-
|
|
1041
|
+
update the required fields in the run object instead of overwriting existing values with empty ones
|
|
1042
|
+
|
|
1043
|
+
:param commit: commit the changes to the DB if autocommit is not set or update the tmpfile alone
|
|
1044
|
+
:param message: commit message
|
|
1043
1045
|
"""
|
|
1044
1046
|
self._merge_tmpfile()
|
|
1045
1047
|
if commit or self._autocommit:
|
mlrun/feature_store/__init__.py
CHANGED
mlrun/feature_store/api.py
CHANGED
|
@@ -35,7 +35,6 @@ from ..datastore.targets import (
|
|
|
35
35
|
validate_target_list,
|
|
36
36
|
validate_target_paths_for_engine,
|
|
37
37
|
)
|
|
38
|
-
from ..db import RunDBError
|
|
39
38
|
from ..model import DataSource, DataTargetBase
|
|
40
39
|
from ..runtimes import RuntimeKinds
|
|
41
40
|
from ..runtimes.function_reference import FunctionReference
|
|
@@ -417,7 +416,7 @@ def ingest(
|
|
|
417
416
|
_, stripped_name = parse_store_uri(featureset)
|
|
418
417
|
try:
|
|
419
418
|
featureset = get_feature_set_by_uri(stripped_name)
|
|
420
|
-
except RunDBError as exc:
|
|
419
|
+
except mlrun.db.RunDBError as exc:
|
|
421
420
|
# TODO: this handling is needed because the generic httpdb error handling doesn't raise the correct
|
|
422
421
|
# error class and doesn't propagate the correct message, until it solved we're manually handling this
|
|
423
422
|
# case to give better user experience, remove this when the error handling is fixed.
|
mlrun/feature_store/common.py
CHANGED
|
@@ -20,8 +20,9 @@ from mlrun.common.schemas import AuthorizationVerificationInput
|
|
|
20
20
|
from mlrun.runtimes import BaseRuntime
|
|
21
21
|
from mlrun.runtimes.function_reference import FunctionReference
|
|
22
22
|
from mlrun.runtimes.utils import enrich_function_from_dict
|
|
23
|
-
from mlrun.utils import StorePrefix, logger
|
|
23
|
+
from mlrun.utils import StorePrefix, logger
|
|
24
24
|
|
|
25
|
+
from ..common.helpers import parse_versioned_object_uri
|
|
25
26
|
from ..config import config
|
|
26
27
|
|
|
27
28
|
project_separator = "/"
|
|
@@ -273,7 +273,7 @@ class FeatureSetStatus(ModelObj):
|
|
|
273
273
|
:param run_uri: last run used for ingestion
|
|
274
274
|
"""
|
|
275
275
|
|
|
276
|
-
self.state = state or
|
|
276
|
+
self.state = state or mlrun.common.schemas.object.ObjectStatusState.CREATED
|
|
277
277
|
self._targets: ObjectList = None
|
|
278
278
|
self.targets = targets or []
|
|
279
279
|
self.stats = stats or {}
|
|
@@ -418,16 +418,6 @@ class FeatureSet(ModelObj):
|
|
|
418
418
|
fullname += ":" + self._metadata.tag
|
|
419
419
|
return fullname
|
|
420
420
|
|
|
421
|
-
def _override_run_db(
|
|
422
|
-
self,
|
|
423
|
-
session,
|
|
424
|
-
):
|
|
425
|
-
# Import here, since this method only runs in API context. If this import was global, client would need
|
|
426
|
-
# API requirements and would fail.
|
|
427
|
-
from ..api.api.utils import get_run_db_instance
|
|
428
|
-
|
|
429
|
-
self._run_db = get_run_db_instance(session)
|
|
430
|
-
|
|
431
421
|
def _get_run_db(self):
|
|
432
422
|
if self._run_db:
|
|
433
423
|
return self._run_db
|