mlrun 1.6.3rc3__py3-none-any.whl → 1.6.3rc6__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/config.py +9 -1
- mlrun/datastore/v3io.py +27 -50
- mlrun/db/auth_utils.py +152 -0
- mlrun/db/httpdb.py +30 -16
- mlrun/model.py +18 -0
- mlrun/model_monitoring/stream_processing.py +0 -1
- mlrun/projects/pipelines.py +22 -5
- mlrun/projects/project.py +8 -6
- mlrun/runtimes/pod.py +5 -5
- mlrun/utils/version/version.json +2 -2
- {mlrun-1.6.3rc3.dist-info → mlrun-1.6.3rc6.dist-info}/METADATA +1 -1
- {mlrun-1.6.3rc3.dist-info → mlrun-1.6.3rc6.dist-info}/RECORD +16 -16
- mlrun/datastore/helpers.py +0 -18
- {mlrun-1.6.3rc3.dist-info → mlrun-1.6.3rc6.dist-info}/LICENSE +0 -0
- {mlrun-1.6.3rc3.dist-info → mlrun-1.6.3rc6.dist-info}/WHEEL +0 -0
- {mlrun-1.6.3rc3.dist-info → mlrun-1.6.3rc6.dist-info}/entry_points.txt +0 -0
- {mlrun-1.6.3rc3.dist-info → mlrun-1.6.3rc6.dist-info}/top_level.txt +0 -0
mlrun/config.py
CHANGED
|
@@ -672,6 +672,10 @@ default_config = {
|
|
|
672
672
|
"access_key": "",
|
|
673
673
|
},
|
|
674
674
|
"grafana_url": "",
|
|
675
|
+
"auth_with_client_id": {
|
|
676
|
+
"enabled": False,
|
|
677
|
+
"request_timeout": 5,
|
|
678
|
+
},
|
|
675
679
|
}
|
|
676
680
|
|
|
677
681
|
_is_running_as_api = None
|
|
@@ -1375,7 +1379,11 @@ def read_env(env=None, prefix=env_prefix):
|
|
|
1375
1379
|
log_formatter = mlrun.utils.create_formatter_instance(
|
|
1376
1380
|
mlrun.utils.FormatterKinds(log_formatter_name)
|
|
1377
1381
|
)
|
|
1378
|
-
mlrun.utils.logger.get_handler("default")
|
|
1382
|
+
current_handler = mlrun.utils.logger.get_handler("default")
|
|
1383
|
+
current_formatter_name = current_handler.formatter.__class__.__name__
|
|
1384
|
+
desired_formatter_name = log_formatter.__class__.__name__
|
|
1385
|
+
if current_formatter_name != desired_formatter_name:
|
|
1386
|
+
current_handler.setFormatter(log_formatter)
|
|
1379
1387
|
|
|
1380
1388
|
# The default function pod resource values are of type str; however, when reading from environment variable numbers,
|
|
1381
1389
|
# it converts them to type int if contains only number, so we want to convert them to str.
|
mlrun/datastore/v3io.py
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
import mmap
|
|
16
|
-
import os
|
|
17
15
|
import time
|
|
18
16
|
from datetime import datetime
|
|
19
17
|
|
|
@@ -22,7 +20,6 @@ import v3io
|
|
|
22
20
|
from v3io.dataplane.response import HttpResponseError
|
|
23
21
|
|
|
24
22
|
import mlrun
|
|
25
|
-
from mlrun.datastore.helpers import ONE_GB, ONE_MB
|
|
26
23
|
|
|
27
24
|
from ..platforms.iguazio import parse_path, split_path
|
|
28
25
|
from .base import (
|
|
@@ -32,6 +29,7 @@ from .base import (
|
|
|
32
29
|
)
|
|
33
30
|
|
|
34
31
|
V3IO_LOCAL_ROOT = "v3io"
|
|
32
|
+
V3IO_DEFAULT_UPLOAD_CHUNK_SIZE = 1024 * 1024 * 100
|
|
35
33
|
|
|
36
34
|
|
|
37
35
|
class V3ioStore(DataStore):
|
|
@@ -94,46 +92,28 @@ class V3ioStore(DataStore):
|
|
|
94
92
|
)
|
|
95
93
|
return self._sanitize_storage_options(res)
|
|
96
94
|
|
|
97
|
-
def _upload(
|
|
95
|
+
def _upload(
|
|
96
|
+
self,
|
|
97
|
+
key: str,
|
|
98
|
+
src_path: str,
|
|
99
|
+
max_chunk_size: int = V3IO_DEFAULT_UPLOAD_CHUNK_SIZE,
|
|
100
|
+
):
|
|
98
101
|
"""helper function for upload method, allows for controlling max_chunk_size in testing"""
|
|
99
102
|
container, path = split_path(self._join(key))
|
|
100
|
-
file_size = os.path.getsize(src_path) # in bytes
|
|
101
|
-
if file_size <= ONE_MB:
|
|
102
|
-
with open(src_path, "rb") as source_file:
|
|
103
|
-
data = source_file.read()
|
|
104
|
-
self._do_object_request(
|
|
105
|
-
self.object.put,
|
|
106
|
-
container=container,
|
|
107
|
-
path=path,
|
|
108
|
-
body=data,
|
|
109
|
-
append=False,
|
|
110
|
-
)
|
|
111
|
-
return
|
|
112
|
-
# chunk must be a multiple of the ALLOCATIONGRANULARITY
|
|
113
|
-
# https://docs.python.org/3/library/mmap.html
|
|
114
|
-
if residue := max_chunk_size % mmap.ALLOCATIONGRANULARITY:
|
|
115
|
-
# round down to the nearest multiple of ALLOCATIONGRANULARITY
|
|
116
|
-
max_chunk_size -= residue
|
|
117
|
-
|
|
118
103
|
with open(src_path, "rb") as file_obj:
|
|
119
|
-
|
|
120
|
-
while
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
path=path,
|
|
133
|
-
body=mmap_obj,
|
|
134
|
-
append=append,
|
|
135
|
-
)
|
|
136
|
-
file_offset += chunk_size
|
|
104
|
+
append = False
|
|
105
|
+
while True:
|
|
106
|
+
data = memoryview(file_obj.read(max_chunk_size))
|
|
107
|
+
if not data:
|
|
108
|
+
break
|
|
109
|
+
self._do_object_request(
|
|
110
|
+
self.object.put,
|
|
111
|
+
container=container,
|
|
112
|
+
path=path,
|
|
113
|
+
body=data,
|
|
114
|
+
append=append,
|
|
115
|
+
)
|
|
116
|
+
append = True
|
|
137
117
|
|
|
138
118
|
def upload(self, key, src_path):
|
|
139
119
|
return self._upload(key, src_path)
|
|
@@ -148,19 +128,16 @@ class V3ioStore(DataStore):
|
|
|
148
128
|
num_bytes=size,
|
|
149
129
|
).body
|
|
150
130
|
|
|
151
|
-
def _put(
|
|
131
|
+
def _put(
|
|
132
|
+
self,
|
|
133
|
+
key,
|
|
134
|
+
data,
|
|
135
|
+
append=False,
|
|
136
|
+
max_chunk_size: int = V3IO_DEFAULT_UPLOAD_CHUNK_SIZE,
|
|
137
|
+
):
|
|
152
138
|
"""helper function for put method, allows for controlling max_chunk_size in testing"""
|
|
153
139
|
container, path = split_path(self._join(key))
|
|
154
140
|
buffer_size = len(data) # in bytes
|
|
155
|
-
if buffer_size <= ONE_MB:
|
|
156
|
-
self._do_object_request(
|
|
157
|
-
self.object.put,
|
|
158
|
-
container=container,
|
|
159
|
-
path=path,
|
|
160
|
-
body=data,
|
|
161
|
-
append=append,
|
|
162
|
-
)
|
|
163
|
-
return
|
|
164
141
|
buffer_offset = 0
|
|
165
142
|
try:
|
|
166
143
|
data = memoryview(data)
|
mlrun/db/auth_utils.py
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Copyright 2024 Iguazio
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from abc import ABC, abstractmethod
|
|
16
|
+
from datetime import datetime, timedelta
|
|
17
|
+
|
|
18
|
+
import requests
|
|
19
|
+
|
|
20
|
+
import mlrun.errors
|
|
21
|
+
from mlrun.utils import logger
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class TokenProvider(ABC):
|
|
25
|
+
@abstractmethod
|
|
26
|
+
def get_token(self):
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
@abstractmethod
|
|
30
|
+
def is_iguazio_session(self):
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class StaticTokenProvider(TokenProvider):
|
|
35
|
+
def __init__(self, token: str):
|
|
36
|
+
self.token = token
|
|
37
|
+
|
|
38
|
+
def get_token(self):
|
|
39
|
+
return self.token
|
|
40
|
+
|
|
41
|
+
def is_iguazio_session(self):
|
|
42
|
+
return mlrun.platforms.iguazio.is_iguazio_session(self.token)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class OAuthClientIDTokenProvider(TokenProvider):
|
|
46
|
+
def __init__(
|
|
47
|
+
self, token_endpoint: str, client_id: str, client_secret: str, timeout=5
|
|
48
|
+
):
|
|
49
|
+
if not token_endpoint or not client_id or not client_secret:
|
|
50
|
+
raise mlrun.errors.MLRunValueError(
|
|
51
|
+
"Invalid client_id configuration for authentication. Must provide token endpoint, client-id and secret"
|
|
52
|
+
)
|
|
53
|
+
self.token_endpoint = token_endpoint
|
|
54
|
+
self.client_id = client_id
|
|
55
|
+
self.client_secret = client_secret
|
|
56
|
+
self.timeout = timeout
|
|
57
|
+
|
|
58
|
+
# Since we're only issuing POST requests, which are actually a disguised GET, then it's ok to allow retries
|
|
59
|
+
# on them.
|
|
60
|
+
self._session = mlrun.utils.HTTPSessionWithRetry(
|
|
61
|
+
retry_on_post=True,
|
|
62
|
+
verbose=True,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
self._cleanup()
|
|
66
|
+
self._refresh_token_if_needed()
|
|
67
|
+
|
|
68
|
+
def get_token(self):
|
|
69
|
+
self._refresh_token_if_needed()
|
|
70
|
+
return self.token
|
|
71
|
+
|
|
72
|
+
def is_iguazio_session(self):
|
|
73
|
+
return False
|
|
74
|
+
|
|
75
|
+
def _cleanup(self):
|
|
76
|
+
self.token = self.token_expiry_time = self.token_refresh_time = None
|
|
77
|
+
|
|
78
|
+
def _refresh_token_if_needed(self):
|
|
79
|
+
now = datetime.now()
|
|
80
|
+
if self.token:
|
|
81
|
+
if self.token_refresh_time and now <= self.token_refresh_time:
|
|
82
|
+
return self.token
|
|
83
|
+
|
|
84
|
+
# We only cleanup if token was really expired - even if we fail in refreshing the token, we can still
|
|
85
|
+
# use the existing one given that it's not expired.
|
|
86
|
+
if now >= self.token_expiry_time:
|
|
87
|
+
self._cleanup()
|
|
88
|
+
|
|
89
|
+
self._issue_token_request()
|
|
90
|
+
return self.token
|
|
91
|
+
|
|
92
|
+
def _issue_token_request(self, raise_on_error=False):
|
|
93
|
+
try:
|
|
94
|
+
headers = {"Content-Type": "application/x-www-form-urlencoded"}
|
|
95
|
+
request_body = {
|
|
96
|
+
"grant_type": "client_credentials",
|
|
97
|
+
"client_id": self.client_id,
|
|
98
|
+
"client_secret": self.client_secret,
|
|
99
|
+
}
|
|
100
|
+
response = self._session.request(
|
|
101
|
+
"POST",
|
|
102
|
+
self.token_endpoint,
|
|
103
|
+
timeout=self.timeout,
|
|
104
|
+
headers=headers,
|
|
105
|
+
data=request_body,
|
|
106
|
+
)
|
|
107
|
+
except requests.RequestException as exc:
|
|
108
|
+
error = f"Retrieving token failed: {mlrun.errors.err_to_str(exc)}"
|
|
109
|
+
if raise_on_error:
|
|
110
|
+
raise mlrun.errors.MLRunRuntimeError(error) from exc
|
|
111
|
+
else:
|
|
112
|
+
logger.warning(error)
|
|
113
|
+
return
|
|
114
|
+
|
|
115
|
+
if not response.ok:
|
|
116
|
+
error = "No error available"
|
|
117
|
+
if response.content:
|
|
118
|
+
try:
|
|
119
|
+
data = response.json()
|
|
120
|
+
error = data.get("error")
|
|
121
|
+
except Exception:
|
|
122
|
+
pass
|
|
123
|
+
logger.warning(
|
|
124
|
+
"Retrieving token failed", status=response.status_code, error=error
|
|
125
|
+
)
|
|
126
|
+
if raise_on_error:
|
|
127
|
+
mlrun.errors.raise_for_status(response)
|
|
128
|
+
return
|
|
129
|
+
|
|
130
|
+
self._parse_response(response.json())
|
|
131
|
+
|
|
132
|
+
def _parse_response(self, data: dict):
|
|
133
|
+
# Response is described in https://datatracker.ietf.org/doc/html/rfc6749#section-4.4.3
|
|
134
|
+
# According to spec, there isn't a refresh token - just the access token and its expiry time (in seconds).
|
|
135
|
+
self.token = data.get("access_token")
|
|
136
|
+
expires_in = data.get("expires_in")
|
|
137
|
+
if not self.token or not expires_in:
|
|
138
|
+
token_str = "****" if self.token else "missing"
|
|
139
|
+
logger.warning(
|
|
140
|
+
"Failed to parse token response", token=token_str, expires_in=expires_in
|
|
141
|
+
)
|
|
142
|
+
return
|
|
143
|
+
|
|
144
|
+
now = datetime.now()
|
|
145
|
+
self.token_expiry_time = now + timedelta(seconds=expires_in)
|
|
146
|
+
self.token_refresh_time = now + timedelta(seconds=expires_in / 2)
|
|
147
|
+
logger.info(
|
|
148
|
+
"Successfully retrieved client-id token",
|
|
149
|
+
expires_in=expires_in,
|
|
150
|
+
expiry=str(self.token_expiry_time),
|
|
151
|
+
refresh=str(self.token_refresh_time),
|
|
152
|
+
)
|
mlrun/db/httpdb.py
CHANGED
|
@@ -33,6 +33,7 @@ import mlrun.common.schemas
|
|
|
33
33
|
import mlrun.model_monitoring.model_endpoint
|
|
34
34
|
import mlrun.platforms
|
|
35
35
|
import mlrun.projects
|
|
36
|
+
from mlrun.db.auth_utils import OAuthClientIDTokenProvider, StaticTokenProvider
|
|
36
37
|
from mlrun.errors import MLRunInvalidArgumentError, err_to_str
|
|
37
38
|
|
|
38
39
|
from ..artifacts import Artifact
|
|
@@ -133,17 +134,28 @@ class HTTPRunDB(RunDBInterface):
|
|
|
133
134
|
endpoint += f":{parsed_url.port}"
|
|
134
135
|
base_url = f"{parsed_url.scheme}://{endpoint}{parsed_url.path}"
|
|
135
136
|
|
|
137
|
+
self.base_url = base_url
|
|
136
138
|
username = parsed_url.username or config.httpdb.user
|
|
137
139
|
password = parsed_url.password or config.httpdb.password
|
|
140
|
+
self.token_provider = None
|
|
138
141
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
if config.auth_with_client_id.enabled:
|
|
143
|
+
self.token_provider = OAuthClientIDTokenProvider(
|
|
144
|
+
token_endpoint=mlrun.get_secret_or_env("MLRUN_AUTH_TOKEN_ENDPOINT"),
|
|
145
|
+
client_id=mlrun.get_secret_or_env("MLRUN_AUTH_CLIENT_ID"),
|
|
146
|
+
client_secret=mlrun.get_secret_or_env("MLRUN_AUTH_CLIENT_SECRET"),
|
|
147
|
+
timeout=config.auth_with_client_id.request_timeout,
|
|
148
|
+
)
|
|
149
|
+
else:
|
|
150
|
+
username, password, token = mlrun.platforms.add_or_refresh_credentials(
|
|
151
|
+
parsed_url.hostname, username, password, config.httpdb.token
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
if token:
|
|
155
|
+
self.token_provider = StaticTokenProvider(token)
|
|
142
156
|
|
|
143
|
-
self.base_url = base_url
|
|
144
157
|
self.user = username
|
|
145
158
|
self.password = password
|
|
146
|
-
self.token = token
|
|
147
159
|
|
|
148
160
|
def __repr__(self):
|
|
149
161
|
cls = self.__class__.__name__
|
|
@@ -213,17 +225,19 @@ class HTTPRunDB(RunDBInterface):
|
|
|
213
225
|
|
|
214
226
|
if self.user:
|
|
215
227
|
kw["auth"] = (self.user, self.password)
|
|
216
|
-
elif self.
|
|
217
|
-
|
|
218
|
-
if
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
"
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
228
|
+
elif self.token_provider:
|
|
229
|
+
token = self.token_provider.get_token()
|
|
230
|
+
if token:
|
|
231
|
+
# Iguazio auth doesn't support passing token through bearer, so use cookie instead
|
|
232
|
+
if self.token_provider.is_iguazio_session():
|
|
233
|
+
session_cookie = f'j:{{"sid": "{token}"}}'
|
|
234
|
+
cookies = {
|
|
235
|
+
"session": session_cookie,
|
|
236
|
+
}
|
|
237
|
+
kw["cookies"] = cookies
|
|
238
|
+
else:
|
|
239
|
+
if "Authorization" not in kw.setdefault("headers", {}):
|
|
240
|
+
kw["headers"].update({"Authorization": "Bearer " + token})
|
|
227
241
|
|
|
228
242
|
if mlrun.common.schemas.HeaderNames.client_version not in kw.setdefault(
|
|
229
243
|
"headers", {}
|
mlrun/model.py
CHANGED
|
@@ -624,6 +624,11 @@ class RunMetadata(ModelObj):
|
|
|
624
624
|
def iteration(self, iteration):
|
|
625
625
|
self._iteration = iteration
|
|
626
626
|
|
|
627
|
+
def is_workflow_runner(self):
|
|
628
|
+
if not self.labels:
|
|
629
|
+
return False
|
|
630
|
+
return self.labels.get("job-type", "") == "workflow-runner"
|
|
631
|
+
|
|
627
632
|
|
|
628
633
|
class HyperParamStrategies:
|
|
629
634
|
grid = "grid"
|
|
@@ -1068,6 +1073,19 @@ class RunStatus(ModelObj):
|
|
|
1068
1073
|
self.reason = reason
|
|
1069
1074
|
self.notifications = notifications or {}
|
|
1070
1075
|
|
|
1076
|
+
def is_failed(self) -> Optional[bool]:
|
|
1077
|
+
"""
|
|
1078
|
+
This method returns whether a run has failed.
|
|
1079
|
+
Returns none if state has yet to be defined. callee is responsible for handling None.
|
|
1080
|
+
(e.g wait for state to be defined)
|
|
1081
|
+
"""
|
|
1082
|
+
if not self.state:
|
|
1083
|
+
return None
|
|
1084
|
+
return self.state.casefold() in [
|
|
1085
|
+
mlrun.run.RunStatuses.failed.casefold(),
|
|
1086
|
+
mlrun.run.RunStatuses.error.casefold(),
|
|
1087
|
+
]
|
|
1088
|
+
|
|
1071
1089
|
|
|
1072
1090
|
class RunTemplate(ModelObj):
|
|
1073
1091
|
"""Run template"""
|
mlrun/projects/pipelines.py
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
import abc
|
|
15
15
|
import builtins
|
|
16
|
+
import http
|
|
16
17
|
import importlib.util as imputil
|
|
17
18
|
import os
|
|
18
19
|
import tempfile
|
|
@@ -877,17 +878,33 @@ class _RemoteRunner(_PipelineRunner):
|
|
|
877
878
|
get_workflow_id_timeout=get_workflow_id_timeout,
|
|
878
879
|
)
|
|
879
880
|
|
|
881
|
+
def _get_workflow_id_or_bail():
|
|
882
|
+
try:
|
|
883
|
+
return run_db.get_workflow_id(
|
|
884
|
+
project=project.name,
|
|
885
|
+
name=workflow_response.name,
|
|
886
|
+
run_id=workflow_response.run_id,
|
|
887
|
+
engine=workflow_spec.engine,
|
|
888
|
+
)
|
|
889
|
+
except mlrun.errors.MLRunHTTPStatusError as get_wf_exc:
|
|
890
|
+
# fail fast on specific errors
|
|
891
|
+
if get_wf_exc.error_status_code in [
|
|
892
|
+
http.HTTPStatus.PRECONDITION_FAILED
|
|
893
|
+
]:
|
|
894
|
+
raise mlrun.errors.MLRunFatalFailureError(
|
|
895
|
+
original_exception=get_wf_exc
|
|
896
|
+
)
|
|
897
|
+
|
|
898
|
+
# raise for a retry (on other errors)
|
|
899
|
+
raise
|
|
900
|
+
|
|
880
901
|
# Getting workflow id from run:
|
|
881
902
|
response = retry_until_successful(
|
|
882
903
|
1,
|
|
883
904
|
get_workflow_id_timeout,
|
|
884
905
|
logger,
|
|
885
906
|
False,
|
|
886
|
-
|
|
887
|
-
project=project.name,
|
|
888
|
-
name=workflow_response.name,
|
|
889
|
-
run_id=workflow_response.run_id,
|
|
890
|
-
engine=workflow_spec.engine,
|
|
907
|
+
_get_workflow_id_or_bail,
|
|
891
908
|
)
|
|
892
909
|
workflow_id = response.workflow_id
|
|
893
910
|
# After fetching the workflow_id the workflow executed successfully
|
mlrun/projects/project.py
CHANGED
|
@@ -2650,12 +2650,14 @@ class MlrunProject(ModelObj):
|
|
|
2650
2650
|
"Remote repo is not defined, use .create_remote() + push()"
|
|
2651
2651
|
)
|
|
2652
2652
|
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2653
|
+
if engine not in ["remote"]:
|
|
2654
|
+
# for remote runs we don't require the functions to be synced as they can be loaded dynamically during run
|
|
2655
|
+
self.sync_functions(always=sync)
|
|
2656
|
+
if not self.spec._function_objects:
|
|
2657
|
+
raise ValueError(
|
|
2658
|
+
"There are no functions in the project."
|
|
2659
|
+
" Make sure you've set your functions with project.set_function()."
|
|
2660
|
+
)
|
|
2659
2661
|
|
|
2660
2662
|
if not name and not workflow_path and not workflow_handler:
|
|
2661
2663
|
raise ValueError("Workflow name, path, or handler must be specified")
|
mlrun/runtimes/pod.py
CHANGED
|
@@ -1012,12 +1012,12 @@ class KubeResource(BaseRuntime):
|
|
|
1012
1012
|
|
|
1013
1013
|
def _set_env(self, name, value=None, value_from=None):
|
|
1014
1014
|
new_var = k8s_client.V1EnvVar(name=name, value=value, value_from=value_from)
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1015
|
+
|
|
1016
|
+
# ensure we don't have duplicate env vars with the same name
|
|
1017
|
+
for env_index, value_item in enumerate(self.spec.env):
|
|
1018
|
+
if get_item_name(value_item) == name:
|
|
1019
|
+
self.spec.env[env_index] = new_var
|
|
1019
1020
|
return self
|
|
1020
|
-
i += 1
|
|
1021
1021
|
self.spec.env.append(new_var)
|
|
1022
1022
|
return self
|
|
1023
1023
|
|
mlrun/utils/version/version.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
mlrun/__init__.py,sha256=o9dHUfVFADfsi6GnOPLr2OkfkHdPvOnA7rkoECen0-I,7248
|
|
2
2
|
mlrun/__main__.py,sha256=zd-o0SkFH69HhIWKhqXnNURsrtpIcOJYYq50JfAxW7k,49234
|
|
3
|
-
mlrun/config.py,sha256=
|
|
3
|
+
mlrun/config.py,sha256=U8La3z_0ac5d71qq6qydUsxLYiBPfEZOf-i-8SdKA7c,63797
|
|
4
4
|
mlrun/errors.py,sha256=YdUtkN3qJ6yrseNygmKxmSWOfQ_RdKBhRxwwyMlTQCM,7106
|
|
5
5
|
mlrun/execution.py,sha256=tgp6PcujZvGhDDVzPNs32YH_JNzaxfSd25yeuLwmjzg,40880
|
|
6
6
|
mlrun/features.py,sha256=UQQ2uh5Xh9XsMGiYBqh3bKgDhOHANjv1gQgWyId9qQE,15624
|
|
7
7
|
mlrun/k8s_utils.py,sha256=-6egUEZNPhzOxJ2gFytubvQvCYU9nPPg5Yn0zsTK-NQ,7065
|
|
8
8
|
mlrun/kfpops.py,sha256=VgvS_4DappCPHzV7057SbraBTbF2mn7zZ7iPAaks3KU,30493
|
|
9
9
|
mlrun/lists.py,sha256=JMc4Ch4wQxD_B9zbrE3JZwXD8cCYWLqHb1FQXWoaGzM,8310
|
|
10
|
-
mlrun/model.py,sha256=
|
|
10
|
+
mlrun/model.py,sha256=Ax3h8A0-vUp8hRDNgttQuLoxaB0_8X8-yjpTLbBhirQ,64579
|
|
11
11
|
mlrun/render.py,sha256=_Jrtqw54AkvUZDWK5ORGUQWnGewREh_lQnUQWuCkTV4,13016
|
|
12
12
|
mlrun/run.py,sha256=gyxYJqVCBsZxp0_HWAG5_lwi2_KPqcxy6un5ZLw_-2Q,42456
|
|
13
13
|
mlrun/secrets.py,sha256=m7jM8fdjGLR-j9Vx-08eNmtOmlxFx9mTUBqBWtMSVQo,7782
|
|
@@ -72,7 +72,6 @@ mlrun/datastore/datastore_profile.py,sha256=vBpkAcnGiYUO09ihg_jPgPdpo2GVBrOOSHYW
|
|
|
72
72
|
mlrun/datastore/dbfs_store.py,sha256=5IkxnFQXkW0fdx-ca5jjQnUdTsTfNdJzMvV31ZpDNrM,6634
|
|
73
73
|
mlrun/datastore/filestore.py,sha256=cI_YvQqY5J3kEvdyPelfWofxKfBitoNHJvABBkpCGRc,3788
|
|
74
74
|
mlrun/datastore/google_cloud_storage.py,sha256=zQlrZnYOFfwQNBw5J2ufoyCDMlbZKA9c9no7NvnylZ4,6038
|
|
75
|
-
mlrun/datastore/helpers.py,sha256=-bKveE9rteLd0hJd6OSMuMbfz09W_OXyu1G5O2ihZjs,622
|
|
76
75
|
mlrun/datastore/inmem.py,sha256=6PAltUk7uyYlDgnsaJPOkg_P98iku1ys2e2wpAmPRkc,2779
|
|
77
76
|
mlrun/datastore/redis.py,sha256=DDA1FsixfnzNwjVUU9MgVCKFo3X3tYvPDcREKyy9zS4,5517
|
|
78
77
|
mlrun/datastore/s3.py,sha256=BCyVDznEsmU1M1HtRROdLo4HkLOy4fjEmgpNrTpsoW0,8030
|
|
@@ -82,13 +81,14 @@ mlrun/datastore/spark_utils.py,sha256=54rF64aC19ojUFCcwzsoBLQ-5Nmzs_KTQl9iEkK2hY
|
|
|
82
81
|
mlrun/datastore/store_resources.py,sha256=dfMdFy2urilECtlwLJr5CSG12MA645b-NPYDnbr5s1A,6839
|
|
83
82
|
mlrun/datastore/targets.py,sha256=EaeNzwHQHkMo7WRezgMeWWjTL1NmYwMx8F0RG1swb48,70159
|
|
84
83
|
mlrun/datastore/utils.py,sha256=x4pm0gvpcNWSjxo99MOmwcd9I5HCwuzCh6IA4uiXlZs,7077
|
|
85
|
-
mlrun/datastore/v3io.py,sha256=
|
|
84
|
+
mlrun/datastore/v3io.py,sha256=3UI22DQ1A4yQEpbMWAbopIzjqlL2k5bhmhg0Cjs3tEk,8039
|
|
86
85
|
mlrun/datastore/wasbfs/__init__.py,sha256=s5Ul-0kAhYqFjKDR2X0O2vDGDbLQQduElb32Ev56Te4,1343
|
|
87
86
|
mlrun/datastore/wasbfs/fs.py,sha256=MnSj7Q4OKA2L55ihCmUnj2t3GA3B77oLMdAw-yxvN9w,6151
|
|
88
87
|
mlrun/db/__init__.py,sha256=WqJ4x8lqJ7ZoKbhEyFqkYADd9P6E3citckx9e9ZLcIU,1163
|
|
88
|
+
mlrun/db/auth_utils.py,sha256=hpg8D2r82oN0BWabuWN04BTNZ7jYMAF242YSUpK7LFM,5211
|
|
89
89
|
mlrun/db/base.py,sha256=Rg2TrcwvzN28vmoyhq8sSxNjiBS1EA6BAHr24fhcmNU,18221
|
|
90
90
|
mlrun/db/factory.py,sha256=wTEKHEmdDkylM6IkTYvmEYVF8gn2HdjLoLoWICCyatI,2403
|
|
91
|
-
mlrun/db/httpdb.py,sha256=
|
|
91
|
+
mlrun/db/httpdb.py,sha256=PUIY5VPln2hqCMgRexJwvuLV-nAXsz5BwGlGAt_ImnU,156882
|
|
92
92
|
mlrun/db/nopdb.py,sha256=rpZy5cpW-8--4OvMzlVoKNYjbhWJ3cn_z-JFwfuPqnI,14520
|
|
93
93
|
mlrun/feature_store/__init__.py,sha256=n1F5m1svFW2chbE2dJdWzZJJiYS4E-y8PQsG9Q-F0lU,1584
|
|
94
94
|
mlrun/feature_store/api.py,sha256=ehEwKlmE07pq1FUwh-ehA8Jm9LTkQofl5MQpEiMwVqM,49520
|
|
@@ -206,7 +206,7 @@ mlrun/model_monitoring/features_drift_table.py,sha256=OEDb_YZm3cyzszzC4SDqi7ufwO
|
|
|
206
206
|
mlrun/model_monitoring/helpers.py,sha256=l8RCxOGBoScZSL4M-x4fIfpsfH7wjSQpqA_t-HVk0BI,7087
|
|
207
207
|
mlrun/model_monitoring/model_endpoint.py,sha256=BBtxdY5ciormI_al4zshmIp0GN7hGhOCn-hLgpCXek0,3938
|
|
208
208
|
mlrun/model_monitoring/prometheus.py,sha256=Z0UWmhQ-dpGGH31gCiGdfmhfj-RFRf1Tu1bYVe-k4jk,7605
|
|
209
|
-
mlrun/model_monitoring/stream_processing.py,sha256=
|
|
209
|
+
mlrun/model_monitoring/stream_processing.py,sha256=mUmF12byO8h5CPszEqrI0xFbOWiyCYr493r58EElWyQ,49150
|
|
210
210
|
mlrun/model_monitoring/tracking_policy.py,sha256=Q6_p4y1ZcRHqs24c_1_4m9E1gYnaOm6pLCNGT22dWKM,5221
|
|
211
211
|
mlrun/model_monitoring/writer.py,sha256=IWPzPenoAkfIxlvn0IdcdB19Nxqmg4mjbo3-RnYWw9A,8669
|
|
212
212
|
mlrun/model_monitoring/stores/__init__.py,sha256=adU_G07jkD3JUT8__d0jAxs9nNomL7igKmd6uVM9L50,4525
|
|
@@ -239,8 +239,8 @@ mlrun/platforms/iguazio.py,sha256=eOO8CbeSD0ooUKp-hbXbRfzWo5OTP7QaBo6zh0BXTKc,19
|
|
|
239
239
|
mlrun/platforms/other.py,sha256=z4pWqxXkVVuMLk-MbNb0Y_ZR5pmIsUm0R8vHnqpEnew,11852
|
|
240
240
|
mlrun/projects/__init__.py,sha256=Lv5rfxyXJrw6WGOWJKhBz66M6t3_zsNMCfUD6waPwx4,1153
|
|
241
241
|
mlrun/projects/operations.py,sha256=CJRGKEFhqKXlg0VOKhcfjOUVAmWHA9WwAFNiXtUqBhg,18550
|
|
242
|
-
mlrun/projects/pipelines.py,sha256=
|
|
243
|
-
mlrun/projects/project.py,sha256=
|
|
242
|
+
mlrun/projects/pipelines.py,sha256=FcKNsFtRUP1sOuSEp5Hk0_Qv4ZIKT9gWpatg6bSUCsI,41165
|
|
243
|
+
mlrun/projects/project.py,sha256=U98H5DF0q17qZcQB4VqqPoEETFgh_VvV51DTHXQhsbA,153280
|
|
244
244
|
mlrun/runtimes/__init__.py,sha256=f5cdEg4raKNXQawJE-AuWzK6AqIsLfDODREeMnI2Ies,7062
|
|
245
245
|
mlrun/runtimes/base.py,sha256=GTVqCR3sBqbyAlEBnDClThOf0EZUoAMzlEIFqjfoyLQ,36604
|
|
246
246
|
mlrun/runtimes/constants.py,sha256=tB7nIlHob3yF0K9Uf9BUZ8yxjZNSzlzrd3K32K_vV7w,9550
|
|
@@ -252,7 +252,7 @@ mlrun/runtimes/generators.py,sha256=v28HdNgxdHvj888G1dTnUeQZz-D9iTO0hoGeZbCdiuQ,
|
|
|
252
252
|
mlrun/runtimes/kubejob.py,sha256=UfSm7hiPLAtM0TfIE5nbBdSvrbsKWCZfvKP-SZhGyAk,12500
|
|
253
253
|
mlrun/runtimes/local.py,sha256=depdJkbyas7V7SMXB1T6Y_jPXxTLEB1TL5HYzDxlcXI,21791
|
|
254
254
|
mlrun/runtimes/nuclio.py,sha256=hwk4dUaZefI-Qbb4s289vQpt1h0nAucxf6eINzVI-d8,2908
|
|
255
|
-
mlrun/runtimes/pod.py,sha256=
|
|
255
|
+
mlrun/runtimes/pod.py,sha256=loo1ysAbGslrHRhcRaFrw-ATNhuOBayEb0MCPi2EduY,56865
|
|
256
256
|
mlrun/runtimes/remotesparkjob.py,sha256=W7WqlPbyqE6FjOZ2EFeOzlL1jLGWAWe61jOH0Umy3F4,7334
|
|
257
257
|
mlrun/runtimes/serving.py,sha256=bV4Io-8K30IZs69pdZTSICR3HkUAAc1kSKuBJOx_jc0,30331
|
|
258
258
|
mlrun/runtimes/utils.py,sha256=mNVu3ejmfEV3d7-fCAiSaF5K-Jyz2ladc5HzqhsY0Cs,16025
|
|
@@ -304,11 +304,11 @@ mlrun/utils/notifications/notification/ipython.py,sha256=qrBmtECiRG6sZpCIVMg7RZc
|
|
|
304
304
|
mlrun/utils/notifications/notification/slack.py,sha256=5JysqIpUYUZKXPSeeZtbl7qb2L9dj7p2NvnEBcEsZkA,3898
|
|
305
305
|
mlrun/utils/notifications/notification/webhook.py,sha256=QHezCuN5uXkLcroAGxGrhGHaxAdUvkDLIsp27_Yrfd4,2390
|
|
306
306
|
mlrun/utils/version/__init__.py,sha256=7kkrB7hEZ3cLXoWj1kPoDwo4MaswsI2JVOBpbKgPAgc,614
|
|
307
|
-
mlrun/utils/version/version.json,sha256=
|
|
307
|
+
mlrun/utils/version/version.json,sha256=Ea75vSxqQz02EmR5HD-yj73A-D06vFxQuD7YPf2n5wk,88
|
|
308
308
|
mlrun/utils/version/version.py,sha256=HMwseV8xjTQ__6T6yUWojx_z6yUj7Io7O4NcCCH_sz8,1970
|
|
309
|
-
mlrun-1.6.
|
|
310
|
-
mlrun-1.6.
|
|
311
|
-
mlrun-1.6.
|
|
312
|
-
mlrun-1.6.
|
|
313
|
-
mlrun-1.6.
|
|
314
|
-
mlrun-1.6.
|
|
309
|
+
mlrun-1.6.3rc6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
310
|
+
mlrun-1.6.3rc6.dist-info/METADATA,sha256=AXurGjRBbwSktSXgTc91G6JUXMfOtjs-hAkWWFvxV_g,18293
|
|
311
|
+
mlrun-1.6.3rc6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
312
|
+
mlrun-1.6.3rc6.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
|
|
313
|
+
mlrun-1.6.3rc6.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
|
|
314
|
+
mlrun-1.6.3rc6.dist-info/RECORD,,
|
mlrun/datastore/helpers.py
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Copyright 2023 Iguazio
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
ONE_GB = 1024 * 1024 * 1024
|
|
18
|
-
ONE_MB = 1024 * 1024
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|