zenml-nightly 0.62.0.dev20240729__py3-none-any.whl → 0.63.0.dev20240731__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 +1 -1
- RELEASE_NOTES.md +41 -0
- zenml/VERSION +1 -1
- zenml/actions/pipeline_run/pipeline_run_action.py +19 -17
- zenml/analytics/enums.py +4 -0
- zenml/cli/__init__.py +28 -15
- zenml/cli/base.py +1 -1
- zenml/cli/pipeline.py +54 -61
- zenml/cli/stack.py +6 -8
- zenml/client.py +232 -99
- zenml/config/compiler.py +14 -22
- zenml/config/pipeline_run_configuration.py +3 -0
- zenml/config/server_config.py +3 -0
- zenml/config/source.py +2 -1
- zenml/constants.py +2 -0
- zenml/enums.py +3 -0
- zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +13 -4
- zenml/integrations/databricks/flavors/databricks_orchestrator_flavor.py +11 -2
- zenml/integrations/databricks/orchestrators/databricks_orchestrator.py +19 -13
- zenml/models/__init__.py +26 -10
- 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 +56 -0
- zenml/models/v2/core/pipeline_run.py +52 -1
- zenml/models/v2/core/run_template.py +393 -0
- zenml/models/v2/misc/stack_deployment.py +5 -0
- zenml/new/pipelines/build_utils.py +34 -58
- zenml/new/pipelines/pipeline.py +17 -76
- zenml/new/pipelines/run_utils.py +12 -0
- zenml/post_execution/pipeline.py +1 -4
- zenml/service_connectors/service_connector_utils.py +4 -2
- zenml/stack_deployments/aws_stack_deployment.py +6 -5
- zenml/stack_deployments/azure_stack_deployment.py +118 -11
- zenml/stack_deployments/gcp_stack_deployment.py +12 -5
- zenml/stack_deployments/stack_deployment.py +6 -5
- zenml/steps/utils.py +0 -4
- zenml/utils/package_utils.py +39 -0
- zenml/zen_server/dashboard/assets/{404-B_YdvmwS.js → 404-CI13wQp4.js} +1 -1
- zenml/zen_server/dashboard/assets/{@reactflow-l_1hUr1S.js → @reactflow-DIYUhKYX.js} +1 -1
- zenml/zen_server/dashboard/assets/{@tanstack-DYiOyJUL.js → @tanstack-k96lU_C-.js} +4 -4
- zenml/zen_server/dashboard/assets/{AwarenessChannel-CFg5iX4Z.js → AwarenessChannel-BNg5uWgI.js} +1 -1
- zenml/zen_server/dashboard/assets/{CodeSnippet-Dvkx_82E.js → CodeSnippet-Cyp7f4dM.js} +2 -2
- zenml/zen_server/dashboard/assets/CollapsibleCard-Cu_A9W57.js +1 -0
- zenml/zen_server/dashboard/assets/{Commands-DoN1xrEq.js → Commands-DmQwTXjj.js} +1 -1
- zenml/zen_server/dashboard/assets/{CopyButton-Cr7xYEPb.js → CopyButton-B3sWVJ4Z.js} +1 -1
- zenml/zen_server/dashboard/assets/{CsvVizualization-Ck-nZ43m.js → CsvVizualization-BvqItd-O.js} +1 -1
- zenml/zen_server/dashboard/assets/{Error-kLtljEOM.js → Error-DbXCTGua.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-DguLLgTK.js → ExecutionStatus-9zM7eaLh.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-BXUMP21n.js → Helpbox-BIiNc-uH.js} +1 -1
- zenml/zen_server/dashboard/assets/{Infobox-DSt0O-dm.js → Infobox-iv1Nu1A0.js} +1 -1
- zenml/zen_server/dashboard/assets/{InlineAvatar-xsrsIGE-.js → InlineAvatar-BvBtO2Dp.js} +1 -1
- zenml/zen_server/dashboard/assets/ProviderRadio-pSAvrGRS.js +1 -0
- zenml/zen_server/dashboard/assets/SearchField-CXoBknpt.js +1 -0
- zenml/zen_server/dashboard/assets/{SetPassword-BXGTWiwj.js → SetPassword-BOxpgh6N.js} +1 -1
- zenml/zen_server/dashboard/assets/{SuccessStep-DZC60t0x.js → SuccessStep-CTSKN2lp.js} +1 -1
- zenml/zen_server/dashboard/assets/Tick-Bnr2TpW6.js +1 -0
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-DGvwFWO1.js → UpdatePasswordSchemas-BeCeaRW5.js} +1 -1
- zenml/zen_server/dashboard/assets/chevron-down-D_ZlKMqH.js +1 -0
- zenml/zen_server/dashboard/assets/{cloud-only-C_yFCAkP.js → cloud-only-qelmY92E.js} +1 -1
- zenml/zen_server/dashboard/assets/components-DWe4cTjS.js +1 -0
- zenml/zen_server/dashboard/assets/dots-horizontal-BObFzD5l.js +1 -0
- zenml/zen_server/dashboard/assets/{index-BczVOqUf.js → index-KsTz2dHG.js} +5 -5
- zenml/zen_server/dashboard/assets/index-vfjX_fJV.css +1 -0
- zenml/zen_server/dashboard/assets/index.esm-CbHNSeVw.js +1 -0
- zenml/zen_server/dashboard/assets/{login-mutation-CrHrndTI.js → login-mutation-DRpbESS7.js} +1 -1
- zenml/zen_server/dashboard/assets/{not-found-DYa4pC-C.js → not-found-Dfx9hfkf.js} +1 -1
- zenml/zen_server/dashboard/assets/package-ClbU3KUi.js +1 -0
- zenml/zen_server/dashboard/assets/{page-uA5prJGY.js → page-399pVZHU.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-1h_sD1jz.js → page-BoFtUD9H.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BDns21Iz.js → page-Btu39x7k.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BnaevhnB.js → page-BxiWdeyg.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-1iL8aMqs.js → page-C176KxyB.js} +1 -1
- zenml/zen_server/dashboard/assets/page-C6tXXjnK.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BkeAAYwp.js → page-CDgZmwxP.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CP9obrnG.js +1 -0
- zenml/zen_server/dashboard/assets/{page-C6-UGEbH.js → page-CZe9GEBF.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CaTOsNNw.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CCNRIt_f.js → page-Cjn97HMv.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CmXmB_5i.js +1 -0
- zenml/zen_server/dashboard/assets/page-CvGAOfad.js +1 -0
- zenml/zen_server/dashboard/assets/page-CzucfYPo.js +2 -0
- zenml/zen_server/dashboard/assets/{page-Bi-wtWiO.js → page-D0bbc-qr.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DLEtD2ex.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BhgCDInH.js → page-DVPxY5fT.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BkuQDIf-.js → page-DYBNGxJt.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-8a4UMKXZ.js → page-DtpwnNXq.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-B6h3iaHJ.js → page-DupV0aBd.js} +1 -1
- zenml/zen_server/dashboard/assets/page-EweAR81y.js +1 -0
- zenml/zen_server/dashboard/assets/{page-MFQyIJd3.js → page-f3jBVI5Z.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-2grKx_MY.js → page-p2hLJdS2.js} +1 -1
- zenml/zen_server/dashboard/assets/page-w-YaL77M.js +9 -0
- zenml/zen_server/dashboard/assets/persist-BReKApOc.js +14 -0
- zenml/zen_server/dashboard/assets/plus-DOeLmm7C.js +1 -0
- zenml/zen_server/dashboard/assets/{stack-detail-query-Cficsl6d.js → stack-detail-query-Ck7j7BP_.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-7d8xi1tS.js → update-server-settings-mutation-f3ZT7psb.js} +1 -1
- zenml/zen_server/dashboard/assets/{url-D7mAQGUM.js → url-rGEp5Umh.js} +1 -1
- zenml/zen_server/dashboard/assets/{zod-BhoGpZ63.js → zod-BtSyGx4C.js} +1 -1
- zenml/zen_server/dashboard/index.html +5 -5
- 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.2fa6e528a6e7447caaf35dadfe7514bb.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.4aab7e98.chunk.js} +2 -2
- zenml/zen_server/dashboard_legacy/static/js/{main.3b27024b.chunk.js.map → main.4aab7e98.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/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 +2 -2
- zenml/zen_server/zen_server_api.py +2 -1
- zenml/zen_stores/migrations/versions/0.63.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/7d1919bb1ef0_add_run_templates.py +100 -0
- zenml/zen_stores/migrations/versions/b59aa68fdb1f_simplify_pipelines.py +139 -0
- zenml/zen_stores/rest_zen_store.py +107 -36
- 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 +29 -2
- zenml/zen_stores/schemas/pipeline_run_schemas.py +26 -3
- zenml/zen_stores/schemas/pipeline_schemas.py +29 -30
- zenml/zen_stores/schemas/run_template_schemas.py +264 -0
- zenml/zen_stores/schemas/step_run_schemas.py +11 -4
- zenml/zen_stores/sql_zen_store.py +364 -150
- 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.63.0.dev20240731.dist-info}/METADATA +2 -2
- {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.63.0.dev20240731.dist-info}/RECORD +139 -129
- zenml/models/v2/core/pipeline_namespace.py +0 -113
- zenml/new/pipelines/deserialization_utils.py +0 -292
- zenml/zen_server/dashboard/assets/CollapsibleCard-opiuBHHc.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-rK_Wuy2W.js +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-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/{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.63.0.dev20240731.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.63.0.dev20240731.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.63.0.dev20240731.dist-info}/entry_points.txt +0 -0
README.md
CHANGED
@@ -327,7 +327,7 @@ the Apache License Version 2.0.
|
|
327
327
|
<a href="https://github.com/zenml-io/zenml-projects">Projects Showcase</a>
|
328
328
|
<br />
|
329
329
|
<br />
|
330
|
-
🎉 Version 0.
|
330
|
+
🎉 Version 0.63.0 is out. Check out the release notes
|
331
331
|
<a href="https://github.com/zenml-io/zenml/releases">here</a>.
|
332
332
|
<br />
|
333
333
|
🖥️ Download our VS Code Extension <a href="https://marketplace.visualstudio.com/items?itemName=ZenML.zenml-vscode">here</a>.
|
RELEASE_NOTES.md
CHANGED
@@ -1,4 +1,45 @@
|
|
1
1
|
<!-- markdown-link-check-disable -->
|
2
|
+
|
3
|
+
# 0.63.0
|
4
|
+
|
5
|
+
Moving forward from the last two releases, we have further improved the
|
6
|
+
1-click deployment tool and the stack wizard by adding support for Azure.
|
7
|
+
|
8
|
+
Moreover, we implemented a new step operator that allows you to run individual
|
9
|
+
steps of your pipeline in Kubernetes pods.
|
10
|
+
|
11
|
+
Lastly, we have simplified our pipeline models by removing their versions.
|
12
|
+
|
13
|
+
## What's Changed
|
14
|
+
* Enable cloud build service in GCP stack deployment by @stefannica in https://github.com/zenml-io/zenml/pull/2864
|
15
|
+
* Adding a `logo_url` and the of the `integration` to component responses by @bcdurak in https://github.com/zenml-io/zenml/pull/2866
|
16
|
+
* Use REST in Model tests by @avishniakov in https://github.com/zenml-io/zenml/pull/2834
|
17
|
+
* Add Azure stack wizard by @avishniakov in https://github.com/zenml-io/zenml/pull/2841
|
18
|
+
* Migration testing for 0.62.0 by @schustmi in https://github.com/zenml-io/zenml/pull/2860
|
19
|
+
* Fix RBAC in combination with lazy loaders by @schustmi in https://github.com/zenml-io/zenml/pull/2869
|
20
|
+
* Misc cleanup after release by @schustmi in https://github.com/zenml-io/zenml/pull/2861
|
21
|
+
* Disable notebook error for Kubernetes orchestrator by @strickvl in https://github.com/zenml-io/zenml/pull/2870
|
22
|
+
* Added ability to add labels to k8s pod by @htahir1 in https://github.com/zenml-io/zenml/pull/2872
|
23
|
+
* Fix zenml pro links by @schustmi in https://github.com/zenml-io/zenml/pull/2875
|
24
|
+
* Fix mlstacks docs typo by @begoechavarren in https://github.com/zenml-io/zenml/pull/2878
|
25
|
+
* Fix requests vulnerability by @stefannica in https://github.com/zenml-io/zenml/pull/2843
|
26
|
+
* Fixed some minor docs things i noticed by @htahir1 in https://github.com/zenml-io/zenml/pull/2881
|
27
|
+
* Serialize source as Any to keep subclass attributes by @schustmi in https://github.com/zenml-io/zenml/pull/2880
|
28
|
+
* Fix node selectors for Vertex orchestrator by @schustmi in https://github.com/zenml-io/zenml/pull/2876
|
29
|
+
* Kubernetes step operator by @schustmi in https://github.com/zenml-io/zenml/pull/2883
|
30
|
+
* Automatically populate GCP/azure path when using wizard from the frontend by @schustmi in https://github.com/zenml-io/zenml/pull/2886
|
31
|
+
* Remove pipeline versioning and add run templates by @schustmi in https://github.com/zenml-io/zenml/pull/2830
|
32
|
+
* Implement the Azure 1-click stack deployment by @stefannica in https://github.com/zenml-io/zenml/pull/2887
|
33
|
+
* Better error message sagemaker, better documentation server env vars by @AlexejPenner in https://github.com/zenml-io/zenml/pull/2885
|
34
|
+
* Azure Stack Wizard docs by @bcdurak in https://github.com/zenml-io/zenml/pull/2890
|
35
|
+
* Docs update mlflow deploy function call by @safoinme in https://github.com/zenml-io/zenml/pull/2863
|
36
|
+
* Fix databricks resource setting by @safoinme in https://github.com/zenml-io/zenml/pull/2889
|
37
|
+
|
38
|
+
## New Contributors
|
39
|
+
* @begoechavarren made their first contribution in https://github.com/zenml-io/zenml/pull/2878
|
40
|
+
|
41
|
+
**Full Changelog**: https://github.com/zenml-io/zenml/compare/0.62.0...0.63.0
|
42
|
+
|
2
43
|
# 0.62.0
|
3
44
|
|
4
45
|
Building on top of the last release, this release adds a new and easy way to deploy a GCP ZenML stack from the dashboard and the CLI. Give it a try by going to the `Stacks` section in the dashboard or running the `zenml stack deploy` command! For more information on this new feature, please do check out [the video and blog](https://www.zenml.io/blog/easy-mlops-pipelines) from our previous release.
|
zenml/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.63.0.dev20240731
|
@@ -33,8 +33,8 @@ from zenml.models import (
|
|
33
33
|
)
|
34
34
|
from zenml.models.v2.base.base import BaseResponse
|
35
35
|
from zenml.zen_server.auth import AuthContext
|
36
|
-
from zenml.zen_server.pipeline_deployment.utils import run_pipeline
|
37
36
|
from zenml.zen_server.rbac.models import ResourceType
|
37
|
+
from zenml.zen_server.template_execution.utils import run_template
|
38
38
|
from zenml.zen_server.utils import server_config
|
39
39
|
|
40
40
|
logger = get_logger(__name__)
|
@@ -45,7 +45,7 @@ logger = get_logger(__name__)
|
|
45
45
|
class PipelineRunActionConfiguration(ActionConfig):
|
46
46
|
"""Configuration class to configure a pipeline run action."""
|
47
47
|
|
48
|
-
|
48
|
+
template_id: UUID
|
49
49
|
run_config: Optional[PipelineRunConfiguration] = None
|
50
50
|
|
51
51
|
|
@@ -95,10 +95,10 @@ class PipelineRunActionHandler(BaseActionHandler):
|
|
95
95
|
|
96
96
|
assert isinstance(config, PipelineRunActionConfiguration)
|
97
97
|
|
98
|
-
|
99
|
-
logger.debug("Running
|
100
|
-
|
101
|
-
|
98
|
+
template = zen_store().get_run_template(config.template_id)
|
99
|
+
logger.debug("Running template:", template)
|
100
|
+
run_template(
|
101
|
+
template=template,
|
102
102
|
run_config=config.run_config,
|
103
103
|
auth_context=auth_context,
|
104
104
|
)
|
@@ -114,13 +114,14 @@ class PipelineRunActionHandler(BaseActionHandler):
|
|
114
114
|
Raises:
|
115
115
|
ValueError: In case no deployment can be found with the deployment_id
|
116
116
|
"""
|
117
|
-
deployment_id = config.pipeline_deployment_id
|
118
117
|
zen_store = GlobalConfiguration().zen_store
|
119
118
|
|
120
119
|
try:
|
121
|
-
zen_store.
|
120
|
+
zen_store.get_run_template(template_id=config.template_id)
|
122
121
|
except KeyError:
|
123
|
-
raise ValueError(
|
122
|
+
raise ValueError(
|
123
|
+
f"No template found with id {config.template_id}."
|
124
|
+
)
|
124
125
|
|
125
126
|
def _validate_action_request(
|
126
127
|
self, action: ActionRequest, config: ActionConfig
|
@@ -176,27 +177,28 @@ class PipelineRunActionHandler(BaseActionHandler):
|
|
176
177
|
List of resources related to the action.
|
177
178
|
|
178
179
|
Raises:
|
179
|
-
ValueError: In case the
|
180
|
+
ValueError: In case the specified template does not exist.
|
180
181
|
"""
|
181
182
|
assert isinstance(action_config, PipelineRunActionConfiguration)
|
182
183
|
|
183
|
-
deployment_id = action_config.pipeline_deployment_id
|
184
184
|
zen_store = GlobalConfiguration().zen_store
|
185
185
|
|
186
186
|
try:
|
187
|
-
|
188
|
-
|
187
|
+
template = zen_store.get_run_template(
|
188
|
+
template_id=action_config.template_id, hydrate=hydrate
|
189
189
|
)
|
190
190
|
except KeyError:
|
191
|
-
raise ValueError(
|
191
|
+
raise ValueError(
|
192
|
+
f"No template found with id {action_config.template_id}."
|
193
|
+
)
|
192
194
|
|
193
195
|
resources: Dict[ResourceType, BaseResponse[Any, Any, Any]] = {
|
194
|
-
ResourceType.
|
196
|
+
ResourceType.RUN_TEMPLATE: template
|
195
197
|
}
|
196
198
|
|
197
|
-
if
|
199
|
+
if template.pipeline is not None:
|
198
200
|
pipeline = zen_store.get_pipeline(
|
199
|
-
pipeline_id=
|
201
|
+
pipeline_id=template.pipeline.id, hydrate=hydrate
|
200
202
|
)
|
201
203
|
resources[ResourceType.PIPELINE] = pipeline
|
202
204
|
|
zenml/analytics/enums.py
CHANGED
@@ -48,6 +48,10 @@ class AnalyticsEvent(str, Enum):
|
|
48
48
|
CREATED_TRIGGER = "Trigger created"
|
49
49
|
UPDATED_TRIGGER = "Trigger updated"
|
50
50
|
|
51
|
+
# Templates
|
52
|
+
CREATED_RUN_TEMPLATE = "Run template created"
|
53
|
+
EXECUTED_RUN_TEMPLATE = "Run templated executed"
|
54
|
+
|
51
55
|
# Model Control Plane
|
52
56
|
MODEL_DEPLOYED = "Model deployed"
|
53
57
|
CREATED_MODEL = "Model created"
|
zenml/cli/__init__.py
CHANGED
@@ -1684,7 +1684,7 @@ def my_pipeline(...):
|
|
1684
1684
|
|
1685
1685
|
You can register your pipeline like this:
|
1686
1686
|
```bash
|
1687
|
-
zenml pipeline register my_pipeline
|
1687
|
+
zenml pipeline register run.my_pipeline
|
1688
1688
|
```
|
1689
1689
|
|
1690
1690
|
To list all registered pipelines, use:
|
@@ -1693,21 +1693,15 @@ To list all registered pipelines, use:
|
|
1693
1693
|
zenml pipeline list
|
1694
1694
|
```
|
1695
1695
|
|
1696
|
-
|
1697
|
-
occasionally want to delete a pipeline, which you can do via:
|
1696
|
+
To delete a pipeline, run:
|
1698
1697
|
|
1699
1698
|
```bash
|
1700
1699
|
zenml pipeline delete <PIPELINE_NAME>
|
1701
1700
|
```
|
1702
1701
|
|
1703
|
-
This will delete the
|
1702
|
+
This will delete the pipeline and change all corresponding
|
1704
1703
|
pipeline runs to become unlisted (not linked to any pipeline).
|
1705
1704
|
|
1706
|
-
If you want to delete all versions of a pipeline, you can do so as follows:
|
1707
|
-
|
1708
|
-
```bash
|
1709
|
-
zenml pipeline delete <PIPELINE_NAME> --all-versions
|
1710
|
-
```
|
1711
1705
|
|
1712
1706
|
To list all pipeline runs that you have executed, use:
|
1713
1707
|
|
@@ -2378,11 +2372,30 @@ zenml code-repository delete <REPOSITORY_NAME_OR_ID>
|
|
2378
2372
|
Building an image without Runs
|
2379
2373
|
------------------------------
|
2380
2374
|
|
2375
|
+
To build or run a pipeline from the CLI, you need to know the source path of
|
2376
|
+
your pipeline. Let's imagine you have defined your pipeline in a python file
|
2377
|
+
called `run.py` like this:
|
2378
|
+
|
2379
|
+
```python
|
2380
|
+
from zenml import pipeline
|
2381
|
+
|
2382
|
+
@pipeline
|
2383
|
+
def my_pipeline(...):
|
2384
|
+
# Connect your pipeline steps here
|
2385
|
+
pass
|
2386
|
+
```
|
2387
|
+
|
2388
|
+
The source path of your pipeline will be `run.my_pipeline`. In a generalized
|
2389
|
+
way, this will be `<MODULE_PATH>.<PIPELINE_FUNCTION_NAME>`. If the python file
|
2390
|
+
defining the pipeline is not in your current directory, the module path consists
|
2391
|
+
of the full path to the file, separated by dots, e.g.
|
2392
|
+
`some_directory.some_file.my_pipeline`.
|
2393
|
+
|
2381
2394
|
To [build Docker images for your pipeline](https://docs.zenml.io/how-to/customize-docker-builds)
|
2382
2395
|
without actually running the pipeline, use:
|
2383
2396
|
|
2384
2397
|
```bash
|
2385
|
-
zenml pipeline build <
|
2398
|
+
zenml pipeline build <PIPELINE_SOURCE_PATH>
|
2386
2399
|
```
|
2387
2400
|
|
2388
2401
|
To specify settings for the Docker builds, use the `--config/-c` option of the
|
@@ -2390,20 +2403,20 @@ command. For more information about the structure of this configuration file,
|
|
2390
2403
|
check out the `zenml.pipelines.base_pipeline.BasePipeline.build(...)` method.
|
2391
2404
|
|
2392
2405
|
```bash
|
2393
|
-
zenml pipeline build <
|
2406
|
+
zenml pipeline build <PIPELINE_SOURCE_PATH> --config=<PATH_TO_CONFIG_YAML>
|
2394
2407
|
```
|
2395
2408
|
|
2396
2409
|
If you want to build the pipeline for a stack other than your current active
|
2397
2410
|
stack, use the `--stack` option.
|
2398
2411
|
|
2399
2412
|
```bash
|
2400
|
-
zenml pipeline build <
|
2413
|
+
zenml pipeline build <PIPELINE_SOURCE_PATH> --stack=<STACK_ID_OR_NAME>
|
2401
2414
|
```
|
2402
2415
|
|
2403
2416
|
To run a pipeline that was previously registered, use:
|
2404
2417
|
|
2405
2418
|
```bash
|
2406
|
-
zenml pipeline run
|
2419
|
+
zenml pipeline run <PIPELINE_SOURCE_PATH>
|
2407
2420
|
```
|
2408
2421
|
|
2409
2422
|
To specify settings for the pipeline, use the `--config/-c` option of the
|
@@ -2411,14 +2424,14 @@ command. For more information about the structure of this configuration file,
|
|
2411
2424
|
check out the `zenml.pipelines.base_pipeline.BasePipeline.run(...)` method.
|
2412
2425
|
|
2413
2426
|
```bash
|
2414
|
-
zenml pipeline run <
|
2427
|
+
zenml pipeline run <PIPELINE_SOURCE_PATH> --config=<PATH_TO_CONFIG_YAML>
|
2415
2428
|
```
|
2416
2429
|
|
2417
2430
|
If you want to run the pipeline on a stack different than your current active
|
2418
2431
|
stack, use the `--stack` option.
|
2419
2432
|
|
2420
2433
|
```bash
|
2421
|
-
zenml pipeline run <
|
2434
|
+
zenml pipeline run <PIPELINE_SOURCE_PATH> --stack=<STACK_ID_OR_NAME>
|
2422
2435
|
```
|
2423
2436
|
|
2424
2437
|
Tagging your resources with ZenML
|
zenml/cli/base.py
CHANGED
@@ -83,7 +83,7 @@ ZENML_PROJECT_TEMPLATES = dict(
|
|
83
83
|
),
|
84
84
|
starter=ZenMLProjectTemplateLocation(
|
85
85
|
github_url="zenml-io/template-starter",
|
86
|
-
github_tag="2024.
|
86
|
+
github_tag="2024.07.26", # Make sure it is aligned with .github/workflows/update-templates-to-examples.yml
|
87
87
|
),
|
88
88
|
nlp=ZenMLProjectTemplateLocation(
|
89
89
|
github_url="zenml-io/template-nlp",
|
zenml/cli/pipeline.py
CHANGED
@@ -121,15 +121,13 @@ def register_pipeline(
|
|
121
121
|
pipeline_instance.register()
|
122
122
|
|
123
123
|
|
124
|
-
@pipeline.command(
|
125
|
-
|
126
|
-
|
127
|
-
"
|
128
|
-
"
|
129
|
-
type=str,
|
130
|
-
required=False,
|
131
|
-
help="Optional version of the pipeline.",
|
124
|
+
@pipeline.command(
|
125
|
+
"build",
|
126
|
+
help="Build Docker images for a pipeline. The SOURCE argument needs to be "
|
127
|
+
" an importable source path resolving to a ZenML pipeline instance, e.g. "
|
128
|
+
"`my_module.my_pipeline_instance`.",
|
132
129
|
)
|
130
|
+
@click.argument("source")
|
133
131
|
@click.option(
|
134
132
|
"--config",
|
135
133
|
"-c",
|
@@ -155,8 +153,7 @@ def register_pipeline(
|
|
155
153
|
help="Output path for the build information.",
|
156
154
|
)
|
157
155
|
def build_pipeline(
|
158
|
-
|
159
|
-
version: Optional[str] = None,
|
156
|
+
source: str,
|
160
157
|
config_path: Optional[str] = None,
|
161
158
|
stack_name_or_id: Optional[str] = None,
|
162
159
|
output_path: Optional[str] = None,
|
@@ -164,8 +161,7 @@ def build_pipeline(
|
|
164
161
|
"""Build Docker images for a pipeline.
|
165
162
|
|
166
163
|
Args:
|
167
|
-
|
168
|
-
version: Version of the pipeline.
|
164
|
+
source: Importable source resolving to a pipeline instance.
|
169
165
|
config_path: Path to pipeline configuration file.
|
170
166
|
stack_name_or_id: Name or ID of the stack for which the images should
|
171
167
|
be built.
|
@@ -180,13 +176,28 @@ def build_pipeline(
|
|
180
176
|
"your source code root."
|
181
177
|
)
|
182
178
|
|
183
|
-
|
184
|
-
|
185
|
-
|
179
|
+
try:
|
180
|
+
pipeline_instance = source_utils.load(source)
|
181
|
+
except ModuleNotFoundError as e:
|
182
|
+
source_root = source_utils.get_source_root()
|
183
|
+
cli_utils.error(
|
184
|
+
f"Unable to import module `{e.name}`. Make sure the source path is "
|
185
|
+
f"relative to your source root `{source_root}`."
|
186
|
+
)
|
187
|
+
except AttributeError as e:
|
188
|
+
cli_utils.error("Unable to load attribute from module: " + str(e))
|
189
|
+
|
190
|
+
if not isinstance(pipeline_instance, Pipeline):
|
191
|
+
cli_utils.error(
|
192
|
+
f"The given source path `{source}` does not resolve to a pipeline "
|
193
|
+
"object."
|
194
|
+
)
|
186
195
|
|
187
196
|
with cli_utils.temporary_active_stack(stack_name_or_id=stack_name_or_id):
|
188
|
-
pipeline_instance =
|
189
|
-
|
197
|
+
pipeline_instance = pipeline_instance.with_options(
|
198
|
+
config_path=config_path
|
199
|
+
)
|
200
|
+
build = pipeline_instance.build()
|
190
201
|
|
191
202
|
if build:
|
192
203
|
cli_utils.declare(f"Created pipeline build `{build.id}`.")
|
@@ -200,15 +211,13 @@ def build_pipeline(
|
|
200
211
|
cli_utils.declare("No docker builds required.")
|
201
212
|
|
202
213
|
|
203
|
-
@pipeline.command(
|
204
|
-
|
205
|
-
|
206
|
-
"
|
207
|
-
"
|
208
|
-
type=str,
|
209
|
-
required=False,
|
210
|
-
help="Optional version of the pipeline.",
|
214
|
+
@pipeline.command(
|
215
|
+
"run",
|
216
|
+
help="Run a pipeline. The SOURCE argument needs to be an "
|
217
|
+
"importable source path resolving to a ZenML pipeline instance, e.g. "
|
218
|
+
"`my_module.my_pipeline_instance`.",
|
211
219
|
)
|
220
|
+
@click.argument("source")
|
212
221
|
@click.option(
|
213
222
|
"--config",
|
214
223
|
"-c",
|
@@ -241,8 +250,7 @@ def build_pipeline(
|
|
241
250
|
help="Prevent automatic build reusing.",
|
242
251
|
)
|
243
252
|
def run_pipeline(
|
244
|
-
|
245
|
-
version: Optional[str] = None,
|
253
|
+
source: str,
|
246
254
|
config_path: Optional[str] = None,
|
247
255
|
stack_name_or_id: Optional[str] = None,
|
248
256
|
build_path_or_id: Optional[str] = None,
|
@@ -251,8 +259,7 @@ def run_pipeline(
|
|
251
259
|
"""Run a pipeline.
|
252
260
|
|
253
261
|
Args:
|
254
|
-
|
255
|
-
version: Version of the pipeline.
|
262
|
+
source: Importable source resolving to a pipeline instance.
|
256
263
|
config_path: Path to pipeline configuration file.
|
257
264
|
stack_name_or_id: Name or ID of the stack on which the pipeline should
|
258
265
|
run.
|
@@ -270,9 +277,22 @@ def run_pipeline(
|
|
270
277
|
"your source code root."
|
271
278
|
)
|
272
279
|
|
273
|
-
|
274
|
-
|
275
|
-
|
280
|
+
try:
|
281
|
+
pipeline_instance = source_utils.load(source)
|
282
|
+
except ModuleNotFoundError as e:
|
283
|
+
source_root = source_utils.get_source_root()
|
284
|
+
cli_utils.error(
|
285
|
+
f"Unable to import module `{e.name}`. Make sure the source path is "
|
286
|
+
f"relative to your source root `{source_root}`."
|
287
|
+
)
|
288
|
+
except AttributeError as e:
|
289
|
+
cli_utils.error("Unable to load attribute from module: " + str(e))
|
290
|
+
|
291
|
+
if not isinstance(pipeline_instance, Pipeline):
|
292
|
+
cli_utils.error(
|
293
|
+
f"The given source path `{source}` does not resolve to a pipeline "
|
294
|
+
"object."
|
295
|
+
)
|
276
296
|
|
277
297
|
build: Union[str, PipelineBuildBase, None] = None
|
278
298
|
if build_path_or_id:
|
@@ -287,7 +307,6 @@ def run_pipeline(
|
|
287
307
|
)
|
288
308
|
|
289
309
|
with cli_utils.temporary_active_stack(stack_name_or_id=stack_name_or_id):
|
290
|
-
pipeline_instance = Pipeline.from_model(pipeline_model)
|
291
310
|
pipeline_instance = pipeline_instance.with_options(
|
292
311
|
config_path=config_path,
|
293
312
|
build=build,
|
@@ -320,18 +339,6 @@ def list_pipelines(**kwargs: Any) -> None:
|
|
320
339
|
|
321
340
|
@pipeline.command("delete")
|
322
341
|
@click.argument("pipeline_name_or_id", type=str, required=True)
|
323
|
-
@click.option(
|
324
|
-
"--version",
|
325
|
-
"-v",
|
326
|
-
help="Optional pipeline version.",
|
327
|
-
type=str,
|
328
|
-
required=False,
|
329
|
-
)
|
330
|
-
@click.option(
|
331
|
-
"--all-versions",
|
332
|
-
help="Delete all versions of the pipeline..",
|
333
|
-
is_flag=True,
|
334
|
-
)
|
335
342
|
@click.option(
|
336
343
|
"--yes",
|
337
344
|
"-y",
|
@@ -340,28 +347,18 @@ def list_pipelines(**kwargs: Any) -> None:
|
|
340
347
|
)
|
341
348
|
def delete_pipeline(
|
342
349
|
pipeline_name_or_id: str,
|
343
|
-
version: Optional[str] = None,
|
344
|
-
all_versions: bool = False,
|
345
350
|
yes: bool = False,
|
346
351
|
) -> None:
|
347
352
|
"""Delete a pipeline.
|
348
353
|
|
349
354
|
Args:
|
350
355
|
pipeline_name_or_id: The name or ID of the pipeline to delete.
|
351
|
-
version: The version of the pipeline to delete.
|
352
|
-
all_versions: If set, delete all versions of the pipeline.
|
353
356
|
yes: If set, don't ask for confirmation.
|
354
357
|
"""
|
355
|
-
version_suffix = ""
|
356
|
-
if all_versions:
|
357
|
-
version_suffix = " (all versions)"
|
358
|
-
elif version:
|
359
|
-
version_suffix = f" (version {version})"
|
360
|
-
|
361
358
|
if not yes:
|
362
359
|
confirmation = cli_utils.confirmation(
|
363
360
|
f"Are you sure you want to delete pipeline "
|
364
|
-
f"`{pipeline_name_or_id}
|
361
|
+
f"`{pipeline_name_or_id}`? This will change all "
|
365
362
|
"existing runs of this pipeline to become unlisted."
|
366
363
|
)
|
367
364
|
if not confirmation:
|
@@ -371,15 +368,11 @@ def delete_pipeline(
|
|
371
368
|
try:
|
372
369
|
Client().delete_pipeline(
|
373
370
|
name_id_or_prefix=pipeline_name_or_id,
|
374
|
-
version=version,
|
375
|
-
all_versions=all_versions,
|
376
371
|
)
|
377
372
|
except KeyError as e:
|
378
373
|
cli_utils.error(str(e))
|
379
374
|
else:
|
380
|
-
cli_utils.declare(
|
381
|
-
f"Deleted pipeline `{pipeline_name_or_id}{version_suffix}`."
|
382
|
-
)
|
375
|
+
cli_utils.declare(f"Deleted pipeline `{pipeline_name_or_id}`.")
|
383
376
|
|
384
377
|
|
385
378
|
@pipeline.group()
|
zenml/cli/stack.py
CHANGED
@@ -1720,7 +1720,7 @@ def deploy(
|
|
1720
1720
|
+ deployment.description
|
1721
1721
|
)
|
1722
1722
|
)
|
1723
|
-
console.print(Markdown("##
|
1723
|
+
console.print(Markdown("## Details\n" + deployment.instructions))
|
1724
1724
|
|
1725
1725
|
deployment_config = client.zen_store.get_stack_deployment_config(
|
1726
1726
|
provider=StackDeploymentProvider(provider),
|
@@ -1728,16 +1728,13 @@ def deploy(
|
|
1728
1728
|
location=location,
|
1729
1729
|
)
|
1730
1730
|
|
1731
|
-
if deployment_config.
|
1731
|
+
if deployment_config.instructions:
|
1732
1732
|
console.print(
|
1733
|
-
Markdown(
|
1734
|
-
"## Configuration\n"
|
1735
|
-
"You will be asked to provide the following configuration "
|
1736
|
-
"values during the deployment process:"
|
1737
|
-
),
|
1733
|
+
Markdown("## Instructions\n" + deployment_config.instructions),
|
1738
1734
|
"\n",
|
1739
1735
|
)
|
1740
1736
|
|
1737
|
+
if deployment_config.configuration:
|
1741
1738
|
console.print(
|
1742
1739
|
deployment_config.configuration,
|
1743
1740
|
no_wrap=True,
|
@@ -1748,7 +1745,8 @@ def deploy(
|
|
1748
1745
|
|
1749
1746
|
if not cli_utils.confirmation(
|
1750
1747
|
"\n\nProceed to continue with the deployment. You will be "
|
1751
|
-
f"automatically redirected to
|
1748
|
+
f"automatically redirected to "
|
1749
|
+
f"{deployment_config.deployment_url_text} in your browser.",
|
1752
1750
|
):
|
1753
1751
|
raise click.Abort()
|
1754
1752
|
|