zenml-nightly 0.62.0.dev20240729__py3-none-any.whl → 0.63.0.dev20240801__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.
Files changed (157) hide show
  1. README.md +1 -1
  2. RELEASE_NOTES.md +41 -0
  3. zenml/VERSION +1 -1
  4. zenml/actions/pipeline_run/pipeline_run_action.py +19 -17
  5. zenml/analytics/enums.py +4 -0
  6. zenml/cli/__init__.py +28 -15
  7. zenml/cli/base.py +1 -1
  8. zenml/cli/pipeline.py +54 -61
  9. zenml/cli/stack.py +6 -8
  10. zenml/client.py +232 -99
  11. zenml/config/compiler.py +14 -22
  12. zenml/config/pipeline_run_configuration.py +3 -0
  13. zenml/config/server_config.py +3 -0
  14. zenml/config/source.py +2 -1
  15. zenml/constants.py +2 -0
  16. zenml/enums.py +3 -0
  17. zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +13 -4
  18. zenml/integrations/databricks/flavors/databricks_orchestrator_flavor.py +11 -2
  19. zenml/integrations/databricks/orchestrators/databricks_orchestrator.py +19 -13
  20. zenml/models/__init__.py +26 -10
  21. zenml/models/v2/base/filter.py +32 -0
  22. zenml/models/v2/core/pipeline.py +73 -89
  23. zenml/models/v2/core/pipeline_build.py +15 -11
  24. zenml/models/v2/core/pipeline_deployment.py +56 -0
  25. zenml/models/v2/core/pipeline_run.py +52 -1
  26. zenml/models/v2/core/run_template.py +393 -0
  27. zenml/models/v2/misc/stack_deployment.py +5 -0
  28. zenml/new/pipelines/build_utils.py +34 -58
  29. zenml/new/pipelines/pipeline.py +17 -76
  30. zenml/new/pipelines/run_utils.py +12 -0
  31. zenml/post_execution/pipeline.py +1 -4
  32. zenml/service_connectors/service_connector_utils.py +4 -2
  33. zenml/stack_deployments/aws_stack_deployment.py +6 -5
  34. zenml/stack_deployments/azure_stack_deployment.py +118 -11
  35. zenml/stack_deployments/gcp_stack_deployment.py +12 -5
  36. zenml/stack_deployments/stack_deployment.py +6 -5
  37. zenml/steps/utils.py +0 -4
  38. zenml/utils/package_utils.py +39 -0
  39. zenml/zen_server/dashboard/assets/{404-B_YdvmwS.js → 404-CI13wQp4.js} +1 -1
  40. zenml/zen_server/dashboard/assets/{@reactflow-l_1hUr1S.js → @reactflow-DIYUhKYX.js} +1 -1
  41. zenml/zen_server/dashboard/assets/{@tanstack-DYiOyJUL.js → @tanstack-k96lU_C-.js} +4 -4
  42. zenml/zen_server/dashboard/assets/{AwarenessChannel-CFg5iX4Z.js → AwarenessChannel-BNg5uWgI.js} +1 -1
  43. zenml/zen_server/dashboard/assets/{CodeSnippet-Dvkx_82E.js → CodeSnippet-Cyp7f4dM.js} +2 -2
  44. zenml/zen_server/dashboard/assets/CollapsibleCard-Cu_A9W57.js +1 -0
  45. zenml/zen_server/dashboard/assets/{Commands-DoN1xrEq.js → Commands-DmQwTXjj.js} +1 -1
  46. zenml/zen_server/dashboard/assets/{CopyButton-Cr7xYEPb.js → CopyButton-B3sWVJ4Z.js} +1 -1
  47. zenml/zen_server/dashboard/assets/{CsvVizualization-Ck-nZ43m.js → CsvVizualization-BvqItd-O.js} +1 -1
  48. zenml/zen_server/dashboard/assets/{Error-kLtljEOM.js → Error-DbXCTGua.js} +1 -1
  49. zenml/zen_server/dashboard/assets/{ExecutionStatus-DguLLgTK.js → ExecutionStatus-9zM7eaLh.js} +1 -1
  50. zenml/zen_server/dashboard/assets/{Helpbox-BXUMP21n.js → Helpbox-BIiNc-uH.js} +1 -1
  51. zenml/zen_server/dashboard/assets/{Infobox-DSt0O-dm.js → Infobox-iv1Nu1A0.js} +1 -1
  52. zenml/zen_server/dashboard/assets/{InlineAvatar-xsrsIGE-.js → InlineAvatar-BvBtO2Dp.js} +1 -1
  53. zenml/zen_server/dashboard/assets/ProviderRadio-pSAvrGRS.js +1 -0
  54. zenml/zen_server/dashboard/assets/SearchField-CXoBknpt.js +1 -0
  55. zenml/zen_server/dashboard/assets/{SetPassword-BXGTWiwj.js → SetPassword-BOxpgh6N.js} +1 -1
  56. zenml/zen_server/dashboard/assets/{SuccessStep-DZC60t0x.js → SuccessStep-CTSKN2lp.js} +1 -1
  57. zenml/zen_server/dashboard/assets/Tick-Bnr2TpW6.js +1 -0
  58. zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-DGvwFWO1.js → UpdatePasswordSchemas-BeCeaRW5.js} +1 -1
  59. zenml/zen_server/dashboard/assets/chevron-down-D_ZlKMqH.js +1 -0
  60. zenml/zen_server/dashboard/assets/{cloud-only-C_yFCAkP.js → cloud-only-qelmY92E.js} +1 -1
  61. zenml/zen_server/dashboard/assets/components-DWe4cTjS.js +1 -0
  62. zenml/zen_server/dashboard/assets/dots-horizontal-BObFzD5l.js +1 -0
  63. zenml/zen_server/dashboard/assets/{index-BczVOqUf.js → index-KsTz2dHG.js} +5 -5
  64. zenml/zen_server/dashboard/assets/index-vfjX_fJV.css +1 -0
  65. zenml/zen_server/dashboard/assets/index.esm-CbHNSeVw.js +1 -0
  66. zenml/zen_server/dashboard/assets/{login-mutation-CrHrndTI.js → login-mutation-DRpbESS7.js} +1 -1
  67. zenml/zen_server/dashboard/assets/{not-found-DYa4pC-C.js → not-found-Dfx9hfkf.js} +1 -1
  68. zenml/zen_server/dashboard/assets/package-ClbU3KUi.js +1 -0
  69. zenml/zen_server/dashboard/assets/{page-uA5prJGY.js → page-399pVZHU.js} +1 -1
  70. zenml/zen_server/dashboard/assets/{page-1h_sD1jz.js → page-BoFtUD9H.js} +1 -1
  71. zenml/zen_server/dashboard/assets/{page-BDns21Iz.js → page-Btu39x7k.js} +1 -1
  72. zenml/zen_server/dashboard/assets/{page-BnaevhnB.js → page-BxiWdeyg.js} +1 -1
  73. zenml/zen_server/dashboard/assets/{page-1iL8aMqs.js → page-C176KxyB.js} +1 -1
  74. zenml/zen_server/dashboard/assets/page-C6tXXjnK.js +1 -0
  75. zenml/zen_server/dashboard/assets/{page-BkeAAYwp.js → page-CDgZmwxP.js} +1 -1
  76. zenml/zen_server/dashboard/assets/page-CP9obrnG.js +1 -0
  77. zenml/zen_server/dashboard/assets/{page-C6-UGEbH.js → page-CZe9GEBF.js} +1 -1
  78. zenml/zen_server/dashboard/assets/page-CaTOsNNw.js +1 -0
  79. zenml/zen_server/dashboard/assets/{page-CCNRIt_f.js → page-Cjn97HMv.js} +1 -1
  80. zenml/zen_server/dashboard/assets/page-CmXmB_5i.js +1 -0
  81. zenml/zen_server/dashboard/assets/page-CvGAOfad.js +1 -0
  82. zenml/zen_server/dashboard/assets/page-CzucfYPo.js +2 -0
  83. zenml/zen_server/dashboard/assets/{page-Bi-wtWiO.js → page-D0bbc-qr.js} +1 -1
  84. zenml/zen_server/dashboard/assets/page-DLEtD2ex.js +1 -0
  85. zenml/zen_server/dashboard/assets/{page-BhgCDInH.js → page-DVPxY5fT.js} +1 -1
  86. zenml/zen_server/dashboard/assets/{page-BkuQDIf-.js → page-DYBNGxJt.js} +1 -1
  87. zenml/zen_server/dashboard/assets/{page-8a4UMKXZ.js → page-DtpwnNXq.js} +1 -1
  88. zenml/zen_server/dashboard/assets/{page-B6h3iaHJ.js → page-DupV0aBd.js} +1 -1
  89. zenml/zen_server/dashboard/assets/page-EweAR81y.js +1 -0
  90. zenml/zen_server/dashboard/assets/{page-MFQyIJd3.js → page-f3jBVI5Z.js} +1 -1
  91. zenml/zen_server/dashboard/assets/{page-2grKx_MY.js → page-p2hLJdS2.js} +1 -1
  92. zenml/zen_server/dashboard/assets/page-w-YaL77M.js +9 -0
  93. zenml/zen_server/dashboard/assets/persist-BReKApOc.js +14 -0
  94. zenml/zen_server/dashboard/assets/plus-DOeLmm7C.js +1 -0
  95. zenml/zen_server/dashboard/assets/{stack-detail-query-Cficsl6d.js → stack-detail-query-Ck7j7BP_.js} +1 -1
  96. zenml/zen_server/dashboard/assets/{update-server-settings-mutation-7d8xi1tS.js → update-server-settings-mutation-f3ZT7psb.js} +1 -1
  97. zenml/zen_server/dashboard/assets/{url-D7mAQGUM.js → url-rGEp5Umh.js} +1 -1
  98. zenml/zen_server/dashboard/assets/{zod-BhoGpZ63.js → zod-BtSyGx4C.js} +1 -1
  99. zenml/zen_server/dashboard/index.html +5 -5
  100. zenml/zen_server/dashboard_legacy/asset-manifest.json +4 -4
  101. zenml/zen_server/dashboard_legacy/index.html +1 -1
  102. zenml/zen_server/dashboard_legacy/{precache-manifest.12246c7548e71e2c4438e496360de80c.js → precache-manifest.2fa6e528a6e7447caaf35dadfe7514bb.js} +4 -4
  103. zenml/zen_server/dashboard_legacy/service-worker.js +1 -1
  104. zenml/zen_server/dashboard_legacy/static/js/{main.3b27024b.chunk.js → main.4aab7e98.chunk.js} +2 -2
  105. zenml/zen_server/dashboard_legacy/static/js/{main.3b27024b.chunk.js.map → main.4aab7e98.chunk.js.map} +1 -1
  106. zenml/zen_server/deploy/helm/Chart.yaml +1 -1
  107. zenml/zen_server/deploy/helm/README.md +2 -2
  108. zenml/zen_server/rbac/models.py +1 -0
  109. zenml/zen_server/rbac/utils.py +4 -0
  110. zenml/zen_server/routers/pipeline_builds_endpoints.py +2 -66
  111. zenml/zen_server/routers/pipeline_deployments_endpoints.py +2 -53
  112. zenml/zen_server/routers/pipelines_endpoints.py +1 -74
  113. zenml/zen_server/routers/run_templates_endpoints.py +212 -0
  114. zenml/zen_server/routers/workspaces_endpoints.py +79 -0
  115. zenml/zen_server/{pipeline_deployment → template_execution}/runner_entrypoint_configuration.py +1 -8
  116. zenml/zen_server/{pipeline_deployment → template_execution}/utils.py +214 -92
  117. zenml/zen_server/utils.py +2 -2
  118. zenml/zen_server/zen_server_api.py +2 -1
  119. zenml/zen_stores/migrations/versions/0.63.0_release.py +23 -0
  120. zenml/zen_stores/migrations/versions/7d1919bb1ef0_add_run_templates.py +100 -0
  121. zenml/zen_stores/migrations/versions/b59aa68fdb1f_simplify_pipelines.py +139 -0
  122. zenml/zen_stores/rest_zen_store.py +107 -36
  123. zenml/zen_stores/schemas/__init__.py +2 -0
  124. zenml/zen_stores/schemas/pipeline_build_schemas.py +3 -3
  125. zenml/zen_stores/schemas/pipeline_deployment_schemas.py +29 -2
  126. zenml/zen_stores/schemas/pipeline_run_schemas.py +26 -3
  127. zenml/zen_stores/schemas/pipeline_schemas.py +29 -30
  128. zenml/zen_stores/schemas/run_template_schemas.py +264 -0
  129. zenml/zen_stores/schemas/step_run_schemas.py +11 -4
  130. zenml/zen_stores/sql_zen_store.py +364 -150
  131. zenml/zen_stores/template_utils.py +261 -0
  132. zenml/zen_stores/zen_store_interface.py +93 -20
  133. {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.63.0.dev20240801.dist-info}/METADATA +2 -2
  134. {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.63.0.dev20240801.dist-info}/RECORD +139 -129
  135. zenml/models/v2/core/pipeline_namespace.py +0 -113
  136. zenml/new/pipelines/deserialization_utils.py +0 -292
  137. zenml/zen_server/dashboard/assets/CollapsibleCard-opiuBHHc.js +0 -1
  138. zenml/zen_server/dashboard/assets/Pagination-C6X-mifw.js +0 -1
  139. zenml/zen_server/dashboard/assets/index-EpMIKgrI.css +0 -1
  140. zenml/zen_server/dashboard/assets/index-rK_Wuy2W.js +0 -1
  141. zenml/zen_server/dashboard/assets/index.esm-Corw4lXQ.js +0 -1
  142. zenml/zen_server/dashboard/assets/package-B3fWP-Dh.js +0 -1
  143. zenml/zen_server/dashboard/assets/page-5NCOHOsy.js +0 -1
  144. zenml/zen_server/dashboard/assets/page-Bq0YxkLV.js +0 -1
  145. zenml/zen_server/dashboard/assets/page-Bs2F4eoD.js +0 -2
  146. zenml/zen_server/dashboard/assets/page-CHNxpz3n.js +0 -1
  147. zenml/zen_server/dashboard/assets/page-DgorQFqi.js +0 -1
  148. zenml/zen_server/dashboard/assets/page-K8ebxVIs.js +0 -1
  149. zenml/zen_server/dashboard/assets/page-TgCF0P_U.js +0 -1
  150. zenml/zen_server/dashboard/assets/page-ZnCEe-eK.js +0 -9
  151. zenml/zen_server/dashboard/assets/persist-D7HJNBWx.js +0 -1
  152. zenml/zen_server/dashboard/assets/plus-C8WOyCzt.js +0 -1
  153. /zenml/zen_server/{pipeline_deployment → template_execution}/__init__.py +0 -0
  154. /zenml/zen_server/{pipeline_deployment → template_execution}/workload_manager_interface.py +0 -0
  155. {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.63.0.dev20240801.dist-info}/LICENSE +0 -0
  156. {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.63.0.dev20240801.dist-info}/WHEEL +0 -0
  157. {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.63.0.dev20240801.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.62.0 is out. Check out the release notes
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.62.0.dev20240729
1
+ 0.63.0.dev20240801
@@ -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
- pipeline_deployment_id: UUID
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
- deployment = zen_store().get_deployment(config.pipeline_deployment_id)
99
- logger.debug("Running deployment:", deployment)
100
- run_pipeline(
101
- deployment=deployment,
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.get_deployment(deployment_id=deployment_id)
120
+ zen_store.get_run_template(template_id=config.template_id)
122
121
  except KeyError:
123
- raise ValueError(f"No deployment found with id {deployment_id}.")
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 deployment_id does not exist.
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
- deployment = zen_store.get_deployment(
188
- deployment_id=deployment_id, hydrate=hydrate
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(f"No deployment found with id {deployment_id}.")
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.PIPELINE_DEPLOYMENT: deployment
196
+ ResourceType.RUN_TEMPLATE: template
195
197
  }
196
198
 
197
- if deployment.pipeline is not None:
199
+ if template.pipeline is not None:
198
200
  pipeline = zen_store.get_pipeline(
199
- pipeline_id=deployment.pipeline.id, hydrate=hydrate
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
- Since every pipeline run creates a new pipeline by default, you might
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 latest pipeline version and change all corresponding
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 <PIPELINE_ID_OR_NAME>
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 <PIPELINE_ID_OR_NAME> --config=<PATH_TO_CONFIG_YAML>
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 <PIPELINE_ID_OR_NAME> --stack=<STACK_ID_OR_NAME>
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 <PIPELINE_ID_OR_NAME>
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 <PIPELINE_ID_OR_NAME> --config=<PATH_TO_CONFIG_YAML>
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 <PIPELINE_ID_OR_NAME> --stack=<STACK_ID_OR_NAME>
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.06.06", # Make sure it is aligned with .github/workflows/update-templates-to-examples.yml
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("build", help="Build Docker images for a pipeline.")
125
- @click.argument("pipeline_name_or_id")
126
- @click.option(
127
- "--version",
128
- "-v",
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
- pipeline_name_or_id: str,
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
- pipeline_name_or_id: Name or ID of the pipeline.
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
- pipeline_model = Client().get_pipeline(
184
- name_id_or_prefix=pipeline_name_or_id, version=version
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 = Pipeline.from_model(pipeline_model)
189
- build = pipeline_instance.build(config_path=config_path)
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("run", help="Run a pipeline.")
204
- @click.argument("pipeline_name_or_id")
205
- @click.option(
206
- "--version",
207
- "-v",
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
- pipeline_name_or_id: str,
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
- pipeline_name_or_id: Name or ID of the pipeline.
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
- pipeline_model = Client().get_pipeline(
274
- name_id_or_prefix=pipeline_name_or_id, version=version
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}{version_suffix}`? This will change all "
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("## Instructions\n" + deployment.instructions))
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.configuration:
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 {provider.upper()} in your browser.",
1748
+ f"automatically redirected to "
1749
+ f"{deployment_config.deployment_url_text} in your browser.",
1752
1750
  ):
1753
1751
  raise click.Abort()
1754
1752