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/client.py
CHANGED
@@ -139,6 +139,10 @@ from zenml.models import (
|
|
139
139
|
RunMetadataFilter,
|
140
140
|
RunMetadataRequest,
|
141
141
|
RunMetadataResponse,
|
142
|
+
RunTemplateFilter,
|
143
|
+
RunTemplateRequest,
|
144
|
+
RunTemplateResponse,
|
145
|
+
RunTemplateUpdate,
|
142
146
|
ScheduleFilter,
|
143
147
|
ScheduleResponse,
|
144
148
|
SecretFilter,
|
@@ -864,7 +868,6 @@ class Client(metaclass=ClientMetaClass):
|
|
864
868
|
updated_full_name: Optional[str] = None,
|
865
869
|
updated_email: Optional[str] = None,
|
866
870
|
updated_email_opt_in: Optional[bool] = None,
|
867
|
-
updated_hub_token: Optional[str] = None,
|
868
871
|
updated_password: Optional[str] = None,
|
869
872
|
old_password: Optional[str] = None,
|
870
873
|
updated_is_admin: Optional[bool] = None,
|
@@ -879,7 +882,6 @@ class Client(metaclass=ClientMetaClass):
|
|
879
882
|
updated_full_name: The new full name of the user.
|
880
883
|
updated_email: The new email of the user.
|
881
884
|
updated_email_opt_in: The new email opt-in status of the user.
|
882
|
-
updated_hub_token: Update the hub token
|
883
885
|
updated_password: The new password of the user.
|
884
886
|
old_password: The old password of the user. Required for password
|
885
887
|
update.
|
@@ -907,8 +909,6 @@ class Client(metaclass=ClientMetaClass):
|
|
907
909
|
)
|
908
910
|
if updated_email_opt_in is not None:
|
909
911
|
user_update.email_opted_in = updated_email_opt_in
|
910
|
-
if updated_hub_token is not None:
|
911
|
-
user_update.hub_token = updated_hub_token
|
912
912
|
if updated_password is not None:
|
913
913
|
user_update.password = updated_password
|
914
914
|
if old_password is None:
|
@@ -2350,11 +2350,9 @@ class Client(metaclass=ClientMetaClass):
|
|
2350
2350
|
created: Optional[Union[datetime, str]] = None,
|
2351
2351
|
updated: Optional[Union[datetime, str]] = None,
|
2352
2352
|
name: Optional[str] = None,
|
2353
|
-
version: Optional[str] = None,
|
2354
|
-
version_hash: Optional[str] = None,
|
2355
|
-
docstring: Optional[str] = None,
|
2356
2353
|
workspace_id: Optional[Union[str, UUID]] = None,
|
2357
2354
|
user_id: Optional[Union[str, UUID]] = None,
|
2355
|
+
tag: Optional[str] = None,
|
2358
2356
|
hydrate: bool = False,
|
2359
2357
|
) -> Page[PipelineResponse]:
|
2360
2358
|
"""List all pipelines.
|
@@ -2368,11 +2366,9 @@ class Client(metaclass=ClientMetaClass):
|
|
2368
2366
|
created: Use to filter by time of creation
|
2369
2367
|
updated: Use the last updated date for filtering
|
2370
2368
|
name: The name of the pipeline to filter by.
|
2371
|
-
version: The version of the pipeline to filter by.
|
2372
|
-
version_hash: The version hash of the pipeline to filter by.
|
2373
|
-
docstring: The docstring of the pipeline to filter by.
|
2374
2369
|
workspace_id: The id of the workspace to filter by.
|
2375
2370
|
user_id: The id of the user to filter by.
|
2371
|
+
tag: Tag to filter by.
|
2376
2372
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2377
2373
|
by including metadata fields in the response.
|
2378
2374
|
|
@@ -2388,11 +2384,9 @@ class Client(metaclass=ClientMetaClass):
|
|
2388
2384
|
created=created,
|
2389
2385
|
updated=updated,
|
2390
2386
|
name=name,
|
2391
|
-
version=version,
|
2392
|
-
version_hash=version_hash,
|
2393
|
-
docstring=docstring,
|
2394
2387
|
workspace_id=workspace_id,
|
2395
2388
|
user_id=user_id,
|
2389
|
+
tag=tag,
|
2396
2390
|
)
|
2397
2391
|
pipeline_filter_model.set_scope_workspace(self.active_workspace.id)
|
2398
2392
|
return self.zen_store.list_pipelines(
|
@@ -2403,124 +2397,83 @@ class Client(metaclass=ClientMetaClass):
|
|
2403
2397
|
def get_pipeline(
|
2404
2398
|
self,
|
2405
2399
|
name_id_or_prefix: Union[str, UUID],
|
2406
|
-
version: Optional[str] = None,
|
2407
2400
|
hydrate: bool = True,
|
2408
2401
|
) -> PipelineResponse:
|
2409
2402
|
"""Get a pipeline by name, id or prefix.
|
2410
2403
|
|
2411
2404
|
Args:
|
2412
2405
|
name_id_or_prefix: The name, ID or ID prefix of the pipeline.
|
2413
|
-
version: The pipeline version. If not specified, the latest
|
2414
|
-
version is returned.
|
2415
2406
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2416
2407
|
by including metadata fields in the response.
|
2417
2408
|
|
2418
2409
|
Returns:
|
2419
2410
|
The pipeline.
|
2420
2411
|
"""
|
2421
|
-
return self.
|
2412
|
+
return self._get_entity_by_id_or_name_or_prefix(
|
2422
2413
|
get_method=self.zen_store.get_pipeline,
|
2423
2414
|
list_method=self.list_pipelines,
|
2424
2415
|
name_id_or_prefix=name_id_or_prefix,
|
2425
|
-
version=version,
|
2426
2416
|
hydrate=hydrate,
|
2427
2417
|
)
|
2428
2418
|
|
2429
2419
|
def delete_pipeline(
|
2430
2420
|
self,
|
2431
2421
|
name_id_or_prefix: Union[str, UUID],
|
2432
|
-
version: Optional[str] = None,
|
2433
|
-
all_versions: bool = False,
|
2434
2422
|
) -> None:
|
2435
2423
|
"""Delete a pipeline.
|
2436
2424
|
|
2437
2425
|
Args:
|
2438
2426
|
name_id_or_prefix: The name, ID or ID prefix of the pipeline.
|
2439
|
-
version: The pipeline version. If left empty, will delete
|
2440
|
-
the latest version.
|
2441
|
-
all_versions: If `True`, delete all versions of the pipeline.
|
2442
|
-
|
2443
|
-
Raises:
|
2444
|
-
ValueError: If an ID is supplied when trying to delete all versions
|
2445
|
-
of a pipeline.
|
2446
2427
|
"""
|
2447
|
-
|
2448
|
-
|
2449
|
-
raise ValueError(
|
2450
|
-
"You need to supply a name (not an ID) when trying to "
|
2451
|
-
"delete all versions of a pipeline."
|
2452
|
-
)
|
2453
|
-
|
2454
|
-
for pipeline in depaginate(
|
2455
|
-
Client().list_pipelines, name=name_id_or_prefix
|
2456
|
-
):
|
2457
|
-
Client().delete_pipeline(pipeline.id)
|
2458
|
-
else:
|
2459
|
-
pipeline = self.get_pipeline(
|
2460
|
-
name_id_or_prefix=name_id_or_prefix, version=version
|
2461
|
-
)
|
2462
|
-
self.zen_store.delete_pipeline(pipeline_id=pipeline.id)
|
2428
|
+
pipeline = self.get_pipeline(name_id_or_prefix=name_id_or_prefix)
|
2429
|
+
self.zen_store.delete_pipeline(pipeline_id=pipeline.id)
|
2463
2430
|
|
2464
2431
|
@_fail_for_sql_zen_store
|
2465
2432
|
def trigger_pipeline(
|
2466
2433
|
self,
|
2467
2434
|
pipeline_name_or_id: Union[str, UUID, None] = None,
|
2468
|
-
pipeline_version: Optional[str] = None,
|
2469
2435
|
run_configuration: Optional[PipelineRunConfiguration] = None,
|
2470
2436
|
config_path: Optional[str] = None,
|
2471
|
-
|
2472
|
-
build_id: Optional[UUID] = None,
|
2437
|
+
template_id: Optional[UUID] = None,
|
2473
2438
|
stack_name_or_id: Union[str, UUID, None] = None,
|
2474
2439
|
synchronous: bool = False,
|
2475
2440
|
) -> PipelineRunResponse:
|
2476
2441
|
"""Trigger a pipeline from the server.
|
2477
2442
|
|
2478
2443
|
Usage examples:
|
2479
|
-
* Run the latest runnable
|
2444
|
+
* Run the latest runnable template for a pipeline:
|
2480
2445
|
```python
|
2481
2446
|
Client().trigger_pipeline(pipeline_name_or_id=<NAME>)
|
2482
2447
|
```
|
2483
|
-
* Run the latest runnable
|
2448
|
+
* Run the latest runnable template for a pipeline on a specific stack:
|
2484
2449
|
```python
|
2485
2450
|
Client().trigger_pipeline(
|
2486
2451
|
pipeline_name_or_id=<NAME>,
|
2487
|
-
|
2488
|
-
)
|
2489
|
-
```
|
2490
|
-
* Run a specific pipeline version on a specific stack:
|
2491
|
-
```python
|
2492
|
-
Client().trigger_pipeline(
|
2493
|
-
pipeline_name_or_id=<ID>,
|
2494
|
-
stack_name_or_id=<ID>
|
2452
|
+
stack_name_or_id=<STACK_NAME_OR_ID>
|
2495
2453
|
)
|
2496
2454
|
```
|
2497
|
-
* Run a specific
|
2455
|
+
* Run a specific template:
|
2498
2456
|
```python
|
2499
|
-
Client().trigger_pipeline(
|
2500
|
-
```
|
2501
|
-
* Run a specific build:
|
2502
|
-
```python
|
2503
|
-
Client().trigger_pipeline(build_id=<ID>)
|
2457
|
+
Client().trigger_pipeline(template_id=<ID>)
|
2504
2458
|
```
|
2505
2459
|
|
2506
2460
|
Args:
|
2507
|
-
pipeline_name_or_id: Name or ID of the pipeline. If
|
2508
|
-
|
2509
|
-
|
2510
|
-
|
2511
|
-
|
2461
|
+
pipeline_name_or_id: Name or ID of the pipeline. If this is
|
2462
|
+
specified, the latest runnable template for this pipeline will
|
2463
|
+
be used for the run (Runnable here means that the build
|
2464
|
+
associated with the template is for a remote stack without any
|
2465
|
+
custom flavor stack components). If not given, a template ID
|
2466
|
+
that should be run needs to be specified.
|
2512
2467
|
run_configuration: Configuration for the run. Either this or a
|
2513
2468
|
path to a config file can be specified.
|
2514
2469
|
config_path: Path to a YAML configuration file. This file will be
|
2515
2470
|
parsed as a `PipelineRunConfiguration` object. Either this or
|
2516
2471
|
the configuration in code can be specified.
|
2517
|
-
|
2518
|
-
|
2519
|
-
build_id: ID of the build to run. Either this or a deployment to
|
2520
|
-
run can be specified.
|
2472
|
+
template_id: ID of the template to run. Either this or a pipeline
|
2473
|
+
can be specified.
|
2521
2474
|
stack_name_or_id: Name or ID of the stack on which to run the
|
2522
2475
|
pipeline. If not specified, this method will try to find a
|
2523
|
-
runnable
|
2476
|
+
runnable template on any stack.
|
2524
2477
|
synchronous: If `True`, this method will wait until the triggered
|
2525
2478
|
run is finished.
|
2526
2479
|
|
@@ -2536,10 +2489,10 @@ class Client(metaclass=ClientMetaClass):
|
|
2536
2489
|
wait_for_pipeline_run_to_finish,
|
2537
2490
|
)
|
2538
2491
|
|
2539
|
-
if Counter([
|
2492
|
+
if Counter([template_id, pipeline_name_or_id])[None] != 1:
|
2540
2493
|
raise RuntimeError(
|
2541
|
-
"You need to specify exactly one of pipeline
|
2542
|
-
"
|
2494
|
+
"You need to specify exactly one of pipeline or template "
|
2495
|
+
"to trigger."
|
2543
2496
|
)
|
2544
2497
|
|
2545
2498
|
if run_configuration and config_path:
|
@@ -2553,32 +2506,20 @@ class Client(metaclass=ClientMetaClass):
|
|
2553
2506
|
if run_configuration:
|
2554
2507
|
validate_run_config_is_runnable_from_server(run_configuration)
|
2555
2508
|
|
2556
|
-
if
|
2509
|
+
if template_id:
|
2557
2510
|
if stack_name_or_id:
|
2558
2511
|
logger.warning(
|
2559
|
-
"
|
2560
|
-
"using stack
|
2512
|
+
"Template ID and stack specified, ignoring the stack and "
|
2513
|
+
"using stack associated with the template instead."
|
2561
2514
|
)
|
2562
2515
|
|
2563
|
-
run = self.zen_store.
|
2564
|
-
|
2516
|
+
run = self.zen_store.run_template(
|
2517
|
+
template_id=template_id,
|
2565
2518
|
run_configuration=run_configuration,
|
2566
2519
|
)
|
2567
|
-
elif build_id:
|
2568
|
-
if stack_name_or_id:
|
2569
|
-
logger.warning(
|
2570
|
-
"Build ID and stack specified, ignoring the stack and "
|
2571
|
-
"using stack from build instead."
|
2572
|
-
)
|
2573
|
-
|
2574
|
-
run = self.zen_store.run_build(
|
2575
|
-
build_id=build_id, run_configuration=run_configuration
|
2576
|
-
)
|
2577
2520
|
else:
|
2578
2521
|
assert pipeline_name_or_id
|
2579
|
-
pipeline = self.get_pipeline(
|
2580
|
-
name_id_or_prefix=pipeline_name_or_id, version=pipeline_version
|
2581
|
-
)
|
2522
|
+
pipeline = self.get_pipeline(name_id_or_prefix=pipeline_name_or_id)
|
2582
2523
|
|
2583
2524
|
stack = None
|
2584
2525
|
if stack_name_or_id:
|
@@ -2589,34 +2530,36 @@ class Client(metaclass=ClientMetaClass):
|
|
2589
2530
|
zen_store=self.zen_store, stack=stack
|
2590
2531
|
)
|
2591
2532
|
|
2592
|
-
|
2593
|
-
self.
|
2533
|
+
templates = depaginate(
|
2534
|
+
self.list_run_templates,
|
2594
2535
|
pipeline_id=pipeline.id,
|
2595
2536
|
stack_id=stack.id if stack else None,
|
2596
2537
|
)
|
2597
2538
|
|
2598
|
-
for
|
2599
|
-
if not build
|
2539
|
+
for template in templates:
|
2540
|
+
if not template.build:
|
2600
2541
|
continue
|
2601
2542
|
|
2602
|
-
|
2543
|
+
stack = template.build.stack
|
2544
|
+
if not stack:
|
2603
2545
|
continue
|
2604
2546
|
|
2605
2547
|
try:
|
2606
2548
|
validate_stack_is_runnable_from_server(
|
2607
|
-
zen_store=self.zen_store, stack=
|
2549
|
+
zen_store=self.zen_store, stack=stack
|
2608
2550
|
)
|
2609
2551
|
except ValueError:
|
2610
2552
|
continue
|
2611
2553
|
|
2612
|
-
run = self.zen_store.
|
2613
|
-
|
2554
|
+
run = self.zen_store.run_template(
|
2555
|
+
template_id=template.id,
|
2556
|
+
run_configuration=run_configuration,
|
2614
2557
|
)
|
2615
2558
|
break
|
2616
2559
|
else:
|
2617
2560
|
raise RuntimeError(
|
2618
|
-
"Unable to find a runnable
|
2619
|
-
"pipeline."
|
2561
|
+
"Unable to find a runnable template for the given stack "
|
2562
|
+
"and pipeline."
|
2620
2563
|
)
|
2621
2564
|
|
2622
2565
|
if synchronous:
|
@@ -3400,6 +3343,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3400
3343
|
pipeline_id: Optional[Union[str, UUID]] = None,
|
3401
3344
|
stack_id: Optional[Union[str, UUID]] = None,
|
3402
3345
|
build_id: Optional[Union[str, UUID]] = None,
|
3346
|
+
template_id: Optional[Union[str, UUID]] = None,
|
3403
3347
|
hydrate: bool = False,
|
3404
3348
|
) -> Page[PipelineDeploymentResponse]:
|
3405
3349
|
"""List all deployments.
|
@@ -3417,6 +3361,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3417
3361
|
pipeline_id: The id of the pipeline to filter by.
|
3418
3362
|
stack_id: The id of the stack to filter by.
|
3419
3363
|
build_id: The id of the build to filter by.
|
3364
|
+
template_id: The ID of the template to filter by.
|
3420
3365
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
3421
3366
|
by including metadata fields in the response.
|
3422
3367
|
|
@@ -3436,6 +3381,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3436
3381
|
pipeline_id=pipeline_id,
|
3437
3382
|
stack_id=stack_id,
|
3438
3383
|
build_id=build_id,
|
3384
|
+
template_id=template_id,
|
3439
3385
|
)
|
3440
3386
|
deployment_filter_model.set_scope_workspace(self.active_workspace.id)
|
3441
3387
|
return self.zen_store.list_deployments(
|
@@ -3452,6 +3398,183 @@ class Client(metaclass=ClientMetaClass):
|
|
3452
3398
|
deployment = self.get_deployment(id_or_prefix=id_or_prefix)
|
3453
3399
|
self.zen_store.delete_deployment(deployment_id=deployment.id)
|
3454
3400
|
|
3401
|
+
# ------------------------------ Run templates -----------------------------
|
3402
|
+
|
3403
|
+
def create_run_template(
|
3404
|
+
self,
|
3405
|
+
name: str,
|
3406
|
+
deployment_id: UUID,
|
3407
|
+
description: Optional[str] = None,
|
3408
|
+
tags: Optional[List[str]] = None,
|
3409
|
+
) -> RunTemplateResponse:
|
3410
|
+
"""Create a run template.
|
3411
|
+
|
3412
|
+
Args:
|
3413
|
+
name: The name of the run template.
|
3414
|
+
deployment_id: ID of the deployment which this template should be
|
3415
|
+
based off of.
|
3416
|
+
description: The description of the run template.
|
3417
|
+
tags: Tags associated with the run template.
|
3418
|
+
|
3419
|
+
Returns:
|
3420
|
+
The created run template.
|
3421
|
+
"""
|
3422
|
+
return self.zen_store.create_run_template(
|
3423
|
+
template=RunTemplateRequest(
|
3424
|
+
name=name,
|
3425
|
+
description=description,
|
3426
|
+
source_deployment_id=deployment_id,
|
3427
|
+
tags=tags,
|
3428
|
+
user=self.active_user.id,
|
3429
|
+
workspace=self.active_workspace.id,
|
3430
|
+
)
|
3431
|
+
)
|
3432
|
+
|
3433
|
+
def get_run_template(
|
3434
|
+
self,
|
3435
|
+
name_id_or_prefix: Union[str, UUID],
|
3436
|
+
hydrate: bool = True,
|
3437
|
+
) -> RunTemplateResponse:
|
3438
|
+
"""Get a run template.
|
3439
|
+
|
3440
|
+
Args:
|
3441
|
+
name_id_or_prefix: Name/ID/ID prefix of the template to get.
|
3442
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
3443
|
+
by including metadata fields in the response.
|
3444
|
+
|
3445
|
+
Returns:
|
3446
|
+
The run template.
|
3447
|
+
"""
|
3448
|
+
return self._get_entity_by_id_or_name_or_prefix(
|
3449
|
+
get_method=self.zen_store.get_run_template,
|
3450
|
+
list_method=self.list_run_templates,
|
3451
|
+
name_id_or_prefix=name_id_or_prefix,
|
3452
|
+
allow_name_prefix_match=False,
|
3453
|
+
hydrate=hydrate,
|
3454
|
+
)
|
3455
|
+
|
3456
|
+
def list_run_templates(
|
3457
|
+
self,
|
3458
|
+
sort_by: str = "created",
|
3459
|
+
page: int = PAGINATION_STARTING_PAGE,
|
3460
|
+
size: int = PAGE_SIZE_DEFAULT,
|
3461
|
+
logical_operator: LogicalOperators = LogicalOperators.AND,
|
3462
|
+
created: Optional[Union[datetime, str]] = None,
|
3463
|
+
updated: Optional[Union[datetime, str]] = None,
|
3464
|
+
name: Optional[str] = None,
|
3465
|
+
tag: Optional[str] = None,
|
3466
|
+
workspace_id: Optional[Union[str, UUID]] = None,
|
3467
|
+
user_id: Optional[Union[str, UUID]] = None,
|
3468
|
+
pipeline_id: Optional[Union[str, UUID]] = None,
|
3469
|
+
build_id: Optional[Union[str, UUID]] = None,
|
3470
|
+
stack_id: Optional[Union[str, UUID]] = None,
|
3471
|
+
code_repository_id: Optional[Union[str, UUID]] = None,
|
3472
|
+
hydrate: bool = False,
|
3473
|
+
) -> Page[RunTemplateResponse]:
|
3474
|
+
"""Get a page of run templates.
|
3475
|
+
|
3476
|
+
Args:
|
3477
|
+
sort_by: The column to sort by.
|
3478
|
+
page: The page of items.
|
3479
|
+
size: The maximum size of all pages.
|
3480
|
+
logical_operator: Which logical operator to use [and, or].
|
3481
|
+
created: Filter by the creation date.
|
3482
|
+
updated: Filter by the last updated date.
|
3483
|
+
name: Filter by run template name.
|
3484
|
+
tag: Filter by run template tags.
|
3485
|
+
workspace_id: Filter by workspace ID.
|
3486
|
+
user_id: Filter by user ID.
|
3487
|
+
pipeline_id: Filter by pipeline ID.
|
3488
|
+
build_id: Filter by build ID.
|
3489
|
+
stack_id: Filter by stack ID.
|
3490
|
+
code_repository_id: Filter by code repository ID.
|
3491
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
3492
|
+
by including metadata fields in the response.
|
3493
|
+
|
3494
|
+
Returns:
|
3495
|
+
A page of run templates.
|
3496
|
+
"""
|
3497
|
+
filter = RunTemplateFilter(
|
3498
|
+
sort_by=sort_by,
|
3499
|
+
page=page,
|
3500
|
+
size=size,
|
3501
|
+
logical_operator=logical_operator,
|
3502
|
+
created=created,
|
3503
|
+
updated=updated,
|
3504
|
+
name=name,
|
3505
|
+
tag=tag,
|
3506
|
+
workspace_id=workspace_id,
|
3507
|
+
user_id=user_id,
|
3508
|
+
pipeline_id=pipeline_id,
|
3509
|
+
build_id=build_id,
|
3510
|
+
stack_id=stack_id,
|
3511
|
+
code_repository_id=code_repository_id,
|
3512
|
+
)
|
3513
|
+
|
3514
|
+
return self.zen_store.list_run_templates(
|
3515
|
+
template_filter_model=filter, hydrate=hydrate
|
3516
|
+
)
|
3517
|
+
|
3518
|
+
def update_run_template(
|
3519
|
+
self,
|
3520
|
+
name_id_or_prefix: Union[str, UUID],
|
3521
|
+
name: Optional[str] = None,
|
3522
|
+
description: Optional[str] = None,
|
3523
|
+
add_tags: Optional[List[str]] = None,
|
3524
|
+
remove_tags: Optional[List[str]] = None,
|
3525
|
+
) -> RunTemplateResponse:
|
3526
|
+
"""Update a run template.
|
3527
|
+
|
3528
|
+
Args:
|
3529
|
+
name_id_or_prefix: Name/ID/ID prefix of the template to update.
|
3530
|
+
name: The new name of the run template.
|
3531
|
+
description: The new description of the run template.
|
3532
|
+
add_tags: Tags to add to the run template.
|
3533
|
+
remove_tags: Tags to remove from the run template.
|
3534
|
+
|
3535
|
+
Returns:
|
3536
|
+
The updated run template.
|
3537
|
+
"""
|
3538
|
+
if is_valid_uuid(name_id_or_prefix):
|
3539
|
+
template_id = (
|
3540
|
+
UUID(name_id_or_prefix)
|
3541
|
+
if isinstance(name_id_or_prefix, str)
|
3542
|
+
else name_id_or_prefix
|
3543
|
+
)
|
3544
|
+
else:
|
3545
|
+
template_id = self.get_run_template(
|
3546
|
+
name_id_or_prefix, hydrate=False
|
3547
|
+
).id
|
3548
|
+
|
3549
|
+
return self.zen_store.update_run_template(
|
3550
|
+
template_id=template_id,
|
3551
|
+
template_update=RunTemplateUpdate(
|
3552
|
+
name=name,
|
3553
|
+
description=description,
|
3554
|
+
add_tags=add_tags,
|
3555
|
+
remove_tags=remove_tags,
|
3556
|
+
),
|
3557
|
+
)
|
3558
|
+
|
3559
|
+
def delete_run_template(self, name_id_or_prefix: Union[str, UUID]) -> None:
|
3560
|
+
"""Delete a run template.
|
3561
|
+
|
3562
|
+
Args:
|
3563
|
+
name_id_or_prefix: Name/ID/ID prefix of the template to delete.
|
3564
|
+
"""
|
3565
|
+
if is_valid_uuid(name_id_or_prefix):
|
3566
|
+
template_id = (
|
3567
|
+
UUID(name_id_or_prefix)
|
3568
|
+
if isinstance(name_id_or_prefix, str)
|
3569
|
+
else name_id_or_prefix
|
3570
|
+
)
|
3571
|
+
else:
|
3572
|
+
template_id = self.get_run_template(
|
3573
|
+
name_id_or_prefix, hydrate=False
|
3574
|
+
).id
|
3575
|
+
|
3576
|
+
self.zen_store.delete_run_template(template_id=template_id)
|
3577
|
+
|
3455
3578
|
# ------------------------------- Schedules --------------------------------
|
3456
3579
|
|
3457
3580
|
def get_schedule(
|
@@ -3620,12 +3743,14 @@ class Client(metaclass=ClientMetaClass):
|
|
3620
3743
|
build_id: Optional[Union[str, UUID]] = None,
|
3621
3744
|
deployment_id: Optional[Union[str, UUID]] = None,
|
3622
3745
|
code_repository_id: Optional[Union[str, UUID]] = None,
|
3746
|
+
template_id: Optional[Union[str, UUID]] = None,
|
3623
3747
|
orchestrator_run_id: Optional[str] = None,
|
3624
3748
|
status: Optional[str] = None,
|
3625
3749
|
start_time: Optional[Union[datetime, str]] = None,
|
3626
3750
|
end_time: Optional[Union[datetime, str]] = None,
|
3627
3751
|
num_steps: Optional[Union[int, str]] = None,
|
3628
3752
|
unlisted: Optional[bool] = None,
|
3753
|
+
tag: Optional[str] = None,
|
3629
3754
|
hydrate: bool = False,
|
3630
3755
|
) -> Page[PipelineRunResponse]:
|
3631
3756
|
"""List all pipeline runs.
|
@@ -3647,6 +3772,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3647
3772
|
build_id: The id of the build to filter by.
|
3648
3773
|
deployment_id: The id of the deployment to filter by.
|
3649
3774
|
code_repository_id: The id of the code repository to filter by.
|
3775
|
+
template_id: The ID of the template to filter by.
|
3650
3776
|
orchestrator_run_id: The run id of the orchestrator to filter by.
|
3651
3777
|
name: The name of the run to filter by.
|
3652
3778
|
status: The status of the pipeline run
|
@@ -3654,6 +3780,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3654
3780
|
end_time: The end_time for the pipeline run
|
3655
3781
|
num_steps: The number of steps for the pipeline run
|
3656
3782
|
unlisted: If the runs should be unlisted or not.
|
3783
|
+
tag: Tag to filter by.
|
3657
3784
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
3658
3785
|
by including metadata fields in the response.
|
3659
3786
|
|
@@ -3676,6 +3803,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3676
3803
|
build_id=build_id,
|
3677
3804
|
deployment_id=deployment_id,
|
3678
3805
|
code_repository_id=code_repository_id,
|
3806
|
+
template_id=template_id,
|
3679
3807
|
orchestrator_run_id=orchestrator_run_id,
|
3680
3808
|
user_id=user_id,
|
3681
3809
|
stack_id=stack_id,
|
@@ -3683,6 +3811,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3683
3811
|
start_time=start_time,
|
3684
3812
|
end_time=end_time,
|
3685
3813
|
num_steps=num_steps,
|
3814
|
+
tag=tag,
|
3686
3815
|
unlisted=unlisted,
|
3687
3816
|
)
|
3688
3817
|
runs_filter_model.set_scope_workspace(self.active_workspace.id)
|
@@ -14,11 +14,13 @@
|
|
14
14
|
"""Build configuration class."""
|
15
15
|
|
16
16
|
import hashlib
|
17
|
+
import json
|
17
18
|
from typing import TYPE_CHECKING, Dict, Optional
|
18
19
|
|
19
20
|
from pydantic import BaseModel
|
20
21
|
|
21
|
-
from zenml.config.docker_settings import DockerSettings
|
22
|
+
from zenml.config.docker_settings import DockerSettings
|
23
|
+
from zenml.utils import json_utils
|
22
24
|
|
23
25
|
if TYPE_CHECKING:
|
24
26
|
from zenml.code_repositories import BaseCodeRepository
|
@@ -60,7 +62,14 @@ class BuildConfiguration(BaseModel):
|
|
60
62
|
The checksum.
|
61
63
|
"""
|
62
64
|
hash_ = hashlib.md5() # nosec
|
63
|
-
|
65
|
+
settings_json = json.dumps(
|
66
|
+
self.settings.model_dump(
|
67
|
+
mode="json", exclude={"prevent_build_reuse"}
|
68
|
+
),
|
69
|
+
sort_keys=True,
|
70
|
+
default=json_utils.pydantic_encoder,
|
71
|
+
)
|
72
|
+
hash_.update(settings_json.encode())
|
64
73
|
if self.entrypoint:
|
65
74
|
hash_.update(self.entrypoint.encode())
|
66
75
|
|
@@ -72,7 +81,7 @@ class BuildConfiguration(BaseModel):
|
|
72
81
|
PipelineDockerImageBuilder,
|
73
82
|
)
|
74
83
|
|
75
|
-
pass_code_repo = self.
|
84
|
+
pass_code_repo = self.should_download_files_from_code_repository(
|
76
85
|
code_repository=code_repository
|
77
86
|
)
|
78
87
|
requirements_files = (
|
@@ -101,34 +110,51 @@ class BuildConfiguration(BaseModel):
|
|
101
110
|
Returns:
|
102
111
|
Whether files should be included in the image.
|
103
112
|
"""
|
104
|
-
if self.
|
105
|
-
return
|
113
|
+
if self.should_download_files(code_repository=code_repository):
|
114
|
+
return False
|
106
115
|
|
107
|
-
|
108
|
-
|
109
|
-
|
116
|
+
return self.settings.allow_including_files_in_images
|
117
|
+
|
118
|
+
def should_download_files(
|
119
|
+
self,
|
120
|
+
code_repository: Optional["BaseCodeRepository"],
|
121
|
+
) -> bool:
|
122
|
+
"""Whether files should be downloaded in the image.
|
123
|
+
|
124
|
+
Args:
|
125
|
+
code_repository: Code repository that can be used to download files
|
126
|
+
inside the image.
|
127
|
+
|
128
|
+
Returns:
|
129
|
+
Whether files should be downloaded in the image.
|
130
|
+
"""
|
131
|
+
if self.should_download_files_from_code_repository(
|
132
|
+
code_repository=code_repository
|
110
133
|
):
|
111
134
|
return True
|
112
135
|
|
136
|
+
if self.settings.allow_download_from_artifact_store:
|
137
|
+
return True
|
138
|
+
|
113
139
|
return False
|
114
140
|
|
115
|
-
def
|
141
|
+
def should_download_files_from_code_repository(
|
116
142
|
self,
|
117
143
|
code_repository: Optional["BaseCodeRepository"],
|
118
144
|
) -> bool:
|
119
|
-
"""Whether files should be downloaded
|
145
|
+
"""Whether files should be downloaded from the code repository.
|
120
146
|
|
121
147
|
Args:
|
122
148
|
code_repository: Code repository that can be used to download files
|
123
149
|
inside the image.
|
124
150
|
|
125
151
|
Returns:
|
126
|
-
Whether files should be downloaded
|
152
|
+
Whether files should be downloaded from the code repository.
|
127
153
|
"""
|
128
|
-
if
|
129
|
-
|
154
|
+
if (
|
155
|
+
code_repository
|
156
|
+
and self.settings.allow_download_from_code_repository
|
157
|
+
):
|
158
|
+
return True
|
130
159
|
|
131
|
-
return
|
132
|
-
SourceFileMode.DOWNLOAD,
|
133
|
-
SourceFileMode.DOWNLOAD_OR_INCLUDE,
|
134
|
-
}
|
160
|
+
return False
|