zenml-nightly 0.70.0.dev20241125__py3-none-any.whl → 0.71.0.dev20241220__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.
- README.md +4 -4
- RELEASE_NOTES.md +112 -0
- zenml/VERSION +1 -1
- zenml/artifact_stores/base_artifact_store.py +2 -2
- zenml/artifacts/artifact_config.py +15 -6
- zenml/artifacts/utils.py +59 -32
- zenml/cli/__init__.py +22 -4
- zenml/cli/base.py +5 -5
- zenml/cli/login.py +26 -0
- zenml/cli/pipeline.py +111 -62
- zenml/cli/server.py +20 -20
- zenml/cli/service_connectors.py +3 -3
- zenml/cli/stack.py +0 -3
- zenml/cli/stack_components.py +0 -1
- zenml/cli/utils.py +0 -5
- zenml/client.py +62 -20
- zenml/config/compiler.py +12 -3
- zenml/config/pipeline_configurations.py +20 -0
- zenml/config/pipeline_run_configuration.py +1 -0
- zenml/config/secret_reference_mixin.py +1 -1
- zenml/config/server_config.py +4 -0
- zenml/config/step_configurations.py +21 -0
- zenml/constants.py +10 -0
- zenml/enums.py +1 -0
- zenml/image_builders/base_image_builder.py +5 -2
- zenml/image_builders/build_context.py +7 -16
- zenml/image_builders/local_image_builder.py +13 -3
- zenml/integrations/__init__.py +1 -0
- zenml/integrations/aws/__init__.py +3 -0
- zenml/integrations/aws/flavors/__init__.py +6 -0
- zenml/integrations/aws/flavors/aws_image_builder_flavor.py +146 -0
- zenml/integrations/aws/image_builders/__init__.py +20 -0
- zenml/integrations/aws/image_builders/aws_image_builder.py +307 -0
- zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +14 -6
- zenml/integrations/constants.py +1 -0
- zenml/integrations/feast/__init__.py +1 -1
- zenml/integrations/feast/feature_stores/feast_feature_store.py +13 -9
- zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +1 -1
- zenml/integrations/kaniko/image_builders/kaniko_image_builder.py +2 -1
- zenml/integrations/kubernetes/flavors/kubernetes_orchestrator_flavor.py +11 -0
- zenml/integrations/kubernetes/orchestrators/kube_utils.py +46 -2
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py +13 -2
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint.py +3 -1
- zenml/integrations/kubernetes/orchestrators/manifest_utils.py +3 -2
- zenml/integrations/kubernetes/step_operators/kubernetes_step_operator.py +3 -2
- zenml/integrations/lightning/flavors/lightning_orchestrator_flavor.py +11 -0
- zenml/integrations/modal/__init__.py +46 -0
- zenml/integrations/modal/flavors/__init__.py +26 -0
- zenml/integrations/modal/flavors/modal_step_operator_flavor.py +125 -0
- zenml/integrations/modal/step_operators/__init__.py +22 -0
- zenml/integrations/modal/step_operators/modal_step_operator.py +242 -0
- zenml/integrations/neptune/experiment_trackers/neptune_experiment_tracker.py +7 -5
- zenml/integrations/neptune/experiment_trackers/run_state.py +69 -53
- zenml/integrations/registry.py +2 -2
- zenml/integrations/skypilot/flavors/skypilot_orchestrator_base_vm_config.py +12 -0
- zenml/integrations/wandb/flavors/wandb_experiment_tracker_flavor.py +13 -5
- zenml/io/filesystem.py +2 -2
- zenml/io/local_filesystem.py +3 -3
- zenml/materializers/built_in_materializer.py +18 -1
- zenml/materializers/structured_string_materializer.py +8 -3
- zenml/model/model.py +23 -101
- zenml/model/utils.py +21 -17
- zenml/models/__init__.py +6 -0
- zenml/models/v2/base/filter.py +26 -30
- zenml/models/v2/base/scoped.py +258 -5
- zenml/models/v2/core/artifact_version.py +21 -29
- zenml/models/v2/core/code_repository.py +1 -12
- zenml/models/v2/core/component.py +5 -68
- zenml/models/v2/core/flavor.py +1 -11
- zenml/models/v2/core/model.py +1 -57
- zenml/models/v2/core/model_version.py +11 -36
- zenml/models/v2/core/model_version_artifact.py +11 -3
- zenml/models/v2/core/model_version_pipeline_run.py +14 -3
- zenml/models/v2/core/pipeline.py +47 -55
- zenml/models/v2/core/pipeline_build.py +67 -12
- zenml/models/v2/core/pipeline_deployment.py +0 -10
- zenml/models/v2/core/pipeline_run.py +110 -32
- zenml/models/v2/core/run_metadata.py +30 -9
- zenml/models/v2/core/run_template.py +21 -29
- zenml/models/v2/core/schedule.py +0 -10
- zenml/models/v2/core/secret.py +0 -14
- zenml/models/v2/core/service.py +9 -16
- zenml/models/v2/core/service_connector.py +0 -11
- zenml/models/v2/core/stack.py +21 -30
- zenml/models/v2/core/step_run.py +24 -18
- zenml/models/v2/core/trigger.py +19 -3
- zenml/models/v2/misc/run_metadata.py +38 -0
- zenml/orchestrators/base_orchestrator.py +13 -1
- zenml/orchestrators/input_utils.py +19 -6
- zenml/orchestrators/output_utils.py +5 -1
- zenml/orchestrators/publish_utils.py +12 -5
- zenml/orchestrators/step_launcher.py +16 -16
- zenml/orchestrators/step_run_utils.py +18 -197
- zenml/orchestrators/step_runner.py +40 -3
- zenml/orchestrators/utils.py +79 -50
- zenml/pipelines/build_utils.py +12 -0
- zenml/pipelines/pipeline_decorator.py +4 -0
- zenml/pipelines/pipeline_definition.py +26 -8
- zenml/pipelines/run_utils.py +9 -5
- zenml/service_connectors/service_connector_utils.py +3 -9
- zenml/stack/stack_component.py +1 -1
- zenml/stack_deployments/aws_stack_deployment.py +22 -0
- zenml/steps/base_step.py +11 -1
- zenml/steps/entrypoint_function_utils.py +7 -3
- zenml/steps/step_decorator.py +4 -0
- zenml/steps/utils.py +23 -7
- zenml/types.py +4 -0
- zenml/utils/archivable.py +65 -36
- zenml/utils/code_utils.py +8 -4
- zenml/utils/docker_utils.py +9 -0
- zenml/utils/metadata_utils.py +186 -153
- zenml/utils/string_utils.py +41 -16
- zenml/utils/visualization_utils.py +4 -1
- zenml/zen_server/auth.py +9 -10
- zenml/zen_server/cloud_utils.py +3 -1
- zenml/zen_server/dashboard/assets/{404-NVXKFp-x.js → 404-Cqu3EDCm.js} +1 -1
- zenml/zen_server/dashboard/assets/{@reactflow-CK0KJUen.js → @reactflow-D2Y7BWwz.js} +1 -1
- zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-DezXKmDf.js → AlertDialogDropdownItem-BHd71pVS.js} +1 -1
- zenml/zen_server/dashboard/assets/{CodeSnippet-JzR8CEtw.js → CodeSnippet-DIonwetW.js} +1 -1
- zenml/zen_server/dashboard/assets/{CollapsibleCard-DQW_ktMO.js → CollapsibleCard-CDnC97pB.js} +1 -1
- zenml/zen_server/dashboard/assets/{Commands-DL2kwkRd.js → Commands-BVEXKAOj.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentBadge-D_g62Wv8.js → ComponentBadge-CrRvovox.js} +1 -1
- zenml/zen_server/dashboard/assets/{CopyButton-LNcWaa14.js → CopyButton-B6wGAhQv.js} +1 -1
- zenml/zen_server/dashboard/assets/{CsvVizualization-DknpE5ej.js → CsvVizualization-CjcT7LMm.js} +5 -5
- zenml/zen_server/dashboard/assets/DeleteAlertDialog-D2ELtM2W.js +1 -0
- zenml/zen_server/dashboard/assets/{DialogItem-Bxf8FuAT.js → DialogItem-DXIMhBgU.js} +1 -1
- zenml/zen_server/dashboard/assets/{Error-DYflYyps.js → Error-B8uUfTpL.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-C7zyIQKZ.js → ExecutionStatus-ibAdY-dG.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-oYSGpLqd.js → Helpbox-BfAfhKHw.js} +1 -1
- zenml/zen_server/dashboard/assets/{Infobox-Cx4xGoXR.js → Infobox-M_SMOu96.js} +1 -1
- zenml/zen_server/dashboard/assets/{InlineAvatar-DiGOWNKF.js → InlineAvatar-DBA0a0-a.js} +1 -1
- zenml/zen_server/dashboard/assets/{NestedCollapsible-DYbgyKxK.js → NestedCollapsible-DpgmEFKw.js} +1 -1
- zenml/zen_server/dashboard/assets/{Partials-03iZf8-N.js → Partials-D_ldD9if.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProBadge-D_EB8HNo.js → ProBadge-DQbfFotM.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProCta-DqNS4v3x.js → ProCta-Bcpb4rcY.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderIcon-Bki2aw8w.js → ProviderIcon-BZpgPigN.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderRadio-8f43sPD4.js → ProviderRadio-DWPnMuQ1.js} +1 -1
- zenml/zen_server/dashboard/assets/RunSelector-DgRGaAc6.js +1 -0
- zenml/zen_server/dashboard/assets/{RunsBody-07YEO7qI.js → RunsBody-KecfSkjY.js} +1 -1
- zenml/zen_server/dashboard/assets/{SearchField-lp1KgU4e.js → SearchField-n-ILHnaP.js} +1 -1
- zenml/zen_server/dashboard/assets/{SecretTooltip-CgnbyeOx.js → SecretTooltip-B8MrX5yu.js} +1 -1
- zenml/zen_server/dashboard/assets/{SetPassword-CpP418A2.js → SetPassword-B_IVq_wg.js} +1 -1
- zenml/zen_server/dashboard/assets/StackList-TWPBYnkF.js +1 -0
- zenml/zen_server/dashboard/assets/{Tabs-BktHkCJJ.js → Tabs-Rg857zmd.js} +1 -1
- zenml/zen_server/dashboard/assets/{Tick-BlMoIlJT.js → Tick-COg4A-xo.js} +1 -1
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-Sc0A0pP-.js → UpdatePasswordSchemas-C6Aj3hm6.js} +1 -1
- zenml/zen_server/dashboard/assets/{UsageReason-YYduL4fj.js → UsageReason-BTLbx7w4.js} +1 -1
- zenml/zen_server/dashboard/assets/{WizardFooter-dgmizSJC.js → WizardFooter-BCAj69Vj.js} +1 -1
- zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-D-c2G6lV.js → all-pipeline-runs-query-DMXkDrV2.js} +1 -1
- zenml/zen_server/dashboard/assets/code-snippets-CqONne41.js +13 -0
- zenml/zen_server/dashboard/assets/{create-stack-DM_JPgef.js → create-stack-HfdbhLs4.js} +1 -1
- zenml/zen_server/dashboard/assets/dates-3pMLCNrD.js +1 -0
- zenml/zen_server/dashboard/assets/delete-run-DZ4hIXff.js +1 -0
- zenml/zen_server/dashboard/assets/{form-schemas-K6FYKjwa.js → form-schemas-B0AVEd9b.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-BAkC7FXi.js → index-DPqSWjug.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-CEV4Cvaf.js → index-DScjfBRb.js} +1 -1
- zenml/zen_server/dashboard/assets/index-DXvT1_Um.css +1 -0
- zenml/zen_server/dashboard/assets/{index-CCOPpudF.js → index-FO-p0GU7.js} +5 -5
- zenml/zen_server/dashboard/assets/{index-B1mVPYxf.js → index-I3bKUGUj.js} +1 -1
- zenml/zen_server/dashboard/assets/key-icon-aH-QIa5R.js +1 -0
- zenml/zen_server/dashboard/assets/login-command-CkqxPtV3.js +1 -0
- zenml/zen_server/dashboard/assets/{login-mutation-hf-lK87O.js → login-mutation-BQeo4wTY.js} +1 -1
- zenml/zen_server/dashboard/assets/{not-found-BGirLjU-.js → not-found-gAJ5aDdR.js} +1 -1
- zenml/zen_server/dashboard/assets/page-9Y9-gig0.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DjRJCGb3.js → page-AUwiQ14W.js} +1 -1
- zenml/zen_server/dashboard/assets/page-B6XU7yYT.js +2 -0
- zenml/zen_server/dashboard/assets/{page-C00YAkaB.js → page-BKZYc2Zv.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CdMWnQak.js → page-BU9FG4sR.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D7S3aCbF.js → page-B_Apk3xg.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Djikxq_S.js → page-BdowiCbr.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Bg8OjTRe.js +1 -0
- zenml/zen_server/dashboard/assets/page-BxL4qD4_.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DakHVWXF.js → page-CWxT5K5J.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CXuQufSe.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DLC-bNBP.js → page-CcQr8CPP.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CD-DcWoy.js → page-Ce4Hrjnr.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CiYxgZP_.js +1 -0
- zenml/zen_server/dashboard/assets/page-Cldq1mpe.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BDigxVpo.js → page-D4wdonLm.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D6uU2ax4.js → page-D8ObrbH8.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DXSTpqRD.js → page-DFuAUGt4.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CbpvrsDL.js → page-DGazBpuP.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-COXXJj1k.js → page-DO1UcqPX.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DRYXdL5o.js +1 -0
- zenml/zen_server/dashboard/assets/{page-Df-Fw0aq.js → page-DYEquBC2.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Dk32IeZm.js +1 -0
- zenml/zen_server/dashboard/assets/{page-yYC9OI-E.js → page-I3nKFGie.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-6m6yHHlE.js → page-M0w-n6vn.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Vcxara9U.js → page-R5dx3xGF.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BR68V0V1.js → page-bT5pOvcB.js} +1 -1
- zenml/zen_server/dashboard/assets/page-hUqK889I.js +6 -0
- zenml/zen_server/dashboard/assets/{page-CjGdWY13.js → page-h_Stveon.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D01JhjQB.js → page-r8XK5vR7.js} +1 -1
- zenml/zen_server/dashboard/assets/page-u_-ZXBKb.js +1 -0
- zenml/zen_server/dashboard/assets/page-zaMqB_ao.js +1 -0
- zenml/zen_server/dashboard/assets/{persist-GjC8PZoC.js → persist-AppN1B0J.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-Coz7ZWvz.js → persist-DAUi_3za.js} +1 -1
- zenml/zen_server/dashboard/assets/service-BqqeXLEe.js +2 -0
- zenml/zen_server/dashboard/assets/{sharedSchema-CQb14VSr.js → sharedSchema-uXN9FLLk.js} +1 -1
- zenml/zen_server/dashboard/assets/{stack-detail-query-OPEW-cDJ.js → stack-detail-query-XfZBiBP2.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-LwuQfHYn.js → update-server-settings-mutation-BWmgVJwA.js} +1 -1
- zenml/zen_server/dashboard/assets/{url-CkvKAnwF.js → url-BLwMbzES.js} +1 -1
- zenml/zen_server/dashboard/index.html +4 -4
- zenml/zen_server/deploy/helm/Chart.yaml +1 -1
- zenml/zen_server/deploy/helm/README.md +2 -2
- zenml/zen_server/rbac/endpoint_utils.py +6 -4
- zenml/zen_server/rbac/models.py +3 -2
- zenml/zen_server/rbac/rbac_sql_zen_store.py +173 -0
- zenml/zen_server/rbac/utils.py +4 -7
- zenml/zen_server/routers/auth_endpoints.py +22 -11
- zenml/zen_server/routers/steps_endpoints.py +7 -1
- zenml/zen_server/routers/users_endpoints.py +35 -37
- zenml/zen_server/routers/workspaces_endpoints.py +44 -55
- zenml/zen_server/template_execution/utils.py +4 -1
- zenml/zen_server/utils.py +4 -3
- zenml/zen_stores/base_zen_store.py +10 -2
- zenml/zen_stores/migrations/versions/0.71.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/26351d482b9e_add_step_run_unique_constraint.py +37 -0
- zenml/zen_stores/migrations/versions/a1237ba94fd8_add_model_version_producer_run_unique_.py +68 -0
- zenml/zen_stores/migrations/versions/b73bc71f1106_remove_component_spec_path.py +36 -0
- zenml/zen_stores/migrations/versions/cc269488e5a9_separate_run_metadata.py +135 -0
- zenml/zen_stores/migrations/versions/ec6307720f92_simplify_model_version_links.py +7 -6
- zenml/zen_stores/rest_zen_store.py +76 -43
- zenml/zen_stores/schemas/__init__.py +5 -1
- zenml/zen_stores/schemas/artifact_schemas.py +12 -11
- zenml/zen_stores/schemas/component_schemas.py +0 -3
- zenml/zen_stores/schemas/model_schemas.py +55 -17
- zenml/zen_stores/schemas/pipeline_deployment_schemas.py +7 -7
- zenml/zen_stores/schemas/pipeline_run_schemas.py +52 -18
- zenml/zen_stores/schemas/pipeline_schemas.py +5 -0
- zenml/zen_stores/schemas/run_metadata_schemas.py +66 -31
- zenml/zen_stores/schemas/step_run_schemas.py +40 -13
- zenml/zen_stores/schemas/utils.py +47 -3
- zenml/zen_stores/sql_zen_store.py +462 -134
- {zenml_nightly-0.70.0.dev20241125.dist-info → zenml_nightly-0.71.0.dev20241220.dist-info}/METADATA +5 -5
- {zenml_nightly-0.70.0.dev20241125.dist-info → zenml_nightly-0.71.0.dev20241220.dist-info}/RECORD +239 -217
- zenml/utils/cloud_utils.py +0 -40
- zenml/zen_server/dashboard/assets/RunSelector-DkPiIiNr.js +0 -1
- zenml/zen_server/dashboard/assets/StackList-WvuKQusZ.js +0 -1
- zenml/zen_server/dashboard/assets/delete-run-CJdh1P_h.js +0 -1
- zenml/zen_server/dashboard/assets/index-DlGvJQPn.css +0 -1
- zenml/zen_server/dashboard/assets/page-0JE_-Ec1.js +0 -1
- zenml/zen_server/dashboard/assets/page-BRLpxOt0.js +0 -1
- zenml/zen_server/dashboard/assets/page-BU7huvKw.js +0 -6
- zenml/zen_server/dashboard/assets/page-BvqLv2Ky.js +0 -1
- zenml/zen_server/dashboard/assets/page-CwxrFarU.js +0 -1
- zenml/zen_server/dashboard/assets/page-DfbXf_8s.js +0 -1
- zenml/zen_server/dashboard/assets/page-Dnovpa0i.js +0 -3
- zenml/zen_server/dashboard/assets/page-Dot3LPmL.js +0 -1
- zenml/zen_server/dashboard/assets/page-Xynx4btY.js +0 -14
- zenml/zen_server/dashboard/assets/page-YpKAqVSa.js +0 -1
- {zenml_nightly-0.70.0.dev20241125.dist-info → zenml_nightly-0.71.0.dev20241220.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.70.0.dev20241125.dist-info → zenml_nightly-0.71.0.dev20241220.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.70.0.dev20241125.dist-info → zenml_nightly-0.71.0.dev20241220.dist-info}/entry_points.txt +0 -0
zenml/models/v2/core/step_run.py
CHANGED
@@ -14,7 +14,16 @@
|
|
14
14
|
"""Models representing steps runs."""
|
15
15
|
|
16
16
|
from datetime import datetime
|
17
|
-
from typing import
|
17
|
+
from typing import (
|
18
|
+
TYPE_CHECKING,
|
19
|
+
ClassVar,
|
20
|
+
Dict,
|
21
|
+
List,
|
22
|
+
Optional,
|
23
|
+
Type,
|
24
|
+
TypeVar,
|
25
|
+
Union,
|
26
|
+
)
|
18
27
|
from uuid import UUID
|
19
28
|
|
20
29
|
from pydantic import BaseModel, ConfigDict, Field
|
@@ -41,6 +50,9 @@ if TYPE_CHECKING:
|
|
41
50
|
LogsRequest,
|
42
51
|
LogsResponse,
|
43
52
|
)
|
53
|
+
from zenml.zen_stores.schemas import BaseSchema
|
54
|
+
|
55
|
+
AnySchema = TypeVar("AnySchema", bound=BaseSchema)
|
44
56
|
|
45
57
|
|
46
58
|
class StepRunInputResponse(ArtifactVersionResponse):
|
@@ -142,7 +154,7 @@ class StepRunRequest(WorkspaceScopedRequest):
|
|
142
154
|
class StepRunUpdate(BaseModel):
|
143
155
|
"""Update model for step runs."""
|
144
156
|
|
145
|
-
outputs: Dict[str, UUID] = Field(
|
157
|
+
outputs: Dict[str, List[UUID]] = Field(
|
146
158
|
title="The IDs of the output artifact versions of the step run.",
|
147
159
|
default={},
|
148
160
|
)
|
@@ -553,16 +565,6 @@ class StepRunFilter(WorkspaceScopedFilter):
|
|
553
565
|
description="Original id for this step run",
|
554
566
|
union_mode="left_to_right",
|
555
567
|
)
|
556
|
-
user_id: Optional[Union[UUID, str]] = Field(
|
557
|
-
default=None,
|
558
|
-
description="User that produced this step run",
|
559
|
-
union_mode="left_to_right",
|
560
|
-
)
|
561
|
-
workspace_id: Optional[Union[UUID, str]] = Field(
|
562
|
-
default=None,
|
563
|
-
description="Workspace of this step run",
|
564
|
-
union_mode="left_to_right",
|
565
|
-
)
|
566
568
|
model_version_id: Optional[Union[UUID, str]] = Field(
|
567
569
|
default=None,
|
568
570
|
description="Model version associated with the step run.",
|
@@ -576,24 +578,27 @@ class StepRunFilter(WorkspaceScopedFilter):
|
|
576
578
|
default=None,
|
577
579
|
description="The run_metadata to filter the step runs by.",
|
578
580
|
)
|
579
|
-
|
580
581
|
model_config = ConfigDict(protected_namespaces=())
|
581
582
|
|
582
583
|
def get_custom_filters(
|
583
|
-
self,
|
584
|
+
self, table: Type["AnySchema"]
|
584
585
|
) -> List["ColumnElement[bool]"]:
|
585
586
|
"""Get custom filters.
|
586
587
|
|
588
|
+
Args:
|
589
|
+
table: The query table.
|
590
|
+
|
587
591
|
Returns:
|
588
592
|
A list of custom filters.
|
589
593
|
"""
|
590
|
-
custom_filters = super().get_custom_filters()
|
594
|
+
custom_filters = super().get_custom_filters(table)
|
591
595
|
|
592
596
|
from sqlmodel import and_
|
593
597
|
|
594
598
|
from zenml.zen_stores.schemas import (
|
595
599
|
ModelSchema,
|
596
600
|
ModelVersionSchema,
|
601
|
+
RunMetadataResourceSchema,
|
597
602
|
RunMetadataSchema,
|
598
603
|
StepRunSchema,
|
599
604
|
)
|
@@ -612,10 +617,11 @@ class StepRunFilter(WorkspaceScopedFilter):
|
|
612
617
|
|
613
618
|
for key, value in self.run_metadata.items():
|
614
619
|
additional_filter = and_(
|
615
|
-
|
616
|
-
|
620
|
+
RunMetadataResourceSchema.resource_id == StepRunSchema.id,
|
621
|
+
RunMetadataResourceSchema.resource_type
|
617
622
|
== MetadataResourceTypes.STEP_RUN,
|
618
|
-
|
623
|
+
RunMetadataResourceSchema.run_metadata_id
|
624
|
+
== RunMetadataSchema.id,
|
619
625
|
self.generate_custom_query_conditions_for_column(
|
620
626
|
value=value,
|
621
627
|
table=RunMetadataSchema,
|
zenml/models/v2/core/trigger.py
CHANGED
@@ -13,7 +13,17 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Collection of all models concerning triggers."""
|
15
15
|
|
16
|
-
from typing import
|
16
|
+
from typing import (
|
17
|
+
TYPE_CHECKING,
|
18
|
+
Any,
|
19
|
+
ClassVar,
|
20
|
+
Dict,
|
21
|
+
List,
|
22
|
+
Optional,
|
23
|
+
Type,
|
24
|
+
TypeVar,
|
25
|
+
Union,
|
26
|
+
)
|
17
27
|
from uuid import UUID
|
18
28
|
|
19
29
|
from pydantic import Field, model_validator
|
@@ -39,6 +49,9 @@ if TYPE_CHECKING:
|
|
39
49
|
ActionResponse,
|
40
50
|
)
|
41
51
|
from zenml.models.v2.core.event_source import EventSourceResponse
|
52
|
+
from zenml.zen_stores.schemas import BaseSchema
|
53
|
+
|
54
|
+
AnySchema = TypeVar("AnySchema", bound=BaseSchema)
|
42
55
|
|
43
56
|
|
44
57
|
# ------------------ Request Model ------------------
|
@@ -358,10 +371,13 @@ class TriggerFilter(WorkspaceScopedFilter):
|
|
358
371
|
)
|
359
372
|
|
360
373
|
def get_custom_filters(
|
361
|
-
self,
|
374
|
+
self, table: Type["AnySchema"]
|
362
375
|
) -> List["ColumnElement[bool]"]:
|
363
376
|
"""Get custom filters.
|
364
377
|
|
378
|
+
Args:
|
379
|
+
table: The query table.
|
380
|
+
|
365
381
|
Returns:
|
366
382
|
A list of custom filters.
|
367
383
|
"""
|
@@ -373,7 +389,7 @@ class TriggerFilter(WorkspaceScopedFilter):
|
|
373
389
|
TriggerSchema,
|
374
390
|
)
|
375
391
|
|
376
|
-
custom_filters = super().get_custom_filters()
|
392
|
+
custom_filters = super().get_custom_filters(table)
|
377
393
|
|
378
394
|
if self.event_source_flavor:
|
379
395
|
event_source_flavor_filter = and_(
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Copyright (c) ZenML GmbH 2024. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at:
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
12
|
+
# or implied. See the License for the specific language governing
|
13
|
+
# permissions and limitations under the License.
|
14
|
+
"""Utility classes for modeling run metadata."""
|
15
|
+
|
16
|
+
from datetime import datetime
|
17
|
+
from uuid import UUID
|
18
|
+
|
19
|
+
from pydantic import BaseModel, Field
|
20
|
+
|
21
|
+
from zenml.enums import MetadataResourceTypes
|
22
|
+
from zenml.metadata.metadata_types import MetadataType
|
23
|
+
|
24
|
+
|
25
|
+
class RunMetadataResource(BaseModel):
|
26
|
+
"""Utility class to help identify resources to tag metadata to."""
|
27
|
+
|
28
|
+
id: UUID = Field(title="The ID of the resource.")
|
29
|
+
type: MetadataResourceTypes = Field(title="The type of the resource.")
|
30
|
+
|
31
|
+
|
32
|
+
class RunMetadataEntry(BaseModel):
|
33
|
+
"""Utility class to sort/list run metadata entries."""
|
34
|
+
|
35
|
+
value: MetadataType = Field(title="The value for the run metadata entry")
|
36
|
+
created: datetime = Field(
|
37
|
+
title="The timestamp when this resource was created."
|
38
|
+
)
|
@@ -61,7 +61,7 @@ class BaseOrchestratorConfig(StackComponentConfig):
|
|
61
61
|
"The 'custom_docker_base_image_name' field has been "
|
62
62
|
"deprecated. To use a custom base container image with your "
|
63
63
|
"orchestrators, please use the DockerSettings in your "
|
64
|
-
"pipeline (see https://docs.zenml.io/how-to/customize-docker-builds)."
|
64
|
+
"pipeline (see https://docs.zenml.io/how-to/infrastructure-deployment/customize-docker-builds)."
|
65
65
|
)
|
66
66
|
|
67
67
|
return data
|
@@ -84,6 +84,15 @@ class BaseOrchestratorConfig(StackComponentConfig):
|
|
84
84
|
"""
|
85
85
|
return False
|
86
86
|
|
87
|
+
@property
|
88
|
+
def supports_client_side_caching(self) -> bool:
|
89
|
+
"""Whether the orchestrator supports client side caching.
|
90
|
+
|
91
|
+
Returns:
|
92
|
+
Whether the orchestrator supports client side caching.
|
93
|
+
"""
|
94
|
+
return True
|
95
|
+
|
87
96
|
|
88
97
|
class BaseOrchestrator(StackComponent, ABC):
|
89
98
|
"""Base class for all orchestrators.
|
@@ -205,6 +214,7 @@ class BaseOrchestrator(StackComponent, ABC):
|
|
205
214
|
|
206
215
|
if (
|
207
216
|
placeholder_run
|
217
|
+
and self.config.supports_client_side_caching
|
208
218
|
and not deployment.schedule
|
209
219
|
and not prevent_client_side_caching
|
210
220
|
):
|
@@ -232,6 +242,8 @@ class BaseOrchestrator(StackComponent, ABC):
|
|
232
242
|
self._cleanup_run()
|
233
243
|
logger.info("All steps of the pipeline run were cached.")
|
234
244
|
return
|
245
|
+
else:
|
246
|
+
logger.debug("Skipping client-side caching.")
|
235
247
|
|
236
248
|
try:
|
237
249
|
if metadata_iterator := self.prepare_or_run_pipeline(
|
@@ -20,7 +20,7 @@ from zenml.client import Client
|
|
20
20
|
from zenml.config.step_configurations import Step
|
21
21
|
from zenml.enums import ArtifactSaveType, StepRunInputArtifactType
|
22
22
|
from zenml.exceptions import InputResolutionError
|
23
|
-
from zenml.utils import pagination_utils
|
23
|
+
from zenml.utils import pagination_utils, string_utils
|
24
24
|
|
25
25
|
if TYPE_CHECKING:
|
26
26
|
from zenml.models import PipelineRunResponse
|
@@ -53,7 +53,8 @@ def resolve_step_inputs(
|
|
53
53
|
current_run_steps = {
|
54
54
|
run_step.name: run_step
|
55
55
|
for run_step in pagination_utils.depaginate(
|
56
|
-
Client().list_run_steps,
|
56
|
+
Client().list_run_steps,
|
57
|
+
pipeline_run_id=pipeline_run.id,
|
57
58
|
)
|
58
59
|
}
|
59
60
|
|
@@ -66,11 +67,23 @@ def resolve_step_inputs(
|
|
66
67
|
f"No step `{input_.step_name}` found in current run."
|
67
68
|
)
|
68
69
|
|
70
|
+
# Try to get the substitutions from the pipeline run first, as we
|
71
|
+
# already have a hydrated version of that. In the unlikely case
|
72
|
+
# that the pipeline run is outdated, we fetch it from the step
|
73
|
+
# run instead which will costs us one hydration call.
|
74
|
+
substitutions = (
|
75
|
+
pipeline_run.step_substitutions.get(step_run.name)
|
76
|
+
or step_run.config.substitutions
|
77
|
+
)
|
78
|
+
output_name = string_utils.format_name_template(
|
79
|
+
input_.output_name, substitutions=substitutions
|
80
|
+
)
|
81
|
+
|
69
82
|
try:
|
70
|
-
outputs = step_run.outputs[
|
83
|
+
outputs = step_run.outputs[output_name]
|
71
84
|
except KeyError:
|
72
85
|
raise InputResolutionError(
|
73
|
-
f"No step output `{
|
86
|
+
f"No step output `{output_name}` found for step "
|
74
87
|
f"`{input_.step_name}`."
|
75
88
|
)
|
76
89
|
|
@@ -83,12 +96,12 @@ def resolve_step_inputs(
|
|
83
96
|
# This should never happen, there can only be a single regular step
|
84
97
|
# output for a name
|
85
98
|
raise InputResolutionError(
|
86
|
-
f"Too many step outputs for output `{
|
99
|
+
f"Too many step outputs for output `{output_name}` of "
|
87
100
|
f"step `{input_.step_name}`."
|
88
101
|
)
|
89
102
|
elif len(step_outputs) == 0:
|
90
103
|
raise InputResolutionError(
|
91
|
-
f"No step output `{
|
104
|
+
f"No step output `{output_name}` found for step "
|
92
105
|
f"`{input_.step_name}`."
|
93
106
|
)
|
94
107
|
|
@@ -19,6 +19,7 @@ from uuid import uuid4
|
|
19
19
|
|
20
20
|
from zenml.client import Client
|
21
21
|
from zenml.logger import get_logger
|
22
|
+
from zenml.utils import string_utils
|
22
23
|
|
23
24
|
if TYPE_CHECKING:
|
24
25
|
from zenml.artifact_stores import BaseArtifactStore
|
@@ -75,10 +76,13 @@ def prepare_output_artifact_uris(
|
|
75
76
|
artifact_store = stack.artifact_store
|
76
77
|
output_artifact_uris: Dict[str, str] = {}
|
77
78
|
for output_name in step.config.outputs.keys():
|
79
|
+
substituted_output_name = string_utils.format_name_template(
|
80
|
+
output_name, substitutions=step_run.config.substitutions
|
81
|
+
)
|
78
82
|
artifact_uri = generate_artifact_uri(
|
79
83
|
artifact_store=stack.artifact_store,
|
80
84
|
step_run=step_run,
|
81
|
-
output_name=
|
85
|
+
output_name=substituted_output_name,
|
82
86
|
)
|
83
87
|
if artifact_store.exists(artifact_uri):
|
84
88
|
raise RuntimeError("Artifact already exists")
|
@@ -21,6 +21,7 @@ from zenml.enums import ExecutionStatus, MetadataResourceTypes
|
|
21
21
|
from zenml.models import (
|
22
22
|
PipelineRunResponse,
|
23
23
|
PipelineRunUpdate,
|
24
|
+
RunMetadataResource,
|
24
25
|
StepRunResponse,
|
25
26
|
StepRunUpdate,
|
26
27
|
)
|
@@ -32,7 +33,7 @@ if TYPE_CHECKING:
|
|
32
33
|
|
33
34
|
|
34
35
|
def publish_successful_step_run(
|
35
|
-
step_run_id: "UUID", output_artifact_ids: Dict[str, "UUID"]
|
36
|
+
step_run_id: "UUID", output_artifact_ids: Dict[str, List["UUID"]]
|
36
37
|
) -> "StepRunResponse":
|
37
38
|
"""Publishes a successful step run.
|
38
39
|
|
@@ -129,8 +130,11 @@ def publish_pipeline_run_metadata(
|
|
129
130
|
for stack_component_id, metadata in pipeline_run_metadata.items():
|
130
131
|
client.create_run_metadata(
|
131
132
|
metadata=metadata,
|
132
|
-
|
133
|
-
|
133
|
+
resources=[
|
134
|
+
RunMetadataResource(
|
135
|
+
id=pipeline_run_id, type=MetadataResourceTypes.PIPELINE_RUN
|
136
|
+
)
|
137
|
+
],
|
134
138
|
stack_component_id=stack_component_id,
|
135
139
|
)
|
136
140
|
|
@@ -150,7 +154,10 @@ def publish_step_run_metadata(
|
|
150
154
|
for stack_component_id, metadata in step_run_metadata.items():
|
151
155
|
client.create_run_metadata(
|
152
156
|
metadata=metadata,
|
153
|
-
|
154
|
-
|
157
|
+
resources=[
|
158
|
+
RunMetadataResource(
|
159
|
+
id=step_run_id, type=MetadataResourceTypes.STEP_RUN
|
160
|
+
)
|
161
|
+
],
|
155
162
|
stack_component_id=stack_component_id,
|
156
163
|
)
|
@@ -179,12 +179,10 @@ class StepLauncher:
|
|
179
179
|
pipeline_run_id=pipeline_run.id,
|
180
180
|
pipeline_run_metadata=pipeline_run_metadata,
|
181
181
|
)
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
)
|
187
|
-
)
|
182
|
+
if model_version := pipeline_run.model_version:
|
183
|
+
step_run_utils.log_model_version_dashboard_url(
|
184
|
+
model_version=model_version
|
185
|
+
)
|
188
186
|
|
189
187
|
request_factory = step_run_utils.StepRunRequestFactory(
|
190
188
|
deployment=self._deployment,
|
@@ -209,12 +207,10 @@ class StepLauncher:
|
|
209
207
|
step_run = Client().zen_store.create_run_step(
|
210
208
|
step_run_request
|
211
209
|
)
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
step_run=step_run, pipeline_run=pipeline_run
|
210
|
+
if model_version := step_run.model_version:
|
211
|
+
step_run_utils.log_model_version_dashboard_url(
|
212
|
+
model_version=model_version
|
216
213
|
)
|
217
|
-
)
|
218
214
|
|
219
215
|
if not step_run.status.is_finished:
|
220
216
|
logger.info(f"Step `{self._step_name}` has started.")
|
@@ -289,8 +285,8 @@ class StepLauncher:
|
|
289
285
|
f"Using cached version of step `{self._step_name}`."
|
290
286
|
)
|
291
287
|
if (
|
292
|
-
model_version :=
|
293
|
-
or
|
288
|
+
model_version := step_run.model_version
|
289
|
+
or pipeline_run.model_version
|
294
290
|
):
|
295
291
|
step_run_utils.link_output_artifacts_to_model_version(
|
296
292
|
artifacts=step_run.outputs,
|
@@ -309,8 +305,12 @@ class StepLauncher:
|
|
309
305
|
The created or existing pipeline run,
|
310
306
|
and a boolean indicating whether the run was created or reused.
|
311
307
|
"""
|
312
|
-
|
313
|
-
|
308
|
+
start_time = datetime.utcnow()
|
309
|
+
run_name = string_utils.format_name_template(
|
310
|
+
name_template=self._deployment.run_name_template,
|
311
|
+
substitutions=self._deployment.pipeline_configuration._get_full_substitutions(
|
312
|
+
start_time
|
313
|
+
),
|
314
314
|
)
|
315
315
|
|
316
316
|
logger.debug("Creating pipeline run %s", run_name)
|
@@ -329,7 +329,7 @@ class StepLauncher:
|
|
329
329
|
),
|
330
330
|
status=ExecutionStatus.RUNNING,
|
331
331
|
orchestrator_environment=get_run_environment_dict(),
|
332
|
-
start_time=
|
332
|
+
start_time=start_time,
|
333
333
|
tags=self._deployment.pipeline_configuration.tags,
|
334
334
|
)
|
335
335
|
return client.zen_store.get_or_create_run(pipeline_run)
|