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.
Files changed (240) hide show
  1. README.md +2 -2
  2. RELEASE_NOTES.md +120 -0
  3. zenml/VERSION +1 -1
  4. zenml/__init__.py +0 -4
  5. zenml/actions/pipeline_run/pipeline_run_action.py +19 -17
  6. zenml/analytics/enums.py +4 -6
  7. zenml/cli/__init__.py +28 -76
  8. zenml/cli/base.py +2 -2
  9. zenml/cli/pipeline.py +54 -61
  10. zenml/cli/stack.py +6 -8
  11. zenml/cli/web_login.py +8 -0
  12. zenml/client.py +232 -103
  13. zenml/config/build_configuration.py +43 -17
  14. zenml/config/compiler.py +14 -22
  15. zenml/config/docker_settings.py +80 -57
  16. zenml/config/pipeline_run_configuration.py +3 -0
  17. zenml/config/server_config.py +3 -0
  18. zenml/config/source.py +60 -1
  19. zenml/constants.py +11 -2
  20. zenml/entrypoints/base_entrypoint_configuration.py +53 -8
  21. zenml/enums.py +4 -1
  22. zenml/environment.py +25 -9
  23. zenml/image_builders/base_image_builder.py +1 -1
  24. zenml/image_builders/build_context.py +25 -72
  25. zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +13 -4
  26. zenml/integrations/azure/__init__.py +4 -0
  27. zenml/integrations/azure/flavors/__init__.py +11 -0
  28. zenml/integrations/azure/flavors/azureml_orchestrator_flavor.py +263 -0
  29. zenml/{_hub → integrations/azure/orchestrators}/__init__.py +7 -2
  30. zenml/integrations/azure/orchestrators/azureml_orchestrator.py +544 -0
  31. zenml/integrations/azure/orchestrators/azureml_orchestrator_entrypoint_config.py +86 -0
  32. zenml/integrations/azure/step_operators/azureml_step_operator.py +3 -0
  33. zenml/integrations/databricks/flavors/databricks_orchestrator_flavor.py +20 -2
  34. zenml/integrations/databricks/orchestrators/databricks_orchestrator.py +19 -13
  35. zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +7 -2
  36. zenml/integrations/gcp/service_connectors/gcp_service_connector.py +123 -6
  37. zenml/integrations/kaniko/image_builders/kaniko_image_builder.py +1 -1
  38. zenml/integrations/mlflow/__init__.py +1 -1
  39. zenml/integrations/mlflow/experiment_trackers/mlflow_experiment_tracker.py +3 -1
  40. zenml/integrations/mlflow/flavors/mlflow_experiment_tracker_flavor.py +3 -0
  41. zenml/logger.py +13 -0
  42. zenml/models/__init__.py +26 -22
  43. zenml/models/v2/base/filter.py +32 -0
  44. zenml/models/v2/core/pipeline.py +73 -89
  45. zenml/models/v2/core/pipeline_build.py +15 -11
  46. zenml/models/v2/core/pipeline_deployment.py +72 -24
  47. zenml/models/v2/core/pipeline_run.py +65 -1
  48. zenml/models/v2/core/run_template.py +393 -0
  49. zenml/models/v2/core/server_settings.py +12 -0
  50. zenml/models/v2/core/user.py +0 -21
  51. zenml/models/v2/misc/server_models.py +7 -1
  52. zenml/models/v2/misc/stack_deployment.py +5 -0
  53. zenml/models/v2/misc/user_auth.py +0 -7
  54. zenml/new/pipelines/build_utils.py +220 -89
  55. zenml/new/pipelines/code_archive.py +157 -0
  56. zenml/new/pipelines/pipeline.py +46 -78
  57. zenml/new/pipelines/run_utils.py +79 -1
  58. zenml/post_execution/pipeline.py +1 -4
  59. zenml/service_connectors/service_connector_utils.py +18 -2
  60. zenml/stack_deployments/aws_stack_deployment.py +32 -8
  61. zenml/stack_deployments/azure_stack_deployment.py +122 -10
  62. zenml/stack_deployments/gcp_stack_deployment.py +36 -7
  63. zenml/stack_deployments/stack_deployment.py +23 -7
  64. zenml/steps/base_step.py +3 -0
  65. zenml/steps/utils.py +0 -4
  66. zenml/utils/archivable.py +149 -0
  67. zenml/utils/code_utils.py +244 -0
  68. zenml/utils/notebook_utils.py +122 -0
  69. zenml/utils/package_utils.py +39 -0
  70. zenml/utils/pipeline_docker_image_builder.py +3 -96
  71. zenml/utils/source_utils.py +109 -1
  72. zenml/zen_server/dashboard/assets/{404-B_YdvmwS.js → 404-CRAA_Lew.js} +1 -1
  73. zenml/zen_server/dashboard/assets/@radix-BXWm7HOa.js +85 -0
  74. zenml/zen_server/dashboard/assets/{@react-router-CO-OsFwI.js → @react-router-l3lMcXA2.js} +1 -1
  75. zenml/zen_server/dashboard/assets/{@reactflow-l_1hUr1S.js → @reactflow-CeVxyqYT.js} +2 -2
  76. zenml/zen_server/dashboard/assets/{@tanstack-DYiOyJUL.js → @tanstack-FmcYZMuX.js} +4 -4
  77. zenml/zen_server/dashboard/assets/AlertDialogDropdownItem-ErO9aOgK.js +1 -0
  78. zenml/zen_server/dashboard/assets/{AwarenessChannel-CFg5iX4Z.js → AwarenessChannel-CLXo5rKM.js} +1 -1
  79. zenml/zen_server/dashboard/assets/{CodeSnippet-Dvkx_82E.js → CodeSnippet-D0VLxT2A.js} +2 -2
  80. zenml/zen_server/dashboard/assets/CollapsibleCard-BaUPiVg0.js +1 -0
  81. zenml/zen_server/dashboard/assets/{Commands-DoN1xrEq.js → Commands-JrcZK-3j.js} +1 -1
  82. zenml/zen_server/dashboard/assets/CopyButton-Dbo52T1K.js +2 -0
  83. zenml/zen_server/dashboard/assets/{CsvVizualization-Ck-nZ43m.js → CsvVizualization-D3kAypDj.js} +3 -3
  84. zenml/zen_server/dashboard/assets/DisplayDate-DizbSeT-.js +1 -0
  85. zenml/zen_server/dashboard/assets/EditSecretDialog-Bd7mFLS4.js +1 -0
  86. zenml/zen_server/dashboard/assets/{EmptyState-BMLnFVlB.js → EmptyState-BHblM39I.js} +1 -1
  87. zenml/zen_server/dashboard/assets/{Error-kLtljEOM.js → Error-C6LeJSER.js} +1 -1
  88. zenml/zen_server/dashboard/assets/{ExecutionStatus-DguLLgTK.js → ExecutionStatus-jH4OrWBq.js} +1 -1
  89. zenml/zen_server/dashboard/assets/{Helpbox-BXUMP21n.js → Helpbox-aAB2XP-z.js} +1 -1
  90. zenml/zen_server/dashboard/assets/{Infobox-DSt0O-dm.js → Infobox-BQ0aty32.js} +1 -1
  91. zenml/zen_server/dashboard/assets/{InlineAvatar-xsrsIGE-.js → InlineAvatar-DpTLgM3Q.js} +1 -1
  92. zenml/zen_server/dashboard/assets/Lock-CNyJvf2r.js +1 -0
  93. zenml/zen_server/dashboard/assets/{MarkdownVisualization-xp3hhULl.js → MarkdownVisualization-Bajxn0HY.js} +1 -1
  94. zenml/zen_server/dashboard/assets/NumberBox-BmKE0qnO.js +1 -0
  95. zenml/zen_server/dashboard/assets/{PasswordChecker-DUveqlva.js → PasswordChecker-yGGoJSB-.js} +1 -1
  96. zenml/zen_server/dashboard/assets/ProviderRadio-BBqkIuTd.js +1 -0
  97. zenml/zen_server/dashboard/assets/RadioItem-xLhXoiFV.js +1 -0
  98. zenml/zen_server/dashboard/assets/SearchField-C9R0mdaX.js +1 -0
  99. zenml/zen_server/dashboard/assets/{SetPassword-BXGTWiwj.js → SetPassword-52sNxNiO.js} +1 -1
  100. zenml/zen_server/dashboard/assets/{SuccessStep-DZC60t0x.js → SuccessStep-DlkItqYG.js} +1 -1
  101. zenml/zen_server/dashboard/assets/Tick-uxv80Q6a.js +1 -0
  102. zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-DGvwFWO1.js → UpdatePasswordSchemas-oN4G3sKz.js} +1 -1
  103. zenml/zen_server/dashboard/assets/{aws-BgKTfTfx.js → aws-0_3UsPif.js} +1 -1
  104. zenml/zen_server/dashboard/assets/{check-circle-i56092KI.js → check-circle-1_I207rW.js} +1 -1
  105. zenml/zen_server/dashboard/assets/chevron-down-BpaF8JqM.js +1 -0
  106. zenml/zen_server/dashboard/assets/{chevron-right-double-CZBOf6JM.js → chevron-right-double-Dk8e2L99.js} +1 -1
  107. zenml/zen_server/dashboard/assets/{cloud-only-C_yFCAkP.js → cloud-only-BkUuI0lZ.js} +1 -1
  108. zenml/zen_server/dashboard/assets/components-Br2ezRib.js +1 -0
  109. zenml/zen_server/dashboard/assets/{copy-BXNk6BjL.js → copy-f3XGPPxt.js} +1 -1
  110. zenml/zen_server/dashboard/assets/{database-1xWSgZfO.js → database-cXYNX9tt.js} +1 -1
  111. zenml/zen_server/dashboard/assets/{docker-CQMVm_4d.js → docker-8uj__HHK.js} +1 -1
  112. zenml/zen_server/dashboard/assets/dots-horizontal-sKQlWEni.js +1 -0
  113. zenml/zen_server/dashboard/assets/edit-C0MVvPD2.js +1 -0
  114. zenml/zen_server/dashboard/assets/{file-text-CqD_iu6l.js → file-text-B9JibxTs.js} +1 -1
  115. zenml/zen_server/dashboard/assets/{help-bu_DgLKI.js → help-FuHlZwn0.js} +1 -1
  116. zenml/zen_server/dashboard/assets/{index-rK_Wuy2W.js → index-Bd1xgUQG.js} +1 -1
  117. zenml/zen_server/dashboard/assets/index-DaGknux4.css +1 -0
  118. zenml/zen_server/dashboard/assets/{index-BczVOqUf.js → index-DhIZtpxB.js} +5 -5
  119. zenml/zen_server/dashboard/assets/index.esm-DT4uyn2i.js +1 -0
  120. zenml/zen_server/dashboard/assets/layout-D6oiSbfd.js +1 -0
  121. zenml/zen_server/dashboard/assets/{login-mutation-CrHrndTI.js → login-mutation-13A_JSVA.js} +1 -1
  122. zenml/zen_server/dashboard/assets/{logs-D8k8BVFf.js → logs-CgeE2vZP.js} +1 -1
  123. zenml/zen_server/dashboard/assets/{not-found-DYa4pC-C.js → not-found-B0Mmb90p.js} +1 -1
  124. zenml/zen_server/dashboard/assets/package-DdkziX79.js +1 -0
  125. zenml/zen_server/dashboard/assets/page-7-v2OBm-.js +1 -0
  126. zenml/zen_server/dashboard/assets/{page-MFQyIJd3.js → page-B3ozwdD1.js} +1 -1
  127. zenml/zen_server/dashboard/assets/{page-BkuQDIf-.js → page-BGwA9B1M.js} +1 -1
  128. zenml/zen_server/dashboard/assets/{page-1iL8aMqs.js → page-BkjAUyTA.js} +1 -1
  129. zenml/zen_server/dashboard/assets/page-BnacgBiy.js +1 -0
  130. zenml/zen_server/dashboard/assets/page-BxF_KMQ3.js +2 -0
  131. zenml/zen_server/dashboard/assets/page-C4POHC0K.js +1 -0
  132. zenml/zen_server/dashboard/assets/page-C9kudd44.js +9 -0
  133. zenml/zen_server/dashboard/assets/page-CA1j3GpJ.js +1 -0
  134. zenml/zen_server/dashboard/assets/page-CCY6yfmu.js +1 -0
  135. zenml/zen_server/dashboard/assets/page-CgTe7Bme.js +1 -0
  136. zenml/zen_server/dashboard/assets/{page-8a4UMKXZ.js → page-Cgn-6v2Y.js} +1 -1
  137. zenml/zen_server/dashboard/assets/page-CxQmQqDw.js +1 -0
  138. zenml/zen_server/dashboard/assets/page-D2Goey3H.js +1 -0
  139. zenml/zen_server/dashboard/assets/page-DLpOnf7u.js +1 -0
  140. zenml/zen_server/dashboard/assets/{page-BhgCDInH.js → page-DSTQnBk-.js} +1 -1
  141. zenml/zen_server/dashboard/assets/{page-1h_sD1jz.js → page-DTysUGOy.js} +1 -1
  142. zenml/zen_server/dashboard/assets/{page-2grKx_MY.js → page-D_EXUFJb.js} +1 -1
  143. zenml/zen_server/dashboard/assets/page-Db15QzsM.js +1 -0
  144. zenml/zen_server/dashboard/assets/{page-BDns21Iz.js → page-DugsjcQ_.js} +1 -1
  145. zenml/zen_server/dashboard/assets/{page-C6-UGEbH.js → page-OFKSPyN7.js} +1 -1
  146. zenml/zen_server/dashboard/assets/{page-BkeAAYwp.js → page-RnG-qhv9.js} +1 -1
  147. zenml/zen_server/dashboard/assets/{page-CCNRIt_f.js → page-T2BtjwPl.js} +1 -1
  148. zenml/zen_server/dashboard/assets/page-TXe1Eo3Z.js +1 -0
  149. zenml/zen_server/dashboard/assets/{page-BnaevhnB.js → page-YiF_fNbe.js} +1 -1
  150. zenml/zen_server/dashboard/assets/{page-uA5prJGY.js → page-hQaiQXfg.js} +1 -1
  151. zenml/zen_server/dashboard/assets/persist-3-5nOJ6m.js +1 -0
  152. zenml/zen_server/dashboard/assets/{play-circle-CNtZKDnW.js → play-circle-XSkLR12B.js} +1 -1
  153. zenml/zen_server/dashboard/assets/plus-FB9-lEq_.js +1 -0
  154. zenml/zen_server/dashboard/assets/refresh-COb6KYDi.js +1 -0
  155. zenml/zen_server/dashboard/assets/sharedSchema-BoYx_B_L.js +14 -0
  156. zenml/zen_server/dashboard/assets/{stack-detail-query-Cficsl6d.js → stack-detail-query-B-US_-wa.js} +1 -1
  157. zenml/zen_server/dashboard/assets/{terminal-By9cErXc.js → terminal-grtjrIEJ.js} +1 -1
  158. zenml/zen_server/dashboard/assets/trash-Cd5CSFqA.js +1 -0
  159. zenml/zen_server/dashboard/assets/{update-server-settings-mutation-7d8xi1tS.js → update-server-settings-mutation-B8GB_ubU.js} +1 -1
  160. zenml/zen_server/dashboard/assets/{url-D7mAQGUM.js → url-hcMJkz8p.js} +1 -1
  161. zenml/zen_server/dashboard/assets/{zod-BhoGpZ63.js → zod-CnykDKJj.js} +1 -1
  162. zenml/zen_server/dashboard/index.html +7 -7
  163. zenml/zen_server/dashboard_legacy/asset-manifest.json +4 -4
  164. zenml/zen_server/dashboard_legacy/index.html +1 -1
  165. zenml/zen_server/dashboard_legacy/{precache-manifest.12246c7548e71e2c4438e496360de80c.js → precache-manifest.9c473c96a43298343a7ce1256183123b.js} +4 -4
  166. zenml/zen_server/dashboard_legacy/service-worker.js +1 -1
  167. zenml/zen_server/dashboard_legacy/static/js/{main.3b27024b.chunk.js → main.463c90b9.chunk.js} +2 -2
  168. zenml/zen_server/dashboard_legacy/static/js/{main.3b27024b.chunk.js.map → main.463c90b9.chunk.js.map} +1 -1
  169. zenml/zen_server/deploy/helm/Chart.yaml +1 -1
  170. zenml/zen_server/deploy/helm/README.md +2 -2
  171. zenml/zen_server/rbac/models.py +1 -0
  172. zenml/zen_server/rbac/utils.py +4 -0
  173. zenml/zen_server/routers/pipeline_builds_endpoints.py +2 -66
  174. zenml/zen_server/routers/pipeline_deployments_endpoints.py +2 -53
  175. zenml/zen_server/routers/pipelines_endpoints.py +1 -74
  176. zenml/zen_server/routers/run_templates_endpoints.py +212 -0
  177. zenml/zen_server/routers/stack_deployment_endpoints.py +6 -0
  178. zenml/zen_server/routers/users_endpoints.py +0 -7
  179. zenml/zen_server/routers/workspaces_endpoints.py +79 -0
  180. zenml/zen_server/{pipeline_deployment → template_execution}/runner_entrypoint_configuration.py +1 -8
  181. zenml/zen_server/{pipeline_deployment → template_execution}/utils.py +214 -92
  182. zenml/zen_server/utils.py +77 -2
  183. zenml/zen_server/zen_server_api.py +54 -2
  184. zenml/zen_stores/base_zen_store.py +7 -1
  185. zenml/zen_stores/migrations/versions/0.63.0_release.py +23 -0
  186. zenml/zen_stores/migrations/versions/0.64.0_release.py +23 -0
  187. zenml/zen_stores/migrations/versions/026d4577b6a0_add_code_path.py +39 -0
  188. zenml/zen_stores/migrations/versions/3dcc5d20e82f_add_last_user_activity.py +51 -0
  189. zenml/zen_stores/migrations/versions/7d1919bb1ef0_add_run_templates.py +100 -0
  190. zenml/zen_stores/migrations/versions/909550c7c4da_remove_user_hub_token.py +36 -0
  191. zenml/zen_stores/migrations/versions/b59aa68fdb1f_simplify_pipelines.py +139 -0
  192. zenml/zen_stores/rest_zen_store.py +112 -39
  193. zenml/zen_stores/schemas/__init__.py +2 -0
  194. zenml/zen_stores/schemas/pipeline_build_schemas.py +3 -3
  195. zenml/zen_stores/schemas/pipeline_deployment_schemas.py +32 -2
  196. zenml/zen_stores/schemas/pipeline_run_schemas.py +29 -3
  197. zenml/zen_stores/schemas/pipeline_schemas.py +29 -30
  198. zenml/zen_stores/schemas/run_template_schemas.py +264 -0
  199. zenml/zen_stores/schemas/server_settings_schemas.py +2 -0
  200. zenml/zen_stores/schemas/step_run_schemas.py +11 -4
  201. zenml/zen_stores/schemas/user_schemas.py +0 -2
  202. zenml/zen_stores/sql_zen_store.py +389 -151
  203. zenml/zen_stores/template_utils.py +261 -0
  204. zenml/zen_stores/zen_store_interface.py +93 -20
  205. {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.64.0.dev20240809.dist-info}/METADATA +3 -3
  206. {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.64.0.dev20240809.dist-info}/RECORD +211 -184
  207. zenml/_hub/client.py +0 -289
  208. zenml/_hub/constants.py +0 -21
  209. zenml/_hub/utils.py +0 -79
  210. zenml/cli/hub.py +0 -1116
  211. zenml/models/v2/core/pipeline_namespace.py +0 -113
  212. zenml/models/v2/misc/hub_plugin_models.py +0 -79
  213. zenml/new/pipelines/deserialization_utils.py +0 -292
  214. zenml/zen_server/dashboard/assets/@radix-CFOkMR_E.js +0 -85
  215. zenml/zen_server/dashboard/assets/CollapsibleCard-opiuBHHc.js +0 -1
  216. zenml/zen_server/dashboard/assets/CopyButton-Cr7xYEPb.js +0 -2
  217. zenml/zen_server/dashboard/assets/DisplayDate-DYgIjlDF.js +0 -1
  218. zenml/zen_server/dashboard/assets/Pagination-C6X-mifw.js +0 -1
  219. zenml/zen_server/dashboard/assets/index-EpMIKgrI.css +0 -1
  220. zenml/zen_server/dashboard/assets/index.esm-Corw4lXQ.js +0 -1
  221. zenml/zen_server/dashboard/assets/package-B3fWP-Dh.js +0 -1
  222. zenml/zen_server/dashboard/assets/page-5NCOHOsy.js +0 -1
  223. zenml/zen_server/dashboard/assets/page-B6h3iaHJ.js +0 -1
  224. zenml/zen_server/dashboard/assets/page-Bi-wtWiO.js +0 -5
  225. zenml/zen_server/dashboard/assets/page-Bq0YxkLV.js +0 -1
  226. zenml/zen_server/dashboard/assets/page-Bs2F4eoD.js +0 -2
  227. zenml/zen_server/dashboard/assets/page-CHNxpz3n.js +0 -1
  228. zenml/zen_server/dashboard/assets/page-DgorQFqi.js +0 -1
  229. zenml/zen_server/dashboard/assets/page-K8ebxVIs.js +0 -1
  230. zenml/zen_server/dashboard/assets/page-TgCF0P_U.js +0 -1
  231. zenml/zen_server/dashboard/assets/page-ZnCEe-eK.js +0 -9
  232. zenml/zen_server/dashboard/assets/persist-D7HJNBWx.js +0 -1
  233. zenml/zen_server/dashboard/assets/plus-C8WOyCzt.js +0 -1
  234. zenml/zen_server/dashboard/assets/secrets-video-OBJ6irhH.svg +0 -21
  235. zenml/zen_server/dashboard/assets/stacks-video-7gfxpAq4.svg +0 -21
  236. /zenml/zen_server/{pipeline_deployment → template_execution}/__init__.py +0 -0
  237. /zenml/zen_server/{pipeline_deployment → template_execution}/workload_manager_interface.py +0 -0
  238. {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.64.0.dev20240809.dist-info}/LICENSE +0 -0
  239. {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.64.0.dev20240809.dist-info}/WHEEL +0 -0
  240. {zenml_nightly-0.62.0.dev20240729.dist-info → zenml_nightly-0.64.0.dev20240809.dist-info}/entry_points.txt +0 -0
@@ -73,6 +73,7 @@ from zenml.new.pipelines.run_utils import (
73
73
  create_placeholder_run,
74
74
  deploy_pipeline,
75
75
  prepare_model_versions,
76
+ upload_notebook_cell_code_if_necessary,
76
77
  )
77
78
  from zenml.stack import Stack
78
79
  from zenml.steps import BaseStep
@@ -82,6 +83,7 @@ from zenml.steps.entrypoint_function_utils import (
82
83
  from zenml.steps.step_invocation import StepInvocation
83
84
  from zenml.utils import (
84
85
  code_repository_utils,
86
+ code_utils,
85
87
  dashboard_utils,
86
88
  dict_utils,
87
89
  pydantic_utils,
@@ -241,20 +243,6 @@ class Pipeline:
241
243
  """
242
244
  return inspect.getsource(self.source_object)
243
245
 
244
- @classmethod
245
- def from_model(cls, model: "PipelineResponse") -> "Pipeline":
246
- """Creates a pipeline instance from a model.
247
-
248
- Args:
249
- model: The model to load the pipeline instance from.
250
-
251
- Returns:
252
- The pipeline instance.
253
- """
254
- from zenml.new.pipelines.deserialization_utils import load_pipeline
255
-
256
- return load_pipeline(model=model)
257
-
258
246
  @property
259
247
  def model(self) -> "PipelineResponse":
260
248
  """Gets the registered pipeline model for this instance.
@@ -267,14 +255,7 @@ class Pipeline:
267
255
  """
268
256
  self._prepare_if_possible()
269
257
 
270
- pipeline_spec = Compiler().compile_spec(self)
271
- version_hash = self._compute_unique_identifier(
272
- pipeline_spec=pipeline_spec
273
- )
274
-
275
- pipelines = Client().list_pipelines(
276
- name=self.name, version_hash=version_hash
277
- )
258
+ pipelines = Client().list_pipelines(name=self.name)
278
259
  if len(pipelines) == 1:
279
260
  return pipelines.items[0]
280
261
 
@@ -513,8 +494,7 @@ To avoid this consider setting pipeline parameters only in one place (config or
513
494
  "pipeline build/run` commands."
514
495
  )
515
496
 
516
- pipeline_spec = Compiler().compile_spec(self)
517
- return self._register(pipeline_spec=pipeline_spec)
497
+ return self._register()
518
498
 
519
499
  def build(
520
500
  self,
@@ -541,12 +521,12 @@ To avoid this consider setting pipeline parameters only in one place (config or
541
521
  """
542
522
  with track_handler(event=AnalyticsEvent.BUILD_PIPELINE):
543
523
  self._prepare_if_possible()
544
- deployment, pipeline_spec, _, _ = self._compile(
524
+ deployment, _, _ = self._compile(
545
525
  config_path=config_path,
546
526
  steps=step_configurations,
547
527
  settings=settings,
548
528
  )
549
- pipeline_id = self._register(pipeline_spec=pipeline_spec).id
529
+ pipeline_id = self._register().id
550
530
 
551
531
  local_repo = code_repository_utils.find_active_code_repository()
552
532
  code_repository = build_utils.verify_local_repository_context(
@@ -601,7 +581,8 @@ To avoid this consider setting pipeline parameters only in one place (config or
601
581
  method.
602
582
  unlisted: Whether the pipeline run should be unlisted (not assigned
603
583
  to any pipeline).
604
- prevent_build_reuse: Whether to prevent the reuse of a build.
584
+ prevent_build_reuse: DEPRECATED: Use
585
+ `DockerSettings.prevent_build_reuse` instead.
605
586
 
606
587
  Returns:
607
588
  Model of the pipeline run if running without a schedule, `None` if
@@ -623,7 +604,7 @@ To avoid this consider setting pipeline parameters only in one place (config or
623
604
  logger.info(f"Initiating a new run for the pipeline: `{self.name}`.")
624
605
 
625
606
  with track_handler(AnalyticsEvent.RUN_PIPELINE) as analytics_handler:
626
- deployment, pipeline_spec, schedule, build = self._compile(
607
+ deployment, schedule, build = self._compile(
627
608
  config_path=config_path,
628
609
  run_name=run_name,
629
610
  enable_cache=enable_cache,
@@ -646,7 +627,7 @@ To avoid this consider setting pipeline parameters only in one place (config or
646
627
 
647
628
  pipeline_id = None
648
629
  if register_pipeline:
649
- pipeline_id = self._register(pipeline_spec=pipeline_spec).id
630
+ pipeline_id = self._register().id
650
631
 
651
632
  else:
652
633
  logger.debug(f"Pipeline {self.name} is unlisted.")
@@ -689,6 +670,9 @@ To avoid this consider setting pipeline parameters only in one place (config or
689
670
 
690
671
  stack = Client().active_stack
691
672
  stack.validate()
673
+ upload_notebook_cell_code_if_necessary(
674
+ deployment=deployment, stack=stack
675
+ )
692
676
 
693
677
  prepare_model_versions(deployment)
694
678
 
@@ -699,6 +683,13 @@ To avoid this consider setting pipeline parameters only in one place (config or
699
683
  deployment=deployment, local_repo_context=local_repo_context
700
684
  )
701
685
 
686
+ if prevent_build_reuse:
687
+ logger.warning(
688
+ "Passing `prevent_build_reuse=True` to "
689
+ "`pipeline.with_opitions(...)` is deprecated. Use "
690
+ "`DockerSettings.prevent_build_reuse` instead."
691
+ )
692
+
702
693
  build_model = build_utils.reuse_or_create_pipeline_build(
703
694
  deployment=deployment,
704
695
  pipeline_id=pipeline_id,
@@ -723,6 +714,18 @@ To avoid this consider setting pipeline parameters only in one place (config or
723
714
  code_repository=local_repo_context.code_repository_id,
724
715
  )
725
716
 
717
+ code_path = None
718
+ if build_utils.should_upload_code(
719
+ deployment=deployment,
720
+ build=build_model,
721
+ code_reference=code_reference,
722
+ ):
723
+ code_archive = code_utils.CodeArchive(
724
+ root=source_utils.get_source_root()
725
+ )
726
+ logger.info("Archiving pipeline code...")
727
+ code_path = code_utils.upload_code_if_necessary(code_archive)
728
+
726
729
  deployment_request = PipelineDeploymentRequest(
727
730
  user=Client().active_user.id,
728
731
  workspace=Client().active_workspace.id,
@@ -731,6 +734,7 @@ To avoid this consider setting pipeline parameters only in one place (config or
731
734
  build=build_id,
732
735
  schedule=schedule_id,
733
736
  code_reference=code_reference,
737
+ code_path=code_path,
734
738
  **deployment.model_dump(),
735
739
  )
736
740
  deployment_model = Client().zen_store.create_deployment(
@@ -987,7 +991,6 @@ To avoid this consider setting pipeline parameters only in one place (config or
987
991
  self, config_path: Optional[str] = None, **run_configuration_args: Any
988
992
  ) -> Tuple[
989
993
  "PipelineDeploymentBase",
990
- "PipelineSpec",
991
994
  Optional["Schedule"],
992
995
  Union["PipelineBuildBase", UUID, None],
993
996
  ]:
@@ -998,7 +1001,7 @@ To avoid this consider setting pipeline parameters only in one place (config or
998
1001
  **run_configuration_args: Configurations for the pipeline run.
999
1002
 
1000
1003
  Returns:
1001
- A tuple containing the deployment, spec, schedule and build of
1004
+ A tuple containing the deployment, schedule and build of
1002
1005
  the compiled pipeline.
1003
1006
  """
1004
1007
  # Activating the built-in integrations to load all materializers
@@ -1019,61 +1022,41 @@ To avoid this consider setting pipeline parameters only in one place (config or
1019
1022
  # Update with the values in code so they take precedence
1020
1023
  run_config = pydantic_utils.update_model(run_config, update=update)
1021
1024
 
1022
- deployment, pipeline_spec = Compiler().compile(
1025
+ deployment = Compiler().compile(
1023
1026
  pipeline=self,
1024
1027
  stack=Client().active_stack,
1025
1028
  run_configuration=run_config,
1026
1029
  )
1027
1030
 
1028
- return deployment, pipeline_spec, run_config.schedule, run_config.build
1031
+ return deployment, run_config.schedule, run_config.build
1029
1032
 
1030
- def _register(self, pipeline_spec: "PipelineSpec") -> "PipelineResponse":
1033
+ def _register(self) -> "PipelineResponse":
1031
1034
  """Register the pipeline in the server.
1032
1035
 
1033
- Args:
1034
- pipeline_spec: The pipeline spec to register.
1035
-
1036
1036
  Returns:
1037
1037
  The registered pipeline model.
1038
1038
  """
1039
+ client = Client()
1039
1040
 
1040
- def _get(version_hash: str) -> PipelineResponse:
1041
- client = Client()
1042
-
1041
+ def _get() -> PipelineResponse:
1043
1042
  matching_pipelines = client.list_pipelines(
1044
1043
  name=self.name,
1045
- version_hash=version_hash,
1046
1044
  size=1,
1047
1045
  sort_by="desc:created",
1048
1046
  )
1047
+
1049
1048
  if matching_pipelines.total:
1050
1049
  registered_pipeline = matching_pipelines.items[0]
1051
- logger.info(
1052
- "Reusing registered pipeline version: `(version: %s)`.",
1053
- registered_pipeline.version,
1054
- )
1055
1050
  return registered_pipeline
1056
1051
  raise RuntimeError("No matching pipelines found.")
1057
1052
 
1058
- version_hash = self._compute_unique_identifier(
1059
- pipeline_spec=pipeline_spec
1060
- )
1061
-
1062
- client = Client()
1063
1053
  try:
1064
- return _get(version_hash)
1054
+ return _get()
1065
1055
  except RuntimeError:
1066
- latest_version = self._get_latest_version() or 0
1067
- version = str(latest_version + 1)
1068
-
1069
1056
  request = PipelineRequest(
1070
1057
  workspace=client.active_workspace.id,
1071
1058
  user=client.active_user.id,
1072
1059
  name=self.name,
1073
- version=version,
1074
- version_hash=version_hash,
1075
- spec=pipeline_spec,
1076
- docstring=self.__doc__,
1077
1060
  )
1078
1061
 
1079
1062
  try:
@@ -1081,12 +1064,12 @@ To avoid this consider setting pipeline parameters only in one place (config or
1081
1064
  pipeline=request
1082
1065
  )
1083
1066
  logger.info(
1084
- "Registered new version: `(version %s)`.",
1085
- registered_pipeline.version,
1067
+ "Registered new pipeline: `%s`.",
1068
+ registered_pipeline.name,
1086
1069
  )
1087
1070
  return registered_pipeline
1088
1071
  except EntityExistsError:
1089
- return _get(version_hash)
1072
+ return _get()
1090
1073
 
1091
1074
  def _compute_unique_identifier(self, pipeline_spec: PipelineSpec) -> str:
1092
1075
  """Computes a unique identifier from the pipeline spec and steps.
@@ -1113,22 +1096,6 @@ To avoid this consider setting pipeline parameters only in one place (config or
1113
1096
 
1114
1097
  return hash_.hexdigest()
1115
1098
 
1116
- def _get_latest_version(self) -> Optional[int]:
1117
- """Gets the latest version of this pipeline.
1118
-
1119
- Returns:
1120
- The latest version or `None` if no version exists.
1121
- """
1122
- all_pipelines = Client().list_pipelines(
1123
- name=self.name, sort_by="desc:created", size=1
1124
- )
1125
- if not all_pipelines.total:
1126
- return None
1127
- pipeline = all_pipelines.items[0]
1128
- if pipeline.version == "UNVERSIONED":
1129
- return None
1130
- return int(all_pipelines.items[0].version)
1131
-
1132
1099
  def add_step_invocation(
1133
1100
  self,
1134
1101
  step: "BaseStep",
@@ -1330,7 +1297,8 @@ To avoid this consider setting pipeline parameters only in one place (config or
1330
1297
  method.
1331
1298
  unlisted: Whether the pipeline run should be unlisted (not assigned
1332
1299
  to any pipeline).
1333
- prevent_build_reuse: Whether to prevent the reuse of a build.
1300
+ prevent_build_reuse: DEPRECATED: Use
1301
+ `DockerSettings.prevent_build_reuse` instead.
1334
1302
  **kwargs: Pipeline configuration options. These will be passed
1335
1303
  to the `pipeline.configure(...)` method.
1336
1304
 
@@ -1,5 +1,6 @@
1
1
  """Utility functions for running pipelines."""
2
2
 
3
+ import hashlib
3
4
  import time
4
5
  from collections import defaultdict
5
6
  from datetime import datetime
@@ -9,6 +10,7 @@ from uuid import UUID
9
10
  from zenml import constants
10
11
  from zenml.client import Client
11
12
  from zenml.config.pipeline_run_configuration import PipelineRunConfiguration
13
+ from zenml.config.source import SourceType
12
14
  from zenml.config.step_configurations import StepConfigurationUpdate
13
15
  from zenml.enums import ExecutionStatus, ModelStages
14
16
  from zenml.logger import get_logger
@@ -23,7 +25,7 @@ from zenml.models import (
23
25
  from zenml.new.pipelines.model_utils import NewModelRequest
24
26
  from zenml.orchestrators.utils import get_run_name
25
27
  from zenml.stack import Flavor, Stack
26
- from zenml.utils import cloud_utils
28
+ from zenml.utils import cloud_utils, code_utils, notebook_utils
27
29
  from zenml.zen_stores.base_zen_store import BaseZenStore
28
30
 
29
31
  if TYPE_CHECKING:
@@ -36,6 +38,18 @@ if TYPE_CHECKING:
36
38
  logger = get_logger(__name__)
37
39
 
38
40
 
41
+ def get_default_run_name(pipeline_name: str) -> str:
42
+ """Gets the default name for a pipeline run.
43
+
44
+ Args:
45
+ pipeline_name: Name of the pipeline which will be run.
46
+
47
+ Returns:
48
+ Run name.
49
+ """
50
+ return f"{pipeline_name}-{{date}}-{{time}}"
51
+
52
+
39
53
  def create_placeholder_run(
40
54
  deployment: "PipelineDeploymentResponse",
41
55
  ) -> Optional["PipelineRunResponse"]:
@@ -349,3 +363,67 @@ def validate_run_config_is_runnable_from_server(
349
363
  raise ValueError(
350
364
  "Can't set DockerSettings when running pipeline via Rest API."
351
365
  )
366
+
367
+
368
+ def upload_notebook_cell_code_if_necessary(
369
+ deployment: "PipelineDeploymentBase", stack: "Stack"
370
+ ) -> None:
371
+ """Upload notebook cell code if necessary.
372
+
373
+ This function checks if any of the steps of the pipeline that will be
374
+ executed in a different process are defined in a notebook. If that is the
375
+ case, it will extract that notebook cell code into python files and upload
376
+ an archive of all the necessary files to the artifact store.
377
+
378
+ Args:
379
+ deployment: The deployment.
380
+ stack: The stack on which the deployment will happen.
381
+
382
+ Raises:
383
+ RuntimeError: If the code for one of the steps that will run out of
384
+ process cannot be extracted into a python file.
385
+ """
386
+ code_archive = code_utils.CodeArchive(root=None)
387
+ should_upload = False
388
+ sources_that_require_upload = []
389
+
390
+ for step in deployment.step_configurations.values():
391
+ source = step.spec.source
392
+
393
+ if source.type == SourceType.NOTEBOOK:
394
+ if (
395
+ stack.orchestrator.flavor != "local"
396
+ or step.config.step_operator
397
+ ):
398
+ should_upload = True
399
+ cell_code = getattr(step.spec.source, "_cell_code", None)
400
+
401
+ # Code does not run in-process, which means we need to
402
+ # extract the step code into a python file
403
+ if not cell_code:
404
+ raise RuntimeError(
405
+ f"Unable to run step {step.config.name}. This step is "
406
+ "defined in a notebook and you're trying to run it "
407
+ "in a remote environment, but ZenML was not able to "
408
+ "detect the step code in the notebook. To fix "
409
+ "this error, define your step in a python file instead "
410
+ "of a notebook."
411
+ )
412
+
413
+ notebook_utils.warn_about_notebook_cell_magic_commands(
414
+ cell_code=cell_code
415
+ )
416
+
417
+ code_hash = hashlib.sha1(cell_code.encode()).hexdigest() # nosec
418
+ module_name = f"extracted_notebook_code_{code_hash}"
419
+ file_name = f"{module_name}.py"
420
+ code_archive.add_file(source=cell_code, destination=file_name)
421
+
422
+ setattr(step.spec.source, "replacement_module", module_name)
423
+ sources_that_require_upload.append(source)
424
+
425
+ if should_upload:
426
+ logger.info("Archiving notebook code...")
427
+ code_path = code_utils.upload_code_if_necessary(code_archive)
428
+ for source in sources_that_require_upload:
429
+ setattr(source, "code_path", code_path)
@@ -38,14 +38,11 @@ def get_pipelines() -> List["PipelineResponse"]:
38
38
 
39
39
  def get_pipeline(
40
40
  pipeline: str,
41
- version: Optional[str] = None,
42
41
  ) -> Optional["PipelineResponse"]:
43
42
  """(Deprecated) Fetches a pipeline model.
44
43
 
45
44
  Args:
46
45
  pipeline: The name of the pipeline.
47
- version: Optional pipeline version. Specifies the version of the
48
- pipeline to return. If not given, returns the latest version.
49
46
 
50
47
  Returns:
51
48
  The pipeline model.
@@ -55,4 +52,4 @@ def get_pipeline(
55
52
  "removed in a future release. Please use "
56
53
  "`zenml.client.Client().get_pipeline()` instead."
57
54
  )
58
- return Client().get_pipeline(name_id_or_prefix=pipeline, version=version)
55
+ return Client().get_pipeline(name_id_or_prefix=pipeline)
@@ -290,7 +290,8 @@ def get_resources_options_from_resource_model_for_full_stack(
290
290
  resource_ids=each.resource_ids,
291
291
  stack_component_type=StackComponentType.ARTIFACT_STORE,
292
292
  flavor="gcp",
293
- required_configuration={},
293
+ required_configuration={"path": "Path"},
294
+ use_resource_value_as_fixed_config=True,
294
295
  flavor_display_name="GCS Bucket",
295
296
  )
296
297
  )
@@ -350,7 +351,8 @@ def get_resources_options_from_resource_model_for_full_stack(
350
351
  resource_ids=each.resource_ids,
351
352
  stack_component_type=StackComponentType.ARTIFACT_STORE,
352
353
  flavor="azure",
353
- required_configuration={},
354
+ required_configuration={"path": "Path"},
355
+ use_resource_value_as_fixed_config=True,
354
356
  flavor_display_name="Blob container",
355
357
  )
356
358
  )
@@ -366,6 +368,20 @@ def get_resources_options_from_resource_model_for_full_stack(
366
368
  flavor_display_name="Skypilot (VM)",
367
369
  )
368
370
  )
371
+ orchestrators.append(
372
+ _prepare_resource_info(
373
+ connector_details=connector_details,
374
+ resource_ids=each.resource_ids,
375
+ stack_component_type=StackComponentType.ORCHESTRATOR,
376
+ flavor="azureml",
377
+ required_configuration={
378
+ "subscription_id": "subscription ID",
379
+ "resource_group": "resource group",
380
+ "workspace": "workspace",
381
+ },
382
+ flavor_display_name="AzureML",
383
+ )
384
+ )
369
385
 
370
386
  if each.resource_type == "kubernetes-cluster":
371
387
  orchestrators.append(
@@ -13,11 +13,14 @@
13
13
  # permissions and limitations under the License.
14
14
  """Functionality to deploy a ZenML stack to AWS."""
15
15
 
16
- from typing import ClassVar, Dict, List
16
+ from typing import ClassVar, Dict, List, Optional
17
17
 
18
18
  from zenml.enums import StackDeploymentProvider
19
19
  from zenml.models import StackDeploymentConfig
20
- from zenml.stack_deployments.stack_deployment import ZenMLCloudStackDeployment
20
+ from zenml.stack_deployments.stack_deployment import (
21
+ STACK_DEPLOYMENT_TERRAFORM,
22
+ ZenMLCloudStackDeployment,
23
+ )
21
24
  from zenml.utils.string_utils import random_str
22
25
 
23
26
  AWS_DEPLOYMENT_TYPE = "cloud-formation"
@@ -217,16 +220,18 @@ console.
217
220
  deploy the ZenML stack. The URL should include as many pre-filled
218
221
  URL query parameters as possible.
219
222
  * a textual description of the URL
223
+ * a Terraform script used to deploy the ZenML stack
220
224
  * some deployment providers may require additional configuration
221
- parameters to be passed to the cloud provider in addition to the
222
- deployment URL query parameters. Where that is the case, this method
225
+ parameters or scripts to be passed to the cloud provider in addition to
226
+ the deployment URL query parameters. Where that is the case, this method
223
227
  should also return a string that the user can copy and paste into the
224
228
  cloud provider console to deploy the ZenML stack (e.g. a set of
225
- environment variables, or YAML configuration snippet etc.).
229
+ environment variables, YAML configuration snippet, bash or Terraform
230
+ script etc.).
226
231
 
227
232
  Returns:
228
- The configuration to deploy the ZenML stack to the specified cloud
229
- provider.
233
+ The configuration or script to deploy the ZenML stack to the
234
+ specified cloud provider.
230
235
  """
231
236
  params = dict(
232
237
  stackName=self.stack_name,
@@ -247,8 +252,27 @@ console.
247
252
  f"{region}#/stacks/create/review?{query_params}"
248
253
  )
249
254
 
255
+ config: Optional[str] = None
256
+ if self.deployment_type == STACK_DEPLOYMENT_TERRAFORM:
257
+ config = f"""module "zenml_stack" {{
258
+ source = "zenml-io/zenml-stack/aws"
259
+
260
+ region = "{self.location or "eu-central-1"}"
261
+ zenml_server_url = "{self.zenml_server_url}"
262
+ zenml_api_key = ""
263
+ zenml_api_token = "{self.zenml_server_api_token}"
264
+ zenml_stack_name = "{self.stack_name}"
265
+ zenml_stack_deployment = "{self.deployment_type}"
266
+ }}
267
+ output "zenml_stack_id" {{
268
+ value = module.zenml_stack.zenml_stack_id
269
+ }}
270
+ output "zenml_stack_name" {{
271
+ value = module.zenml_stack.zenml_stack_name
272
+ }}"""
273
+
250
274
  return StackDeploymentConfig(
251
275
  deployment_url=url,
252
276
  deployment_url_text="AWS CloudFormation Console",
253
- configuration=None,
277
+ configuration=config,
254
278
  )