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
@@ -1,113 +0,0 @@
|
|
1
|
-
# Copyright (c) ZenML GmbH 2023. 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
|
-
"""Models representing pipeline namespaces."""
|
15
|
-
|
16
|
-
from typing import Optional
|
17
|
-
from uuid import UUID
|
18
|
-
|
19
|
-
from pydantic import Field
|
20
|
-
|
21
|
-
from zenml.constants import STR_FIELD_MAX_LENGTH
|
22
|
-
from zenml.enums import ExecutionStatus
|
23
|
-
from zenml.models.v2.base.base import (
|
24
|
-
BaseResponse,
|
25
|
-
BaseResponseBody,
|
26
|
-
BaseResponseMetadata,
|
27
|
-
BaseResponseResources,
|
28
|
-
)
|
29
|
-
from zenml.models.v2.base.filter import BaseFilter
|
30
|
-
|
31
|
-
# ------------------ Request Model ------------------
|
32
|
-
|
33
|
-
# There is no request model for pipeline namespaces.
|
34
|
-
|
35
|
-
# ------------------ Update Model ------------------
|
36
|
-
|
37
|
-
# There is no update model for pipeline namespaces.
|
38
|
-
|
39
|
-
# ------------------ Response Model ------------------
|
40
|
-
|
41
|
-
|
42
|
-
class PipelineNamespaceResponseBody(BaseResponseBody):
|
43
|
-
"""Response body for pipeline namespaces."""
|
44
|
-
|
45
|
-
latest_run_id: Optional[UUID] = Field(
|
46
|
-
default=None,
|
47
|
-
title="The ID of the latest run of the pipeline namespace.",
|
48
|
-
)
|
49
|
-
latest_run_status: Optional[ExecutionStatus] = Field(
|
50
|
-
default=None,
|
51
|
-
title="The status of the latest run of the pipeline namespace.",
|
52
|
-
)
|
53
|
-
|
54
|
-
|
55
|
-
class PipelineNamespaceResponseMetadata(BaseResponseMetadata):
|
56
|
-
"""Response metadata for pipeline namespaces."""
|
57
|
-
|
58
|
-
|
59
|
-
class PipelineNamespaceResponseResources(BaseResponseResources):
|
60
|
-
"""Class for all resource models associated with the pipeline namespace entity."""
|
61
|
-
|
62
|
-
|
63
|
-
class PipelineNamespaceResponse(
|
64
|
-
BaseResponse[
|
65
|
-
PipelineNamespaceResponseBody,
|
66
|
-
PipelineNamespaceResponseMetadata,
|
67
|
-
PipelineNamespaceResponseResources,
|
68
|
-
]
|
69
|
-
):
|
70
|
-
"""Response model for pipeline namespaces."""
|
71
|
-
|
72
|
-
name: str = Field(
|
73
|
-
title="The name of the pipeline namespace.",
|
74
|
-
max_length=STR_FIELD_MAX_LENGTH,
|
75
|
-
)
|
76
|
-
|
77
|
-
def get_hydrated_version(self) -> "PipelineNamespaceResponse":
|
78
|
-
"""Get the hydrated version of this pipeline namespace.
|
79
|
-
|
80
|
-
Returns:
|
81
|
-
an instance of the same entity with the metadata field attached.
|
82
|
-
"""
|
83
|
-
return self
|
84
|
-
|
85
|
-
@property
|
86
|
-
def latest_run_id(self) -> Optional[UUID]:
|
87
|
-
"""The `latest_run_id` property.
|
88
|
-
|
89
|
-
Returns:
|
90
|
-
the value of the property.
|
91
|
-
"""
|
92
|
-
return self.get_body().latest_run_id
|
93
|
-
|
94
|
-
@property
|
95
|
-
def latest_run_status(self) -> Optional[ExecutionStatus]:
|
96
|
-
"""The `latest_run_status` property.
|
97
|
-
|
98
|
-
Returns:
|
99
|
-
the value of the property.
|
100
|
-
"""
|
101
|
-
return self.get_body().latest_run_status
|
102
|
-
|
103
|
-
|
104
|
-
# ------------------ Filter Model ------------------
|
105
|
-
|
106
|
-
|
107
|
-
class PipelineNamespaceFilter(BaseFilter):
|
108
|
-
"""Pipeline namespace filter model."""
|
109
|
-
|
110
|
-
name: Optional[str] = Field(
|
111
|
-
default=None,
|
112
|
-
description="Name of the pipeline namespace.",
|
113
|
-
)
|
@@ -1,79 +0,0 @@
|
|
1
|
-
# Copyright (c) ZenML GmbH 2023. 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
|
-
"""Models representing ZenML Hub plugins."""
|
15
|
-
|
16
|
-
from datetime import datetime
|
17
|
-
from typing import List, Optional
|
18
|
-
from uuid import UUID
|
19
|
-
|
20
|
-
from pydantic import BaseModel
|
21
|
-
|
22
|
-
from zenml.utils.enum_utils import StrEnum
|
23
|
-
|
24
|
-
|
25
|
-
class PluginStatus(StrEnum):
|
26
|
-
"""Enum that represents the status of a plugin.
|
27
|
-
|
28
|
-
- PENDING: Plugin is being built
|
29
|
-
- FAILED: Plugin build failed
|
30
|
-
- AVAILABLE: Plugin is available for installation
|
31
|
-
- YANKED: Plugin was yanked and is no longer available
|
32
|
-
"""
|
33
|
-
|
34
|
-
PENDING = "pending"
|
35
|
-
FAILED = "failed"
|
36
|
-
AVAILABLE = "available"
|
37
|
-
YANKED = "yanked"
|
38
|
-
|
39
|
-
|
40
|
-
class HubUserResponseModel(BaseModel):
|
41
|
-
"""Model for a ZenML Hub user."""
|
42
|
-
|
43
|
-
id: UUID
|
44
|
-
email: str
|
45
|
-
username: Optional[str] = None
|
46
|
-
|
47
|
-
|
48
|
-
class HubPluginBaseModel(BaseModel):
|
49
|
-
"""Base model for a ZenML Hub plugin."""
|
50
|
-
|
51
|
-
name: str
|
52
|
-
description: Optional[str] = None
|
53
|
-
version: Optional[str] = None
|
54
|
-
release_notes: Optional[str] = None
|
55
|
-
repository_url: str
|
56
|
-
repository_subdirectory: Optional[str] = None
|
57
|
-
repository_branch: Optional[str] = None
|
58
|
-
repository_commit: Optional[str] = None
|
59
|
-
tags: Optional[List[str]] = None
|
60
|
-
logo_url: Optional[str] = None
|
61
|
-
|
62
|
-
|
63
|
-
class HubPluginRequestModel(HubPluginBaseModel):
|
64
|
-
"""Request model for a ZenML Hub plugin."""
|
65
|
-
|
66
|
-
|
67
|
-
class HubPluginResponseModel(HubPluginBaseModel):
|
68
|
-
"""Response model for a ZenML Hub plugin."""
|
69
|
-
|
70
|
-
id: UUID
|
71
|
-
status: PluginStatus
|
72
|
-
author: str
|
73
|
-
version: str
|
74
|
-
index_url: Optional[str] = None
|
75
|
-
package_name: Optional[str] = None
|
76
|
-
requirements: Optional[List[str]] = None
|
77
|
-
build_logs: Optional[str] = None
|
78
|
-
created: datetime
|
79
|
-
updated: datetime
|
@@ -1,292 +0,0 @@
|
|
1
|
-
# Copyright (c) ZenML GmbH 2023. 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
|
-
"""Pipeline deserialization utilities."""
|
15
|
-
|
16
|
-
import inspect
|
17
|
-
from typing import TYPE_CHECKING, Callable, Dict, Set, Type
|
18
|
-
|
19
|
-
from packaging import version
|
20
|
-
|
21
|
-
from zenml.logger import get_logger
|
22
|
-
from zenml.new.pipelines.pipeline import Pipeline
|
23
|
-
from zenml.steps.base_step import BaseStep
|
24
|
-
from zenml.steps.entrypoint_function_utils import StepArtifact
|
25
|
-
from zenml.utils import source_utils
|
26
|
-
|
27
|
-
if TYPE_CHECKING:
|
28
|
-
from zenml.config.pipeline_spec import PipelineSpec
|
29
|
-
from zenml.models import PipelineResponse
|
30
|
-
|
31
|
-
logger = get_logger(__name__)
|
32
|
-
|
33
|
-
|
34
|
-
def load_pipeline(model: "PipelineResponse") -> "Pipeline":
|
35
|
-
"""Load a pipeline from a model.
|
36
|
-
|
37
|
-
Args:
|
38
|
-
model: The pipeline model to load.
|
39
|
-
|
40
|
-
Raises:
|
41
|
-
ValueError: If the pipeline can't be loaded due to an old model spec
|
42
|
-
(version <0.2).
|
43
|
-
|
44
|
-
Returns:
|
45
|
-
The loaded pipeline.
|
46
|
-
"""
|
47
|
-
model_version = version.parse(model.spec.version)
|
48
|
-
if model_version < version.parse("0.2"):
|
49
|
-
raise ValueError(
|
50
|
-
"Loading a pipeline is only possible for pipeline specs with "
|
51
|
-
"version 0.2 or higher."
|
52
|
-
)
|
53
|
-
elif model_version == version.parse("0.2"):
|
54
|
-
pipeline_instance = load_pipeline_v_0_2(model=model)
|
55
|
-
elif model_version == version.parse("0.3"):
|
56
|
-
pipeline_instance = load_pipeline_v_0_3(model=model)
|
57
|
-
else:
|
58
|
-
pipeline_instance = load_pipeline_v_0_4(model=model)
|
59
|
-
|
60
|
-
version_hash = pipeline_instance._compute_unique_identifier(
|
61
|
-
pipeline_spec=model.spec
|
62
|
-
)
|
63
|
-
if version_hash != model.version_hash:
|
64
|
-
logger.warning(
|
65
|
-
"Trying to load pipeline version `%s`, but the local step code "
|
66
|
-
"changed since this pipeline version was registered. Using "
|
67
|
-
"this pipeline instance will result in a different pipeline "
|
68
|
-
"version being registered or reused.",
|
69
|
-
model.version,
|
70
|
-
)
|
71
|
-
return pipeline_instance
|
72
|
-
|
73
|
-
|
74
|
-
def load_pipeline_v_0_4(model: "PipelineResponse") -> "Pipeline":
|
75
|
-
"""Load a pipeline from a model with spec version 0.4.
|
76
|
-
|
77
|
-
Args:
|
78
|
-
model: The pipeline model to load.
|
79
|
-
|
80
|
-
Raises:
|
81
|
-
TypeError: If the pipeline source does not refer to a pipeline instance.
|
82
|
-
|
83
|
-
Returns:
|
84
|
-
The loaded pipeline.
|
85
|
-
"""
|
86
|
-
pipeline_source = model.spec.source
|
87
|
-
assert pipeline_source
|
88
|
-
|
89
|
-
pipeline = source_utils.load(pipeline_source)
|
90
|
-
|
91
|
-
if not isinstance(pipeline, Pipeline):
|
92
|
-
raise TypeError("Not a pipeline")
|
93
|
-
|
94
|
-
pipeline.prepare(**model.spec.parameters)
|
95
|
-
return pipeline
|
96
|
-
|
97
|
-
|
98
|
-
def load_pipeline_v_0_3(model: "PipelineResponse") -> "Pipeline":
|
99
|
-
"""Load a pipeline from a model with spec version 0.3.
|
100
|
-
|
101
|
-
Args:
|
102
|
-
model: The pipeline model to load.
|
103
|
-
|
104
|
-
Returns:
|
105
|
-
The loaded pipeline.
|
106
|
-
"""
|
107
|
-
return _load_legacy_pipeline(model=model, use_pipeline_parameter_name=True)
|
108
|
-
|
109
|
-
|
110
|
-
def load_pipeline_v_0_2(model: "PipelineResponse") -> "Pipeline":
|
111
|
-
"""Load a pipeline from a model with spec version 0.2.
|
112
|
-
|
113
|
-
Args:
|
114
|
-
model: The pipeline model to load.
|
115
|
-
|
116
|
-
Returns:
|
117
|
-
The loaded pipeline.
|
118
|
-
"""
|
119
|
-
return _load_legacy_pipeline(
|
120
|
-
model=model, use_pipeline_parameter_name=False
|
121
|
-
)
|
122
|
-
|
123
|
-
|
124
|
-
def _load_legacy_pipeline(
|
125
|
-
model: "PipelineResponse", use_pipeline_parameter_name: bool
|
126
|
-
) -> "Pipeline":
|
127
|
-
"""Load a legacy pipeline.
|
128
|
-
|
129
|
-
Args:
|
130
|
-
model: The pipeline model to load.
|
131
|
-
use_pipeline_parameter_name: Whether to use the pipeline parameter name
|
132
|
-
when referring to upstream steps. If `False` the step name will be
|
133
|
-
used instead.
|
134
|
-
|
135
|
-
Returns:
|
136
|
-
The loaded pipeline.
|
137
|
-
"""
|
138
|
-
from zenml.pipelines.base_pipeline import BasePipeline
|
139
|
-
|
140
|
-
steps = _load_and_verify_steps(
|
141
|
-
pipeline_spec=model.spec,
|
142
|
-
use_pipeline_parameter_name=use_pipeline_parameter_name,
|
143
|
-
)
|
144
|
-
connect_method = _generate_connect_method(
|
145
|
-
model=model, use_pipeline_parameter_name=use_pipeline_parameter_name
|
146
|
-
)
|
147
|
-
|
148
|
-
pipeline_class: Type[BasePipeline] = type(
|
149
|
-
model.name,
|
150
|
-
(BasePipeline,),
|
151
|
-
{
|
152
|
-
"connect": staticmethod(connect_method),
|
153
|
-
"__doc__": model.docstring,
|
154
|
-
},
|
155
|
-
)
|
156
|
-
|
157
|
-
pipeline_instance = pipeline_class(**steps)
|
158
|
-
pipeline_instance.prepare()
|
159
|
-
return pipeline_instance
|
160
|
-
|
161
|
-
|
162
|
-
def _load_and_verify_steps(
|
163
|
-
pipeline_spec: "PipelineSpec", use_pipeline_parameter_name: bool = False
|
164
|
-
) -> Dict[str, BaseStep]:
|
165
|
-
"""Loads steps and verifies their names and inputs/outputs names.
|
166
|
-
|
167
|
-
Args:
|
168
|
-
pipeline_spec: The pipeline spec from which to load the steps.
|
169
|
-
use_pipeline_parameter_name: Whether to use the pipeline parameter name
|
170
|
-
when referring to upstream steps. If `False` the step name will be
|
171
|
-
used instead.
|
172
|
-
|
173
|
-
Raises:
|
174
|
-
RuntimeError: If the step names or input/output names of the
|
175
|
-
loaded steps don't match with the names defined in the spec.
|
176
|
-
|
177
|
-
Returns:
|
178
|
-
The loaded steps.
|
179
|
-
"""
|
180
|
-
steps = {}
|
181
|
-
available_outputs: Dict[str, Set[str]] = {}
|
182
|
-
|
183
|
-
for step_spec in pipeline_spec.steps:
|
184
|
-
for upstream_step in step_spec.upstream_steps:
|
185
|
-
if upstream_step not in available_outputs:
|
186
|
-
raise RuntimeError(
|
187
|
-
f"Unable to find upstream step `{upstream_step}`. "
|
188
|
-
"This is probably because the step was renamed in code."
|
189
|
-
)
|
190
|
-
|
191
|
-
for input_spec in step_spec.inputs.values():
|
192
|
-
if (
|
193
|
-
input_spec.output_name
|
194
|
-
not in available_outputs[input_spec.step_name]
|
195
|
-
):
|
196
|
-
raise RuntimeError(
|
197
|
-
f"Missing output `{input_spec.output_name}` for step "
|
198
|
-
f"`{input_spec.step_name}`. This is probably because "
|
199
|
-
"the output of the step was renamed."
|
200
|
-
)
|
201
|
-
|
202
|
-
step = BaseStep.load_from_source(step_spec.source)
|
203
|
-
input_names = set(step.entrypoint_definition.inputs)
|
204
|
-
spec_input_names = set(step_spec.inputs)
|
205
|
-
|
206
|
-
if input_names != spec_input_names:
|
207
|
-
raise RuntimeError(
|
208
|
-
f"Input names of step {step_spec.source} and the spec "
|
209
|
-
f"from the database don't match. Step inputs: "
|
210
|
-
f"`{input_names}`, spec inputs: `{spec_input_names}`."
|
211
|
-
)
|
212
|
-
|
213
|
-
steps[step_spec.pipeline_parameter_name] = step
|
214
|
-
output_name = (
|
215
|
-
step_spec.pipeline_parameter_name
|
216
|
-
if use_pipeline_parameter_name
|
217
|
-
else step.name
|
218
|
-
)
|
219
|
-
available_outputs[output_name] = set(
|
220
|
-
step.entrypoint_definition.outputs.keys()
|
221
|
-
)
|
222
|
-
|
223
|
-
return steps
|
224
|
-
|
225
|
-
|
226
|
-
def _generate_connect_method(
|
227
|
-
model: "PipelineResponse", use_pipeline_parameter_name: bool = False
|
228
|
-
) -> Callable[..., None]:
|
229
|
-
"""Dynamically generates a connect method for a pipeline model.
|
230
|
-
|
231
|
-
Args:
|
232
|
-
model: The model for which to generate the method.
|
233
|
-
use_pipeline_parameter_name: Whether to use the pipeline parameter name
|
234
|
-
when referring to upstream steps. If `False` the step name will be
|
235
|
-
used instead.
|
236
|
-
|
237
|
-
Returns:
|
238
|
-
The generated connect method.
|
239
|
-
"""
|
240
|
-
|
241
|
-
def connect(**steps: BaseStep) -> None:
|
242
|
-
# Bind **steps to the connect signature assigned to this method
|
243
|
-
# below. This ensures that the method inputs get verified and only
|
244
|
-
# the arguments defined in the signature are allowed
|
245
|
-
inspect.signature(connect).bind(**steps)
|
246
|
-
|
247
|
-
step_outputs: Dict[str, Dict[str, StepArtifact]] = {}
|
248
|
-
for step_spec in model.spec.steps:
|
249
|
-
step = steps[step_spec.pipeline_parameter_name]
|
250
|
-
|
251
|
-
step_inputs = {}
|
252
|
-
for input_name, input_ in step_spec.inputs.items():
|
253
|
-
try:
|
254
|
-
upstream_step = step_outputs[input_.step_name]
|
255
|
-
step_input = upstream_step[input_.output_name]
|
256
|
-
step_inputs[input_name] = step_input
|
257
|
-
except KeyError:
|
258
|
-
raise RuntimeError(
|
259
|
-
f"Unable to find upstream step "
|
260
|
-
f"`{input_.step_name}` in pipeline `{model.name}`. "
|
261
|
-
"This is probably due to configuring a new step "
|
262
|
-
"name after loading a pipeline using "
|
263
|
-
"`Pipeline.from_model`."
|
264
|
-
)
|
265
|
-
|
266
|
-
step_output = step(**step_inputs) # type: ignore[arg-type]
|
267
|
-
output_keys = list(step.entrypoint_definition.outputs.keys())
|
268
|
-
|
269
|
-
if isinstance(step_output, StepArtifact):
|
270
|
-
step_output = (step_output,)
|
271
|
-
|
272
|
-
output_name = (
|
273
|
-
step_spec.pipeline_parameter_name
|
274
|
-
if use_pipeline_parameter_name
|
275
|
-
else step.name
|
276
|
-
)
|
277
|
-
step_outputs[output_name] = {
|
278
|
-
key: step_output[i] for i, key in enumerate(output_keys)
|
279
|
-
}
|
280
|
-
|
281
|
-
# Create the connect method signature based on the expected steps
|
282
|
-
parameters = [
|
283
|
-
inspect.Parameter(
|
284
|
-
name=step_spec.pipeline_parameter_name,
|
285
|
-
kind=inspect.Parameter.POSITIONAL_OR_KEYWORD,
|
286
|
-
)
|
287
|
-
for step_spec in model.spec.steps
|
288
|
-
]
|
289
|
-
signature = inspect.Signature(parameters=parameters)
|
290
|
-
connect.__signature__ = signature # type: ignore[attr-defined]
|
291
|
-
|
292
|
-
return connect
|