zenml-nightly 0.62.0.dev20240723__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.dev20240723
1
+ 0.62.0.dev20240724
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zenml-nightly
3
- Version: 0.62.0.dev20240723
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=KFiLa4HCCGbwP8pgY-oopSQzVxgM4GpuIQoek8J2h5U,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
@@ -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
@@ -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.dev20240723.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
1341
- zenml_nightly-0.62.0.dev20240723.dist-info/METADATA,sha256=O2ypGr_pHHTSAHzBDlPLqBwibXmS9uGL-FxLHVbcgSE,21026
1342
- zenml_nightly-0.62.0.dev20240723.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1343
- zenml_nightly-0.62.0.dev20240723.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
1344
- zenml_nightly-0.62.0.dev20240723.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,,