zenml-nightly 0.70.0.dev20241125__py3-none-any.whl → 0.71.0.dev20241220__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 (254) hide show
  1. README.md +4 -4
  2. RELEASE_NOTES.md +112 -0
  3. zenml/VERSION +1 -1
  4. zenml/artifact_stores/base_artifact_store.py +2 -2
  5. zenml/artifacts/artifact_config.py +15 -6
  6. zenml/artifacts/utils.py +59 -32
  7. zenml/cli/__init__.py +22 -4
  8. zenml/cli/base.py +5 -5
  9. zenml/cli/login.py +26 -0
  10. zenml/cli/pipeline.py +111 -62
  11. zenml/cli/server.py +20 -20
  12. zenml/cli/service_connectors.py +3 -3
  13. zenml/cli/stack.py +0 -3
  14. zenml/cli/stack_components.py +0 -1
  15. zenml/cli/utils.py +0 -5
  16. zenml/client.py +62 -20
  17. zenml/config/compiler.py +12 -3
  18. zenml/config/pipeline_configurations.py +20 -0
  19. zenml/config/pipeline_run_configuration.py +1 -0
  20. zenml/config/secret_reference_mixin.py +1 -1
  21. zenml/config/server_config.py +4 -0
  22. zenml/config/step_configurations.py +21 -0
  23. zenml/constants.py +10 -0
  24. zenml/enums.py +1 -0
  25. zenml/image_builders/base_image_builder.py +5 -2
  26. zenml/image_builders/build_context.py +7 -16
  27. zenml/image_builders/local_image_builder.py +13 -3
  28. zenml/integrations/__init__.py +1 -0
  29. zenml/integrations/aws/__init__.py +3 -0
  30. zenml/integrations/aws/flavors/__init__.py +6 -0
  31. zenml/integrations/aws/flavors/aws_image_builder_flavor.py +146 -0
  32. zenml/integrations/aws/image_builders/__init__.py +20 -0
  33. zenml/integrations/aws/image_builders/aws_image_builder.py +307 -0
  34. zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +14 -6
  35. zenml/integrations/constants.py +1 -0
  36. zenml/integrations/feast/__init__.py +1 -1
  37. zenml/integrations/feast/feature_stores/feast_feature_store.py +13 -9
  38. zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +1 -1
  39. zenml/integrations/kaniko/image_builders/kaniko_image_builder.py +2 -1
  40. zenml/integrations/kubernetes/flavors/kubernetes_orchestrator_flavor.py +11 -0
  41. zenml/integrations/kubernetes/orchestrators/kube_utils.py +46 -2
  42. zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py +13 -2
  43. zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint.py +3 -1
  44. zenml/integrations/kubernetes/orchestrators/manifest_utils.py +3 -2
  45. zenml/integrations/kubernetes/step_operators/kubernetes_step_operator.py +3 -2
  46. zenml/integrations/lightning/flavors/lightning_orchestrator_flavor.py +11 -0
  47. zenml/integrations/modal/__init__.py +46 -0
  48. zenml/integrations/modal/flavors/__init__.py +26 -0
  49. zenml/integrations/modal/flavors/modal_step_operator_flavor.py +125 -0
  50. zenml/integrations/modal/step_operators/__init__.py +22 -0
  51. zenml/integrations/modal/step_operators/modal_step_operator.py +242 -0
  52. zenml/integrations/neptune/experiment_trackers/neptune_experiment_tracker.py +7 -5
  53. zenml/integrations/neptune/experiment_trackers/run_state.py +69 -53
  54. zenml/integrations/registry.py +2 -2
  55. zenml/integrations/skypilot/flavors/skypilot_orchestrator_base_vm_config.py +12 -0
  56. zenml/integrations/wandb/flavors/wandb_experiment_tracker_flavor.py +13 -5
  57. zenml/io/filesystem.py +2 -2
  58. zenml/io/local_filesystem.py +3 -3
  59. zenml/materializers/built_in_materializer.py +18 -1
  60. zenml/materializers/structured_string_materializer.py +8 -3
  61. zenml/model/model.py +23 -101
  62. zenml/model/utils.py +21 -17
  63. zenml/models/__init__.py +6 -0
  64. zenml/models/v2/base/filter.py +26 -30
  65. zenml/models/v2/base/scoped.py +258 -5
  66. zenml/models/v2/core/artifact_version.py +21 -29
  67. zenml/models/v2/core/code_repository.py +1 -12
  68. zenml/models/v2/core/component.py +5 -68
  69. zenml/models/v2/core/flavor.py +1 -11
  70. zenml/models/v2/core/model.py +1 -57
  71. zenml/models/v2/core/model_version.py +11 -36
  72. zenml/models/v2/core/model_version_artifact.py +11 -3
  73. zenml/models/v2/core/model_version_pipeline_run.py +14 -3
  74. zenml/models/v2/core/pipeline.py +47 -55
  75. zenml/models/v2/core/pipeline_build.py +67 -12
  76. zenml/models/v2/core/pipeline_deployment.py +0 -10
  77. zenml/models/v2/core/pipeline_run.py +110 -32
  78. zenml/models/v2/core/run_metadata.py +30 -9
  79. zenml/models/v2/core/run_template.py +21 -29
  80. zenml/models/v2/core/schedule.py +0 -10
  81. zenml/models/v2/core/secret.py +0 -14
  82. zenml/models/v2/core/service.py +9 -16
  83. zenml/models/v2/core/service_connector.py +0 -11
  84. zenml/models/v2/core/stack.py +21 -30
  85. zenml/models/v2/core/step_run.py +24 -18
  86. zenml/models/v2/core/trigger.py +19 -3
  87. zenml/models/v2/misc/run_metadata.py +38 -0
  88. zenml/orchestrators/base_orchestrator.py +13 -1
  89. zenml/orchestrators/input_utils.py +19 -6
  90. zenml/orchestrators/output_utils.py +5 -1
  91. zenml/orchestrators/publish_utils.py +12 -5
  92. zenml/orchestrators/step_launcher.py +16 -16
  93. zenml/orchestrators/step_run_utils.py +18 -197
  94. zenml/orchestrators/step_runner.py +40 -3
  95. zenml/orchestrators/utils.py +79 -50
  96. zenml/pipelines/build_utils.py +12 -0
  97. zenml/pipelines/pipeline_decorator.py +4 -0
  98. zenml/pipelines/pipeline_definition.py +26 -8
  99. zenml/pipelines/run_utils.py +9 -5
  100. zenml/service_connectors/service_connector_utils.py +3 -9
  101. zenml/stack/stack_component.py +1 -1
  102. zenml/stack_deployments/aws_stack_deployment.py +22 -0
  103. zenml/steps/base_step.py +11 -1
  104. zenml/steps/entrypoint_function_utils.py +7 -3
  105. zenml/steps/step_decorator.py +4 -0
  106. zenml/steps/utils.py +23 -7
  107. zenml/types.py +4 -0
  108. zenml/utils/archivable.py +65 -36
  109. zenml/utils/code_utils.py +8 -4
  110. zenml/utils/docker_utils.py +9 -0
  111. zenml/utils/metadata_utils.py +186 -153
  112. zenml/utils/string_utils.py +41 -16
  113. zenml/utils/visualization_utils.py +4 -1
  114. zenml/zen_server/auth.py +9 -10
  115. zenml/zen_server/cloud_utils.py +3 -1
  116. zenml/zen_server/dashboard/assets/{404-NVXKFp-x.js → 404-Cqu3EDCm.js} +1 -1
  117. zenml/zen_server/dashboard/assets/{@reactflow-CK0KJUen.js → @reactflow-D2Y7BWwz.js} +1 -1
  118. zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-DezXKmDf.js → AlertDialogDropdownItem-BHd71pVS.js} +1 -1
  119. zenml/zen_server/dashboard/assets/{CodeSnippet-JzR8CEtw.js → CodeSnippet-DIonwetW.js} +1 -1
  120. zenml/zen_server/dashboard/assets/{CollapsibleCard-DQW_ktMO.js → CollapsibleCard-CDnC97pB.js} +1 -1
  121. zenml/zen_server/dashboard/assets/{Commands-DL2kwkRd.js → Commands-BVEXKAOj.js} +1 -1
  122. zenml/zen_server/dashboard/assets/{ComponentBadge-D_g62Wv8.js → ComponentBadge-CrRvovox.js} +1 -1
  123. zenml/zen_server/dashboard/assets/{CopyButton-LNcWaa14.js → CopyButton-B6wGAhQv.js} +1 -1
  124. zenml/zen_server/dashboard/assets/{CsvVizualization-DknpE5ej.js → CsvVizualization-CjcT7LMm.js} +5 -5
  125. zenml/zen_server/dashboard/assets/DeleteAlertDialog-D2ELtM2W.js +1 -0
  126. zenml/zen_server/dashboard/assets/{DialogItem-Bxf8FuAT.js → DialogItem-DXIMhBgU.js} +1 -1
  127. zenml/zen_server/dashboard/assets/{Error-DYflYyps.js → Error-B8uUfTpL.js} +1 -1
  128. zenml/zen_server/dashboard/assets/{ExecutionStatus-C7zyIQKZ.js → ExecutionStatus-ibAdY-dG.js} +1 -1
  129. zenml/zen_server/dashboard/assets/{Helpbox-oYSGpLqd.js → Helpbox-BfAfhKHw.js} +1 -1
  130. zenml/zen_server/dashboard/assets/{Infobox-Cx4xGoXR.js → Infobox-M_SMOu96.js} +1 -1
  131. zenml/zen_server/dashboard/assets/{InlineAvatar-DiGOWNKF.js → InlineAvatar-DBA0a0-a.js} +1 -1
  132. zenml/zen_server/dashboard/assets/{NestedCollapsible-DYbgyKxK.js → NestedCollapsible-DpgmEFKw.js} +1 -1
  133. zenml/zen_server/dashboard/assets/{Partials-03iZf8-N.js → Partials-D_ldD9if.js} +1 -1
  134. zenml/zen_server/dashboard/assets/{ProBadge-D_EB8HNo.js → ProBadge-DQbfFotM.js} +1 -1
  135. zenml/zen_server/dashboard/assets/{ProCta-DqNS4v3x.js → ProCta-Bcpb4rcY.js} +1 -1
  136. zenml/zen_server/dashboard/assets/{ProviderIcon-Bki2aw8w.js → ProviderIcon-BZpgPigN.js} +1 -1
  137. zenml/zen_server/dashboard/assets/{ProviderRadio-8f43sPD4.js → ProviderRadio-DWPnMuQ1.js} +1 -1
  138. zenml/zen_server/dashboard/assets/RunSelector-DgRGaAc6.js +1 -0
  139. zenml/zen_server/dashboard/assets/{RunsBody-07YEO7qI.js → RunsBody-KecfSkjY.js} +1 -1
  140. zenml/zen_server/dashboard/assets/{SearchField-lp1KgU4e.js → SearchField-n-ILHnaP.js} +1 -1
  141. zenml/zen_server/dashboard/assets/{SecretTooltip-CgnbyeOx.js → SecretTooltip-B8MrX5yu.js} +1 -1
  142. zenml/zen_server/dashboard/assets/{SetPassword-CpP418A2.js → SetPassword-B_IVq_wg.js} +1 -1
  143. zenml/zen_server/dashboard/assets/StackList-TWPBYnkF.js +1 -0
  144. zenml/zen_server/dashboard/assets/{Tabs-BktHkCJJ.js → Tabs-Rg857zmd.js} +1 -1
  145. zenml/zen_server/dashboard/assets/{Tick-BlMoIlJT.js → Tick-COg4A-xo.js} +1 -1
  146. zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-Sc0A0pP-.js → UpdatePasswordSchemas-C6Aj3hm6.js} +1 -1
  147. zenml/zen_server/dashboard/assets/{UsageReason-YYduL4fj.js → UsageReason-BTLbx7w4.js} +1 -1
  148. zenml/zen_server/dashboard/assets/{WizardFooter-dgmizSJC.js → WizardFooter-BCAj69Vj.js} +1 -1
  149. zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-D-c2G6lV.js → all-pipeline-runs-query-DMXkDrV2.js} +1 -1
  150. zenml/zen_server/dashboard/assets/code-snippets-CqONne41.js +13 -0
  151. zenml/zen_server/dashboard/assets/{create-stack-DM_JPgef.js → create-stack-HfdbhLs4.js} +1 -1
  152. zenml/zen_server/dashboard/assets/dates-3pMLCNrD.js +1 -0
  153. zenml/zen_server/dashboard/assets/delete-run-DZ4hIXff.js +1 -0
  154. zenml/zen_server/dashboard/assets/{form-schemas-K6FYKjwa.js → form-schemas-B0AVEd9b.js} +1 -1
  155. zenml/zen_server/dashboard/assets/{index-BAkC7FXi.js → index-DPqSWjug.js} +1 -1
  156. zenml/zen_server/dashboard/assets/{index-CEV4Cvaf.js → index-DScjfBRb.js} +1 -1
  157. zenml/zen_server/dashboard/assets/index-DXvT1_Um.css +1 -0
  158. zenml/zen_server/dashboard/assets/{index-CCOPpudF.js → index-FO-p0GU7.js} +5 -5
  159. zenml/zen_server/dashboard/assets/{index-B1mVPYxf.js → index-I3bKUGUj.js} +1 -1
  160. zenml/zen_server/dashboard/assets/key-icon-aH-QIa5R.js +1 -0
  161. zenml/zen_server/dashboard/assets/login-command-CkqxPtV3.js +1 -0
  162. zenml/zen_server/dashboard/assets/{login-mutation-hf-lK87O.js → login-mutation-BQeo4wTY.js} +1 -1
  163. zenml/zen_server/dashboard/assets/{not-found-BGirLjU-.js → not-found-gAJ5aDdR.js} +1 -1
  164. zenml/zen_server/dashboard/assets/page-9Y9-gig0.js +1 -0
  165. zenml/zen_server/dashboard/assets/{page-DjRJCGb3.js → page-AUwiQ14W.js} +1 -1
  166. zenml/zen_server/dashboard/assets/page-B6XU7yYT.js +2 -0
  167. zenml/zen_server/dashboard/assets/{page-C00YAkaB.js → page-BKZYc2Zv.js} +1 -1
  168. zenml/zen_server/dashboard/assets/{page-CdMWnQak.js → page-BU9FG4sR.js} +1 -1
  169. zenml/zen_server/dashboard/assets/{page-D7S3aCbF.js → page-B_Apk3xg.js} +1 -1
  170. zenml/zen_server/dashboard/assets/{page-Djikxq_S.js → page-BdowiCbr.js} +1 -1
  171. zenml/zen_server/dashboard/assets/page-Bg8OjTRe.js +1 -0
  172. zenml/zen_server/dashboard/assets/page-BxL4qD4_.js +1 -0
  173. zenml/zen_server/dashboard/assets/{page-DakHVWXF.js → page-CWxT5K5J.js} +1 -1
  174. zenml/zen_server/dashboard/assets/page-CXuQufSe.js +1 -0
  175. zenml/zen_server/dashboard/assets/{page-DLC-bNBP.js → page-CcQr8CPP.js} +1 -1
  176. zenml/zen_server/dashboard/assets/{page-CD-DcWoy.js → page-Ce4Hrjnr.js} +1 -1
  177. zenml/zen_server/dashboard/assets/page-CiYxgZP_.js +1 -0
  178. zenml/zen_server/dashboard/assets/page-Cldq1mpe.js +1 -0
  179. zenml/zen_server/dashboard/assets/{page-BDigxVpo.js → page-D4wdonLm.js} +1 -1
  180. zenml/zen_server/dashboard/assets/{page-D6uU2ax4.js → page-D8ObrbH8.js} +1 -1
  181. zenml/zen_server/dashboard/assets/{page-DXSTpqRD.js → page-DFuAUGt4.js} +1 -1
  182. zenml/zen_server/dashboard/assets/{page-CbpvrsDL.js → page-DGazBpuP.js} +1 -1
  183. zenml/zen_server/dashboard/assets/{page-COXXJj1k.js → page-DO1UcqPX.js} +1 -1
  184. zenml/zen_server/dashboard/assets/page-DRYXdL5o.js +1 -0
  185. zenml/zen_server/dashboard/assets/{page-Df-Fw0aq.js → page-DYEquBC2.js} +1 -1
  186. zenml/zen_server/dashboard/assets/page-Dk32IeZm.js +1 -0
  187. zenml/zen_server/dashboard/assets/{page-yYC9OI-E.js → page-I3nKFGie.js} +1 -1
  188. zenml/zen_server/dashboard/assets/{page-6m6yHHlE.js → page-M0w-n6vn.js} +1 -1
  189. zenml/zen_server/dashboard/assets/{page-Vcxara9U.js → page-R5dx3xGF.js} +1 -1
  190. zenml/zen_server/dashboard/assets/{page-BR68V0V1.js → page-bT5pOvcB.js} +1 -1
  191. zenml/zen_server/dashboard/assets/page-hUqK889I.js +6 -0
  192. zenml/zen_server/dashboard/assets/{page-CjGdWY13.js → page-h_Stveon.js} +1 -1
  193. zenml/zen_server/dashboard/assets/{page-D01JhjQB.js → page-r8XK5vR7.js} +1 -1
  194. zenml/zen_server/dashboard/assets/page-u_-ZXBKb.js +1 -0
  195. zenml/zen_server/dashboard/assets/page-zaMqB_ao.js +1 -0
  196. zenml/zen_server/dashboard/assets/{persist-GjC8PZoC.js → persist-AppN1B0J.js} +1 -1
  197. zenml/zen_server/dashboard/assets/{persist-Coz7ZWvz.js → persist-DAUi_3za.js} +1 -1
  198. zenml/zen_server/dashboard/assets/service-BqqeXLEe.js +2 -0
  199. zenml/zen_server/dashboard/assets/{sharedSchema-CQb14VSr.js → sharedSchema-uXN9FLLk.js} +1 -1
  200. zenml/zen_server/dashboard/assets/{stack-detail-query-OPEW-cDJ.js → stack-detail-query-XfZBiBP2.js} +1 -1
  201. zenml/zen_server/dashboard/assets/{update-server-settings-mutation-LwuQfHYn.js → update-server-settings-mutation-BWmgVJwA.js} +1 -1
  202. zenml/zen_server/dashboard/assets/{url-CkvKAnwF.js → url-BLwMbzES.js} +1 -1
  203. zenml/zen_server/dashboard/index.html +4 -4
  204. zenml/zen_server/deploy/helm/Chart.yaml +1 -1
  205. zenml/zen_server/deploy/helm/README.md +2 -2
  206. zenml/zen_server/rbac/endpoint_utils.py +6 -4
  207. zenml/zen_server/rbac/models.py +3 -2
  208. zenml/zen_server/rbac/rbac_sql_zen_store.py +173 -0
  209. zenml/zen_server/rbac/utils.py +4 -7
  210. zenml/zen_server/routers/auth_endpoints.py +22 -11
  211. zenml/zen_server/routers/steps_endpoints.py +7 -1
  212. zenml/zen_server/routers/users_endpoints.py +35 -37
  213. zenml/zen_server/routers/workspaces_endpoints.py +44 -55
  214. zenml/zen_server/template_execution/utils.py +4 -1
  215. zenml/zen_server/utils.py +4 -3
  216. zenml/zen_stores/base_zen_store.py +10 -2
  217. zenml/zen_stores/migrations/versions/0.71.0_release.py +23 -0
  218. zenml/zen_stores/migrations/versions/26351d482b9e_add_step_run_unique_constraint.py +37 -0
  219. zenml/zen_stores/migrations/versions/a1237ba94fd8_add_model_version_producer_run_unique_.py +68 -0
  220. zenml/zen_stores/migrations/versions/b73bc71f1106_remove_component_spec_path.py +36 -0
  221. zenml/zen_stores/migrations/versions/cc269488e5a9_separate_run_metadata.py +135 -0
  222. zenml/zen_stores/migrations/versions/ec6307720f92_simplify_model_version_links.py +7 -6
  223. zenml/zen_stores/rest_zen_store.py +76 -43
  224. zenml/zen_stores/schemas/__init__.py +5 -1
  225. zenml/zen_stores/schemas/artifact_schemas.py +12 -11
  226. zenml/zen_stores/schemas/component_schemas.py +0 -3
  227. zenml/zen_stores/schemas/model_schemas.py +55 -17
  228. zenml/zen_stores/schemas/pipeline_deployment_schemas.py +7 -7
  229. zenml/zen_stores/schemas/pipeline_run_schemas.py +52 -18
  230. zenml/zen_stores/schemas/pipeline_schemas.py +5 -0
  231. zenml/zen_stores/schemas/run_metadata_schemas.py +66 -31
  232. zenml/zen_stores/schemas/step_run_schemas.py +40 -13
  233. zenml/zen_stores/schemas/utils.py +47 -3
  234. zenml/zen_stores/sql_zen_store.py +462 -134
  235. {zenml_nightly-0.70.0.dev20241125.dist-info → zenml_nightly-0.71.0.dev20241220.dist-info}/METADATA +5 -5
  236. {zenml_nightly-0.70.0.dev20241125.dist-info → zenml_nightly-0.71.0.dev20241220.dist-info}/RECORD +239 -217
  237. zenml/utils/cloud_utils.py +0 -40
  238. zenml/zen_server/dashboard/assets/RunSelector-DkPiIiNr.js +0 -1
  239. zenml/zen_server/dashboard/assets/StackList-WvuKQusZ.js +0 -1
  240. zenml/zen_server/dashboard/assets/delete-run-CJdh1P_h.js +0 -1
  241. zenml/zen_server/dashboard/assets/index-DlGvJQPn.css +0 -1
  242. zenml/zen_server/dashboard/assets/page-0JE_-Ec1.js +0 -1
  243. zenml/zen_server/dashboard/assets/page-BRLpxOt0.js +0 -1
  244. zenml/zen_server/dashboard/assets/page-BU7huvKw.js +0 -6
  245. zenml/zen_server/dashboard/assets/page-BvqLv2Ky.js +0 -1
  246. zenml/zen_server/dashboard/assets/page-CwxrFarU.js +0 -1
  247. zenml/zen_server/dashboard/assets/page-DfbXf_8s.js +0 -1
  248. zenml/zen_server/dashboard/assets/page-Dnovpa0i.js +0 -3
  249. zenml/zen_server/dashboard/assets/page-Dot3LPmL.js +0 -1
  250. zenml/zen_server/dashboard/assets/page-Xynx4btY.js +0 -14
  251. zenml/zen_server/dashboard/assets/page-YpKAqVSa.js +0 -1
  252. {zenml_nightly-0.70.0.dev20241125.dist-info → zenml_nightly-0.71.0.dev20241220.dist-info}/LICENSE +0 -0
  253. {zenml_nightly-0.70.0.dev20241125.dist-info → zenml_nightly-0.71.0.dev20241220.dist-info}/WHEEL +0 -0
  254. {zenml_nightly-0.70.0.dev20241125.dist-info → zenml_nightly-0.71.0.dev20241220.dist-info}/entry_points.txt +0 -0
zenml/cli/pipeline.py CHANGED
@@ -40,6 +40,35 @@ from zenml.utils.yaml_utils import write_yaml
40
40
  logger = get_logger(__name__)
41
41
 
42
42
 
43
+ def _import_pipeline(source: str) -> Pipeline:
44
+ """Import a pipeline.
45
+
46
+ Args:
47
+ source: The pipeline source.
48
+
49
+ Returns:
50
+ The pipeline.
51
+ """
52
+ try:
53
+ pipeline_instance = source_utils.load(source)
54
+ except ModuleNotFoundError as e:
55
+ source_root = source_utils.get_source_root()
56
+ cli_utils.error(
57
+ f"Unable to import module `{e.name}`. Make sure the source path is "
58
+ f"relative to your source root `{source_root}`."
59
+ )
60
+ except AttributeError as e:
61
+ cli_utils.error("Unable to load attribute from module: " + str(e))
62
+
63
+ if not isinstance(pipeline_instance, Pipeline):
64
+ cli_utils.error(
65
+ f"The given source path `{source}` does not resolve to a pipeline "
66
+ "object."
67
+ )
68
+
69
+ return pipeline_instance
70
+
71
+
43
72
  @cli.group(cls=TagGroup, tag=CliCategories.MANAGEMENT_TOOLS)
44
73
  def pipeline() -> None:
45
74
  """Interact with pipelines, runs and schedules."""
@@ -85,22 +114,7 @@ def register_pipeline(
85
114
  "source code root."
86
115
  )
87
116
 
88
- try:
89
- pipeline_instance = source_utils.load(source)
90
- except ModuleNotFoundError as e:
91
- source_root = source_utils.get_source_root()
92
- cli_utils.error(
93
- f"Unable to import module `{e.name}`. Make sure the source path is "
94
- f"relative to your source root `{source_root}`."
95
- )
96
- except AttributeError as e:
97
- cli_utils.error("Unable to load attribute from module: " + str(e))
98
-
99
- if not isinstance(pipeline_instance, Pipeline):
100
- cli_utils.error(
101
- f"The given source path `{source}` does not resolve to a pipeline "
102
- "object."
103
- )
117
+ pipeline_instance = _import_pipeline(source=source)
104
118
 
105
119
  parameters: Dict[str, Any] = {}
106
120
  if parameters_path:
@@ -176,24 +190,9 @@ def build_pipeline(
176
190
  "your source code root."
177
191
  )
178
192
 
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
- )
195
-
196
193
  with cli_utils.temporary_active_stack(stack_name_or_id=stack_name_or_id):
194
+ pipeline_instance = _import_pipeline(source=source)
195
+
197
196
  pipeline_instance = pipeline_instance.with_options(
198
197
  config_path=config_path
199
198
  )
@@ -277,36 +276,21 @@ def run_pipeline(
277
276
  "your source code root."
278
277
  )
279
278
 
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
- )
296
-
297
- build: Union[str, PipelineBuildBase, None] = None
298
- if build_path_or_id:
299
- if uuid_utils.is_valid_uuid(build_path_or_id):
300
- build = build_path_or_id
301
- elif os.path.exists(build_path_or_id):
302
- build = PipelineBuildBase.from_yaml(build_path_or_id)
303
- else:
304
- cli_utils.error(
305
- f"The specified build {build_path_or_id} is not a valid UUID "
306
- "or file path."
307
- )
308
-
309
279
  with cli_utils.temporary_active_stack(stack_name_or_id=stack_name_or_id):
280
+ pipeline_instance = _import_pipeline(source=source)
281
+
282
+ build: Union[str, PipelineBuildBase, None] = None
283
+ if build_path_or_id:
284
+ if uuid_utils.is_valid_uuid(build_path_or_id):
285
+ build = build_path_or_id
286
+ elif os.path.exists(build_path_or_id):
287
+ build = PipelineBuildBase.from_yaml(build_path_or_id)
288
+ else:
289
+ cli_utils.error(
290
+ f"The specified build {build_path_or_id} is not a valid UUID "
291
+ "or file path."
292
+ )
293
+
310
294
  pipeline_instance = pipeline_instance.with_options(
311
295
  config_path=config_path,
312
296
  build=build,
@@ -315,6 +299,71 @@ def run_pipeline(
315
299
  pipeline_instance()
316
300
 
317
301
 
302
+ @pipeline.command(
303
+ "create-run-template",
304
+ help="Create a run template for a pipeline. The SOURCE argument needs to "
305
+ "be an importable source path resolving to a ZenML pipeline instance, e.g. "
306
+ "`my_module.my_pipeline_instance`.",
307
+ )
308
+ @click.argument("source")
309
+ @click.option(
310
+ "--name",
311
+ "-n",
312
+ type=str,
313
+ required=True,
314
+ help="Name for the template",
315
+ )
316
+ @click.option(
317
+ "--config",
318
+ "-c",
319
+ "config_path",
320
+ type=click.Path(exists=True, dir_okay=False),
321
+ required=False,
322
+ help="Path to configuration file for the build.",
323
+ )
324
+ @click.option(
325
+ "--stack",
326
+ "-s",
327
+ "stack_name_or_id",
328
+ type=str,
329
+ required=False,
330
+ help="Name or ID of the stack to use for the build.",
331
+ )
332
+ def create_run_template(
333
+ source: str,
334
+ name: str,
335
+ config_path: Optional[str] = None,
336
+ stack_name_or_id: Optional[str] = None,
337
+ ) -> None:
338
+ """Create a run template for a pipeline.
339
+
340
+ Args:
341
+ source: Importable source resolving to a pipeline instance.
342
+ name: Name of the run template.
343
+ config_path: Path to pipeline configuration file.
344
+ stack_name_or_id: Name or ID of the stack for which the template should
345
+ be created.
346
+ """
347
+ if not Client().root:
348
+ cli_utils.warning(
349
+ "You're running the `zenml pipeline create-run-template` command "
350
+ "without a ZenML repository. Your current working directory will "
351
+ "be used as the source root relative to which the registered step "
352
+ "classes will be resolved. To silence this warning, run `zenml "
353
+ "init` at your source code root."
354
+ )
355
+
356
+ with cli_utils.temporary_active_stack(stack_name_or_id=stack_name_or_id):
357
+ pipeline_instance = _import_pipeline(source=source)
358
+
359
+ pipeline_instance = pipeline_instance.with_options(
360
+ config_path=config_path
361
+ )
362
+ template = pipeline_instance.create_run_template(name=name)
363
+
364
+ cli_utils.declare(f"Created run template `{template.id}`.")
365
+
366
+
318
367
  @pipeline.command("list", help="List all registered pipelines.")
319
368
  @list_options(PipelineFilter)
320
369
  def list_pipelines(**kwargs: Any) -> None:
zenml/cli/server.py CHANGED
@@ -469,7 +469,7 @@ def logs(
469
469
  if server is None:
470
470
  cli_utils.error(
471
471
  "The local ZenML dashboard is not running. Please call `zenml "
472
- "up` first to start the ZenML dashboard locally."
472
+ "login --local` first to start the ZenML dashboard locally."
473
473
  )
474
474
 
475
475
  from zenml.zen_server.deploy.deployer import LocalServerDeployer
@@ -587,25 +587,6 @@ def server_list(verbose: bool = False, all: bool = False) -> None:
587
587
  accessible_pro_servers = client.tenant.list(member_only=not all)
588
588
  except AuthorizationException as e:
589
589
  cli_utils.warning(f"ZenML Pro authorization error: {e}")
590
- else:
591
- if not all:
592
- accessible_pro_servers = [
593
- s
594
- for s in accessible_pro_servers
595
- if s.status == TenantStatus.AVAILABLE
596
- ]
597
-
598
- if not accessible_pro_servers:
599
- cli_utils.declare(
600
- "No ZenML Pro servers that are accessible to the current "
601
- "user could be found."
602
- )
603
- if not all:
604
- cli_utils.declare(
605
- "Hint: use the `--all` flag to show all ZenML servers, "
606
- "including those that the client is not currently "
607
- "authorized to access or are not running."
608
- )
609
590
 
610
591
  # We update the list of stored ZenML Pro servers with the ones that the
611
592
  # client is a member of
@@ -633,6 +614,25 @@ def server_list(verbose: bool = False, all: bool = False) -> None:
633
614
  stored_server.update_server_info(accessible_server)
634
615
  pro_servers.append(stored_server)
635
616
 
617
+ if not all:
618
+ accessible_pro_servers = [
619
+ s
620
+ for s in accessible_pro_servers
621
+ if s.status == TenantStatus.AVAILABLE
622
+ ]
623
+
624
+ if not accessible_pro_servers:
625
+ cli_utils.declare(
626
+ "No ZenML Pro servers that are accessible to the current "
627
+ "user could be found."
628
+ )
629
+ if not all:
630
+ cli_utils.declare(
631
+ "Hint: use the `--all` flag to show all ZenML servers, "
632
+ "including those that the client is not currently "
633
+ "authorized to access or are not running."
634
+ )
635
+
636
636
  elif pro_servers:
637
637
  cli_utils.warning(
638
638
  "The ZenML Pro authentication has expired. Please re-login "
@@ -1194,9 +1194,9 @@ to provide access to:
1194
1194
  use from an STS token to an AWS secret key. This involves updating some config
1195
1195
  values and deleting others:
1196
1196
 
1197
- $ zenml service-connector update aws-auto-multi \\
1198
- --aws-access-key-id=<aws-key-id> \\
1199
- --aws_secret_access_key=<aws-secret-key> \\
1197
+ $ zenml service-connector update aws-auto-multi \\
1198
+ --aws_access_key_id=<aws-key-id> \\
1199
+ --aws_secret_access_key=<aws-secret-key> \\
1200
1200
  --remove-attr aws-sts-token
1201
1201
 
1202
1202
  - update the foo label to a new value and delete the baz label from a connector:
zenml/cli/stack.py CHANGED
@@ -1129,14 +1129,12 @@ def export_stack(
1129
1129
  def _import_stack_component(
1130
1130
  component_type: StackComponentType,
1131
1131
  component_dict: Dict[str, Any],
1132
- component_spec_path: Optional[str] = None,
1133
1132
  ) -> UUID:
1134
1133
  """Import a single stack component with given type/config.
1135
1134
 
1136
1135
  Args:
1137
1136
  component_type: The type of component to import.
1138
1137
  component_dict: Dict representation of the component to import.
1139
- component_spec_path: Path to the component spec file.
1140
1138
 
1141
1139
  Returns:
1142
1140
  The ID of the imported component.
@@ -1172,7 +1170,6 @@ def _import_stack_component(
1172
1170
  component_type=component_type,
1173
1171
  flavor=flavor,
1174
1172
  configuration=config,
1175
- component_spec_path=component_spec_path,
1176
1173
  )
1177
1174
  return component.id
1178
1175
 
@@ -573,7 +573,6 @@ def generate_stack_component_copy_command(
573
573
  component_type=component_to_copy.type,
574
574
  configuration=component_to_copy.configuration,
575
575
  labels=component_to_copy.labels,
576
- component_spec_path=component_to_copy.component_spec_path,
577
576
  )
578
577
  print_model_url(get_component_url(copied_component))
579
578
 
zenml/cli/utils.py CHANGED
@@ -711,11 +711,6 @@ def print_stack_component_configuration(
711
711
 
712
712
  console.print(rich_table)
713
713
 
714
- if component.component_spec_path:
715
- declare(
716
- f"Component spec path for `mlstacks`: {component.component_spec_path}"
717
- )
718
-
719
714
 
720
715
  def expand_argument_value_from_file(name: str, value: str) -> str:
721
716
  """Expands the value of an argument pointing to a file into the contents of that file.