zenml-nightly 0.83.0.dev20250623__py3-none-any.whl → 0.83.1.dev20250625__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.
Files changed (158) hide show
  1. zenml/VERSION +1 -1
  2. zenml/cli/login.py +21 -3
  3. zenml/config/__init__.py +13 -2
  4. zenml/constants.py +0 -1
  5. zenml/exceptions.py +16 -0
  6. zenml/integrations/airflow/orchestrators/airflow_orchestrator.py +15 -6
  7. zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +54 -58
  8. zenml/integrations/azure/orchestrators/azureml_orchestrator.py +28 -19
  9. zenml/integrations/databricks/orchestrators/databricks_orchestrator.py +19 -63
  10. zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +36 -61
  11. zenml/integrations/hyperai/orchestrators/hyperai_orchestrator.py +19 -22
  12. zenml/integrations/kubeflow/orchestrators/kubeflow_orchestrator.py +28 -31
  13. zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py +33 -20
  14. zenml/integrations/lightning/orchestrators/lightning_orchestrator.py +25 -100
  15. zenml/integrations/skypilot/orchestrators/skypilot_base_vm_orchestrator.py +19 -8
  16. zenml/integrations/skypilot/utils.py +17 -13
  17. zenml/integrations/tekton/orchestrators/tekton_orchestrator.py +28 -12
  18. zenml/models/v2/core/step_run.py +1 -0
  19. zenml/orchestrators/__init__.py +2 -0
  20. zenml/orchestrators/base_orchestrator.py +137 -66
  21. zenml/orchestrators/input_utils.py +5 -13
  22. zenml/orchestrators/local/local_orchestrator.py +19 -9
  23. zenml/orchestrators/local_docker/local_docker_orchestrator.py +15 -5
  24. zenml/orchestrators/publish_utils.py +24 -0
  25. zenml/orchestrators/step_run_utils.py +1 -2
  26. zenml/pipelines/run_utils.py +12 -7
  27. zenml/step_operators/step_operator_entrypoint_configuration.py +1 -1
  28. zenml/zen_server/dashboard/assets/{404-DmJUgorp.js → 404-B5eko6XL.js} +1 -1
  29. zenml/zen_server/dashboard/assets/{@reactflow-8OCk19Fi.js → @reactflow-B_iCtR7X.js} +1 -1
  30. zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-CZW4QyWn.js → AlertDialogDropdownItem-DsOmO1FH.js} +1 -1
  31. zenml/zen_server/dashboard/assets/{ButtonGroup-DFWWFGUE.js → ButtonGroup-4sPZDv70.js} +1 -1
  32. zenml/zen_server/dashboard/assets/{CodeSnippet-D2HkkAGr.js → CodeSnippet-Ctplhzdc.js} +1 -1
  33. zenml/zen_server/dashboard/assets/{CollapsibleCard-CnS09ljw.js → CollapsibleCard-CBKenz9f.js} +1 -1
  34. zenml/zen_server/dashboard/assets/{ComponentBadge-CDgdd0Ks.js → ComponentBadge-Cnecw3qz.js} +1 -1
  35. zenml/zen_server/dashboard/assets/{ComponentIcon-CbbOc7lb.js → ComponentIcon-CMiVW-O6.js} +1 -1
  36. zenml/zen_server/dashboard/assets/{DeleteAlertDialog-VIOMDLmx.js → DeleteAlertDialog-DEI0YDzP.js} +1 -1
  37. zenml/zen_server/dashboard/assets/{DialogItem-ClFCqxEp.js → DialogItem-CRCDpYU6.js} +1 -1
  38. zenml/zen_server/dashboard/assets/{Error-CQzjbDcN.js → Error-BG6f_WRd.js} +1 -1
  39. zenml/zen_server/dashboard/assets/{ExecutionStatus-CWreILP0.js → ExecutionStatus-BuhNAE9w.js} +1 -1
  40. zenml/zen_server/dashboard/assets/{Helpbox-CiKxG5_X.js → Helpbox-DtUG2Bf_.js} +1 -1
  41. zenml/zen_server/dashboard/assets/{Infobox-CGxFvqzi.js → Infobox-CSBRrM6r.js} +1 -1
  42. zenml/zen_server/dashboard/assets/{LeftSideMenu-DCsKdIjC.js → LeftSideMenu-DPsCCK3z.js} +1 -1
  43. zenml/zen_server/dashboard/assets/{NestedCollapsible-3M4llYtH.js → NestedCollapsible-CMuDIJlp.js} +1 -1
  44. zenml/zen_server/dashboard/assets/{NumberBox-C0mQktmV.js → NumberBox-DtCv7jh3.js} +1 -1
  45. zenml/zen_server/dashboard/assets/Pagination-CWnEpSpN.js +1 -0
  46. zenml/zen_server/dashboard/assets/{Partials-DSjkttlz.js → Partials-CfHD6OH5.js} +1 -1
  47. zenml/zen_server/dashboard/assets/{ProCta-Dm5cWKpS.js → ProCta-CNyp04C8.js} +1 -1
  48. zenml/zen_server/dashboard/assets/{ProviderIcon-DPwMR6nF.js → ProviderIcon-DHejyg7C.js} +1 -1
  49. zenml/zen_server/dashboard/assets/{ProviderRadio-DEDNRgAb.js → ProviderRadio-tGtie8Gc.js} +1 -1
  50. zenml/zen_server/dashboard/assets/RunsBody-mYwMcWWj.js +1 -0
  51. zenml/zen_server/dashboard/assets/SearchField-BtUi6cYl.js +1 -0
  52. zenml/zen_server/dashboard/assets/{SecretTooltip-CZTRnaCV.js → SecretTooltip-B5u1UsQ9.js} +1 -1
  53. zenml/zen_server/dashboard/assets/{SetPassword-BjNGDC5e.js → SetPassword-BmbgL_ed.js} +1 -1
  54. zenml/zen_server/dashboard/assets/{SheetHeader-CASpN2Lz.js → SheetHeader-DkH7aG9K.js} +1 -1
  55. zenml/zen_server/dashboard/assets/StackComponentList-Bi8BKqCu.js +1 -0
  56. zenml/zen_server/dashboard/assets/StackList-Cvxapo0p.js +1 -0
  57. zenml/zen_server/dashboard/assets/{StackName-ojLC6xdl.js → StackName-CFSZL8ec.js} +1 -1
  58. zenml/zen_server/dashboard/assets/Tabs-D4dv48ry.js +1 -0
  59. zenml/zen_server/dashboard/assets/{Tick-BPrWnNlN.js → Tick-Qquvr4P3.js} +1 -1
  60. zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-CNfKDo2Q.js → UpdatePasswordSchemas-D_DCETSO.js} +1 -1
  61. zenml/zen_server/dashboard/assets/{UsageReason-Cb-mpV8M.js → UsageReason-DhiUV1bu.js} +1 -1
  62. zenml/zen_server/dashboard/assets/{Wizard-Dg8Pmn5A.js → Wizard-BHvY75u_.js} +1 -1
  63. zenml/zen_server/dashboard/assets/{WizardFooter-BcNDIvlQ.js → WizardFooter-FQm8y-jP.js} +1 -1
  64. zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-DCdax7I5.js → all-pipeline-runs-query-DpKw9WL9.js} +1 -1
  65. zenml/zen_server/dashboard/assets/{bulk-delete-C_kpIB9A.js → bulk-delete-CzYA--cC.js} +1 -1
  66. zenml/zen_server/dashboard/assets/{configuration-form-B2hmKGnF.js → configuration-form-DSoMMiPE.js} +1 -1
  67. zenml/zen_server/dashboard/assets/{constants-1EZZxtay.js → constants-DTfsIqHy.js} +1 -1
  68. zenml/zen_server/dashboard/assets/{create-stack-TKmMtrkQ.js → create-stack-BpZrmKDu.js} +1 -1
  69. zenml/zen_server/dashboard/assets/{delete-run-CCR9md_s.js → delete-run-BkyDsKQc.js} +1 -1
  70. zenml/zen_server/dashboard/assets/elk-worker.min-BdOC9sib.js +6263 -0
  71. zenml/zen_server/dashboard/assets/expand-full-BPiXpch2.js +1 -0
  72. zenml/zen_server/dashboard/assets/{form-DFJkaFDX.js → form-BgtamtJm.js} +1 -1
  73. zenml/zen_server/dashboard/assets/{form-schemas-CrznJVzA.js → form-schemas-dyDkAxXP.js} +1 -1
  74. zenml/zen_server/dashboard/assets/{index-BjUu1mP4.js → index-BBt0LDtR.js} +1 -1
  75. zenml/zen_server/dashboard/assets/index-BfNISy0X.css +1 -0
  76. zenml/zen_server/dashboard/assets/{index-BFqbGSck.js → index-BgEfQ3_G.js} +4 -4
  77. zenml/zen_server/dashboard/assets/{index-U992soPJ.js → index-eoDB_1XX.js} +1 -1
  78. zenml/zen_server/dashboard/assets/{layout-Do9YI4QX.js → layout-o1x87a3q.js} +1 -1
  79. zenml/zen_server/dashboard/assets/{login-mutation-D3tFP6Wm.js → login-mutation-C1hvP_cX.js} +1 -1
  80. zenml/zen_server/dashboard/assets/page-4xUZpMN0.js +31 -0
  81. zenml/zen_server/dashboard/assets/page-4zc4xPv2.js +2 -0
  82. zenml/zen_server/dashboard/assets/page-B0104V6C.js +1 -0
  83. zenml/zen_server/dashboard/assets/page-BNJsjvof.js +1 -0
  84. zenml/zen_server/dashboard/assets/{page-sJjNT9xA.js → page-BPQ66vR-.js} +1 -1
  85. zenml/zen_server/dashboard/assets/{page-CAJ8B0vb.js → page-BQgSZ2nH.js} +1 -1
  86. zenml/zen_server/dashboard/assets/page-BXl2ZX6J.js +1 -0
  87. zenml/zen_server/dashboard/assets/{page-CtiuMP_r.js → page-BxeZrG_t.js} +1 -1
  88. zenml/zen_server/dashboard/assets/{page-Cal6XQ4U.js → page-C2A-2Cj_.js} +1 -1
  89. zenml/zen_server/dashboard/assets/page-C2i-C7jv.js +1 -0
  90. zenml/zen_server/dashboard/assets/{page-DJIGaUQ9.js → page-C3JfJxuR.js} +1 -1
  91. zenml/zen_server/dashboard/assets/{page-ChGcZI_6.js → page-CESEqC2L.js} +1 -1
  92. zenml/zen_server/dashboard/assets/{page-DCcuPZ8P.js → page-CF8cTZ7l.js} +1 -1
  93. zenml/zen_server/dashboard/assets/page-CKjsimVu.js +1 -0
  94. zenml/zen_server/dashboard/assets/{page-DNjKHjnH.js → page-COLzBwff.js} +1 -1
  95. zenml/zen_server/dashboard/assets/page-COifg5fa.js +1 -0
  96. zenml/zen_server/dashboard/assets/{page-CnbIYE80.js → page-CQeJuA8T.js} +1 -1
  97. zenml/zen_server/dashboard/assets/{page-DKK6ulgy.js → page-CcjWEjre.js} +1 -1
  98. zenml/zen_server/dashboard/assets/{page-9RjCitFH.js → page-CefGLeWy.js} +1 -1
  99. zenml/zen_server/dashboard/assets/{page-DUKbOhaD.js → page-CfxpV3j4.js} +1 -1
  100. zenml/zen_server/dashboard/assets/{page-D9Hfx6GV.js → page-ClcUzawe.js} +1 -1
  101. zenml/zen_server/dashboard/assets/page-Ct_LB3zo.js +1 -0
  102. zenml/zen_server/dashboard/assets/page-D-ZWUMYY.js +1 -0
  103. zenml/zen_server/dashboard/assets/{page-CUaMMoPG.js → page-D-tJ_Y0a.js} +1 -1
  104. zenml/zen_server/dashboard/assets/{page-CdZCmszX.js → page-DHrvih9u.js} +1 -1
  105. zenml/zen_server/dashboard/assets/{page-DUK0Nd_1.js → page-DMhaHZDw.js} +1 -1
  106. zenml/zen_server/dashboard/assets/{page-CAUYrfui.js → page-DOCOmmKn.js} +1 -1
  107. zenml/zen_server/dashboard/assets/{page-akLcPcKw.js → page-DcQmxKLp.js} +1 -1
  108. zenml/zen_server/dashboard/assets/page-Dh4GRWw5.js +1 -0
  109. zenml/zen_server/dashboard/assets/{page-DwVPpCFg.js → page-DiHZK-1w.js} +1 -1
  110. zenml/zen_server/dashboard/assets/page-Dn7ZNapg.js +1 -0
  111. zenml/zen_server/dashboard/assets/page-Dy4vSQY7.js +1 -0
  112. zenml/zen_server/dashboard/assets/{page-CN7lkvXr.js → page-QrvWQwZb.js} +1 -1
  113. zenml/zen_server/dashboard/assets/{page-BrT0_zSJ.js → page-RF3Fup0q.js} +1 -1
  114. zenml/zen_server/dashboard/assets/page-WuvCrN47.js +1 -0
  115. zenml/zen_server/dashboard/assets/{page-Be3R2uYn.js → page-_WnHBI1F.js} +1 -1
  116. zenml/zen_server/dashboard/assets/{page-C210HcBA.js → page-ghjVNgVE.js} +1 -1
  117. zenml/zen_server/dashboard/assets/{page-BCrKmYIZ.js → page-iDsDiDXw.js} +1 -1
  118. zenml/zen_server/dashboard/assets/{page-ClvmVesa.js → page-rVhXI5ZO.js} +1 -1
  119. zenml/zen_server/dashboard/assets/{page-DEohTSz6.js → page-uxjMX8Iq.js} +1 -1
  120. zenml/zen_server/dashboard/assets/{persist-Dec_w7aB.js → persist-BsdEtCkd.js} +1 -1
  121. zenml/zen_server/dashboard/assets/{persist-DWMWVP-y.js → persist-CFPbMcJX.js} +1 -1
  122. zenml/zen_server/dashboard/assets/{resource-tyes-list-o2LXiMay.js → resource-tyes-list-79FqS3LY.js} +1 -1
  123. zenml/zen_server/dashboard/assets/{resource-type-tooltip-DwHrJstL.js → resource-type-tooltip-BL9ZTRKi.js} +1 -1
  124. zenml/zen_server/dashboard/assets/{service-connectors-DSEMwJ5A.js → service-connectors-Q8h7-_rG.js} +1 -1
  125. zenml/zen_server/dashboard/assets/{service-jxtvgks0.js → service-k-9Vsb30.js} +1 -1
  126. zenml/zen_server/dashboard/assets/{sharedSchema-BXzg0EZz.js → sharedSchema-C_HkejsG.js} +1 -1
  127. zenml/zen_server/dashboard/assets/{stack-detail-query-Cm0fsgo-.js → stack-detail-query-CNmVZ0Bo.js} +1 -1
  128. zenml/zen_server/dashboard/assets/{update-current-user-mutation-D5MjcQ6F.js → update-current-user-mutation-Ca-Lmwuj.js} +1 -1
  129. zenml/zen_server/dashboard/assets/{update-server-settings-mutation-CmnxdxiK.js → update-server-settings-mutation-Bwe3gUt4.js} +1 -1
  130. zenml/zen_server/dashboard/index.html +4 -4
  131. zenml/zen_stores/migrations/versions/0.83.1_release.py +23 -0
  132. zenml/zen_stores/rest_zen_store.py +147 -128
  133. zenml/zen_stores/sql_zen_store.py +27 -17
  134. {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250625.dist-info}/METADATA +5 -9
  135. {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250625.dist-info}/RECORD +138 -134
  136. zenml/zen_server/dashboard/assets/RunsBody-BRBn1e2O.js +0 -1
  137. zenml/zen_server/dashboard/assets/SearchField-DY6-UbRT.js +0 -1
  138. zenml/zen_server/dashboard/assets/StackComponentList-Be1pQt9m.js +0 -1
  139. zenml/zen_server/dashboard/assets/StackList-BdiR5DvR.js +0 -1
  140. zenml/zen_server/dashboard/assets/Tabs-DNSKblCM.js +0 -1
  141. zenml/zen_server/dashboard/assets/index-DuhuqTCI.css +0 -1
  142. zenml/zen_server/dashboard/assets/page-B0PsXWiT.js +0 -1
  143. zenml/zen_server/dashboard/assets/page-BcRI3-aR.js +0 -29
  144. zenml/zen_server/dashboard/assets/page-BgknnddT.js +0 -1
  145. zenml/zen_server/dashboard/assets/page-Bs3W2FDi.js +0 -1
  146. zenml/zen_server/dashboard/assets/page-C6KaiZ_W.js +0 -1
  147. zenml/zen_server/dashboard/assets/page-CHxVhF3x.js +0 -1
  148. zenml/zen_server/dashboard/assets/page-CktmtZ8Z.js +0 -1
  149. zenml/zen_server/dashboard/assets/page-CoXzjeEY.js +0 -1
  150. zenml/zen_server/dashboard/assets/page-D9iuB88h.js +0 -1
  151. zenml/zen_server/dashboard/assets/page-DYOucPtA.js +0 -1
  152. zenml/zen_server/dashboard/assets/page-DpqRelAy.js +0 -1
  153. zenml/zen_server/dashboard/assets/page-XURWnYZP.js +0 -1
  154. zenml/zen_server/dashboard/assets/page-abw-2oeW.js +0 -1
  155. zenml/zen_server/dashboard/assets/page-n9ejQ2V3.js +0 -2
  156. {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250625.dist-info}/LICENSE +0 -0
  157. {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250625.dist-info}/WHEEL +0 -0
  158. {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250625.dist-info}/entry_points.txt +0 -0
@@ -14,7 +14,16 @@
14
14
  """Base orchestrator class."""
15
15
 
16
16
  from abc import ABC, abstractmethod
17
- from typing import TYPE_CHECKING, Any, Dict, Iterator, Optional, Type, cast
17
+ from typing import (
18
+ TYPE_CHECKING,
19
+ Any,
20
+ Callable,
21
+ Dict,
22
+ Iterator,
23
+ Optional,
24
+ Type,
25
+ cast,
26
+ )
18
27
  from uuid import UUID
19
28
 
20
29
  from pydantic import model_validator
@@ -24,9 +33,13 @@ from zenml.constants import (
24
33
  handle_bool_env_var,
25
34
  )
26
35
  from zenml.enums import ExecutionStatus, StackComponentType
36
+ from zenml.exceptions import RunMonitoringError
27
37
  from zenml.logger import get_logger
28
38
  from zenml.metadata.metadata_types import MetadataType
29
- from zenml.orchestrators.publish_utils import publish_pipeline_run_metadata
39
+ from zenml.orchestrators.publish_utils import (
40
+ publish_pipeline_run_metadata,
41
+ publish_schedule_metadata,
42
+ )
30
43
  from zenml.orchestrators.step_launcher import StepLauncher
31
44
  from zenml.orchestrators.utils import get_config_environment_vars
32
45
  from zenml.stack import Flavor, Stack, StackComponent, StackComponentConfig
@@ -39,6 +52,26 @@ if TYPE_CHECKING:
39
52
  logger = get_logger(__name__)
40
53
 
41
54
 
55
+ class SubmissionResult:
56
+ """Result of submitting a pipeline run."""
57
+
58
+ def __init__(
59
+ self,
60
+ wait_for_completion: Optional[Callable[[], None]] = None,
61
+ metadata: Optional[Dict[str, MetadataType]] = None,
62
+ ):
63
+ """Initialize a submission result.
64
+
65
+ Args:
66
+ wait_for_completion: A function that waits for the pipeline run to
67
+ complete. If provided, this will be called after the pipeline
68
+ run was submitted successfully.
69
+ metadata: Metadata for the pipeline run or schedule.
70
+ """
71
+ self.wait_for_completion = wait_for_completion
72
+ self.metadata = metadata
73
+
74
+
42
75
  class BaseOrchestratorConfig(StackComponentConfig):
43
76
  """Base orchestrator config."""
44
77
 
@@ -95,22 +128,7 @@ class BaseOrchestratorConfig(StackComponentConfig):
95
128
 
96
129
 
97
130
  class BaseOrchestrator(StackComponent, ABC):
98
- """Base class for all orchestrators.
99
-
100
- In order to implement an orchestrator you will need to subclass from this
101
- class.
102
-
103
- How it works:
104
- -------------
105
- The `run(...)` method is the entrypoint that is executed when the
106
- pipeline's run method is called within the user code
107
- (`pipeline_instance.run(...)`).
108
-
109
- This method will do some internal preparation and then call the
110
- `prepare_or_run_pipeline(...)` method. BaseOrchestrator subclasses must
111
- implement this method and either run the pipeline steps directly or deploy
112
- the pipeline to some remote infrastructure.
113
- """
131
+ """Base class for all orchestrators."""
114
132
 
115
133
  _active_deployment: Optional["PipelineDeploymentResponse"] = None
116
134
 
@@ -134,7 +152,32 @@ class BaseOrchestrator(StackComponent, ABC):
134
152
  The orchestrator run id.
135
153
  """
136
154
 
137
- @abstractmethod
155
+ def submit_pipeline(
156
+ self,
157
+ deployment: "PipelineDeploymentResponse",
158
+ stack: "Stack",
159
+ environment: Dict[str, str],
160
+ placeholder_run: Optional["PipelineRunResponse"] = None,
161
+ ) -> Optional[SubmissionResult]:
162
+ """Submits a pipeline to the orchestrator.
163
+
164
+ This method should only submit the pipeline and not wait for it to
165
+ complete. If the orchestrator is configured to wait for the pipeline run
166
+ to complete, a function that waits for the pipeline run to complete can
167
+ be passed as part of the submission result.
168
+
169
+ Args:
170
+ deployment: The pipeline deployment to submit.
171
+ stack: The stack the pipeline will run on.
172
+ environment: Environment variables to set in the orchestration
173
+ environment. These don't need to be set if running locally.
174
+ placeholder_run: An optional placeholder run for the deployment.
175
+
176
+ Returns:
177
+ Optional submission result.
178
+ """
179
+ return None
180
+
138
181
  def prepare_or_run_pipeline(
139
182
  self,
140
183
  deployment: "PipelineDeploymentResponse",
@@ -142,34 +185,7 @@ class BaseOrchestrator(StackComponent, ABC):
142
185
  environment: Dict[str, str],
143
186
  placeholder_run: Optional["PipelineRunResponse"] = None,
144
187
  ) -> Optional[Iterator[Dict[str, MetadataType]]]:
145
- """The method needs to be implemented by the respective orchestrator.
146
-
147
- Depending on the type of orchestrator you'll have to perform slightly
148
- different operations.
149
-
150
- Simple Case:
151
- ------------
152
- The Steps are run directly from within the same environment in which
153
- the orchestrator code is executed. In this case you will need to
154
- deal with implementation-specific runtime configurations (like the
155
- schedule) and then iterate through the steps and finally call
156
- `self.run_step(...)` to execute each step.
157
-
158
- Advanced Case:
159
- --------------
160
- Most orchestrators will not run the steps directly. Instead, they
161
- build some intermediate representation of the pipeline that is then
162
- used to create and run the pipeline and its steps on the target
163
- environment. For such orchestrators this method will have to build
164
- this representation and deploy it.
165
-
166
- Regardless of the implementation details, the orchestrator will need
167
- to run each step in the target environment. For this the
168
- `self.run_step(...)` method should be used.
169
-
170
- The easiest way to make this work is by using an entrypoint
171
- configuration to run single steps (`zenml.entrypoints.step_entrypoint_configuration.StepEntrypointConfiguration`)
172
- or entire pipelines (`zenml.entrypoints.pipeline_entrypoint_configuration.PipelineEntrypointConfiguration`).
188
+ """DEPRECATED: Prepare or run a pipeline.
173
189
 
174
190
  Args:
175
191
  deployment: The pipeline deployment to prepare or run.
@@ -177,9 +193,6 @@ class BaseOrchestrator(StackComponent, ABC):
177
193
  environment: Environment variables to set in the orchestration
178
194
  environment. These don't need to be set if running locally.
179
195
  placeholder_run: An optional placeholder run for the deployment.
180
-
181
- Yields:
182
- Metadata for the pipeline run.
183
196
  """
184
197
 
185
198
  def run(
@@ -195,6 +208,10 @@ class BaseOrchestrator(StackComponent, ABC):
195
208
  stack: The stack on which to run the pipeline.
196
209
  placeholder_run: An optional placeholder run for the deployment.
197
210
  This will be deleted in case the pipeline deployment failed.
211
+
212
+ Raises:
213
+ RunMonitoringError: If a failure happened while monitoring the
214
+ pipeline run.
198
215
  """
199
216
  self._prepare_run(deployment=deployment)
200
217
 
@@ -237,24 +254,78 @@ class BaseOrchestrator(StackComponent, ABC):
237
254
  logger.debug("Skipping client-side caching.")
238
255
 
239
256
  try:
240
- if metadata_iterator := self.prepare_or_run_pipeline(
241
- deployment=deployment,
242
- stack=stack,
243
- environment=environment,
244
- placeholder_run=placeholder_run,
257
+ if (
258
+ getattr(self.submit_pipeline, "__func__", None)
259
+ is BaseOrchestrator.submit_pipeline
245
260
  ):
246
- for metadata_dict in metadata_iterator:
247
- try:
248
- if placeholder_run:
249
- publish_pipeline_run_metadata(
250
- pipeline_run_id=placeholder_run.id,
251
- pipeline_run_metadata={self.id: metadata_dict},
261
+ logger.warning(
262
+ "The orchestrator '%s' is still using the deprecated "
263
+ "`prepare_or_run_pipeline(...)` method which will be "
264
+ "removed in the future. Please implement the replacement "
265
+ "`submit_pipeline(...)` method for your custom "
266
+ "orchestrator.",
267
+ self.name,
268
+ )
269
+ if metadata_iterator := self.prepare_or_run_pipeline(
270
+ deployment=deployment,
271
+ stack=stack,
272
+ environment=environment,
273
+ placeholder_run=placeholder_run,
274
+ ):
275
+ for metadata_dict in metadata_iterator:
276
+ try:
277
+ if placeholder_run:
278
+ publish_pipeline_run_metadata(
279
+ pipeline_run_id=placeholder_run.id,
280
+ pipeline_run_metadata={
281
+ self.id: metadata_dict
282
+ },
283
+ )
284
+ except Exception as e:
285
+ logger.debug(
286
+ "Something went went wrong trying to publish the"
287
+ f"run metadata: {e}"
252
288
  )
253
- except Exception as e:
254
- logger.debug(
255
- "Something went went wrong trying to publish the"
256
- f"run metadata: {e}"
257
- )
289
+ else:
290
+ submission_result = self.submit_pipeline(
291
+ deployment=deployment,
292
+ stack=stack,
293
+ environment=environment,
294
+ placeholder_run=placeholder_run,
295
+ )
296
+
297
+ if submission_result:
298
+ if submission_result.metadata:
299
+ if placeholder_run:
300
+ try:
301
+ publish_pipeline_run_metadata(
302
+ pipeline_run_id=placeholder_run.id,
303
+ pipeline_run_metadata={
304
+ self.id: submission_result.metadata
305
+ },
306
+ )
307
+ except Exception as e:
308
+ logger.debug(
309
+ "Error publishing run metadata: %s", e
310
+ )
311
+ elif deployment.schedule:
312
+ try:
313
+ publish_schedule_metadata(
314
+ schedule_id=deployment.schedule.id,
315
+ schedule_metadata={
316
+ self.id: submission_result.metadata
317
+ },
318
+ )
319
+ except Exception as e:
320
+ logger.debug(
321
+ "Error publishing schedule metadata: %s", e
322
+ )
323
+
324
+ if submission_result.wait_for_completion:
325
+ try:
326
+ submission_result.wait_for_completion()
327
+ except BaseException as e:
328
+ raise RunMonitoringError(original_exception=e)
258
329
  finally:
259
330
  self._cleanup_run()
260
331
 
@@ -14,8 +14,7 @@
14
14
  """Utilities for inputs."""
15
15
 
16
16
  import json
17
- from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
18
- from uuid import UUID
17
+ from typing import TYPE_CHECKING, Dict, Optional
19
18
 
20
19
  from zenml.client import Client
21
20
  from zenml.config.step_configurations import Step
@@ -32,7 +31,7 @@ def resolve_step_inputs(
32
31
  step: "Step",
33
32
  pipeline_run: "PipelineRunResponse",
34
33
  step_runs: Optional[Dict[str, "StepRunResponse"]] = None,
35
- ) -> Tuple[Dict[str, "StepRunInputResponse"], List[UUID]]:
34
+ ) -> Dict[str, "StepRunInputResponse"]:
36
35
  """Resolves inputs for the current step.
37
36
 
38
37
  Args:
@@ -49,16 +48,14 @@ def resolve_step_inputs(
49
48
  resolved in runtime due to missing object.
50
49
 
51
50
  Returns:
52
- The IDs of the input artifact versions and the IDs of parent steps of
53
- the current step.
51
+ The input artifact versions.
54
52
  """
55
53
  from zenml.models import ArtifactVersionResponse
56
54
  from zenml.models.v2.core.step_run import StepRunInputResponse
57
55
 
58
56
  step_runs = step_runs or {}
59
57
 
60
- steps_to_fetch = set(step.spec.upstream_steps)
61
- steps_to_fetch.update(
58
+ steps_to_fetch = set(
62
59
  input_.step_name for input_ in step.spec.inputs.values()
63
60
  )
64
61
  # Remove all the step runs that we've already fetched.
@@ -205,9 +202,4 @@ def resolve_step_inputs(
205
202
  else:
206
203
  step.config.parameters[name] = value_
207
204
 
208
- parent_step_ids = [
209
- step_runs[upstream_step].id
210
- for upstream_step in step.spec.upstream_steps
211
- ]
212
-
213
- return input_artifacts, parent_step_ids
205
+ return input_artifacts
@@ -14,14 +14,15 @@
14
14
  """Implementation of the ZenML local orchestrator."""
15
15
 
16
16
  import time
17
- from typing import TYPE_CHECKING, Any, Dict, Optional, Type
17
+ from typing import TYPE_CHECKING, Dict, Optional, Type
18
18
  from uuid import uuid4
19
19
 
20
20
  from zenml.logger import get_logger
21
- from zenml.orchestrators import BaseOrchestrator
22
- from zenml.orchestrators.base_orchestrator import (
21
+ from zenml.orchestrators import (
22
+ BaseOrchestrator,
23
23
  BaseOrchestratorConfig,
24
24
  BaseOrchestratorFlavor,
25
+ SubmissionResult,
25
26
  )
26
27
  from zenml.stack import Stack
27
28
  from zenml.utils import string_utils
@@ -41,21 +42,29 @@ class LocalOrchestrator(BaseOrchestrator):
41
42
 
42
43
  _orchestrator_run_id: Optional[str] = None
43
44
 
44
- def prepare_or_run_pipeline(
45
+ def submit_pipeline(
45
46
  self,
46
47
  deployment: "PipelineDeploymentResponse",
47
48
  stack: "Stack",
48
49
  environment: Dict[str, str],
49
50
  placeholder_run: Optional["PipelineRunResponse"] = None,
50
- ) -> Any:
51
- """Iterates through all steps and executes them sequentially.
51
+ ) -> Optional[SubmissionResult]:
52
+ """Submits a pipeline to the orchestrator.
53
+
54
+ This method should only submit the pipeline and not wait for it to
55
+ complete. If the orchestrator is configured to wait for the pipeline run
56
+ to complete, a function that waits for the pipeline run to complete can
57
+ be passed as part of the submission result.
52
58
 
53
59
  Args:
54
- deployment: The pipeline deployment to prepare or run.
55
- stack: The stack on which the pipeline is deployed.
60
+ deployment: The pipeline deployment to submit.
61
+ stack: The stack the pipeline will run on.
56
62
  environment: Environment variables to set in the orchestration
57
- environment.
63
+ environment. These don't need to be set if running locally.
58
64
  placeholder_run: An optional placeholder run for the deployment.
65
+
66
+ Returns:
67
+ Optional submission result.
59
68
  """
60
69
  if deployment.schedule:
61
70
  logger.warning(
@@ -87,6 +96,7 @@ class LocalOrchestrator(BaseOrchestrator):
87
96
  string_utils.get_human_readable_time(run_duration),
88
97
  )
89
98
  self._orchestrator_run_id = None
99
+ return None
90
100
 
91
101
  def get_orchestrator_run_id(self) -> str:
92
102
  """Returns the active orchestrator run id.
@@ -34,6 +34,7 @@ from zenml.orchestrators import (
34
34
  BaseOrchestratorConfig,
35
35
  BaseOrchestratorFlavor,
36
36
  ContainerizedOrchestrator,
37
+ SubmissionResult,
37
38
  )
38
39
  from zenml.stack import Stack, StackValidator
39
40
  from zenml.utils import docker_utils, string_utils
@@ -91,24 +92,32 @@ class LocalDockerOrchestrator(ContainerizedOrchestrator):
91
92
  f"{ENV_ZENML_DOCKER_ORCHESTRATOR_RUN_ID}."
92
93
  )
93
94
 
94
- def prepare_or_run_pipeline(
95
+ def submit_pipeline(
95
96
  self,
96
97
  deployment: "PipelineDeploymentResponse",
97
98
  stack: "Stack",
98
99
  environment: Dict[str, str],
99
100
  placeholder_run: Optional["PipelineRunResponse"] = None,
100
- ) -> Any:
101
- """Sequentially runs all pipeline steps in local Docker containers.
101
+ ) -> Optional[SubmissionResult]:
102
+ """Submits a pipeline to the orchestrator.
103
+
104
+ This method should only submit the pipeline and not wait for it to
105
+ complete. If the orchestrator is configured to wait for the pipeline run
106
+ to complete, a function that waits for the pipeline run to complete can
107
+ be passed as part of the submission result.
102
108
 
103
109
  Args:
104
- deployment: The pipeline deployment to prepare or run.
110
+ deployment: The pipeline deployment to submit.
105
111
  stack: The stack the pipeline will run on.
106
112
  environment: Environment variables to set in the orchestration
107
- environment.
113
+ environment. These don't need to be set if running locally.
108
114
  placeholder_run: An optional placeholder run for the deployment.
109
115
 
110
116
  Raises:
111
117
  RuntimeError: If a step fails.
118
+
119
+ Returns:
120
+ Optional submission result.
112
121
  """
113
122
  if deployment.schedule:
114
123
  logger.warning(
@@ -194,6 +203,7 @@ class LocalDockerOrchestrator(ContainerizedOrchestrator):
194
203
  "Pipeline run has finished in `%s`.",
195
204
  string_utils.get_human_readable_time(run_duration),
196
205
  )
206
+ return None
197
207
 
198
208
 
199
209
  class LocalDockerOrchestratorSettings(BaseSettings):
@@ -161,3 +161,27 @@ def publish_step_run_metadata(
161
161
  ],
162
162
  stack_component_id=stack_component_id,
163
163
  )
164
+
165
+
166
+ def publish_schedule_metadata(
167
+ schedule_id: "UUID",
168
+ schedule_metadata: Dict["UUID", Dict[str, "MetadataType"]],
169
+ ) -> None:
170
+ """Publishes the given schedule metadata.
171
+
172
+ Args:
173
+ schedule_id: The ID of the schedule.
174
+ schedule_metadata: A dictionary mapping stack component IDs to the
175
+ metadata they created.
176
+ """
177
+ client = Client()
178
+ for stack_component_id, metadata in schedule_metadata.items():
179
+ client.create_run_metadata(
180
+ metadata=metadata,
181
+ resources=[
182
+ RunMetadataResource(
183
+ id=schedule_id, type=MetadataResourceTypes.SCHEDULE
184
+ )
185
+ ],
186
+ stack_component_id=stack_component_id,
187
+ )
@@ -95,7 +95,7 @@ class StepRunRequestFactory:
95
95
  """
96
96
  step = self.deployment.step_configurations[request.name]
97
97
 
98
- input_artifacts, parent_step_ids = input_utils.resolve_step_inputs(
98
+ input_artifacts = input_utils.resolve_step_inputs(
99
99
  step=step,
100
100
  pipeline_run=self.pipeline_run,
101
101
  step_runs=step_runs,
@@ -108,7 +108,6 @@ class StepRunRequestFactory:
108
108
  request.inputs = {
109
109
  name: [artifact.id] for name, artifact in input_artifacts.items()
110
110
  }
111
- request.parent_step_ids = parent_step_ids
112
111
 
113
112
  cache_key = cache_utils.generate_cache_key(
114
113
  step=step,
@@ -12,6 +12,7 @@ from zenml.config.pipeline_run_configuration import PipelineRunConfiguration
12
12
  from zenml.config.source import Source, SourceType
13
13
  from zenml.config.step_configurations import StepConfigurationUpdate
14
14
  from zenml.enums import ExecutionStatus
15
+ from zenml.exceptions import RunMonitoringError
15
16
  from zenml.logger import get_logger
16
17
  from zenml.models import (
17
18
  FlavorFilter,
@@ -136,8 +137,9 @@ def deploy_pipeline(
136
137
  stack: The stack on which to run the deployment.
137
138
  placeholder_run: An optional placeholder run for the deployment.
138
139
 
140
+ # noqa: DAR401
139
141
  Raises:
140
- Exception: Any exception that happened while deploying or running
142
+ BaseException: Any exception that happened while deploying or running
141
143
  (in case it happens synchronously) the pipeline.
142
144
  """
143
145
  # Prevent execution of nested pipelines which might lead to
@@ -150,16 +152,19 @@ def deploy_pipeline(
150
152
  deployment=deployment,
151
153
  placeholder_run=placeholder_run,
152
154
  )
153
- except Exception as e:
155
+ except RunMonitoringError as e:
156
+ # Don't mark the run as failed if the error happened during monitoring
157
+ # of the run.
158
+ raise e.original_exception from None
159
+ except BaseException as e:
154
160
  if (
155
161
  placeholder_run
156
- and Client()
162
+ and not Client()
157
163
  .get_pipeline_run(placeholder_run.id, hydrate=False)
158
- .status
159
- == ExecutionStatus.INITIALIZING
164
+ .status.is_finished
160
165
  ):
161
- # The run failed during the initialization phase -> We change it's
162
- # status to `Failed`
166
+ # We failed during/before the submission of the run, so we mark the
167
+ # run as failed if it is still in an initializing/running state.
163
168
  publish_failed_pipeline_run(placeholder_run.id)
164
169
 
165
170
  raise e
@@ -90,7 +90,7 @@ class StepOperatorEntrypointConfiguration(StepEntrypointConfiguration):
90
90
  )
91
91
 
92
92
  stack = Client().active_stack
93
- input_artifacts, _ = input_utils.resolve_step_inputs(
93
+ input_artifacts = input_utils.resolve_step_inputs(
94
94
  step=step, pipeline_run=pipeline_run
95
95
  )
96
96
  output_artifact_uris = output_utils.prepare_output_artifact_uris(
@@ -1 +1 @@
1
- import{j as e}from"./@radix-Cdvw4jJ8.js";import{B as s,r as t}from"./index-BFqbGSck.js";import{E as r}from"./EmptyState-CjrgDtVk.js";import{S as a}from"./help-Co6aedki.js";import{L as o}from"./@react-router-DeDfXbUF.js";import"./@tanstack-5gTMR7G2.js";import"./@reactflow-8OCk19Fi.js";function d(){return e.jsx("div",{className:"flex min-h-screen w-full flex-col",children:e.jsx(r,{icon:e.jsx(a,{className:"h-[120px] w-[120px] fill-neutral-300"}),children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-2 text-display-xs font-semibold",children:"We can't find the page you are looking for"}),e.jsx("p",{className:"text-lg text-theme-text-secondary",children:"You can try typing a different URL or we can bring you back to your Homepage."}),e.jsx("div",{className:"mt-5 flex justify-center",children:e.jsx(s,{size:"md",asChild:!0,children:e.jsx(o,{className:"w-min self-center whitespace-nowrap",to:t.home,children:e.jsx("span",{className:"px-0.5",children:"Go to Home"})})})})]})})})}export{d as default};
1
+ import{j as e}from"./@radix-Cdvw4jJ8.js";import{B as s,r as t}from"./index-BgEfQ3_G.js";import{E as r}from"./EmptyState-CjrgDtVk.js";import{S as a}from"./help-Co6aedki.js";import{L as o}from"./@react-router-DeDfXbUF.js";import"./@tanstack-5gTMR7G2.js";import"./@reactflow-B_iCtR7X.js";function d(){return e.jsx("div",{className:"flex min-h-screen w-full flex-col",children:e.jsx(r,{icon:e.jsx(a,{className:"h-[120px] w-[120px] fill-neutral-300"}),children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-2 text-display-xs font-semibold",children:"We can't find the page you are looking for"}),e.jsx("p",{className:"text-lg text-theme-text-secondary",children:"You can try typing a different URL or we can bring you back to your Homepage."}),e.jsx("div",{className:"mt-5 flex justify-center",children:e.jsx(s,{size:"md",asChild:!0,children:e.jsx(o,{className:"w-min self-center whitespace-nowrap",to:t.home,children:e.jsx("span",{className:"px-0.5",children:"Go to Home"})})})})]})})})}export{d as default};