zenml-nightly 0.62.0.dev20240729__py3-none-any.whl → 0.64.0.dev20240809__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 +2 -2
- RELEASE_NOTES.md +120 -0
- zenml/VERSION +1 -1
- zenml/__init__.py +0 -4
- zenml/actions/pipeline_run/pipeline_run_action.py +19 -17
- zenml/analytics/enums.py +4 -6
- zenml/cli/__init__.py +28 -76
- zenml/cli/base.py +2 -2
- zenml/cli/pipeline.py +54 -61
- zenml/cli/stack.py +6 -8
- zenml/cli/web_login.py +8 -0
- zenml/client.py +232 -103
- zenml/config/build_configuration.py +43 -17
- zenml/config/compiler.py +14 -22
- zenml/config/docker_settings.py +80 -57
- zenml/config/pipeline_run_configuration.py +3 -0
- zenml/config/server_config.py +3 -0
- zenml/config/source.py +60 -1
- zenml/constants.py +11 -2
- zenml/entrypoints/base_entrypoint_configuration.py +53 -8
- zenml/enums.py +4 -1
- zenml/environment.py +25 -9
- zenml/image_builders/base_image_builder.py +1 -1
- zenml/image_builders/build_context.py +25 -72
- zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +13 -4
- zenml/integrations/azure/__init__.py +4 -0
- zenml/integrations/azure/flavors/__init__.py +11 -0
- zenml/integrations/azure/flavors/azureml_orchestrator_flavor.py +263 -0
- zenml/{_hub → integrations/azure/orchestrators}/__init__.py +7 -2
- zenml/integrations/azure/orchestrators/azureml_orchestrator.py +544 -0
- zenml/integrations/azure/orchestrators/azureml_orchestrator_entrypoint_config.py +86 -0
- zenml/integrations/azure/step_operators/azureml_step_operator.py +3 -0
- zenml/integrations/databricks/flavors/databricks_orchestrator_flavor.py +20 -2
- zenml/integrations/databricks/orchestrators/databricks_orchestrator.py +19 -13
- zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +7 -2
- zenml/integrations/gcp/service_connectors/gcp_service_connector.py +123 -6
- zenml/integrations/kaniko/image_builders/kaniko_image_builder.py +1 -1
- zenml/integrations/mlflow/__init__.py +1 -1
- zenml/integrations/mlflow/experiment_trackers/mlflow_experiment_tracker.py +3 -1
- zenml/integrations/mlflow/flavors/mlflow_experiment_tracker_flavor.py +3 -0
- zenml/logger.py +13 -0
- zenml/models/__init__.py +26 -22
- zenml/models/v2/base/filter.py +32 -0
- zenml/models/v2/core/pipeline.py +73 -89
- zenml/models/v2/core/pipeline_build.py +15 -11
- zenml/models/v2/core/pipeline_deployment.py +72 -24
- zenml/models/v2/core/pipeline_run.py +65 -1
- zenml/models/v2/core/run_template.py +393 -0
- zenml/models/v2/core/server_settings.py +12 -0
- zenml/models/v2/core/user.py +0 -21
- zenml/models/v2/misc/server_models.py +7 -1
- zenml/models/v2/misc/stack_deployment.py +5 -0
- zenml/models/v2/misc/user_auth.py +0 -7
- zenml/new/pipelines/build_utils.py +220 -89
- zenml/new/pipelines/code_archive.py +157 -0
- zenml/new/pipelines/pipeline.py +46 -78
- zenml/new/pipelines/run_utils.py +79 -1
- zenml/post_execution/pipeline.py +1 -4
- zenml/service_connectors/service_connector_utils.py +18 -2
- zenml/stack_deployments/aws_stack_deployment.py +32 -8
- zenml/stack_deployments/azure_stack_deployment.py +122 -10
- zenml/stack_deployments/gcp_stack_deployment.py +36 -7
- zenml/stack_deployments/stack_deployment.py +23 -7
- zenml/steps/base_step.py +3 -0
- zenml/steps/utils.py +0 -4
- zenml/utils/archivable.py +149 -0
- zenml/utils/code_utils.py +244 -0
- zenml/utils/notebook_utils.py +122 -0
- zenml/utils/package_utils.py +39 -0
- zenml/utils/pipeline_docker_image_builder.py +3 -96
- zenml/utils/source_utils.py +109 -1
- zenml/zen_server/dashboard/assets/{404-B_YdvmwS.js → 404-CRAA_Lew.js} +1 -1
- zenml/zen_server/dashboard/assets/@radix-BXWm7HOa.js +85 -0
- zenml/zen_server/dashboard/assets/{@react-router-CO-OsFwI.js → @react-router-l3lMcXA2.js} +1 -1
- zenml/zen_server/dashboard/assets/{@reactflow-l_1hUr1S.js → @reactflow-CeVxyqYT.js} +2 -2
- zenml/zen_server/dashboard/assets/{@tanstack-DYiOyJUL.js → @tanstack-FmcYZMuX.js} +4 -4
- zenml/zen_server/dashboard/assets/AlertDialogDropdownItem-ErO9aOgK.js +1 -0
- zenml/zen_server/dashboard/assets/{AwarenessChannel-CFg5iX4Z.js → AwarenessChannel-CLXo5rKM.js} +1 -1
- zenml/zen_server/dashboard/assets/{CodeSnippet-Dvkx_82E.js → CodeSnippet-D0VLxT2A.js} +2 -2
- zenml/zen_server/dashboard/assets/CollapsibleCard-BaUPiVg0.js +1 -0
- zenml/zen_server/dashboard/assets/{Commands-DoN1xrEq.js → Commands-JrcZK-3j.js} +1 -1
- zenml/zen_server/dashboard/assets/CopyButton-Dbo52T1K.js +2 -0
- zenml/zen_server/dashboard/assets/{CsvVizualization-Ck-nZ43m.js → CsvVizualization-D3kAypDj.js} +3 -3
- zenml/zen_server/dashboard/assets/DisplayDate-DizbSeT-.js +1 -0
- zenml/zen_server/dashboard/assets/EditSecretDialog-Bd7mFLS4.js +1 -0
- zenml/zen_server/dashboard/assets/{EmptyState-BMLnFVlB.js → EmptyState-BHblM39I.js} +1 -1
- zenml/zen_server/dashboard/assets/{Error-kLtljEOM.js → Error-C6LeJSER.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-DguLLgTK.js → ExecutionStatus-jH4OrWBq.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-BXUMP21n.js → Helpbox-aAB2XP-z.js} +1 -1
- zenml/zen_server/dashboard/assets/{Infobox-DSt0O-dm.js → Infobox-BQ0aty32.js} +1 -1
- zenml/zen_server/dashboard/assets/{InlineAvatar-xsrsIGE-.js → InlineAvatar-DpTLgM3Q.js} +1 -1
- zenml/zen_server/dashboard/assets/Lock-CNyJvf2r.js +1 -0
- zenml/zen_server/dashboard/assets/{MarkdownVisualization-xp3hhULl.js → MarkdownVisualization-Bajxn0HY.js} +1 -1
- zenml/zen_server/dashboard/assets/NumberBox-BmKE0qnO.js +1 -0
- zenml/zen_server/dashboard/assets/{PasswordChecker-DUveqlva.js → PasswordChecker-yGGoJSB-.js} +1 -1
- zenml/zen_server/dashboard/assets/ProviderRadio-BBqkIuTd.js +1 -0
- zenml/zen_server/dashboard/assets/RadioItem-xLhXoiFV.js +1 -0
- zenml/zen_server/dashboard/assets/SearchField-C9R0mdaX.js +1 -0
- zenml/zen_server/dashboard/assets/{SetPassword-BXGTWiwj.js → SetPassword-52sNxNiO.js} +1 -1
- zenml/zen_server/dashboard/assets/{SuccessStep-DZC60t0x.js → SuccessStep-DlkItqYG.js} +1 -1
- zenml/zen_server/dashboard/assets/Tick-uxv80Q6a.js +1 -0
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-DGvwFWO1.js → UpdatePasswordSchemas-oN4G3sKz.js} +1 -1
- zenml/zen_server/dashboard/assets/{aws-BgKTfTfx.js → aws-0_3UsPif.js} +1 -1
- zenml/zen_server/dashboard/assets/{check-circle-i56092KI.js → check-circle-1_I207rW.js} +1 -1
- zenml/zen_server/dashboard/assets/chevron-down-BpaF8JqM.js +1 -0
- zenml/zen_server/dashboard/assets/{chevron-right-double-CZBOf6JM.js → chevron-right-double-Dk8e2L99.js} +1 -1
- zenml/zen_server/dashboard/assets/{cloud-only-C_yFCAkP.js → cloud-only-BkUuI0lZ.js} +1 -1
- zenml/zen_server/dashboard/assets/components-Br2ezRib.js +1 -0
- zenml/zen_server/dashboard/assets/{copy-BXNk6BjL.js → copy-f3XGPPxt.js} +1 -1
- zenml/zen_server/dashboard/assets/{database-1xWSgZfO.js → database-cXYNX9tt.js} +1 -1
- zenml/zen_server/dashboard/assets/{docker-CQMVm_4d.js → docker-8uj__HHK.js} +1 -1
- zenml/zen_server/dashboard/assets/dots-horizontal-sKQlWEni.js +1 -0
- zenml/zen_server/dashboard/assets/edit-C0MVvPD2.js +1 -0
- zenml/zen_server/dashboard/assets/{file-text-CqD_iu6l.js → file-text-B9JibxTs.js} +1 -1
- zenml/zen_server/dashboard/assets/{help-bu_DgLKI.js → help-FuHlZwn0.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-rK_Wuy2W.js → index-Bd1xgUQG.js} +1 -1
- zenml/zen_server/dashboard/assets/index-DaGknux4.css +1 -0
- zenml/zen_server/dashboard/assets/{index-BczVOqUf.js → index-DhIZtpxB.js} +5 -5
- zenml/zen_server/dashboard/assets/index.esm-DT4uyn2i.js +1 -0
- zenml/zen_server/dashboard/assets/layout-D6oiSbfd.js +1 -0
- zenml/zen_server/dashboard/assets/{login-mutation-CrHrndTI.js → login-mutation-13A_JSVA.js} +1 -1
- zenml/zen_server/dashboard/assets/{logs-D8k8BVFf.js → logs-CgeE2vZP.js} +1 -1
- zenml/zen_server/dashboard/assets/{not-found-DYa4pC-C.js → not-found-B0Mmb90p.js} +1 -1
- zenml/zen_server/dashboard/assets/package-DdkziX79.js +1 -0
- zenml/zen_server/dashboard/assets/page-7-v2OBm-.js +1 -0
- zenml/zen_server/dashboard/assets/{page-MFQyIJd3.js → page-B3ozwdD1.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BkuQDIf-.js → page-BGwA9B1M.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-1iL8aMqs.js → page-BkjAUyTA.js} +1 -1
- zenml/zen_server/dashboard/assets/page-BnacgBiy.js +1 -0
- zenml/zen_server/dashboard/assets/page-BxF_KMQ3.js +2 -0
- zenml/zen_server/dashboard/assets/page-C4POHC0K.js +1 -0
- zenml/zen_server/dashboard/assets/page-C9kudd44.js +9 -0
- zenml/zen_server/dashboard/assets/page-CA1j3GpJ.js +1 -0
- zenml/zen_server/dashboard/assets/page-CCY6yfmu.js +1 -0
- zenml/zen_server/dashboard/assets/page-CgTe7Bme.js +1 -0
- zenml/zen_server/dashboard/assets/{page-8a4UMKXZ.js → page-Cgn-6v2Y.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CxQmQqDw.js +1 -0
- zenml/zen_server/dashboard/assets/page-D2Goey3H.js +1 -0
- zenml/zen_server/dashboard/assets/page-DLpOnf7u.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BhgCDInH.js → page-DSTQnBk-.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-1h_sD1jz.js → page-DTysUGOy.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-2grKx_MY.js → page-D_EXUFJb.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Db15QzsM.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BDns21Iz.js → page-DugsjcQ_.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-C6-UGEbH.js → page-OFKSPyN7.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BkeAAYwp.js → page-RnG-qhv9.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CCNRIt_f.js → page-T2BtjwPl.js} +1 -1
- zenml/zen_server/dashboard/assets/page-TXe1Eo3Z.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BnaevhnB.js → page-YiF_fNbe.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-uA5prJGY.js → page-hQaiQXfg.js} +1 -1
- zenml/zen_server/dashboard/assets/persist-3-5nOJ6m.js +1 -0
- zenml/zen_server/dashboard/assets/{play-circle-CNtZKDnW.js → play-circle-XSkLR12B.js} +1 -1
- zenml/zen_server/dashboard/assets/plus-FB9-lEq_.js +1 -0
- zenml/zen_server/dashboard/assets/refresh-COb6KYDi.js +1 -0
- zenml/zen_server/dashboard/assets/sharedSchema-BoYx_B_L.js +14 -0
- zenml/zen_server/dashboard/assets/{stack-detail-query-Cficsl6d.js → stack-detail-query-B-US_-wa.js} +1 -1
- zenml/zen_server/dashboard/assets/{terminal-By9cErXc.js → terminal-grtjrIEJ.js} +1 -1
- zenml/zen_server/dashboard/assets/trash-Cd5CSFqA.js +1 -0
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-7d8xi1tS.js → update-server-settings-mutation-B8GB_ubU.js} +1 -1
- zenml/zen_server/dashboard/assets/{url-D7mAQGUM.js → url-hcMJkz8p.js} +1 -1
- zenml/zen_server/dashboard/assets/{zod-BhoGpZ63.js → zod-CnykDKJj.js} +1 -1
- zenml/zen_server/dashboard/index.html +7 -7
- zenml/zen_server/dashboard_legacy/asset-manifest.json +4 -4
- zenml/zen_server/dashboard_legacy/index.html +1 -1
- zenml/zen_server/dashboard_legacy/{precache-manifest.12246c7548e71e2c4438e496360de80c.js → precache-manifest.9c473c96a43298343a7ce1256183123b.js} +4 -4
- zenml/zen_server/dashboard_legacy/service-worker.js +1 -1
- zenml/zen_server/dashboard_legacy/static/js/{main.3b27024b.chunk.js → main.463c90b9.chunk.js} +2 -2
- zenml/zen_server/dashboard_legacy/static/js/{main.3b27024b.chunk.js.map → main.463c90b9.chunk.js.map} +1 -1
- zenml/zen_server/deploy/helm/Chart.yaml +1 -1
- zenml/zen_server/deploy/helm/README.md +2 -2
- zenml/zen_server/rbac/models.py +1 -0
- zenml/zen_server/rbac/utils.py +4 -0
- zenml/zen_server/routers/pipeline_builds_endpoints.py +2 -66
- zenml/zen_server/routers/pipeline_deployments_endpoints.py +2 -53
- zenml/zen_server/routers/pipelines_endpoints.py +1 -74
- zenml/zen_server/routers/run_templates_endpoints.py +212 -0
- zenml/zen_server/routers/stack_deployment_endpoints.py +6 -0
- zenml/zen_server/routers/users_endpoints.py +0 -7
- zenml/zen_server/routers/workspaces_endpoints.py +79 -0
- zenml/zen_server/{pipeline_deployment → template_execution}/runner_entrypoint_configuration.py +1 -8
- zenml/zen_server/{pipeline_deployment → template_execution}/utils.py +214 -92
- zenml/zen_server/utils.py +77 -2
- zenml/zen_server/zen_server_api.py +54 -2
- zenml/zen_stores/base_zen_store.py +7 -1
- zenml/zen_stores/migrations/versions/0.63.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.64.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/026d4577b6a0_add_code_path.py +39 -0
- zenml/zen_stores/migrations/versions/3dcc5d20e82f_add_last_user_activity.py +51 -0
- zenml/zen_stores/migrations/versions/7d1919bb1ef0_add_run_templates.py +100 -0
- zenml/zen_stores/migrations/versions/909550c7c4da_remove_user_hub_token.py +36 -0
- zenml/zen_stores/migrations/versions/b59aa68fdb1f_simplify_pipelines.py +139 -0
- zenml/zen_stores/rest_zen_store.py +112 -39
- zenml/zen_stores/schemas/__init__.py +2 -0
- zenml/zen_stores/schemas/pipeline_build_schemas.py +3 -3
- zenml/zen_stores/schemas/pipeline_deployment_schemas.py +32 -2
- zenml/zen_stores/schemas/pipeline_run_schemas.py +29 -3
- zenml/zen_stores/schemas/pipeline_schemas.py +29 -30
- zenml/zen_stores/schemas/run_template_schemas.py +264 -0
- zenml/zen_stores/schemas/server_settings_schemas.py +2 -0
- zenml/zen_stores/schemas/step_run_schemas.py +11 -4
- zenml/zen_stores/schemas/user_schemas.py +0 -2
- zenml/zen_stores/sql_zen_store.py +389 -151
- zenml/zen_stores/template_utils.py +261 -0
- zenml/zen_stores/zen_store_interface.py +93 -20
- {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.64.0.dev20240809.dist-info}/METADATA +3 -3
- {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.64.0.dev20240809.dist-info}/RECORD +211 -184
- zenml/_hub/client.py +0 -289
- zenml/_hub/constants.py +0 -21
- zenml/_hub/utils.py +0 -79
- zenml/cli/hub.py +0 -1116
- zenml/models/v2/core/pipeline_namespace.py +0 -113
- zenml/models/v2/misc/hub_plugin_models.py +0 -79
- zenml/new/pipelines/deserialization_utils.py +0 -292
- zenml/zen_server/dashboard/assets/@radix-CFOkMR_E.js +0 -85
- zenml/zen_server/dashboard/assets/CollapsibleCard-opiuBHHc.js +0 -1
- zenml/zen_server/dashboard/assets/CopyButton-Cr7xYEPb.js +0 -2
- zenml/zen_server/dashboard/assets/DisplayDate-DYgIjlDF.js +0 -1
- zenml/zen_server/dashboard/assets/Pagination-C6X-mifw.js +0 -1
- zenml/zen_server/dashboard/assets/index-EpMIKgrI.css +0 -1
- zenml/zen_server/dashboard/assets/index.esm-Corw4lXQ.js +0 -1
- zenml/zen_server/dashboard/assets/package-B3fWP-Dh.js +0 -1
- zenml/zen_server/dashboard/assets/page-5NCOHOsy.js +0 -1
- zenml/zen_server/dashboard/assets/page-B6h3iaHJ.js +0 -1
- zenml/zen_server/dashboard/assets/page-Bi-wtWiO.js +0 -5
- zenml/zen_server/dashboard/assets/page-Bq0YxkLV.js +0 -1
- zenml/zen_server/dashboard/assets/page-Bs2F4eoD.js +0 -2
- zenml/zen_server/dashboard/assets/page-CHNxpz3n.js +0 -1
- zenml/zen_server/dashboard/assets/page-DgorQFqi.js +0 -1
- zenml/zen_server/dashboard/assets/page-K8ebxVIs.js +0 -1
- zenml/zen_server/dashboard/assets/page-TgCF0P_U.js +0 -1
- zenml/zen_server/dashboard/assets/page-ZnCEe-eK.js +0 -9
- zenml/zen_server/dashboard/assets/persist-D7HJNBWx.js +0 -1
- zenml/zen_server/dashboard/assets/plus-C8WOyCzt.js +0 -1
- zenml/zen_server/dashboard/assets/secrets-video-OBJ6irhH.svg +0 -21
- zenml/zen_server/dashboard/assets/stacks-video-7gfxpAq4.svg +0 -21
- /zenml/zen_server/{pipeline_deployment → template_execution}/__init__.py +0 -0
- /zenml/zen_server/{pipeline_deployment → template_execution}/workload_manager_interface.py +0 -0
- {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.64.0.dev20240809.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.64.0.dev20240809.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.64.0.dev20240809.dist-info}/entry_points.txt +0 -0
zenml/models/v2/core/pipeline.py
CHANGED
@@ -13,27 +13,35 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Models representing pipelines."""
|
15
15
|
|
16
|
-
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
16
|
+
from typing import TYPE_CHECKING, Any, List, Optional, Type, TypeVar, Union
|
17
17
|
from uuid import UUID
|
18
18
|
|
19
19
|
from pydantic import Field
|
20
20
|
|
21
|
-
from zenml.
|
22
|
-
|
21
|
+
from zenml.constants import (
|
22
|
+
SORT_PIPELINES_BY_LATEST_RUN_KEY,
|
23
|
+
STR_FIELD_MAX_LENGTH,
|
24
|
+
TEXT_FIELD_MAX_LENGTH,
|
25
|
+
)
|
23
26
|
from zenml.enums import ExecutionStatus
|
24
27
|
from zenml.models.v2.base.base import BaseUpdate
|
25
28
|
from zenml.models.v2.base.scoped import (
|
26
|
-
WorkspaceScopedFilter,
|
27
29
|
WorkspaceScopedRequest,
|
28
30
|
WorkspaceScopedResponse,
|
29
31
|
WorkspaceScopedResponseBody,
|
30
32
|
WorkspaceScopedResponseMetadata,
|
31
33
|
WorkspaceScopedResponseResources,
|
34
|
+
WorkspaceScopedTaggableFilter,
|
32
35
|
)
|
36
|
+
from zenml.models.v2.core.tag import TagResponse
|
33
37
|
|
34
38
|
if TYPE_CHECKING:
|
35
39
|
from zenml.models.v2.core.pipeline_run import PipelineRunResponse
|
40
|
+
from zenml.zen_stores.schemas import BaseSchema
|
41
|
+
|
42
|
+
AnySchema = TypeVar("AnySchema", bound=BaseSchema)
|
36
43
|
|
44
|
+
AnyQuery = TypeVar("AnyQuery", bound=Any)
|
37
45
|
|
38
46
|
# ------------------ Request Model ------------------
|
39
47
|
|
@@ -45,20 +53,15 @@ class PipelineRequest(WorkspaceScopedRequest):
|
|
45
53
|
title="The name of the pipeline.",
|
46
54
|
max_length=STR_FIELD_MAX_LENGTH,
|
47
55
|
)
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
)
|
52
|
-
version_hash: str = Field(
|
53
|
-
title="The version hash of the pipeline.",
|
54
|
-
max_length=STR_FIELD_MAX_LENGTH,
|
55
|
-
)
|
56
|
-
docstring: Optional[str] = Field(
|
57
|
-
title="The docstring of the pipeline.",
|
56
|
+
description: Optional[str] = Field(
|
57
|
+
default=None,
|
58
|
+
title="The description of the pipeline.",
|
58
59
|
max_length=TEXT_FIELD_MAX_LENGTH,
|
60
|
+
)
|
61
|
+
tags: Optional[List[str]] = Field(
|
59
62
|
default=None,
|
63
|
+
title="Tags of the pipeline.",
|
60
64
|
)
|
61
|
-
spec: PipelineSpec = Field(title="The spec of the pipeline.")
|
62
65
|
|
63
66
|
|
64
67
|
# ------------------ Update Model ------------------
|
@@ -67,29 +70,16 @@ class PipelineRequest(WorkspaceScopedRequest):
|
|
67
70
|
class PipelineUpdate(BaseUpdate):
|
68
71
|
"""Update model for pipelines."""
|
69
72
|
|
70
|
-
|
71
|
-
title="The name of the pipeline.",
|
72
|
-
max_length=STR_FIELD_MAX_LENGTH,
|
73
|
-
default=None,
|
74
|
-
)
|
75
|
-
version: Optional[str] = Field(
|
76
|
-
title="The version of the pipeline.",
|
77
|
-
max_length=STR_FIELD_MAX_LENGTH,
|
73
|
+
description: Optional[str] = Field(
|
78
74
|
default=None,
|
79
|
-
|
80
|
-
version_hash: Optional[str] = Field(
|
81
|
-
title="The version hash of the pipeline.",
|
82
|
-
max_length=STR_FIELD_MAX_LENGTH,
|
83
|
-
default=None,
|
84
|
-
)
|
85
|
-
docstring: Optional[str] = Field(
|
86
|
-
title="The docstring of the pipeline.",
|
75
|
+
title="The description of the pipeline.",
|
87
76
|
max_length=TEXT_FIELD_MAX_LENGTH,
|
88
|
-
default=None,
|
89
77
|
)
|
90
|
-
|
91
|
-
title="
|
92
|
-
|
78
|
+
add_tags: Optional[List[str]] = Field(
|
79
|
+
default=None, title="New tags to add to the pipeline."
|
80
|
+
)
|
81
|
+
remove_tags: Optional[List[str]] = Field(
|
82
|
+
default=None, title="Tags to remove from the pipeline."
|
93
83
|
)
|
94
84
|
|
95
85
|
|
@@ -99,33 +89,32 @@ class PipelineUpdate(BaseUpdate):
|
|
99
89
|
class PipelineResponseBody(WorkspaceScopedResponseBody):
|
100
90
|
"""Response body for pipelines."""
|
101
91
|
|
102
|
-
|
103
|
-
default=None,
|
92
|
+
latest_run_id: Optional[UUID] = Field(
|
93
|
+
default=None,
|
94
|
+
title="The ID of the latest run of the pipeline.",
|
104
95
|
)
|
105
|
-
|
106
|
-
|
107
|
-
|
96
|
+
latest_run_status: Optional[ExecutionStatus] = Field(
|
97
|
+
default=None,
|
98
|
+
title="The status of the latest run of the pipeline.",
|
108
99
|
)
|
109
100
|
|
110
101
|
|
111
102
|
class PipelineResponseMetadata(WorkspaceScopedResponseMetadata):
|
112
103
|
"""Response metadata for pipelines."""
|
113
104
|
|
114
|
-
|
115
|
-
title="The version hash of the pipeline.",
|
116
|
-
max_length=STR_FIELD_MAX_LENGTH,
|
117
|
-
)
|
118
|
-
spec: PipelineSpec = Field(title="The spec of the pipeline.")
|
119
|
-
docstring: Optional[str] = Field(
|
120
|
-
title="The docstring of the pipeline.",
|
121
|
-
max_length=TEXT_FIELD_MAX_LENGTH,
|
105
|
+
description: Optional[str] = Field(
|
122
106
|
default=None,
|
107
|
+
title="The description of the pipeline.",
|
123
108
|
)
|
124
109
|
|
125
110
|
|
126
111
|
class PipelineResponseResources(WorkspaceScopedResponseResources):
|
127
112
|
"""Class for all resource models associated with the pipeline entity."""
|
128
113
|
|
114
|
+
tags: List[TagResponse] = Field(
|
115
|
+
title="Tags associated with the pipeline.",
|
116
|
+
)
|
117
|
+
|
129
118
|
|
130
119
|
class PipelineResponse(
|
131
120
|
WorkspaceScopedResponse[
|
@@ -224,75 +213,46 @@ class PipelineResponse(
|
|
224
213
|
)
|
225
214
|
return runs[0]
|
226
215
|
|
227
|
-
# Body and metadata properties
|
228
|
-
@property
|
229
|
-
def status(self) -> Optional[List[ExecutionStatus]]:
|
230
|
-
"""The `status` property.
|
231
|
-
|
232
|
-
Returns:
|
233
|
-
the value of the property.
|
234
|
-
"""
|
235
|
-
return self.get_body().status
|
236
|
-
|
237
|
-
@property
|
238
|
-
def version(self) -> str:
|
239
|
-
"""The `version` property.
|
240
|
-
|
241
|
-
Returns:
|
242
|
-
the value of the property.
|
243
|
-
"""
|
244
|
-
return self.get_body().version
|
245
|
-
|
246
216
|
@property
|
247
|
-
def
|
248
|
-
"""The `
|
217
|
+
def latest_run_id(self) -> Optional[UUID]:
|
218
|
+
"""The `latest_run_id` property.
|
249
219
|
|
250
220
|
Returns:
|
251
221
|
the value of the property.
|
252
222
|
"""
|
253
|
-
return self.
|
223
|
+
return self.get_body().latest_run_id
|
254
224
|
|
255
225
|
@property
|
256
|
-
def
|
257
|
-
"""The `
|
226
|
+
def latest_run_status(self) -> Optional[ExecutionStatus]:
|
227
|
+
"""The `latest_run_status` property.
|
258
228
|
|
259
229
|
Returns:
|
260
230
|
the value of the property.
|
261
231
|
"""
|
262
|
-
return self.
|
232
|
+
return self.get_body().latest_run_status
|
263
233
|
|
264
234
|
@property
|
265
|
-
def
|
266
|
-
"""The `
|
235
|
+
def tags(self) -> List[TagResponse]:
|
236
|
+
"""The `tags` property.
|
267
237
|
|
268
238
|
Returns:
|
269
239
|
the value of the property.
|
270
240
|
"""
|
271
|
-
return self.
|
241
|
+
return self.get_resources().tags
|
272
242
|
|
273
243
|
|
274
244
|
# ------------------ Filter Model ------------------
|
275
245
|
|
276
246
|
|
277
|
-
class PipelineFilter(
|
247
|
+
class PipelineFilter(WorkspaceScopedTaggableFilter):
|
278
248
|
"""Pipeline filter model."""
|
279
249
|
|
250
|
+
CUSTOM_SORTING_OPTIONS = [SORT_PIPELINES_BY_LATEST_RUN_KEY]
|
251
|
+
|
280
252
|
name: Optional[str] = Field(
|
281
253
|
default=None,
|
282
254
|
description="Name of the Pipeline",
|
283
255
|
)
|
284
|
-
version: Optional[str] = Field(
|
285
|
-
default=None,
|
286
|
-
description="Version of the Pipeline",
|
287
|
-
)
|
288
|
-
version_hash: Optional[str] = Field(
|
289
|
-
default=None,
|
290
|
-
description="Version hash of the Pipeline",
|
291
|
-
)
|
292
|
-
docstring: Optional[str] = Field(
|
293
|
-
default=None,
|
294
|
-
description="Docstring of the Pipeline",
|
295
|
-
)
|
296
256
|
workspace_id: Optional[Union[UUID, str]] = Field(
|
297
257
|
default=None,
|
298
258
|
description="Workspace of the Pipeline",
|
@@ -303,3 +263,27 @@ class PipelineFilter(WorkspaceScopedFilter):
|
|
303
263
|
description="User of the Pipeline",
|
304
264
|
union_mode="left_to_right",
|
305
265
|
)
|
266
|
+
|
267
|
+
def apply_sorting(
|
268
|
+
self,
|
269
|
+
query: AnyQuery,
|
270
|
+
table: Type["AnySchema"],
|
271
|
+
) -> AnyQuery:
|
272
|
+
"""Apply sorting to the query.
|
273
|
+
|
274
|
+
Args:
|
275
|
+
query: The query to which to apply the sorting.
|
276
|
+
table: The query table.
|
277
|
+
|
278
|
+
Returns:
|
279
|
+
The query with sorting applied.
|
280
|
+
"""
|
281
|
+
column, _ = self.sorting_params
|
282
|
+
|
283
|
+
if column == SORT_PIPELINES_BY_LATEST_RUN_KEY:
|
284
|
+
# If sorting by the latest run, the sorting is already done in the
|
285
|
+
# base query in `SqlZenStore.list_pipelines(...)` and we don't need
|
286
|
+
# to to anything here
|
287
|
+
return query
|
288
|
+
else:
|
289
|
+
return super().apply_sorting(query=query, table=table)
|
@@ -157,6 +157,9 @@ class PipelineBuildRequest(PipelineBuildBase, WorkspaceScopedRequest):
|
|
157
157
|
"""Request model for pipelines builds."""
|
158
158
|
|
159
159
|
checksum: Optional[str] = Field(title="The build checksum.", default=None)
|
160
|
+
stack_checksum: Optional[str] = Field(
|
161
|
+
title="The stack checksum.", default=None
|
162
|
+
)
|
160
163
|
|
161
164
|
stack: Optional[UUID] = Field(
|
162
165
|
title="The stack that was used for this build.", default=None
|
@@ -164,7 +167,6 @@ class PipelineBuildRequest(PipelineBuildBase, WorkspaceScopedRequest):
|
|
164
167
|
pipeline: Optional[UUID] = Field(
|
165
168
|
title="The pipeline that was used for this build.", default=None
|
166
169
|
)
|
167
|
-
template_deployment_id: Optional[UUID] = None
|
168
170
|
|
169
171
|
|
170
172
|
# ------------------ Update Model ------------------
|
@@ -196,6 +198,9 @@ class PipelineBuildResponseMetadata(WorkspaceScopedResponseMetadata):
|
|
196
198
|
default=None, title="The Python version used for this build."
|
197
199
|
)
|
198
200
|
checksum: Optional[str] = Field(default=None, title="The build checksum.")
|
201
|
+
stack_checksum: Optional[str] = Field(
|
202
|
+
default=None, title="The stack checksum."
|
203
|
+
)
|
199
204
|
is_local: bool = Field(
|
200
205
|
title="Whether the build images are stored in a container "
|
201
206
|
"registry or locally.",
|
@@ -203,7 +208,6 @@ class PipelineBuildResponseMetadata(WorkspaceScopedResponseMetadata):
|
|
203
208
|
contains_code: bool = Field(
|
204
209
|
title="Whether any image of the build contains user code.",
|
205
210
|
)
|
206
|
-
template_deployment_id: Optional[UUID] = None
|
207
211
|
|
208
212
|
|
209
213
|
class PipelineBuildResponseResources(WorkspaceScopedResponseResources):
|
@@ -409,31 +413,31 @@ class PipelineBuildResponse(
|
|
409
413
|
return self.get_metadata().checksum
|
410
414
|
|
411
415
|
@property
|
412
|
-
def
|
413
|
-
"""The `
|
416
|
+
def stack_checksum(self) -> Optional[str]:
|
417
|
+
"""The `stack_checksum` property.
|
414
418
|
|
415
419
|
Returns:
|
416
420
|
the value of the property.
|
417
421
|
"""
|
418
|
-
return self.get_metadata().
|
422
|
+
return self.get_metadata().stack_checksum
|
419
423
|
|
420
424
|
@property
|
421
|
-
def
|
422
|
-
"""The `
|
425
|
+
def is_local(self) -> bool:
|
426
|
+
"""The `is_local` property.
|
423
427
|
|
424
428
|
Returns:
|
425
429
|
the value of the property.
|
426
430
|
"""
|
427
|
-
return self.get_metadata().
|
431
|
+
return self.get_metadata().is_local
|
428
432
|
|
429
433
|
@property
|
430
|
-
def
|
431
|
-
"""The `
|
434
|
+
def contains_code(self) -> bool:
|
435
|
+
"""The `contains_code` property.
|
432
436
|
|
433
437
|
Returns:
|
434
438
|
the value of the property.
|
435
439
|
"""
|
436
|
-
return self.get_metadata().
|
440
|
+
return self.get_metadata().contains_code
|
437
441
|
|
438
442
|
|
439
443
|
# ------------------ Filter Model ------------------
|
@@ -18,8 +18,8 @@ from uuid import UUID
|
|
18
18
|
|
19
19
|
from pydantic import Field
|
20
20
|
|
21
|
-
from zenml.config.docker_settings import SourceFileMode
|
22
21
|
from zenml.config.pipeline_configurations import PipelineConfiguration
|
22
|
+
from zenml.config.pipeline_spec import PipelineSpec
|
23
23
|
from zenml.config.step_configurations import Step
|
24
24
|
from zenml.models.v2.base.base import BaseZenModel
|
25
25
|
from zenml.models.v2.base.page import Page
|
@@ -71,28 +71,24 @@ class PipelineDeploymentBase(BaseZenModel):
|
|
71
71
|
default=None,
|
72
72
|
title="The version of the ZenML installation on the server side.",
|
73
73
|
)
|
74
|
+
pipeline_version_hash: Optional[str] = Field(
|
75
|
+
default=None,
|
76
|
+
title="The pipeline version hash of the deployment.",
|
77
|
+
)
|
78
|
+
pipeline_spec: Optional[PipelineSpec] = Field(
|
79
|
+
default=None,
|
80
|
+
title="The pipeline spec of the deployment.",
|
81
|
+
)
|
74
82
|
|
75
83
|
@property
|
76
|
-
def
|
77
|
-
"""Whether the deployment
|
78
|
-
|
79
|
-
Returns:
|
80
|
-
Whether the deployment requires included files.
|
81
|
-
"""
|
82
|
-
return any(
|
83
|
-
step.config.docker_settings.source_files == SourceFileMode.INCLUDE
|
84
|
-
for step in self.step_configurations.values()
|
85
|
-
)
|
86
|
-
|
87
|
-
@property
|
88
|
-
def requires_code_download(self) -> bool:
|
89
|
-
"""Whether the deployment requires downloading some code files.
|
84
|
+
def should_prevent_build_reuse(self) -> bool:
|
85
|
+
"""Whether the deployment prevents a build reuse.
|
90
86
|
|
91
87
|
Returns:
|
92
|
-
Whether the deployment
|
88
|
+
Whether the deployment prevents a build reuse.
|
93
89
|
"""
|
94
90
|
return any(
|
95
|
-
step.config.docker_settings.
|
91
|
+
step.config.docker_settings.prevent_build_reuse
|
96
92
|
for step in self.step_configurations.values()
|
97
93
|
)
|
98
94
|
|
@@ -116,6 +112,14 @@ class PipelineDeploymentRequest(
|
|
116
112
|
default=None,
|
117
113
|
title="The code reference associated with the deployment.",
|
118
114
|
)
|
115
|
+
code_path: Optional[str] = Field(
|
116
|
+
default=None,
|
117
|
+
title="Optional path where the code is stored in the artifact store.",
|
118
|
+
)
|
119
|
+
template: Optional[UUID] = Field(
|
120
|
+
default=None,
|
121
|
+
description="Template used for the deployment.",
|
122
|
+
)
|
119
123
|
|
120
124
|
|
121
125
|
# ------------------ Update Model ------------------
|
@@ -150,6 +154,17 @@ class PipelineDeploymentResponseMetadata(WorkspaceScopedResponseMetadata):
|
|
150
154
|
server_version: Optional[str] = Field(
|
151
155
|
title="The version of the ZenML installation on the server side."
|
152
156
|
)
|
157
|
+
pipeline_version_hash: Optional[str] = Field(
|
158
|
+
default=None, title="The pipeline version hash of the deployment."
|
159
|
+
)
|
160
|
+
pipeline_spec: Optional[PipelineSpec] = Field(
|
161
|
+
default=None, title="The pipeline spec of the deployment."
|
162
|
+
)
|
163
|
+
code_path: Optional[str] = Field(
|
164
|
+
default=None,
|
165
|
+
title="Optional path where the code is stored in the artifact store.",
|
166
|
+
)
|
167
|
+
|
153
168
|
pipeline: Optional[PipelineResponse] = Field(
|
154
169
|
default=None, title="The pipeline associated with the deployment."
|
155
170
|
)
|
@@ -167,6 +182,10 @@ class PipelineDeploymentResponseMetadata(WorkspaceScopedResponseMetadata):
|
|
167
182
|
default=None,
|
168
183
|
title="The code reference associated with the deployment.",
|
169
184
|
)
|
185
|
+
template_id: Optional[UUID] = Field(
|
186
|
+
default=None,
|
187
|
+
description="Template used for the pipeline run.",
|
188
|
+
)
|
170
189
|
|
171
190
|
|
172
191
|
class PipelineDeploymentResponseResources(WorkspaceScopedResponseResources):
|
@@ -251,6 +270,33 @@ class PipelineDeploymentResponse(
|
|
251
270
|
"""
|
252
271
|
return self.get_metadata().server_version
|
253
272
|
|
273
|
+
@property
|
274
|
+
def pipeline_version_hash(self) -> Optional[str]:
|
275
|
+
"""The `pipeline_version_hash` property.
|
276
|
+
|
277
|
+
Returns:
|
278
|
+
the value of the property.
|
279
|
+
"""
|
280
|
+
return self.get_metadata().pipeline_version_hash
|
281
|
+
|
282
|
+
@property
|
283
|
+
def pipeline_spec(self) -> Optional[PipelineSpec]:
|
284
|
+
"""The `pipeline_spec` property.
|
285
|
+
|
286
|
+
Returns:
|
287
|
+
the value of the property.
|
288
|
+
"""
|
289
|
+
return self.get_metadata().pipeline_spec
|
290
|
+
|
291
|
+
@property
|
292
|
+
def code_path(self) -> Optional[str]:
|
293
|
+
"""The `code_path` property.
|
294
|
+
|
295
|
+
Returns:
|
296
|
+
the value of the property.
|
297
|
+
"""
|
298
|
+
return self.get_metadata().code_path
|
299
|
+
|
254
300
|
@property
|
255
301
|
def pipeline(self) -> Optional[PipelineResponse]:
|
256
302
|
"""The `pipeline` property.
|
@@ -297,16 +343,13 @@ class PipelineDeploymentResponse(
|
|
297
343
|
return self.get_metadata().code_reference
|
298
344
|
|
299
345
|
@property
|
300
|
-
def
|
301
|
-
"""
|
346
|
+
def template_id(self) -> Optional[UUID]:
|
347
|
+
"""The `template_id` property.
|
302
348
|
|
303
349
|
Returns:
|
304
|
-
|
350
|
+
the value of the property.
|
305
351
|
"""
|
306
|
-
return
|
307
|
-
step.config.docker_settings.source_files == SourceFileMode.DOWNLOAD
|
308
|
-
for step in self.step_configurations.values()
|
309
|
-
)
|
352
|
+
return self.get_metadata().template_id
|
310
353
|
|
311
354
|
|
312
355
|
# ------------------ Filter Model ------------------
|
@@ -345,3 +388,8 @@ class PipelineDeploymentFilter(WorkspaceScopedFilter):
|
|
345
388
|
description="Schedule associated with the deployment.",
|
346
389
|
union_mode="left_to_right",
|
347
390
|
)
|
391
|
+
template_id: Optional[Union[UUID, str]] = Field(
|
392
|
+
default=None,
|
393
|
+
description="Template used as base for the deployment.",
|
394
|
+
union_mode="left_to_right",
|
395
|
+
)
|
@@ -37,8 +37,10 @@ from zenml.models.v2.base.scoped import (
|
|
37
37
|
WorkspaceScopedResponseBody,
|
38
38
|
WorkspaceScopedResponseMetadata,
|
39
39
|
WorkspaceScopedResponseResources,
|
40
|
+
WorkspaceScopedTaggableFilter,
|
40
41
|
)
|
41
42
|
from zenml.models.v2.core.model_version import ModelVersionResponse
|
43
|
+
from zenml.models.v2.core.tag import TagResponse
|
42
44
|
|
43
45
|
if TYPE_CHECKING:
|
44
46
|
from sqlalchemy.sql.elements import ColumnElement
|
@@ -109,6 +111,10 @@ class PipelineRunRequest(WorkspaceScopedRequest):
|
|
109
111
|
default=None,
|
110
112
|
title="ID of the trigger execution that triggered this run.",
|
111
113
|
)
|
114
|
+
tags: Optional[List[str]] = Field(
|
115
|
+
default=None,
|
116
|
+
title="Tags of the pipeline run.",
|
117
|
+
)
|
112
118
|
|
113
119
|
|
114
120
|
# ------------------ Update Model ------------------
|
@@ -119,6 +125,13 @@ class PipelineRunUpdate(BaseModel):
|
|
119
125
|
|
120
126
|
status: Optional[ExecutionStatus] = None
|
121
127
|
end_time: Optional[datetime] = None
|
128
|
+
# TODO: we should maybe have a different update model here, the upper two attributes should only be for internal use
|
129
|
+
add_tags: Optional[List[str]] = Field(
|
130
|
+
default=None, title="New tags to add to the pipeline run."
|
131
|
+
)
|
132
|
+
remove_tags: Optional[List[str]] = Field(
|
133
|
+
default=None, title="Tags to remove from the pipeline run."
|
134
|
+
)
|
122
135
|
|
123
136
|
|
124
137
|
# ------------------ Response Model ------------------
|
@@ -193,12 +206,23 @@ class PipelineRunResponseMetadata(WorkspaceScopedResponseMetadata):
|
|
193
206
|
max_length=STR_FIELD_MAX_LENGTH,
|
194
207
|
default=None,
|
195
208
|
)
|
209
|
+
code_path: Optional[str] = Field(
|
210
|
+
default=None,
|
211
|
+
title="Optional path where the code is stored in the artifact store.",
|
212
|
+
)
|
213
|
+
template_id: Optional[UUID] = Field(
|
214
|
+
default=None,
|
215
|
+
description="Template used for the pipeline run.",
|
216
|
+
)
|
196
217
|
|
197
218
|
|
198
219
|
class PipelineRunResponseResources(WorkspaceScopedResponseResources):
|
199
220
|
"""Class for all resource models associated with the pipeline run entity."""
|
200
221
|
|
201
222
|
model_version: Optional[ModelVersionResponse] = None
|
223
|
+
tags: List[TagResponse] = Field(
|
224
|
+
title="Tags associated with the pipeline run.",
|
225
|
+
)
|
202
226
|
|
203
227
|
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
204
228
|
# fields defined under base models. If not handled, this raises a warning.
|
@@ -405,6 +429,24 @@ class PipelineRunResponse(
|
|
405
429
|
"""
|
406
430
|
return self.get_metadata().orchestrator_run_id
|
407
431
|
|
432
|
+
@property
|
433
|
+
def code_path(self) -> Optional[str]:
|
434
|
+
"""The `code_path` property.
|
435
|
+
|
436
|
+
Returns:
|
437
|
+
the value of the property.
|
438
|
+
"""
|
439
|
+
return self.get_metadata().code_path
|
440
|
+
|
441
|
+
@property
|
442
|
+
def template_id(self) -> Optional[UUID]:
|
443
|
+
"""The `template_id` property.
|
444
|
+
|
445
|
+
Returns:
|
446
|
+
the value of the property.
|
447
|
+
"""
|
448
|
+
return self.get_metadata().template_id
|
449
|
+
|
408
450
|
@property
|
409
451
|
def model_version(self) -> Optional[ModelVersionResponse]:
|
410
452
|
"""The `model_version` property.
|
@@ -414,11 +456,20 @@ class PipelineRunResponse(
|
|
414
456
|
"""
|
415
457
|
return self.get_resources().model_version
|
416
458
|
|
459
|
+
@property
|
460
|
+
def tags(self) -> List[TagResponse]:
|
461
|
+
"""The `tags` property.
|
462
|
+
|
463
|
+
Returns:
|
464
|
+
the value of the property.
|
465
|
+
"""
|
466
|
+
return self.get_resources().tags
|
467
|
+
|
417
468
|
|
418
469
|
# ------------------ Filter Model ------------------
|
419
470
|
|
420
471
|
|
421
|
-
class PipelineRunFilter(
|
472
|
+
class PipelineRunFilter(WorkspaceScopedTaggableFilter):
|
422
473
|
"""Model to enable advanced filtering of all Workspaces."""
|
423
474
|
|
424
475
|
FILTER_EXCLUDE_FIELDS: ClassVar[List[str]] = [
|
@@ -428,6 +479,7 @@ class PipelineRunFilter(WorkspaceScopedFilter):
|
|
428
479
|
"build_id",
|
429
480
|
"schedule_id",
|
430
481
|
"stack_id",
|
482
|
+
"template_id",
|
431
483
|
"pipeline_name",
|
432
484
|
]
|
433
485
|
name: Optional[str] = Field(
|
@@ -482,6 +534,11 @@ class PipelineRunFilter(WorkspaceScopedFilter):
|
|
482
534
|
description="Code repository used for the Pipeline Run",
|
483
535
|
union_mode="left_to_right",
|
484
536
|
)
|
537
|
+
template_id: Optional[Union[UUID, str]] = Field(
|
538
|
+
default=None,
|
539
|
+
description="Template used for the pipeline run.",
|
540
|
+
union_mode="left_to_right",
|
541
|
+
)
|
485
542
|
status: Optional[str] = Field(
|
486
543
|
default=None,
|
487
544
|
description="Name of the Pipeline Run",
|
@@ -574,4 +631,11 @@ class PipelineRunFilter(WorkspaceScopedFilter):
|
|
574
631
|
)
|
575
632
|
custom_filters.append(pipeline_build_filter)
|
576
633
|
|
634
|
+
if self.template_id:
|
635
|
+
run_template_filter = and_(
|
636
|
+
PipelineRunSchema.deployment_id == PipelineDeploymentSchema.id,
|
637
|
+
PipelineDeploymentSchema.template_id == self.template_id,
|
638
|
+
)
|
639
|
+
custom_filters.append(run_template_filter)
|
640
|
+
|
577
641
|
return custom_filters
|