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.
- zenml/VERSION +1 -1
- zenml/cli/login.py +21 -3
- zenml/config/__init__.py +13 -2
- zenml/constants.py +0 -1
- zenml/exceptions.py +16 -0
- zenml/integrations/airflow/orchestrators/airflow_orchestrator.py +15 -6
- zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +54 -58
- zenml/integrations/azure/orchestrators/azureml_orchestrator.py +28 -19
- zenml/integrations/databricks/orchestrators/databricks_orchestrator.py +19 -63
- zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +36 -61
- zenml/integrations/hyperai/orchestrators/hyperai_orchestrator.py +19 -22
- zenml/integrations/kubeflow/orchestrators/kubeflow_orchestrator.py +28 -31
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py +33 -20
- zenml/integrations/lightning/orchestrators/lightning_orchestrator.py +25 -100
- zenml/integrations/skypilot/orchestrators/skypilot_base_vm_orchestrator.py +19 -8
- zenml/integrations/skypilot/utils.py +17 -13
- zenml/integrations/tekton/orchestrators/tekton_orchestrator.py +28 -12
- zenml/models/v2/core/step_run.py +1 -0
- zenml/orchestrators/__init__.py +2 -0
- zenml/orchestrators/base_orchestrator.py +137 -66
- zenml/orchestrators/input_utils.py +5 -13
- zenml/orchestrators/local/local_orchestrator.py +19 -9
- zenml/orchestrators/local_docker/local_docker_orchestrator.py +15 -5
- zenml/orchestrators/publish_utils.py +24 -0
- zenml/orchestrators/step_run_utils.py +1 -2
- zenml/pipelines/run_utils.py +12 -7
- zenml/step_operators/step_operator_entrypoint_configuration.py +1 -1
- zenml/zen_server/dashboard/assets/{404-DmJUgorp.js → 404-B5eko6XL.js} +1 -1
- zenml/zen_server/dashboard/assets/{@reactflow-8OCk19Fi.js → @reactflow-B_iCtR7X.js} +1 -1
- zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-CZW4QyWn.js → AlertDialogDropdownItem-DsOmO1FH.js} +1 -1
- zenml/zen_server/dashboard/assets/{ButtonGroup-DFWWFGUE.js → ButtonGroup-4sPZDv70.js} +1 -1
- zenml/zen_server/dashboard/assets/{CodeSnippet-D2HkkAGr.js → CodeSnippet-Ctplhzdc.js} +1 -1
- zenml/zen_server/dashboard/assets/{CollapsibleCard-CnS09ljw.js → CollapsibleCard-CBKenz9f.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentBadge-CDgdd0Ks.js → ComponentBadge-Cnecw3qz.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentIcon-CbbOc7lb.js → ComponentIcon-CMiVW-O6.js} +1 -1
- zenml/zen_server/dashboard/assets/{DeleteAlertDialog-VIOMDLmx.js → DeleteAlertDialog-DEI0YDzP.js} +1 -1
- zenml/zen_server/dashboard/assets/{DialogItem-ClFCqxEp.js → DialogItem-CRCDpYU6.js} +1 -1
- zenml/zen_server/dashboard/assets/{Error-CQzjbDcN.js → Error-BG6f_WRd.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-CWreILP0.js → ExecutionStatus-BuhNAE9w.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-CiKxG5_X.js → Helpbox-DtUG2Bf_.js} +1 -1
- zenml/zen_server/dashboard/assets/{Infobox-CGxFvqzi.js → Infobox-CSBRrM6r.js} +1 -1
- zenml/zen_server/dashboard/assets/{LeftSideMenu-DCsKdIjC.js → LeftSideMenu-DPsCCK3z.js} +1 -1
- zenml/zen_server/dashboard/assets/{NestedCollapsible-3M4llYtH.js → NestedCollapsible-CMuDIJlp.js} +1 -1
- zenml/zen_server/dashboard/assets/{NumberBox-C0mQktmV.js → NumberBox-DtCv7jh3.js} +1 -1
- zenml/zen_server/dashboard/assets/Pagination-CWnEpSpN.js +1 -0
- zenml/zen_server/dashboard/assets/{Partials-DSjkttlz.js → Partials-CfHD6OH5.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProCta-Dm5cWKpS.js → ProCta-CNyp04C8.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderIcon-DPwMR6nF.js → ProviderIcon-DHejyg7C.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderRadio-DEDNRgAb.js → ProviderRadio-tGtie8Gc.js} +1 -1
- zenml/zen_server/dashboard/assets/RunsBody-mYwMcWWj.js +1 -0
- zenml/zen_server/dashboard/assets/SearchField-BtUi6cYl.js +1 -0
- zenml/zen_server/dashboard/assets/{SecretTooltip-CZTRnaCV.js → SecretTooltip-B5u1UsQ9.js} +1 -1
- zenml/zen_server/dashboard/assets/{SetPassword-BjNGDC5e.js → SetPassword-BmbgL_ed.js} +1 -1
- zenml/zen_server/dashboard/assets/{SheetHeader-CASpN2Lz.js → SheetHeader-DkH7aG9K.js} +1 -1
- zenml/zen_server/dashboard/assets/StackComponentList-Bi8BKqCu.js +1 -0
- zenml/zen_server/dashboard/assets/StackList-Cvxapo0p.js +1 -0
- zenml/zen_server/dashboard/assets/{StackName-ojLC6xdl.js → StackName-CFSZL8ec.js} +1 -1
- zenml/zen_server/dashboard/assets/Tabs-D4dv48ry.js +1 -0
- zenml/zen_server/dashboard/assets/{Tick-BPrWnNlN.js → Tick-Qquvr4P3.js} +1 -1
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-CNfKDo2Q.js → UpdatePasswordSchemas-D_DCETSO.js} +1 -1
- zenml/zen_server/dashboard/assets/{UsageReason-Cb-mpV8M.js → UsageReason-DhiUV1bu.js} +1 -1
- zenml/zen_server/dashboard/assets/{Wizard-Dg8Pmn5A.js → Wizard-BHvY75u_.js} +1 -1
- zenml/zen_server/dashboard/assets/{WizardFooter-BcNDIvlQ.js → WizardFooter-FQm8y-jP.js} +1 -1
- zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-DCdax7I5.js → all-pipeline-runs-query-DpKw9WL9.js} +1 -1
- zenml/zen_server/dashboard/assets/{bulk-delete-C_kpIB9A.js → bulk-delete-CzYA--cC.js} +1 -1
- zenml/zen_server/dashboard/assets/{configuration-form-B2hmKGnF.js → configuration-form-DSoMMiPE.js} +1 -1
- zenml/zen_server/dashboard/assets/{constants-1EZZxtay.js → constants-DTfsIqHy.js} +1 -1
- zenml/zen_server/dashboard/assets/{create-stack-TKmMtrkQ.js → create-stack-BpZrmKDu.js} +1 -1
- zenml/zen_server/dashboard/assets/{delete-run-CCR9md_s.js → delete-run-BkyDsKQc.js} +1 -1
- zenml/zen_server/dashboard/assets/elk-worker.min-BdOC9sib.js +6263 -0
- zenml/zen_server/dashboard/assets/expand-full-BPiXpch2.js +1 -0
- zenml/zen_server/dashboard/assets/{form-DFJkaFDX.js → form-BgtamtJm.js} +1 -1
- zenml/zen_server/dashboard/assets/{form-schemas-CrznJVzA.js → form-schemas-dyDkAxXP.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-BjUu1mP4.js → index-BBt0LDtR.js} +1 -1
- zenml/zen_server/dashboard/assets/index-BfNISy0X.css +1 -0
- zenml/zen_server/dashboard/assets/{index-BFqbGSck.js → index-BgEfQ3_G.js} +4 -4
- zenml/zen_server/dashboard/assets/{index-U992soPJ.js → index-eoDB_1XX.js} +1 -1
- zenml/zen_server/dashboard/assets/{layout-Do9YI4QX.js → layout-o1x87a3q.js} +1 -1
- zenml/zen_server/dashboard/assets/{login-mutation-D3tFP6Wm.js → login-mutation-C1hvP_cX.js} +1 -1
- zenml/zen_server/dashboard/assets/page-4xUZpMN0.js +31 -0
- zenml/zen_server/dashboard/assets/page-4zc4xPv2.js +2 -0
- zenml/zen_server/dashboard/assets/page-B0104V6C.js +1 -0
- zenml/zen_server/dashboard/assets/page-BNJsjvof.js +1 -0
- zenml/zen_server/dashboard/assets/{page-sJjNT9xA.js → page-BPQ66vR-.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CAJ8B0vb.js → page-BQgSZ2nH.js} +1 -1
- zenml/zen_server/dashboard/assets/page-BXl2ZX6J.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CtiuMP_r.js → page-BxeZrG_t.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Cal6XQ4U.js → page-C2A-2Cj_.js} +1 -1
- zenml/zen_server/dashboard/assets/page-C2i-C7jv.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DJIGaUQ9.js → page-C3JfJxuR.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-ChGcZI_6.js → page-CESEqC2L.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DCcuPZ8P.js → page-CF8cTZ7l.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CKjsimVu.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DNjKHjnH.js → page-COLzBwff.js} +1 -1
- zenml/zen_server/dashboard/assets/page-COifg5fa.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CnbIYE80.js → page-CQeJuA8T.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DKK6ulgy.js → page-CcjWEjre.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-9RjCitFH.js → page-CefGLeWy.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DUKbOhaD.js → page-CfxpV3j4.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D9Hfx6GV.js → page-ClcUzawe.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Ct_LB3zo.js +1 -0
- zenml/zen_server/dashboard/assets/page-D-ZWUMYY.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CUaMMoPG.js → page-D-tJ_Y0a.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CdZCmszX.js → page-DHrvih9u.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DUK0Nd_1.js → page-DMhaHZDw.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CAUYrfui.js → page-DOCOmmKn.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-akLcPcKw.js → page-DcQmxKLp.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Dh4GRWw5.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DwVPpCFg.js → page-DiHZK-1w.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Dn7ZNapg.js +1 -0
- zenml/zen_server/dashboard/assets/page-Dy4vSQY7.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CN7lkvXr.js → page-QrvWQwZb.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BrT0_zSJ.js → page-RF3Fup0q.js} +1 -1
- zenml/zen_server/dashboard/assets/page-WuvCrN47.js +1 -0
- zenml/zen_server/dashboard/assets/{page-Be3R2uYn.js → page-_WnHBI1F.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-C210HcBA.js → page-ghjVNgVE.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BCrKmYIZ.js → page-iDsDiDXw.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-ClvmVesa.js → page-rVhXI5ZO.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DEohTSz6.js → page-uxjMX8Iq.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-Dec_w7aB.js → persist-BsdEtCkd.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-DWMWVP-y.js → persist-CFPbMcJX.js} +1 -1
- zenml/zen_server/dashboard/assets/{resource-tyes-list-o2LXiMay.js → resource-tyes-list-79FqS3LY.js} +1 -1
- zenml/zen_server/dashboard/assets/{resource-type-tooltip-DwHrJstL.js → resource-type-tooltip-BL9ZTRKi.js} +1 -1
- zenml/zen_server/dashboard/assets/{service-connectors-DSEMwJ5A.js → service-connectors-Q8h7-_rG.js} +1 -1
- zenml/zen_server/dashboard/assets/{service-jxtvgks0.js → service-k-9Vsb30.js} +1 -1
- zenml/zen_server/dashboard/assets/{sharedSchema-BXzg0EZz.js → sharedSchema-C_HkejsG.js} +1 -1
- zenml/zen_server/dashboard/assets/{stack-detail-query-Cm0fsgo-.js → stack-detail-query-CNmVZ0Bo.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-current-user-mutation-D5MjcQ6F.js → update-current-user-mutation-Ca-Lmwuj.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-CmnxdxiK.js → update-server-settings-mutation-Bwe3gUt4.js} +1 -1
- zenml/zen_server/dashboard/index.html +4 -4
- zenml/zen_stores/migrations/versions/0.83.1_release.py +23 -0
- zenml/zen_stores/rest_zen_store.py +147 -128
- zenml/zen_stores/sql_zen_store.py +27 -17
- {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250625.dist-info}/METADATA +5 -9
- {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250625.dist-info}/RECORD +138 -134
- zenml/zen_server/dashboard/assets/RunsBody-BRBn1e2O.js +0 -1
- zenml/zen_server/dashboard/assets/SearchField-DY6-UbRT.js +0 -1
- zenml/zen_server/dashboard/assets/StackComponentList-Be1pQt9m.js +0 -1
- zenml/zen_server/dashboard/assets/StackList-BdiR5DvR.js +0 -1
- zenml/zen_server/dashboard/assets/Tabs-DNSKblCM.js +0 -1
- zenml/zen_server/dashboard/assets/index-DuhuqTCI.css +0 -1
- zenml/zen_server/dashboard/assets/page-B0PsXWiT.js +0 -1
- zenml/zen_server/dashboard/assets/page-BcRI3-aR.js +0 -29
- zenml/zen_server/dashboard/assets/page-BgknnddT.js +0 -1
- zenml/zen_server/dashboard/assets/page-Bs3W2FDi.js +0 -1
- zenml/zen_server/dashboard/assets/page-C6KaiZ_W.js +0 -1
- zenml/zen_server/dashboard/assets/page-CHxVhF3x.js +0 -1
- zenml/zen_server/dashboard/assets/page-CktmtZ8Z.js +0 -1
- zenml/zen_server/dashboard/assets/page-CoXzjeEY.js +0 -1
- zenml/zen_server/dashboard/assets/page-D9iuB88h.js +0 -1
- zenml/zen_server/dashboard/assets/page-DYOucPtA.js +0 -1
- zenml/zen_server/dashboard/assets/page-DpqRelAy.js +0 -1
- zenml/zen_server/dashboard/assets/page-XURWnYZP.js +0 -1
- zenml/zen_server/dashboard/assets/page-abw-2oeW.js +0 -1
- zenml/zen_server/dashboard/assets/page-n9ejQ2V3.js +0 -2
- {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250625.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250625.dist-info}/WHEEL +0 -0
- {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
|
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
|
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
|
-
|
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
|
-
"""
|
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
|
241
|
-
|
242
|
-
|
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
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
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
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
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,
|
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
|
-
) ->
|
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
|
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(
|
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
|
-
|
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,
|
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
|
22
|
-
|
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
|
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
|
-
) ->
|
51
|
-
"""
|
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
|
55
|
-
stack: The stack
|
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
|
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
|
-
) ->
|
101
|
-
"""
|
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
|
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
|
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,
|
zenml/pipelines/run_utils.py
CHANGED
@@ -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
|
-
|
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
|
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
|
-
#
|
162
|
-
#
|
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
|
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-
|
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};
|