mlrun 1.10.0rc39__py3-none-any.whl → 1.10.0rc40__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/common/secrets.py CHANGED
@@ -11,18 +11,10 @@
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
- import re
14
+
15
15
  from abc import ABC, abstractmethod
16
16
 
17
17
  import mlrun.common.schemas
18
- from mlrun.config import config as mlconf
19
-
20
- _AUTH_SECRET_NAME_TEMPLATE = re.escape(
21
- mlconf.secret_stores.kubernetes.auth_secret_name.format(
22
- hashed_access_key="",
23
- )
24
- )
25
- AUTH_SECRET_PATTERN = re.compile(f"^{_AUTH_SECRET_NAME_TEMPLATE}.*")
26
18
 
27
19
 
28
20
  class SecretProviderInterface(ABC):
mlrun/model.py CHANGED
@@ -29,7 +29,6 @@ import pydantic.v1.error_wrappers
29
29
  import mlrun
30
30
  import mlrun.common.constants as mlrun_constants
31
31
  import mlrun.common.schemas.notification
32
- import mlrun.common.secrets
33
32
  import mlrun.utils.regex
34
33
 
35
34
  from .utils import (
@@ -1617,14 +1616,7 @@ class RunTemplate(ModelObj):
1617
1616
 
1618
1617
  :returns: The RunTemplate object
1619
1618
  """
1620
- if kind == "azure_vault" and isinstance(source, dict):
1621
- candidate_secret_name = (source.get("k8s_secret") or "").strip()
1622
- if candidate_secret_name and mlrun.common.secrets.AUTH_SECRET_PATTERN.match(
1623
- candidate_secret_name
1624
- ):
1625
- raise mlrun.errors.MLRunInvalidArgumentError(
1626
- f"Forbidden secret '{candidate_secret_name}' matches MLRun auth-secret pattern."
1627
- )
1619
+
1628
1620
  if kind == "vault" and isinstance(source, list):
1629
1621
  source = {"project": self.metadata.project, "secrets": source}
1630
1622
 
mlrun/projects/project.py CHANGED
@@ -45,7 +45,6 @@ import mlrun.common.runtimes.constants
45
45
  import mlrun.common.schemas.alert
46
46
  import mlrun.common.schemas.artifact
47
47
  import mlrun.common.schemas.model_monitoring.constants as mm_constants
48
- import mlrun.common.secrets
49
48
  import mlrun.datastore.datastore_profile
50
49
  import mlrun.db
51
50
  import mlrun.errors
@@ -3419,12 +3418,7 @@ class MlrunProject(ModelObj):
3419
3418
  self._initialized = True
3420
3419
  return self.spec._function_objects
3421
3420
 
3422
- def with_secrets(
3423
- self,
3424
- kind,
3425
- source,
3426
- prefix="",
3427
- ):
3421
+ def with_secrets(self, kind, source, prefix=""):
3428
3422
  """register a secrets source (file, env or dict)
3429
3423
 
3430
3424
  read secrets from a source provider to be used in workflows, example::
@@ -3446,21 +3440,12 @@ class MlrunProject(ModelObj):
3446
3440
 
3447
3441
  This will enable access to all secrets in vault registered to the current project.
3448
3442
 
3449
- :param kind: secret type (file, inline, env, vault, azure_vault)
3443
+ :param kind: secret type (file, inline, env, vault)
3450
3444
  :param source: secret data or link (see example)
3451
3445
  :param prefix: add a prefix to the keys in this source
3452
3446
 
3453
3447
  :returns: project object
3454
3448
  """
3455
- # Block using mlrun-auth-secrets.* via azure_vault's k8s_secret param (client-side only)
3456
- if kind == "azure_vault" and isinstance(source, dict):
3457
- candidate_secret_name = (source.get("k8s_secret") or "").strip()
3458
- if candidate_secret_name and mlrun.common.secrets.AUTH_SECRET_PATTERN.match(
3459
- candidate_secret_name
3460
- ):
3461
- raise mlrun.errors.MLRunInvalidArgumentError(
3462
- f"Forbidden secret '{candidate_secret_name}' matches MLRun auth-secret pattern."
3463
- )
3464
3449
 
3465
3450
  if kind == "vault" and isinstance(source, list):
3466
3451
  source = {"project": self.metadata.name, "secrets": source}
mlrun/runtimes/mounts.py CHANGED
@@ -17,8 +17,6 @@ import typing
17
17
  import warnings
18
18
  from collections import namedtuple
19
19
 
20
- import mlrun.common.secrets
21
- import mlrun.errors
22
20
  from mlrun.config import config
23
21
  from mlrun.config import config as mlconf
24
22
  from mlrun.errors import MLRunInvalidArgumentError
@@ -414,13 +412,6 @@ def mount_secret(
414
412
  the specified paths, and unlisted keys will not be
415
413
  present."""
416
414
 
417
- if secret_name and mlrun.common.secrets.AUTH_SECRET_PATTERN.match(
418
- secret_name.strip()
419
- ):
420
- raise mlrun.errors.MLRunInvalidArgumentError(
421
- f"Forbidden secret '{secret_name}' matches MLRun auth-secret pattern."
422
- )
423
-
424
415
  def _mount_secret(runtime: "KubeResource"):
425
416
  # Define the secret volume source
426
417
  secret_volume_source = {
@@ -44,7 +44,6 @@ from mlrun.serving.states import (
44
44
  )
45
45
  from mlrun.utils import get_caller_globals, logger, set_paths
46
46
 
47
- from ...common.secrets import AUTH_SECRET_PATTERN
48
47
  from .. import KubejobRuntime
49
48
  from ..pod import KubeResourceSpec
50
49
  from .function import NuclioSpec, RemoteRuntime, min_nuclio_versions
@@ -636,14 +635,7 @@ class ServingRuntime(RemoteRuntime):
636
635
 
637
636
  :returns: The Runtime (function) object
638
637
  """
639
- if kind == "azure_vault" and isinstance(source, dict):
640
- candidate_secret_name = (source.get("k8s_secret") or "").strip()
641
- if candidate_secret_name and AUTH_SECRET_PATTERN.match(
642
- candidate_secret_name
643
- ):
644
- raise mlrun.errors.MLRunInvalidArgumentError(
645
- f"Forbidden secret '{candidate_secret_name}' matches MLRun auth-secret pattern."
646
- )
638
+
647
639
  if kind == "vault" and isinstance(source, list):
648
640
  source = {"project": self.metadata.project, "secrets": source}
649
641
 
mlrun/runtimes/pod.py CHANGED
@@ -20,7 +20,6 @@ import typing
20
20
  import warnings
21
21
  from collections.abc import Iterable
22
22
  from enum import Enum
23
- from typing import Optional
24
23
 
25
24
  import dotenv
26
25
  import kubernetes.client as k8s_client
@@ -35,7 +34,6 @@ from mlrun.common.schemas import (
35
34
  SecurityContextEnrichmentModes,
36
35
  )
37
36
 
38
- from ..common.secrets import AUTH_SECRET_PATTERN
39
37
  from ..config import config as mlconf
40
38
  from ..k8s_utils import (
41
39
  generate_preemptible_nodes_affinity_terms,
@@ -710,44 +708,19 @@ class KubeResource(BaseRuntime):
710
708
  def spec(self, spec):
711
709
  self._spec = self._verify_dict(spec, "spec", KubeResourceSpec)
712
710
 
713
- def set_env_from_secret(
714
- self,
715
- name: str,
716
- secret: Optional[str] = None,
717
- secret_key: Optional[str] = None,
718
- ):
719
- """Set env var from secret; block auth-secret usage on client side."""
720
- self._validate_no_auth_secret(
721
- secret_name=secret,
722
- )
711
+ def set_env_from_secret(self, name, secret=None, secret_key=None):
712
+ """set pod environment var from secret"""
723
713
  secret_key = secret_key or name
724
714
  value_from = k8s_client.V1EnvVarSource(
725
- secret_key_ref=k8s_client.V1SecretKeySelector(
726
- name=secret,
727
- key=secret_key,
728
- )
729
- )
730
- return self._set_env(
731
- name=name,
732
- value_from=value_from,
715
+ secret_key_ref=k8s_client.V1SecretKeySelector(name=secret, key=secret_key)
733
716
  )
717
+ return self._set_env(name, value_from=value_from)
734
718
 
735
- def set_env(
736
- self,
737
- name: str,
738
- value: Optional[str] = None,
739
- value_from: Optional[typing.Any] = None,
740
- ):
741
- """Set env var; block auth-secret usage when coming from a secret."""
742
- if value_from is not None:
743
- secret_name = self._extract_secret_name_from_value_from(
744
- value_from=value_from,
745
- )
746
- self._validate_no_auth_secret(
747
- secret_name=secret_name,
748
- )
749
- return self._set_env(name, value_from=value_from)
750
- return self._set_env(name, value=str(value) if value is not None else None)
719
+ def set_env(self, name, value=None, value_from=None):
720
+ """set pod environment var from value"""
721
+ if value is not None:
722
+ return self._set_env(name, value=str(value))
723
+ return self._set_env(name, value_from=value_from)
751
724
 
752
725
  def with_annotations(self, annotations: dict):
753
726
  """set a key/value annotations in the metadata of the pod"""
@@ -1393,37 +1366,6 @@ class KubeResource(BaseRuntime):
1393
1366
 
1394
1367
  return self.status.state
1395
1368
 
1396
- @staticmethod
1397
- def _validate_no_auth_secret(
1398
- secret_name: Optional[str],
1399
- ):
1400
- """Raise if secret name matches MLRun auth-secret pattern."""
1401
- if secret_name and AUTH_SECRET_PATTERN.match(secret_name):
1402
- raise mlrun.errors.MLRunInvalidArgumentError(
1403
- f"Forbidden secret '{secret_name}' matches MLRun auth-secret pattern."
1404
- )
1405
-
1406
- @staticmethod
1407
- def _extract_secret_name_from_value_from(
1408
- value_from: typing.Any,
1409
- ) -> Optional[str]:
1410
- """Extract secret name from a V1EnvVarSource or dict representation."""
1411
- if isinstance(value_from, k8s_client.V1EnvVarSource):
1412
- if value_from.secret_key_ref:
1413
- return value_from.secret_key_ref.name
1414
- elif isinstance(value_from, dict):
1415
- value_from = (
1416
- value_from.get("valueFrom")
1417
- or value_from.get("value_from")
1418
- or value_from
1419
- )
1420
- secret_key_ref = (value_from or {}).get("secretKeyRef") or (
1421
- value_from or {}
1422
- ).get("secret_key_ref")
1423
- if isinstance(secret_key_ref, dict):
1424
- return secret_key_ref.get("name")
1425
- return None
1426
-
1427
1369
 
1428
1370
  def _resolve_if_type_sanitized(attribute_name, attribute):
1429
1371
  attribute_config = sanitized_attributes[attribute_name]
@@ -1,4 +1,4 @@
1
1
  {
2
- "git_commit": "a8c2a4e78b2c7ad2c929bb0edce5d9db47c2baea",
3
- "version": "1.10.0-rc39"
2
+ "git_commit": "3bb8c631304e89739430fbb6e6299e190fe6738a",
3
+ "version": "1.10.0-rc40"
4
4
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mlrun
3
- Version: 1.10.0rc39
3
+ Version: 1.10.0rc40
4
4
  Summary: Tracking and config of machine learning runs
5
5
  Home-page: https://github.com/mlrun/mlrun
6
6
  Author: Yaron Haviv
@@ -6,7 +6,7 @@ mlrun/execution.py,sha256=Ozu8SjO-nQ6l5vHwqrTQjmP6koMpUqNQpp6qn6jvhVE,58802
6
6
  mlrun/features.py,sha256=jMEXo6NB36A6iaxNEJWzdtYwUmglYD90OIKTIEeWhE8,15841
7
7
  mlrun/k8s_utils.py,sha256=zIacVyvsXrXVO-DdxAoGQOGEDWOGJEFJzYPhPVnn3z8,24548
8
8
  mlrun/lists.py,sha256=OlaV2QIFUzmenad9kxNJ3k4whlDyxI3zFbGwr6vpC5Y,8561
9
- mlrun/model.py,sha256=KnLnJjGa7SsJO1LSTvoMQbmp3JN4LExA7yJqCXvgAY4,89444
9
+ mlrun/model.py,sha256=JxYWYfMvRMloVEsxfghjH8gq5vsVCVk-OJmHGhbPJuU,88954
10
10
  mlrun/render.py,sha256=5DlhD6JtzHgmj5RVlpaYiHGhX84Q7qdi4RCEUj2UMgw,13195
11
11
  mlrun/run.py,sha256=BA0CPJqtcM3c-hMmnGl6AccRMyIejJxvCcrSXTwcRwU,49841
12
12
  mlrun/secrets.py,sha256=VFETVDJFZ0AGDivYjhYscO_YHnzeBnAebxlio7Svkq0,9633
@@ -24,7 +24,7 @@ mlrun/artifacts/plots.py,sha256=wmaxVXiAPSCyn3M7pIlcBu9pP3O8lrq0Ewx6iHRDF9s,4238
24
24
  mlrun/common/__init__.py,sha256=kXGBqhLN0rlAx0kTXhozGzFsIdSqW0uTSKMmsLgq_is,569
25
25
  mlrun/common/constants.py,sha256=BbKFJN6EoFSOmUmvos20ZAty8hWtwG0quTrfbLzrWO4,4294
26
26
  mlrun/common/helpers.py,sha256=DIdqs_eN3gO5bZ8iFobIvx8cEiOxYxhFIyut6-O69T0,1385
27
- mlrun/common/secrets.py,sha256=SCNLDIzC9-4r7CcJuJJxSAA89dUDcKD7g3yvSKIhqN4,5439
27
+ mlrun/common/secrets.py,sha256=8g9xtIw-9DGcwiZRT62a5ozSQM-aYo8yK5Ghey9WM0g,5179
28
28
  mlrun/common/types.py,sha256=1gxThbmC0Vd0U1ffIkEwz4T4S7JOgHt70rvw8TCO21c,1073
29
29
  mlrun/common/db/__init__.py,sha256=kXGBqhLN0rlAx0kTXhozGzFsIdSqW0uTSKMmsLgq_is,569
30
30
  mlrun/common/db/dialects.py,sha256=QN9bx7CTo32IIdJ2J3ZrsX8IUdp_BPxBtl0LyjMEC9g,868
@@ -281,7 +281,7 @@ mlrun/platforms/iguazio.py,sha256=32_o95Ntx9z3ciowt2NcnX7tAiLBwX3VB0mbTQ-KrIQ,13
281
281
  mlrun/projects/__init__.py,sha256=hdCOA6_fp8X4qGGGT7Bj7sPbkM1PayWuaVZL0DkpuZw,1240
282
282
  mlrun/projects/operations.py,sha256=Oo7h0TMztI_RVmj0rQxNS1igS_c94HpQZwMIFjiWt0E,21038
283
283
  mlrun/projects/pipelines.py,sha256=ZOfuIEHOXfuc4qAkuWvbWhCjP6kqpLkv-yBBaY9RXhg,52219
284
- mlrun/projects/project.py,sha256=alWbBKoOl_fej8IyFB397r7JYPZkSlRXrSsmVaaQw8U,258335
284
+ mlrun/projects/project.py,sha256=jSJ65upJ6zYRHly6aOQxBR6414Ypueg2iXE6XBjc-uQ,257695
285
285
  mlrun/runtimes/__init__.py,sha256=NSIk1xlUduSY3ZZ2tLmXegw1Z1im5_KjtbmsL874Z6s,9829
286
286
  mlrun/runtimes/base.py,sha256=CpIaml8nJbbPt8PQXDzy_AXbJ0LObRWk1lprRBDRYdI,38986
287
287
  mlrun/runtimes/daskjob.py,sha256=IN6gKKrmCIjWooj5FgFm-pAb2i7ra1ERRzClfu_rYGI,20102
@@ -290,8 +290,8 @@ mlrun/runtimes/function_reference.py,sha256=fnMKUEieKgy4JyVLhFpDtr6JvKgOaQP8F_K2
290
290
  mlrun/runtimes/generators.py,sha256=X8NDlCEPveDDPOHtOGcSpbl3pAVM3DP7fuPj5xVhxEY,7290
291
291
  mlrun/runtimes/kubejob.py,sha256=wadCzmSgjv9OU_Ax8CQNHfXLo0v-ev9ZGHUFGcNc9Qw,8577
292
292
  mlrun/runtimes/local.py,sha256=sbIFQdU-GBfAwESJGU06hiqXUiwjP6IVvbCieIPGQn4,22311
293
- mlrun/runtimes/mounts.py,sha256=S2nC5UaZFAl8N5HRyLkD9AUj7RqlPVSYVJcP9W8v4sg,19594
294
- mlrun/runtimes/pod.py,sha256=4GZCobICnLcIBCjIbdCRuL-4k7tu0CKXzv3iatKD_gg,60192
293
+ mlrun/runtimes/mounts.py,sha256=Q6oN1ilVcsFaVM1DAS-mfCD7vGWa7Wa9aEhRrctJPyk,19292
294
+ mlrun/runtimes/pod.py,sha256=HtSnhdfaT_rvYwybXjLowl3eOZSrRSyWqW7HYXuUT40,58252
295
295
  mlrun/runtimes/remotesparkjob.py,sha256=BalAea66GleaKeoYTw6ZL1Qr4wf1yRxfgk1-Fkc9Pqg,7864
296
296
  mlrun/runtimes/utils.py,sha256=b0T5Qm0WmbHk_I4d14ikzhhjymjIVedaifBi-ymKwOc,17733
297
297
  mlrun/runtimes/databricks_job/__init__.py,sha256=kXGBqhLN0rlAx0kTXhozGzFsIdSqW0uTSKMmsLgq_is,569
@@ -305,7 +305,7 @@ mlrun/runtimes/nuclio/__init__.py,sha256=osOVMN9paIOuUoOTizmkxMb_OXRP-SlPwXHJSSY
305
305
  mlrun/runtimes/nuclio/api_gateway.py,sha256=vH9ClKVP4Mb24rvA67xPuAvAhX-gAv6vVtjVxyplhdc,26969
306
306
  mlrun/runtimes/nuclio/function.py,sha256=vcW7IqCeLzxJ9YFBErqtEkp4MbgomFC1qWFTznBbNEY,56078
307
307
  mlrun/runtimes/nuclio/nuclio.py,sha256=sLK8KdGO1LbftlL3HqPZlFOFTAAuxJACZCVl1c0Ha6E,2942
308
- mlrun/runtimes/nuclio/serving.py,sha256=Y7wyqPrBS3Z-0QR6suGbqX36Cq-dKUwHI7zvO1fuLLo,39425
308
+ mlrun/runtimes/nuclio/serving.py,sha256=r5j6ZQJmofrhb_TNQDT1Mu0jdb98ej5yWYSewgf7f5Y,38934
309
309
  mlrun/runtimes/nuclio/application/__init__.py,sha256=rRs5vasy_G9IyoTpYIjYDafGoL6ifFBKgBtsXn31Atw,614
310
310
  mlrun/runtimes/nuclio/application/application.py,sha256=eVOdGXZF23VMxRhR_cZYArxxaUKKXtEshtomFf-vp3E,34065
311
311
  mlrun/runtimes/nuclio/application/reverse_proxy.go,sha256=lEHH74vr2PridIHp1Jkc_NjkrWb5b6zawRrNxHQhwGU,2913
@@ -352,11 +352,11 @@ mlrun/utils/notifications/notification/mail.py,sha256=ZyJ3eqd8simxffQmXzqd3bgbAq
352
352
  mlrun/utils/notifications/notification/slack.py,sha256=wSu_7W0EnGLBNwIgWCYEeTP8j9SPAMPDBnfUcPnVZYA,7299
353
353
  mlrun/utils/notifications/notification/webhook.py,sha256=FM5-LQAKAVJKp37MRzR3SsejalcnpM6r_9Oe7znxZEA,5313
354
354
  mlrun/utils/version/__init__.py,sha256=YnzE6tlf24uOQ8y7Z7l96QLAI6-QEii7-77g8ynmzy0,613
355
- mlrun/utils/version/version.json,sha256=0zf1ul8-GHaXcJBnhG8fhsvEvZAHbHo2DlsdZIEg4mk,90
355
+ mlrun/utils/version/version.json,sha256=d2kVwExSHA2hiyMjmiaPD_iZ5fjAznYTpHbWnGCOSVI,90
356
356
  mlrun/utils/version/version.py,sha256=M2hVhRrgkN3SxacZHs3ZqaOsqAA7B6a22ne324IQ1HE,1877
357
- mlrun-1.10.0rc39.dist-info/licenses/LICENSE,sha256=zTiv1CxWNkOk1q8eJS1G_8oD4gWpWLwWxj_Agcsi8Os,11337
358
- mlrun-1.10.0rc39.dist-info/METADATA,sha256=ZwFeqUwSkgA190q2yKK3LxcboenfDmI8VitS_siZVy0,26104
359
- mlrun-1.10.0rc39.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
360
- mlrun-1.10.0rc39.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
361
- mlrun-1.10.0rc39.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
362
- mlrun-1.10.0rc39.dist-info/RECORD,,
357
+ mlrun-1.10.0rc40.dist-info/licenses/LICENSE,sha256=zTiv1CxWNkOk1q8eJS1G_8oD4gWpWLwWxj_Agcsi8Os,11337
358
+ mlrun-1.10.0rc40.dist-info/METADATA,sha256=mvE99J8jhZaTLDUcm4FJxCBBri3R8GeqOEwsN6dAxt4,26104
359
+ mlrun-1.10.0rc40.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
360
+ mlrun-1.10.0rc40.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
361
+ mlrun-1.10.0rc40.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
362
+ mlrun-1.10.0rc40.dist-info/RECORD,,