zenml-nightly 0.62.0.dev20240722__py3-none-any.whl → 0.62.0.dev20240724__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.
zenml/VERSION CHANGED
@@ -1 +1 @@
1
- 0.62.0.dev20240722
1
+ 0.62.0.dev20240724
@@ -15,7 +15,6 @@
15
15
 
16
16
  import argparse
17
17
  import logging
18
- import os
19
18
  import sys
20
19
 
21
20
  from zenml import constants
@@ -45,8 +44,7 @@ def main() -> None:
45
44
  parser = argparse.ArgumentParser()
46
45
  parser.add_argument(f"--{ENTRYPOINT_CONFIG_SOURCE_OPTION}", required=True)
47
46
  args, remaining_args = parser.parse_known_args()
48
- if os.environ.get(constants.ENV_ZENML_CUSTOM_SOURCE_ROOT):
49
- source_utils.set_custom_source_root(source_root=os.getcwd())
47
+
50
48
  entrypoint_config_class = source_utils.load_and_validate_class(
51
49
  args.entrypoint_config_source,
52
50
  expected_class=BaseEntrypointConfiguration,
@@ -96,7 +96,6 @@ class DatabricksOrchestrator(WheeledOrchestrator):
96
96
  stack: "Stack",
97
97
  ) -> Tuple[bool, str]:
98
98
  for component in stack.components.values():
99
- continue # TODO: Remove this line
100
99
  if not component.config.is_local:
101
100
  continue
102
101
 
@@ -38,7 +38,6 @@ from kubernetes import config as k8s_config
38
38
 
39
39
  from zenml.config.base_settings import BaseSettings
40
40
  from zenml.enums import StackComponentType
41
- from zenml.environment import Environment
42
41
  from zenml.integrations.kubernetes.flavors.kubernetes_orchestrator_flavor import (
43
42
  KubernetesOrchestratorConfig,
44
43
  KubernetesOrchestratorSettings,
@@ -335,19 +334,8 @@ class KubernetesOrchestrator(ContainerizedOrchestrator):
335
334
  environment.
336
335
 
337
336
  Raises:
338
- RuntimeError: If trying to run from a Jupyter notebook.
337
+ RuntimeError: If the Kubernetes orchestrator is not configured.
339
338
  """
340
- # First check whether the code is running in a notebook.
341
- if Environment.in_notebook():
342
- raise RuntimeError(
343
- "The Kubernetes orchestrator cannot run pipelines in a notebook "
344
- "environment. The reason is that it is non-trivial to create "
345
- "a Docker image of a notebook. Please consider refactoring "
346
- "your notebook cells into separate scripts in a Python module "
347
- "and run the code outside of a notebook when using this "
348
- "orchestrator."
349
- )
350
-
351
339
  for step_name, step in deployment.step_configurations.items():
352
340
  if self.requires_resources_in_orchestration_environment(step):
353
341
  logger.warning(
@@ -155,15 +155,26 @@ def build_pod_manifest(
155
155
  if service_account_name is not None:
156
156
  pod_spec.service_account_name = service_account_name
157
157
 
158
+ labels = {}
159
+
158
160
  if pod_settings:
159
161
  add_pod_settings(pod_spec, pod_settings)
160
162
 
161
- pod_metadata = k8s_client.V1ObjectMeta(
162
- name=pod_name,
163
- labels={
163
+ # Add pod_settings.labels to the labels
164
+ if pod_settings.labels:
165
+ labels.update(pod_settings.labels)
166
+
167
+ # Add run_name and pipeline_name to the labels
168
+ labels.update(
169
+ {
164
170
  "run": run_name,
165
171
  "pipeline": pipeline_name,
166
- },
172
+ }
173
+ )
174
+
175
+ pod_metadata = k8s_client.V1ObjectMeta(
176
+ name=pod_name,
177
+ labels=labels,
167
178
  )
168
179
 
169
180
  if pod_settings and pod_settings.annotations:
@@ -34,6 +34,7 @@ class KubernetesPodSettings(BaseSettings):
34
34
  volume_mounts: Volume mounts to apply to the pod containers.
35
35
  host_ipc: Whether to enable host IPC for the pod.
36
36
  image_pull_secrets: Image pull secrets to use for the pod.
37
+ labels: Labels to apply to the pod.
37
38
  """
38
39
 
39
40
  node_selectors: Dict[str, str] = {}
@@ -45,6 +46,7 @@ class KubernetesPodSettings(BaseSettings):
45
46
  volume_mounts: List[Dict[str, Any]] = []
46
47
  host_ipc: bool = False
47
48
  image_pull_secrets: List[str] = []
49
+ labels: Dict[str, str] = {}
48
50
 
49
51
  @field_validator("volumes", mode="before")
50
52
  @classmethod
@@ -38,6 +38,7 @@ from zenml.config.source import (
38
38
  Source,
39
39
  SourceType,
40
40
  )
41
+ from zenml.constants import ENV_ZENML_CUSTOM_SOURCE_ROOT
41
42
  from zenml.environment import Environment
42
43
  from zenml.logger import get_logger
43
44
 
@@ -57,7 +58,9 @@ BuiltinFunctionTypeSource = Source(
57
58
  type=SourceType.BUILTIN,
58
59
  )
59
60
 
60
- _CUSTOM_SOURCE_ROOT: Optional[str] = None
61
+ _CUSTOM_SOURCE_ROOT: Optional[str] = os.getenv(
62
+ ENV_ZENML_CUSTOM_SOURCE_ROOT, None
63
+ )
61
64
 
62
65
 
63
66
  def load(source: Union[Source, str]) -> Any:
@@ -103,7 +103,9 @@ def dehydrate_response_model(
103
103
  )
104
104
 
105
105
  dehydrated_values = {}
106
- for key, value in dict(model).items():
106
+ # See `get_subresources_for_model(...)` for a detailed explanation why we
107
+ # need to use `model.__iter__()` here
108
+ for key, value in model.__iter__():
107
109
  dehydrated_values[key] = _dehydrate_value(
108
110
  value, permissions=permissions
109
111
  )
@@ -484,7 +486,13 @@ def get_subresources_for_model(
484
486
  """
485
487
  resources = set()
486
488
 
487
- for value in dict(model).values():
489
+ # We don't want to use `model.model_dump()` here as that recursively
490
+ # converts models to dicts, but we want to preserve those classes for
491
+ # the recursive `_get_subresources_for_value` calls.
492
+ # We previously used `dict(model)` here, but that lead to issues with
493
+ # models overwriting `__getattr__`, this `model.__iter__()` has the same
494
+ # results though.
495
+ for _, value in model.__iter__():
488
496
  resources.update(_get_subresources_for_value(value))
489
497
 
490
498
  return resources
@@ -117,7 +117,8 @@ def create_run_step(
117
117
  pipeline_run = zen_store().get_run(step.pipeline_run_id)
118
118
  verify_permission_for_model(pipeline_run, action=Action.UPDATE)
119
119
 
120
- return zen_store().create_run_step(step_run=step)
120
+ step_response = zen_store().create_run_step(step_run=step)
121
+ return dehydrate_response_model(step_response)
121
122
 
122
123
 
123
124
  @router.get(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zenml-nightly
3
- Version: 0.62.0.dev20240722
3
+ Version: 0.62.0.dev20240724
4
4
  Summary: ZenML: Write production-ready ML code.
5
5
  Home-page: https://zenml.io
6
6
  License: Apache-2.0
@@ -6,7 +6,7 @@ RELEASE_NOTES.md,sha256=rF05H0U7U4lCYWomDqKhWdaWtOfCFSOf10LNBoFnl3Y,349994
6
6
  ROADMAP.md,sha256=hiLSmr16BH8Dfx7SaQM4JcXCGCVl6mFZPFAwJeDTrJU,407
7
7
  SECURITY.md,sha256=9DepA8y03yvCZLHEfcXLTDH4lUyKHquAdukBsccNN7c,682
8
8
  zenml/README.md,sha256=827dekbOWAs1BpW7VF1a4d7EbwPbjwccX-2zdXBENZo,1777
9
- zenml/VERSION,sha256=5cbiUOfZDvEsLzdqSg1M3tO0asaw0EV2VmHKCU_yR7g,19
9
+ zenml/VERSION,sha256=_nHp1XaU7-Wj7_LXnlLe1L6yA0_8nnw1GKKU4__T2Qc,19
10
10
  zenml/__init__.py,sha256=6zRqB0FeBWX5E4Np9k9jzJgKaEHKvLFbtmOZQYrGpD8,2453
11
11
  zenml/_hub/__init__.py,sha256=6qDzpQAAZa__Aiiz0mC1qM-9dw9_jk_v_aXeJknxbDE,644
12
12
  zenml/_hub/client.py,sha256=Um2df1JO7-BmNm65efHSPpV5e0GITuoQJmod_wkdvbw,9136
@@ -110,7 +110,7 @@ zenml/data_validators/__init__.py,sha256=9Fa0jiUSQ_JsLMHYjqDayWQl4m_uuai9tQjIP60
110
110
  zenml/data_validators/base_data_validator.py,sha256=tk-7-SjUREs4FyVYkSx2KpsMQ-W0E9Z2nTf9WPE0EaU,9839
111
111
  zenml/entrypoints/__init__.py,sha256=2CMemOrHIJauxAss6k7dKFtsCFqgYR-JbAx4REoCaE8,946
112
112
  zenml/entrypoints/base_entrypoint_configuration.py,sha256=8dD_TRMUAXbRj6XNboQjyze3rNcomUG5F2Jg-TfuM6E,8449
113
- zenml/entrypoints/entrypoint.py,sha256=Cxh4S_F4URQQ1WF2fGuJEIfLcUWcxVDeDiKYJA4Kxps,2174
113
+ zenml/entrypoints/entrypoint.py,sha256=XNgXBCMKoidmP0_AYgMpqo-neG8Y8jG0rj43ofTDZ9E,2033
114
114
  zenml/entrypoints/pipeline_entrypoint_configuration.py,sha256=To-vTP29qAE36ndJDF1fRw9wL2Nk2bsBuO-ayAwvSmo,1646
115
115
  zenml/entrypoints/step_entrypoint_configuration.py,sha256=NskQF6OFFCIoD7v0JxR_cZRVXBRaKl3R0fwqpaQCPLM,6571
116
116
  zenml/enums.py,sha256=tyte4wjKGy3bmTydYMkJaXGaxPKED21XhNXWOqYpM5c,10053
@@ -204,7 +204,7 @@ zenml/integrations/databricks/flavors/databricks_orchestrator_flavor.py,sha256=7
204
204
  zenml/integrations/databricks/model_deployers/__init__.py,sha256=8qqgepgmJWbh4KqqckxZKv5z9w_vMHLtimN-8lSWU7o,833
205
205
  zenml/integrations/databricks/model_deployers/databricks_model_deployer.py,sha256=hxNxjs_CdPr4MX1zloVXdF75WQbvToV0oOV8P8vIAH0,9173
206
206
  zenml/integrations/databricks/orchestrators/__init__.py,sha256=qmpWv6-OjzvlQw3-hWcGaiJnwp3DgzwW4duJHG7QVys,830
207
- zenml/integrations/databricks/orchestrators/databricks_orchestrator.py,sha256=dUGCBvJPw1MPrBn2pr99Ewei6hOnhKx6K8sfiivbuiY,18805
207
+ zenml/integrations/databricks/orchestrators/databricks_orchestrator.py,sha256=82k7LM5-Womv5xxzmFEx0rGKWX4J28byimrvWXmawdc,18754
208
208
  zenml/integrations/databricks/orchestrators/databricks_orchestrator_entrypoint_config.py,sha256=KlZNkPMHacVqHG5bHwxf_5hK1lMQtigzJSitgap-3Mc,3492
209
209
  zenml/integrations/databricks/services/__init__.py,sha256=Sve9TXrgzs7PH_rFq4ReqAdnrffe-p0YzejRlcCgHTw,811
210
210
  zenml/integrations/databricks/services/databricks_deployment.py,sha256=RAjSeCegRHYJyKRE5EEKLZOKXDrNRGS_CGS9VfnZf98,14505
@@ -334,11 +334,11 @@ zenml/integrations/kubernetes/flavors/__init__.py,sha256=ANKG2tCNpna3xVSmA2V9WOw
334
334
  zenml/integrations/kubernetes/flavors/kubernetes_orchestrator_flavor.py,sha256=8SHSyXg0vPxTHsJhQ_MJpSLkDAAw-YvMNUQcvIn5ogo,7689
335
335
  zenml/integrations/kubernetes/orchestrators/__init__.py,sha256=TJID3OTieZBox36WpQpzD0jdVRA_aZVcs_bNtfXS8ik,811
336
336
  zenml/integrations/kubernetes/orchestrators/kube_utils.py,sha256=o5yfxHt3hPGc6ki5Pzr_FRcUk-KNUh2PTxRUlVnUVCI,10639
337
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py,sha256=y9mgs3QMBFGjSnvSufMh-tYHyeZtv6kf288tMboIFoA,20911
337
+ zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py,sha256=vuyHmaNwiVCPL7uN68HWa8gNmwNc0GH65NC48BfJgA8,20303
338
338
  zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint.py,sha256=Jbi32O6tOHxRpIBxRMVNsiniHzALHkggOUf6STCZy38,5835
339
339
  zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint_configuration.py,sha256=Y7uGU8eksMluGyXYsf688CwpiXwI_W6WYLscYwRZXRY,2494
340
- zenml/integrations/kubernetes/orchestrators/manifest_utils.py,sha256=uiLbA70aEQ7Z8yGMo9wbePGqQ1JGno_HSoeblJkI4UA,11151
341
- zenml/integrations/kubernetes/pod_settings.py,sha256=b_nLjwn1fXjywXjBWzvaZjnb1XyYSK-oPXfuTnpKZLg,4822
340
+ zenml/integrations/kubernetes/orchestrators/manifest_utils.py,sha256=LZwhoQDXrklD9p1Esx4yEWVQaZmrnXmkQ5CxgzjRXGg,11388
341
+ zenml/integrations/kubernetes/pod_settings.py,sha256=NMp4aHKRG29mh1Nq5uvV78Hzj1cMZj93poWCBiwov-M,4898
342
342
  zenml/integrations/kubernetes/serialization_utils.py,sha256=cPSe4szdBLzDnUZT9nQc2CCA8h84aj5oTA8vsUE36ig,7000
343
343
  zenml/integrations/kubernetes/service_connectors/__init__.py,sha256=Uf6zlHIapYrRDl3xOPWQ2jA7jt85SXx1U7DmSxzxTvQ,818
344
344
  zenml/integrations/kubernetes/service_connectors/kubernetes_service_connector.py,sha256=IbVWwKEXG7PZay1lj3Q1VNAlap4qGxjhE4yIW9_0tIc,19525
@@ -753,7 +753,7 @@ zenml/utils/secret_utils.py,sha256=KrLPwRyQqUFT-Sev6_Mm1iIyco_sAjbASqb6rZ_E9g4,5
753
753
  zenml/utils/settings_utils.py,sha256=msfMw1Mq_0ERaaCkAl6_BGQbUHCgf4fD2y4N4ZK3U04,4628
754
754
  zenml/utils/singleton.py,sha256=Qgi7yjV7asDuLiKTzFbeW-CoRRmW5RHRhmGAXtDZH7Y,2415
755
755
  zenml/utils/source_code_utils.py,sha256=8iyNA2MGIORYVEkSdxNTXfS1ZdFKXTAG1dZRkeQtPL0,3751
756
- zenml/utils/source_utils.py,sha256=6ei-5ab4ZlrzMwAIeF129qsom8bDXgVDKvqJKNjLi6o,20208
756
+ zenml/utils/source_utils.py,sha256=IJfgiMY1ECYbQydfolLXHFBCy7piEErqoSY7TCcTcn0,20312
757
757
  zenml/utils/string_utils.py,sha256=hOU_rgAoCn5rbMD9x3_KSdXNdIDSW9hp10gQdecOFcg,3881
758
758
  zenml/utils/terraform_utils.py,sha256=yI399qdGdQmQNRs-8cvDXEYMEqojmxH_ENEO7nr32_U,1584
759
759
  zenml/utils/typed_model.py,sha256=00EAo1I1VnOBHG4-ce8dPkyHRPpgi67SRIU-KdewRWs,4757
@@ -1103,7 +1103,7 @@ zenml/zen_server/rbac/__init__.py,sha256=nACbn_G7nZt_AWM3zeFL0FCmELvQnvaOFMwvTG3
1103
1103
  zenml/zen_server/rbac/endpoint_utils.py,sha256=F_l2LyucuOiN3OEOtw-Xs6bxJPrJNPlfZxZX9hAyqfU,6507
1104
1104
  zenml/zen_server/rbac/models.py,sha256=JXOeWxOBfVRCqci3X-UorVZEVLS3v9sBQIr0lmcYwHI,2370
1105
1105
  zenml/zen_server/rbac/rbac_interface.py,sha256=pNdfNtis5YhQgpWYkli7xNwfzNT_uXQlBaYKlSFi5HA,2881
1106
- zenml/zen_server/rbac/utils.py,sha256=BZ-9iATMT7VPB4VQQhVN_HdyQUDyIm8LRwy-wFUYbOk,19142
1106
+ zenml/zen_server/rbac/utils.py,sha256=WBeQgmlDXX-yi5LRv25tkh9oOtH_xmgSxaNPJOO9dzI,19635
1107
1107
  zenml/zen_server/rbac/zenml_cloud_rbac.py,sha256=mFWwskAEmeZyNCVF4aImEZpZNqm4SWALnSgbv7s0Zk4,6747
1108
1108
  zenml/zen_server/routers/__init__.py,sha256=ViyAhWL-ogHxE9wBvB_iMcur5H1NRVrzXkpogVY7FBA,641
1109
1109
  zenml/zen_server/routers/actions_endpoints.py,sha256=TgFFU9fMu43iqTu-ybnxJ5QokzV-eivRAd6pW2TrFe0,9549
@@ -1131,7 +1131,7 @@ zenml/zen_server/routers/service_endpoints.py,sha256=PyAxQLewVnpotfQI_OmyUTl7ohT
1131
1131
  zenml/zen_server/routers/stack_components_endpoints.py,sha256=mFVeAZY2QmlEdeowvaFO0wy6mG2zQlybOBvrFg4zWdU,6110
1132
1132
  zenml/zen_server/routers/stack_deployment_endpoints.py,sha256=_pYU96IM2o0tcQhKzGnO6pE38G9o25AldT_bbqljGO4,4931
1133
1133
  zenml/zen_server/routers/stacks_endpoints.py,sha256=imL7s26xFOf4EY4zwSz8y8-Ggl6-Xfu-tJY75TNodeo,4540
1134
- zenml/zen_server/routers/steps_endpoints.py,sha256=117ly8jW3-jInZ6ERQ1k54qHphr76ElPpta_O7F65fU,7635
1134
+ zenml/zen_server/routers/steps_endpoints.py,sha256=w-mOkidTIw_h0L0JZrc5XHr7oo80O5X9YZwlatqKN_M,7695
1135
1135
  zenml/zen_server/routers/tags_endpoints.py,sha256=oK-A-EqAsrIXXgl7A870I2PT8_fct1dZVQDQ-g8GHys,4941
1136
1136
  zenml/zen_server/routers/triggers_endpoints.py,sha256=1fHKDRDr6WsjnGCvkV7SOcX9cggw1rvHzce27uAzM9A,10190
1137
1137
  zenml/zen_server/routers/users_endpoints.py,sha256=f-ZuuqtOwiyhtucJ3RAJ4IzeQVYcPTaQBca_wAtlxcU,25199
@@ -1337,8 +1337,8 @@ zenml/zen_stores/secrets_stores/service_connector_secrets_store.py,sha256=kPYX-Z
1337
1337
  zenml/zen_stores/secrets_stores/sql_secrets_store.py,sha256=Bq1djrUP9saoD7vECjS7-TlA_7sjJGgw1talri4spjU,8656
1338
1338
  zenml/zen_stores/sql_zen_store.py,sha256=j1D_vqLzg8lK2wT-a8moDOXJfTVGAa_oA0bb-RHWEVo,381780
1339
1339
  zenml/zen_stores/zen_store_interface.py,sha256=ZcgPtlAMdO5die42Hwd6l8glxHYsxFjzuCBewIu5Hrs,91984
1340
- zenml_nightly-0.62.0.dev20240722.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
1341
- zenml_nightly-0.62.0.dev20240722.dist-info/METADATA,sha256=iwxGizROduJEVBSIFF9RpIMWzC15nJnnLvvk27Ycjs4,21026
1342
- zenml_nightly-0.62.0.dev20240722.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1343
- zenml_nightly-0.62.0.dev20240722.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
1344
- zenml_nightly-0.62.0.dev20240722.dist-info/RECORD,,
1340
+ zenml_nightly-0.62.0.dev20240724.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
1341
+ zenml_nightly-0.62.0.dev20240724.dist-info/METADATA,sha256=v3QDDM3Ix9c44Amfxi0Uj8qIFn1uC6uF1gnZGN1qsI4,21026
1342
+ zenml_nightly-0.62.0.dev20240724.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1343
+ zenml_nightly-0.62.0.dev20240724.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
1344
+ zenml_nightly-0.62.0.dev20240724.dist-info/RECORD,,