zenml-nightly 0.66.0.dev20240927__py3-none-any.whl → 0.68.1.dev20241102__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 (597) hide show
  1. README.md +18 -12
  2. RELEASE_NOTES.md +236 -0
  3. zenml/VERSION +1 -1
  4. zenml/__init__.py +5 -10
  5. zenml/analytics/context.py +16 -1
  6. zenml/analytics/enums.py +0 -13
  7. zenml/analytics/utils.py +18 -7
  8. zenml/artifact_stores/base_artifact_store.py +11 -0
  9. zenml/artifacts/artifact_config.py +19 -65
  10. zenml/artifacts/external_artifact.py +7 -53
  11. zenml/artifacts/external_artifact_config.py +21 -40
  12. zenml/artifacts/load_directory_materializer.py +91 -0
  13. zenml/artifacts/utils.py +204 -145
  14. zenml/cli/__init__.py +62 -127
  15. zenml/cli/base.py +8 -8
  16. zenml/cli/integration.py +0 -9
  17. zenml/cli/login.py +951 -0
  18. zenml/cli/pipeline.py +1 -1
  19. zenml/cli/served_model.py +8 -1
  20. zenml/cli/server.py +462 -577
  21. zenml/cli/service_accounts.py +4 -4
  22. zenml/cli/stack.py +78 -569
  23. zenml/cli/stack_components.py +5 -594
  24. zenml/cli/user_management.py +0 -12
  25. zenml/cli/utils.py +24 -142
  26. zenml/client.py +57 -40
  27. zenml/client_lazy_loader.py +29 -12
  28. zenml/config/compiler.py +7 -11
  29. zenml/config/global_config.py +9 -0
  30. zenml/config/pipeline_configurations.py +2 -1
  31. zenml/config/pipeline_run_configuration.py +2 -1
  32. zenml/config/server_config.py +7 -5
  33. zenml/config/step_configurations.py +2 -0
  34. zenml/constants.py +6 -42
  35. zenml/enums.py +1 -4
  36. zenml/environment.py +1 -315
  37. zenml/exceptions.py +12 -41
  38. zenml/hooks/hook_validators.py +1 -8
  39. zenml/integrations/airflow/orchestrators/airflow_orchestrator.py +2 -3
  40. zenml/integrations/argilla/__init__.py +1 -1
  41. zenml/integrations/argilla/annotators/argilla_annotator.py +234 -89
  42. zenml/integrations/argilla/flavors/argilla_annotator_flavor.py +10 -5
  43. zenml/integrations/aws/flavors/sagemaker_orchestrator_flavor.py +9 -5
  44. zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +15 -2
  45. zenml/integrations/aws/service_connectors/aws_service_connector.py +6 -0
  46. zenml/integrations/azure/__init__.py +6 -2
  47. zenml/integrations/azure/flavors/azureml_orchestrator_flavor.py +5 -4
  48. zenml/integrations/azure/orchestrators/azureml_orchestrator.py +1 -1
  49. zenml/integrations/bentoml/model_deployers/bentoml_model_deployer.py +85 -19
  50. zenml/integrations/bentoml/services/__init__.py +15 -4
  51. zenml/integrations/bentoml/services/bentoml_container_deployment.py +399 -0
  52. zenml/integrations/bentoml/services/{bentoml_deployment.py → bentoml_local_deployment.py} +81 -40
  53. zenml/{steps/base_parameters.py → integrations/bentoml/services/deployment_type.py} +8 -5
  54. zenml/integrations/bentoml/steps/bento_builder.py +1 -0
  55. zenml/integrations/bentoml/steps/bentoml_deployer.py +93 -41
  56. zenml/integrations/github/code_repositories/github_code_repository.py +1 -1
  57. zenml/integrations/gitlab/code_repositories/gitlab_code_repository.py +6 -1
  58. zenml/integrations/huggingface/__init__.py +1 -6
  59. zenml/integrations/kaniko/image_builders/kaniko_image_builder.py +3 -3
  60. zenml/integrations/lightning/orchestrators/lightning_orchestrator.py +3 -3
  61. zenml/integrations/lightning/orchestrators/lightning_orchestrator_entrypoint.py +2 -2
  62. zenml/integrations/mlflow/experiment_trackers/mlflow_experiment_tracker.py +6 -3
  63. zenml/integrations/mlflow/model_registries/mlflow_model_registry.py +6 -0
  64. zenml/integrations/mlflow/services/mlflow_deployment.py +2 -2
  65. zenml/integrations/mlflow/steps/mlflow_deployer.py +1 -1
  66. zenml/integrations/mlflow/steps/mlflow_registry.py +1 -1
  67. zenml/integrations/neptune/experiment_trackers/run_state.py +2 -2
  68. zenml/integrations/pytorch/materializers/base_pytorch_materializer.py +8 -2
  69. zenml/integrations/pytorch/materializers/pytorch_module_materializer.py +4 -1
  70. zenml/integrations/s3/artifact_stores/s3_artifact_store.py +98 -0
  71. zenml/integrations/s3/flavors/s3_artifact_store_flavor.py +14 -0
  72. zenml/integrations/s3/utils.py +40 -0
  73. zenml/integrations/tensorflow/__init__.py +0 -9
  74. zenml/logging/step_logging.py +13 -15
  75. zenml/{new/pipelines → login}/__init__.py +4 -1
  76. zenml/login/credentials.py +346 -0
  77. zenml/login/credentials_store.py +603 -0
  78. zenml/{new → login/pro}/__init__.py +4 -1
  79. zenml/login/pro/client.py +496 -0
  80. zenml/login/pro/constants.py +34 -0
  81. zenml/{lineage_graph/edge.py → login/pro/models.py} +9 -8
  82. zenml/{zen_server/deploy/terraform/providers → login/pro/organization}/__init__.py +2 -2
  83. zenml/login/pro/organization/client.py +79 -0
  84. zenml/{lineage_graph/node/base_node.py → login/pro/organization/models.py} +13 -12
  85. zenml/{new/steps → login/pro/tenant}/__init__.py +2 -1
  86. zenml/login/pro/tenant/client.py +92 -0
  87. zenml/login/pro/tenant/models.py +174 -0
  88. zenml/login/pro/utils.py +121 -0
  89. zenml/{cli → login}/web_login.py +64 -28
  90. zenml/materializers/__init__.py +2 -0
  91. zenml/materializers/base_materializer.py +43 -9
  92. zenml/materializers/built_in_materializer.py +1 -1
  93. zenml/materializers/uuid_materializer.py +79 -0
  94. zenml/metadata/lazy_load.py +10 -7
  95. zenml/metadata/metadata_types.py +49 -0
  96. zenml/model/lazy_load.py +85 -4
  97. zenml/model/model.py +61 -83
  98. zenml/model/utils.py +47 -118
  99. zenml/models/__init__.py +6 -0
  100. zenml/models/v2/base/base.py +12 -8
  101. zenml/models/v2/base/filter.py +9 -0
  102. zenml/models/v2/core/artifact_version.py +53 -25
  103. zenml/models/v2/core/component.py +54 -19
  104. zenml/models/v2/core/flavor.py +13 -13
  105. zenml/models/v2/core/model.py +4 -1
  106. zenml/models/v2/core/model_version.py +4 -6
  107. zenml/models/v2/core/model_version_artifact.py +3 -1
  108. zenml/models/v2/core/model_version_pipeline_run.py +3 -1
  109. zenml/models/v2/core/pipeline.py +3 -1
  110. zenml/models/v2/core/pipeline_run.py +24 -3
  111. zenml/models/v2/core/run_metadata.py +2 -2
  112. zenml/models/v2/core/run_template.py +3 -1
  113. zenml/models/v2/core/stack.py +7 -3
  114. zenml/models/v2/core/step_run.py +58 -14
  115. zenml/models/v2/misc/auth_models.py +11 -2
  116. zenml/models/v2/misc/server_models.py +2 -4
  117. zenml/orchestrators/base_orchestrator.py +41 -4
  118. zenml/orchestrators/input_utils.py +52 -36
  119. zenml/orchestrators/step_launcher.py +50 -171
  120. zenml/orchestrators/step_run_utils.py +574 -0
  121. zenml/orchestrators/step_runner.py +83 -120
  122. zenml/orchestrators/utils.py +46 -180
  123. zenml/pipelines/__init__.py +3 -16
  124. zenml/{new/pipelines → pipelines}/pipeline_context.py +3 -18
  125. zenml/pipelines/pipeline_decorator.py +34 -60
  126. zenml/{new/pipelines/pipeline.py → pipelines/pipeline_definition.py} +210 -207
  127. zenml/{new/pipelines → pipelines}/run_utils.py +11 -10
  128. zenml/services/local/local_daemon_entrypoint.py +4 -4
  129. zenml/services/service.py +2 -2
  130. zenml/stack/stack.py +3 -108
  131. zenml/stack/stack_component.py +2 -78
  132. zenml/stack/utils.py +26 -14
  133. zenml/stack_deployments/aws_stack_deployment.py +3 -0
  134. zenml/step_operators/step_operator_entrypoint_configuration.py +1 -1
  135. zenml/steps/__init__.py +3 -9
  136. zenml/steps/base_step.py +25 -267
  137. zenml/steps/entrypoint_function_utils.py +2 -80
  138. zenml/{new/steps → steps}/step_context.py +12 -66
  139. zenml/steps/step_decorator.py +42 -89
  140. zenml/steps/step_invocation.py +16 -60
  141. zenml/steps/utils.py +4 -23
  142. zenml/utils/dashboard_utils.py +16 -51
  143. zenml/utils/materializer_utils.py +1 -1
  144. zenml/utils/requirements_utils.py +71 -0
  145. zenml/utils/singleton.py +15 -3
  146. zenml/utils/source_utils.py +39 -2
  147. zenml/utils/typing_utils.py +8 -28
  148. zenml/utils/visualization_utils.py +1 -1
  149. zenml/zen_server/auth.py +44 -39
  150. zenml/zen_server/dashboard/assets/{404-Y50hSt65.js → 404-DT4QRUqN.js} +1 -1
  151. zenml/zen_server/dashboard/assets/@radix-DP6vWzyx.js +85 -0
  152. zenml/zen_server/dashboard/assets/@react-router-BMhZulnd.js +29 -0
  153. zenml/zen_server/dashboard/assets/@reactflow-8U9qNlMR.js +17 -0
  154. zenml/zen_server/dashboard/assets/@tanstack-BUCbhJyH.js +22 -0
  155. zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-xLR9a1iw.js → AlertDialogDropdownItem-C6N2rGrB.js} +1 -1
  156. zenml/zen_server/dashboard/assets/{CodeSnippet-IxXNxUDa.js → CodeSnippet-CqybNv0k.js} +1 -1
  157. zenml/zen_server/dashboard/assets/{CollapsibleCard-BhutZbBL.js → CollapsibleCard-0r_8G2Lj.js} +1 -1
  158. zenml/zen_server/dashboard/assets/{Commands-Bf-rd1z8.js → Commands-BDjgBQKi.js} +1 -1
  159. zenml/zen_server/dashboard/assets/ComponentBadge-DUiEYJHu.js +1 -0
  160. zenml/zen_server/dashboard/assets/ComponentFallbackDialog-BFoH5K4V.js +1 -0
  161. zenml/zen_server/dashboard/assets/ComponentIcon-CAIoUis2.js +1 -0
  162. zenml/zen_server/dashboard/assets/{CopyButton-DcFHidFJ.js → CopyButton-C745BrKi.js} +1 -1
  163. zenml/zen_server/dashboard/assets/{CsvVizualization-QSbjrfxw.js → CsvVizualization-PpAq0CeZ.js} +5 -5
  164. zenml/zen_server/dashboard/assets/{DialogItem-Cd3HqST4.js → DialogItem-DcVCZEew.js} +1 -1
  165. zenml/zen_server/dashboard/assets/{DisplayDate-DkCy54Bp.js → DisplayDate-BeXgUG_C.js} +1 -1
  166. zenml/zen_server/dashboard/assets/{EmptyState-Cs3DEmso.js → EmptyState-DeK7H4pr.js} +1 -1
  167. zenml/zen_server/dashboard/assets/{Error-BhwdmqK7.js → Error-BMlzibXj.js} +1 -1
  168. zenml/zen_server/dashboard/assets/{Helpbox-0pBpTwTm.js → Helpbox-BLf40fLV.js} +1 -1
  169. zenml/zen_server/dashboard/assets/{Infobox-BTK_EUKT.js → Infobox-BwisKifi.js} +1 -1
  170. zenml/zen_server/dashboard/assets/{InlineAvatar-CA3DFMcM.js → InlineAvatar-jEgodSgX.js} +1 -1
  171. zenml/zen_server/dashboard/assets/{Lock-CmIn0szs.js → Lock-3lLt1ih0.js} +1 -1
  172. zenml/zen_server/dashboard/assets/MarkdownVisualization-8O9kTr-2.js +14 -0
  173. zenml/zen_server/dashboard/assets/{NumberBox-CrN0_kqI.js → NumberBox-T9eELfLZ.js} +1 -1
  174. zenml/zen_server/dashboard/assets/{Partials-QLOZw624.js → Partials-YPBB3V4q.js} +1 -1
  175. zenml/zen_server/dashboard/assets/{PasswordChecker-DE71J_3F.js → PasswordChecker-CW0kqY0W.js} +1 -1
  176. zenml/zen_server/dashboard/assets/{ProviderIcon-C16CCIN4.js → ProviderIcon-Bb3Xha5A.js} +1 -1
  177. zenml/zen_server/dashboard/assets/{ProviderRadio-D3FuCHf3.js → ProviderRadio-BROY1700.js} +1 -1
  178. zenml/zen_server/dashboard/assets/RunSelector-DCiL3M1c.js +1 -0
  179. zenml/zen_server/dashboard/assets/SearchField-DfUiGFVd.js +1 -0
  180. zenml/zen_server/dashboard/assets/{SecretTooltip-BaMwHF-Q.js → SecretTooltip-C_qByGWB.js} +1 -1
  181. zenml/zen_server/dashboard/assets/{SetPassword-DuIC65H9.js → SetPassword-7pRB00El.js} +1 -1
  182. zenml/zen_server/dashboard/assets/{Tick-DJTCF0Re.js → Tick-CykQFPj2.js} +1 -1
  183. zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-CUm-DMpw.js → UpdatePasswordSchemas-DckMEkFf.js} +1 -1
  184. zenml/zen_server/dashboard/assets/{UsageReason-CKw0juLF.js → UsageReason-DVceN14P.js} +1 -1
  185. zenml/zen_server/dashboard/assets/{WizardFooter-Cv9ApYWU.js → WizardFooter-CW0Cvd70.js} +1 -1
  186. zenml/zen_server/dashboard/assets/{check-circle-DOoS4yhF.js → check-circle-Dwxliy1Z.js} +1 -1
  187. zenml/zen_server/dashboard/assets/{chevron-down-Cwb-W_B_.js → chevron-down-8wLBS5pQ.js} +1 -1
  188. zenml/zen_server/dashboard/assets/{chevron-right-double-c9H46Kl8.js → chevron-right-double-DoD8iXWM.js} +1 -1
  189. zenml/zen_server/dashboard/assets/{cloud-only-BB4BVa6E.js → cloud-only-B-s_HMDm.js} +1 -1
  190. zenml/zen_server/dashboard/assets/{code-browser-BJYErIjr.js → code-browser-CZUQs3Wa.js} +1 -1
  191. zenml/zen_server/dashboard/assets/{copy-CaGlDsUy.js → copy-CaSMXwiU.js} +1 -1
  192. zenml/zen_server/dashboard/assets/{create-stack-F29xAUEx.js → create-stack-CEmaPZ4c.js} +1 -1
  193. zenml/zen_server/dashboard/assets/delete-run-D-LKbGyz.js +1 -0
  194. zenml/zen_server/dashboard/assets/{docker-BFAFXr2_.js → docker-BFNgg-z3.js} +1 -1
  195. zenml/zen_server/dashboard/assets/{dots-horizontal-C6K59vUm.js → dots-horizontal-DK5Duzx4.js} +1 -1
  196. zenml/zen_server/dashboard/assets/{form-schemas-BKXwSDK2.js → form-schemas-1AyOCx90.js} +1 -1
  197. zenml/zen_server/dashboard/assets/{gcp-Dj6ntk0L.js → gcp-7M2Yf3ZK.js} +1 -1
  198. zenml/zen_server/dashboard/assets/{help-CwN931fX.js → help-Dam461dC.js} +1 -1
  199. zenml/zen_server/dashboard/assets/{index-5GJ5ysEZ.js → index-BVJ8n2-j.js} +1 -1
  200. zenml/zen_server/dashboard/assets/index-Bpmj40BI.js +1 -0
  201. zenml/zen_server/dashboard/assets/index-CbU4Ln_E.css +1 -0
  202. zenml/zen_server/dashboard/assets/{index-D-mtoBj3.js → index-DKPhqP2B.js} +1 -1
  203. zenml/zen_server/dashboard/assets/index-QQb7wQEC.js +55 -0
  204. zenml/zen_server/dashboard/assets/index.esm-cuVep_NJ.js +1 -0
  205. zenml/zen_server/dashboard/assets/inter-cyrillic-400-normal-BLGc9T1a.woff2 +0 -0
  206. zenml/zen_server/dashboard/assets/inter-cyrillic-400-normal-ZzOtrSSW.woff +0 -0
  207. zenml/zen_server/dashboard/assets/inter-cyrillic-500-normal-D4Vwzodn.woff2 +0 -0
  208. zenml/zen_server/dashboard/assets/inter-cyrillic-500-normal-DH2hs3aW.woff +0 -0
  209. zenml/zen_server/dashboard/assets/inter-cyrillic-600-normal-BGBWG807.woff2 +0 -0
  210. zenml/zen_server/dashboard/assets/inter-cyrillic-600-normal-BuzJQFbW.woff +0 -0
  211. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-400-normal-BPnxn4xp.woff +0 -0
  212. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-400-normal-Dc4VJyIJ.woff2 +0 -0
  213. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-500-normal-BShVwWPj.woff2 +0 -0
  214. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-500-normal-CUiC4oBV.woff +0 -0
  215. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-600-normal-Bt9VVOA-.woff +0 -0
  216. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-600-normal-CaqZN2hq.woff2 +0 -0
  217. zenml/zen_server/dashboard/assets/inter-greek-400-normal-BZzXV7-1.woff +0 -0
  218. zenml/zen_server/dashboard/assets/inter-greek-400-normal-DxZsaF_h.woff2 +0 -0
  219. zenml/zen_server/dashboard/assets/inter-greek-500-normal-CeQXL5ds.woff2 +0 -0
  220. zenml/zen_server/dashboard/assets/inter-greek-500-normal-d_eO-yCQ.woff +0 -0
  221. zenml/zen_server/dashboard/assets/inter-greek-600-normal-CwicyhtI.woff +0 -0
  222. zenml/zen_server/dashboard/assets/inter-greek-600-normal-Dhlb-90d.woff2 +0 -0
  223. zenml/zen_server/dashboard/assets/inter-greek-ext-400-normal-Bput3-QP.woff2 +0 -0
  224. zenml/zen_server/dashboard/assets/inter-greek-ext-400-normal-DCpCPQOf.woff +0 -0
  225. zenml/zen_server/dashboard/assets/inter-greek-ext-500-normal-B6guLgqG.woff2 +0 -0
  226. zenml/zen_server/dashboard/assets/inter-greek-ext-500-normal-M2hEX8vc.woff +0 -0
  227. zenml/zen_server/dashboard/assets/inter-greek-ext-600-normal-C9WLioJ8.woff +0 -0
  228. zenml/zen_server/dashboard/assets/inter-greek-ext-600-normal-Cnui8OiR.woff2 +0 -0
  229. zenml/zen_server/dashboard/assets/inter-latin-400-normal-BOOGhInR.woff2 +0 -0
  230. zenml/zen_server/dashboard/assets/inter-latin-400-normal-gitzw0hO.woff +0 -0
  231. zenml/zen_server/dashboard/assets/inter-latin-500-normal-D2bGa7uu.woff2 +0 -0
  232. zenml/zen_server/dashboard/assets/inter-latin-500-normal-deR1Tlfd.woff +0 -0
  233. zenml/zen_server/dashboard/assets/inter-latin-600-normal-B5cFAncS.woff +0 -0
  234. zenml/zen_server/dashboard/assets/inter-latin-600-normal-D273HNI0.woff2 +0 -0
  235. zenml/zen_server/dashboard/assets/inter-latin-ext-400-normal-C1t-h-pH.woff +0 -0
  236. zenml/zen_server/dashboard/assets/inter-latin-ext-400-normal-hnt3BR84.woff2 +0 -0
  237. zenml/zen_server/dashboard/assets/inter-latin-ext-500-normal-CIS2RHJS.woff2 +0 -0
  238. zenml/zen_server/dashboard/assets/inter-latin-ext-500-normal-UMdmhHu2.woff +0 -0
  239. zenml/zen_server/dashboard/assets/inter-latin-ext-600-normal-BnYJhD27.woff2 +0 -0
  240. zenml/zen_server/dashboard/assets/inter-latin-ext-600-normal-CAF0vJDd.woff +0 -0
  241. zenml/zen_server/dashboard/assets/inter-vietnamese-400-normal-BUNmGMP1.woff +0 -0
  242. zenml/zen_server/dashboard/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
  243. zenml/zen_server/dashboard/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
  244. zenml/zen_server/dashboard/assets/inter-vietnamese-500-normal-DQPw2Hwd.woff +0 -0
  245. zenml/zen_server/dashboard/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
  246. zenml/zen_server/dashboard/assets/inter-vietnamese-600-normal-Cm6aH8_k.woff +0 -0
  247. zenml/zen_server/dashboard/assets/{kubernetes-BjbR6D-1.js → kubernetes--g7r02Zu.js} +1 -1
  248. zenml/zen_server/dashboard/assets/{layout-Dru15_XR.js → layout-DCSYN7-C.js} +1 -1
  249. zenml/zen_server/dashboard/assets/{link-external-BT2L8hAQ.js → link-external-CBEk6kEG.js} +1 -1
  250. zenml/zen_server/dashboard/assets/{login-mutation-ax6iL2Mb.js → login-mutation-DTcAFP1l.js} +1 -1
  251. zenml/zen_server/dashboard/assets/{logs-GiDJXbLS.js → logs-D5bdJGur.js} +1 -1
  252. zenml/zen_server/dashboard/assets/not-found-Cc-JkRH2.js +1 -0
  253. zenml/zen_server/dashboard/assets/{package-DYKZ5jKW.js → package-Cs35Szwh.js} +1 -1
  254. zenml/zen_server/dashboard/assets/{page-HkVBdZl6.js → page-9yplj5JT.js} +1 -1
  255. zenml/zen_server/dashboard/assets/{page-uORspyRu.js → page-B-y2XKIc.js} +1 -1
  256. zenml/zen_server/dashboard/assets/page-BBpOxVcY.js +1 -0
  257. zenml/zen_server/dashboard/assets/{page-BDg1F-Ug.js → page-BQQKaabe.js} +2 -2
  258. zenml/zen_server/dashboard/assets/page-BRInM1Lg.js +1 -0
  259. zenml/zen_server/dashboard/assets/{page-CvKnNK1S.js → page-BjjlMk7s.js} +1 -1
  260. zenml/zen_server/dashboard/assets/{page-BukXK1Aa.js → page-Bvd7YH2A.js} +1 -1
  261. zenml/zen_server/dashboard/assets/{page-DcTjHmYZ.js → page-C0N5q3l7.js} +1 -1
  262. zenml/zen_server/dashboard/assets/page-CT3Nep8W.js +1 -0
  263. zenml/zen_server/dashboard/assets/{page-DuqYMYmH.js → page-C_f47pBf.js} +1 -1
  264. zenml/zen_server/dashboard/assets/{page-DRfcRK1w.js → page-ClUVkl-O.js} +1 -1
  265. zenml/zen_server/dashboard/assets/page-Cmv8C_yM.js +3 -0
  266. zenml/zen_server/dashboard/assets/{page-p0BhSAWx.js → page-CyN2bdWG.js} +1 -1
  267. zenml/zen_server/dashboard/assets/page-CzzXH4fs.js +1 -0
  268. zenml/zen_server/dashboard/assets/{page-6mfzecin.js → page-DH_Z7iW1.js} +1 -1
  269. zenml/zen_server/dashboard/assets/{page-8kYmrh0B.js → page-DIOXwhiD.js} +1 -1
  270. zenml/zen_server/dashboard/assets/{page-BXarY9K2.js → page-DLixvR-7.js} +1 -1
  271. zenml/zen_server/dashboard/assets/page-DTlGjgnG.js +1 -0
  272. zenml/zen_server/dashboard/assets/page-Dbpl86h0.js +1 -0
  273. zenml/zen_server/dashboard/assets/{page-MAXyfXBq.js → page-Ddgy6kDS.js} +1 -1
  274. zenml/zen_server/dashboard/assets/page-DtCAfBLy.js +9 -0
  275. zenml/zen_server/dashboard/assets/{page-CKHNAq7z.js → page-Dx16z7nA.js} +1 -1
  276. zenml/zen_server/dashboard/assets/{page-DMSLXKGT.js → page-DzpVUZ8f.js} +1 -1
  277. zenml/zen_server/dashboard/assets/page-McUyYbo1.js +1 -0
  278. zenml/zen_server/dashboard/assets/{page-miU2rhYG.js → page-N4qoPHKb.js} +1 -1
  279. zenml/zen_server/dashboard/assets/page-T1P3RyAR.js +1 -0
  280. zenml/zen_server/dashboard/assets/{page-3qPX9WYH.js → page-bKaULTGG.js} +1 -1
  281. zenml/zen_server/dashboard/assets/page-sbXUJy9t.js +1 -0
  282. zenml/zen_server/dashboard/assets/{persist-CfJMar_k.js → persist-CP0JmYZ4.js} +1 -1
  283. zenml/zen_server/dashboard/assets/{persist-BxIR2XZs.js → persist-DNb5cdrU.js} +1 -1
  284. zenml/zen_server/dashboard/assets/{plus-Bc8eLSDM.js → plus-C9IxgN2M.js} +1 -1
  285. zenml/zen_server/dashboard/assets/{refresh-hfgWPeto.js → refresh-BVu22P_C.js} +1 -1
  286. zenml/zen_server/dashboard/assets/{rocket-SESCGQXm.js → rocket-CONEmRmB.js} +1 -1
  287. zenml/zen_server/dashboard/assets/{sharedSchema-vub0rii3.js → sharedSchema-TMLu-nYQ.js} +1 -1
  288. zenml/zen_server/dashboard/assets/stack-detail-query-xmYxSsUY.js +1 -0
  289. zenml/zen_server/dashboard/assets/{tick-circle-m-hJG8i9.js → tick-circle-CM1ZScbQ.js} +1 -1
  290. zenml/zen_server/dashboard/assets/{trash-DUWZWzse.js → trash-DkJHMOg7.js} +1 -1
  291. zenml/zen_server/dashboard/assets/{update-server-settings-mutation-FGVP7X2U.js → update-server-settings-mutation-DsU8cNVl.js} +1 -1
  292. zenml/zen_server/dashboard/assets/{url-CbAPzsmT.js → url-D5le3J4q.js} +1 -1
  293. zenml/zen_server/dashboard/assets/zod-D89GC_vc.js +1 -0
  294. zenml/zen_server/dashboard/index.html +7 -7
  295. zenml/zen_server/deploy/__init__.py +7 -16
  296. zenml/zen_server/deploy/base_provider.py +46 -73
  297. zenml/zen_server/deploy/{local → daemon}/__init__.py +3 -3
  298. zenml/zen_server/deploy/{local/local_provider.py → daemon/daemon_provider.py} +44 -63
  299. zenml/zen_server/deploy/{local/local_zen_server.py → daemon/daemon_zen_server.py} +50 -28
  300. zenml/zen_server/deploy/deployer.py +90 -171
  301. zenml/zen_server/deploy/deployment.py +20 -12
  302. zenml/zen_server/deploy/docker/docker_provider.py +9 -28
  303. zenml/zen_server/deploy/docker/docker_zen_server.py +19 -9
  304. zenml/zen_server/deploy/helm/Chart.yaml +1 -1
  305. zenml/zen_server/deploy/helm/README.md +2 -2
  306. zenml/zen_server/exceptions.py +11 -0
  307. zenml/zen_server/feature_gate/zenml_cloud_feature_gate.py +1 -1
  308. zenml/zen_server/jwt.py +9 -9
  309. zenml/zen_server/routers/artifact_version_endpoints.py +1 -1
  310. zenml/zen_server/routers/auth_endpoints.py +30 -8
  311. zenml/zen_server/routers/runs_endpoints.py +0 -28
  312. zenml/zen_server/routers/stack_components_endpoints.py +1 -1
  313. zenml/zen_server/routers/workspaces_endpoints.py +1 -1
  314. zenml/zen_server/template_execution/runner_entrypoint_configuration.py +7 -4
  315. zenml/zen_server/template_execution/utils.py +8 -63
  316. zenml/zen_server/utils.py +67 -69
  317. zenml/zen_server/zen_server_api.py +107 -17
  318. zenml/zen_stores/base_zen_store.py +4 -51
  319. zenml/zen_stores/migrations/versions/0.67.0_release.py +23 -0
  320. zenml/zen_stores/migrations/versions/0.68.0_release.py +23 -0
  321. zenml/zen_stores/migrations/versions/0.68.1_release.py +23 -0
  322. zenml/zen_stores/migrations/versions/1d8f30c54477_migrate_to_new_.py +124 -0
  323. zenml/zen_stores/migrations/versions/c22561cbb3a9_add_artifact_unique_constraints.py +86 -0
  324. zenml/zen_stores/rest_zen_store.py +325 -147
  325. zenml/zen_stores/schemas/api_key_schemas.py +9 -4
  326. zenml/zen_stores/schemas/artifact_schemas.py +21 -2
  327. zenml/zen_stores/schemas/artifact_visualization_schemas.py +1 -1
  328. zenml/zen_stores/schemas/component_schemas.py +49 -6
  329. zenml/zen_stores/schemas/device_schemas.py +9 -4
  330. zenml/zen_stores/schemas/flavor_schemas.py +1 -1
  331. zenml/zen_stores/schemas/model_schemas.py +1 -1
  332. zenml/zen_stores/schemas/pipeline_run_schemas.py +12 -4
  333. zenml/zen_stores/schemas/service_schemas.py +1 -1
  334. zenml/zen_stores/schemas/step_run_schemas.py +3 -3
  335. zenml/zen_stores/schemas/trigger_schemas.py +1 -1
  336. zenml/zen_stores/sql_zen_store.py +422 -145
  337. zenml/zen_stores/template_utils.py +3 -1
  338. {zenml_nightly-0.66.0.dev20240927.dist-info → zenml_nightly-0.68.1.dev20241102.dist-info}/METADATA +20 -18
  339. {zenml_nightly-0.66.0.dev20240927.dist-info → zenml_nightly-0.68.1.dev20241102.dist-info}/RECORD +344 -506
  340. {zenml_nightly-0.66.0.dev20240927.dist-info → zenml_nightly-0.68.1.dev20241102.dist-info}/WHEEL +1 -1
  341. zenml/api.py +0 -60
  342. zenml/cli/stack_recipes.py +0 -469
  343. zenml/lineage_graph/__init__.py +0 -34
  344. zenml/lineage_graph/lineage_graph.py +0 -244
  345. zenml/lineage_graph/node/__init__.py +0 -32
  346. zenml/lineage_graph/node/artifact_node.py +0 -51
  347. zenml/lineage_graph/node/step_node.py +0 -41
  348. zenml/model/model_version.py +0 -38
  349. zenml/new/pipelines/code_archive.py +0 -157
  350. zenml/new/pipelines/pipeline_decorator.py +0 -118
  351. zenml/new/steps/step_decorator.py +0 -176
  352. zenml/pipelines/base_pipeline.py +0 -273
  353. zenml/post_execution/__init__.py +0 -30
  354. zenml/post_execution/pipeline.py +0 -55
  355. zenml/post_execution/pipeline_run.py +0 -55
  356. zenml/services/terraform/__init__.py +0 -14
  357. zenml/services/terraform/terraform_service.py +0 -441
  358. zenml/steps/external_artifact.py +0 -26
  359. zenml/steps/step_environment.py +0 -108
  360. zenml/steps/step_output.py +0 -36
  361. zenml/utils/mlstacks_utils.py +0 -635
  362. zenml/utils/terraform_utils.py +0 -43
  363. zenml/zen_server/dashboard/assets/@radix-DnFH_oo1.js +0 -85
  364. zenml/zen_server/dashboard/assets/@react-router-APVeuk-U.js +0 -29
  365. zenml/zen_server/dashboard/assets/@reactflow-ytavUpwh.js +0 -17
  366. zenml/zen_server/dashboard/assets/@tanstack-QbMbTrh5.js +0 -22
  367. zenml/zen_server/dashboard/assets/ComponentBadge-gKR1OIwG.js +0 -1
  368. zenml/zen_server/dashboard/assets/ExecutionStatus-D6r6aK8J.js +0 -1
  369. zenml/zen_server/dashboard/assets/MarkdownVisualization-DS05sfBm.js +0 -14
  370. zenml/zen_server/dashboard/assets/SearchField-BzmfxS0L.js +0 -1
  371. zenml/zen_server/dashboard/assets/all-pipeline-runs-query-BA3R2Sey.js +0 -1
  372. zenml/zen_server/dashboard/assets/delete-run-CP0pcJ3U.js +0 -1
  373. zenml/zen_server/dashboard/assets/index-BhJ6ZJxv.css +0 -1
  374. zenml/zen_server/dashboard/assets/index-Ci0nJ8EZ.js +0 -55
  375. zenml/zen_server/dashboard/assets/index.esm-BE1uqCX5.js +0 -1
  376. zenml/zen_server/dashboard/assets/inter-cyrillic-400-normal-Df6ckaLK.woff2 +0 -0
  377. zenml/zen_server/dashboard/assets/inter-cyrillic-400-normal-JrS_4yms.woff +0 -0
  378. zenml/zen_server/dashboard/assets/inter-cyrillic-500-normal-BRrLR67x.woff2 +0 -0
  379. zenml/zen_server/dashboard/assets/inter-cyrillic-500-normal-DskEQOpE.woff +0 -0
  380. zenml/zen_server/dashboard/assets/inter-cyrillic-600-normal-DDpWG8g5.woff2 +0 -0
  381. zenml/zen_server/dashboard/assets/inter-cyrillic-600-normal-iz1--dBq.woff +0 -0
  382. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-400-normal-CzG7Kr3z.woff +0 -0
  383. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-400-normal-tyfMZHQw.woff2 +0 -0
  384. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-500-normal-DOnSzjnx.woff2 +0 -0
  385. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-500-normal-Xebo2OyJ.woff +0 -0
  386. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-600-normal-DpA2xaRd.woff2 +0 -0
  387. zenml/zen_server/dashboard/assets/inter-cyrillic-ext-600-normal-KAwcVx6H.woff +0 -0
  388. zenml/zen_server/dashboard/assets/inter-greek-400-normal-DQXyrmoy.woff2 +0 -0
  389. zenml/zen_server/dashboard/assets/inter-greek-400-normal-DvIPHDQ7.woff +0 -0
  390. zenml/zen_server/dashboard/assets/inter-greek-500-normal-BjpBGs91.woff +0 -0
  391. zenml/zen_server/dashboard/assets/inter-greek-500-normal-CmOavsDc.woff2 +0 -0
  392. zenml/zen_server/dashboard/assets/inter-greek-600-normal-B-l8Lzzd.woff2 +0 -0
  393. zenml/zen_server/dashboard/assets/inter-greek-600-normal-BLZsI-P3.woff +0 -0
  394. zenml/zen_server/dashboard/assets/inter-greek-ext-400-normal-CIdlr5YK.woff2 +0 -0
  395. zenml/zen_server/dashboard/assets/inter-greek-ext-400-normal-_Rr29XE2.woff +0 -0
  396. zenml/zen_server/dashboard/assets/inter-greek-ext-500-normal-2pdUafRD.woff2 +0 -0
  397. zenml/zen_server/dashboard/assets/inter-greek-ext-500-normal-Dtavx3qw.woff +0 -0
  398. zenml/zen_server/dashboard/assets/inter-greek-ext-600-normal-BmtRFZgT.woff +0 -0
  399. zenml/zen_server/dashboard/assets/inter-greek-ext-600-normal-CkBLDEl_.woff2 +0 -0
  400. zenml/zen_server/dashboard/assets/inter-latin-400-normal-BT1H-PT_.woff2 +0 -0
  401. zenml/zen_server/dashboard/assets/inter-latin-400-normal-Cdi8t5Mu.woff +0 -0
  402. zenml/zen_server/dashboard/assets/inter-latin-500-normal-D4I8BKCx.woff +0 -0
  403. zenml/zen_server/dashboard/assets/inter-latin-500-normal-kWhwEdDH.woff2 +0 -0
  404. zenml/zen_server/dashboard/assets/inter-latin-600-normal-B2Ssfs8e.woff2 +0 -0
  405. zenml/zen_server/dashboard/assets/inter-latin-600-normal-Dbvh0wvx.woff +0 -0
  406. zenml/zen_server/dashboard/assets/inter-latin-ext-400-normal-8tIzm-yw.woff +0 -0
  407. zenml/zen_server/dashboard/assets/inter-latin-ext-400-normal-D3W-OpO-.woff2 +0 -0
  408. zenml/zen_server/dashboard/assets/inter-latin-ext-500-normal-B9u8Q_zH.woff2 +0 -0
  409. zenml/zen_server/dashboard/assets/inter-latin-ext-500-normal-SuUkSNTU.woff +0 -0
  410. zenml/zen_server/dashboard/assets/inter-latin-ext-600-normal-Dg0Bk0Yr.woff +0 -0
  411. zenml/zen_server/dashboard/assets/inter-latin-ext-600-normal-ao35dkSb.woff2 +0 -0
  412. zenml/zen_server/dashboard/assets/inter-vietnamese-400-normal-Cnt0N5Vm.woff2 +0 -0
  413. zenml/zen_server/dashboard/assets/inter-vietnamese-400-normal-DIOGfGLL.woff +0 -0
  414. zenml/zen_server/dashboard/assets/inter-vietnamese-500-normal-0i6yoQMg.woff +0 -0
  415. zenml/zen_server/dashboard/assets/inter-vietnamese-500-normal-5IkPJ6Nk.woff2 +0 -0
  416. zenml/zen_server/dashboard/assets/inter-vietnamese-600-normal-BQ_dbMbg.woff +0 -0
  417. zenml/zen_server/dashboard/assets/inter-vietnamese-600-normal-DjnxGF-L.woff2 +0 -0
  418. zenml/zen_server/dashboard/assets/not-found-DbjllLY_.js +0 -1
  419. zenml/zen_server/dashboard/assets/page-B1n7_W7z.js +0 -1
  420. zenml/zen_server/dashboard/assets/page-BZZhLo2u.js +0 -1
  421. zenml/zen_server/dashboard/assets/page-Bbf_oBjn.js +0 -1
  422. zenml/zen_server/dashboard/assets/page-BjjuBvZG.js +0 -9
  423. zenml/zen_server/dashboard/assets/page-CHaQkFK5.js +0 -1
  424. zenml/zen_server/dashboard/assets/page-CS0SYFK8.js +0 -1
  425. zenml/zen_server/dashboard/assets/page-DGM1CbYT.js +0 -2
  426. zenml/zen_server/dashboard/assets/page-DOmIZ2ra.js +0 -1
  427. zenml/zen_server/dashboard/assets/page-DYVmJ9_w.js +0 -3
  428. zenml/zen_server/dashboard/assets/page-Dwow2doB.js +0 -1
  429. zenml/zen_server/dashboard/assets/stack-detail-query-DQcyzG-2.js +0 -1
  430. zenml/zen_server/dashboard/assets/zod-uFd1wBcd.js +0 -1
  431. zenml/zen_server/dashboard_legacy/_redirects +0 -1
  432. zenml/zen_server/dashboard_legacy/asset-manifest.json +0 -131
  433. zenml/zen_server/dashboard_legacy/favicon.ico +0 -0
  434. zenml/zen_server/dashboard_legacy/index.html +0 -1
  435. zenml/zen_server/dashboard_legacy/manifest.json +0 -25
  436. zenml/zen_server/dashboard_legacy/precache-manifest.6d320abb70db612019dda6c4948e7a90.js +0 -462
  437. zenml/zen_server/dashboard_legacy/robots.txt +0 -2
  438. zenml/zen_server/dashboard_legacy/service-worker.js +0 -39
  439. zenml/zen_server/dashboard_legacy/static/css/2.5b37d44a.chunk.css +0 -16
  440. zenml/zen_server/dashboard_legacy/static/css/2.5b37d44a.chunk.css.map +0 -1
  441. zenml/zen_server/dashboard_legacy/static/css/main.e79dff04.chunk.css +0 -2
  442. zenml/zen_server/dashboard_legacy/static/css/main.e79dff04.chunk.css.map +0 -1
  443. zenml/zen_server/dashboard_legacy/static/js/2.7934458d.chunk.js +0 -3
  444. zenml/zen_server/dashboard_legacy/static/js/2.7934458d.chunk.js.LICENSE.txt +0 -95
  445. zenml/zen_server/dashboard_legacy/static/js/2.7934458d.chunk.js.map +0 -1
  446. zenml/zen_server/dashboard_legacy/static/js/main.fa9299d5.chunk.js +0 -2
  447. zenml/zen_server/dashboard_legacy/static/js/main.fa9299d5.chunk.js.map +0 -1
  448. zenml/zen_server/dashboard_legacy/static/js/runtime-main.bfca2edd.js +0 -2
  449. zenml/zen_server/dashboard_legacy/static/js/runtime-main.bfca2edd.js.map +0 -1
  450. zenml/zen_server/dashboard_legacy/static/media/AlertTriangle.28aee535.svg +0 -5
  451. zenml/zen_server/dashboard_legacy/static/media/ArrowSquareOut.abfb9bc7.svg +0 -5
  452. zenml/zen_server/dashboard_legacy/static/media/Back.86c23a22.svg +0 -4
  453. zenml/zen_server/dashboard_legacy/static/media/BookOpen.5cb101ff.svg +0 -4
  454. zenml/zen_server/dashboard_legacy/static/media/BoundingBox.1eb98717.svg +0 -10
  455. zenml/zen_server/dashboard_legacy/static/media/Burger.9b1c67d7.svg +0 -3
  456. zenml/zen_server/dashboard_legacy/static/media/Cached.2381fb8d.svg +0 -1
  457. zenml/zen_server/dashboard_legacy/static/media/Calendar.356e11c7.svg +0 -3
  458. zenml/zen_server/dashboard_legacy/static/media/ChartBarHorizontal.0247447b.svg +0 -6
  459. zenml/zen_server/dashboard_legacy/static/media/ChartLine.0d79e18d.svg +0 -4
  460. zenml/zen_server/dashboard_legacy/static/media/ChatDots.2e1c9211.svg +0 -6
  461. zenml/zen_server/dashboard_legacy/static/media/Check.dad6beb2.svg +0 -3
  462. zenml/zen_server/dashboard_legacy/static/media/CheckCircleFilled.c19566d0.svg +0 -3
  463. zenml/zen_server/dashboard_legacy/static/media/Checkbox.af50e31e.svg +0 -3
  464. zenml/zen_server/dashboard_legacy/static/media/ChevronDown.f860ce32.svg +0 -3
  465. zenml/zen_server/dashboard_legacy/static/media/ChevronDownLight.6642d756.svg +0 -3
  466. zenml/zen_server/dashboard_legacy/static/media/ChevronLeft.f6edfcdb.svg +0 -3
  467. zenml/zen_server/dashboard_legacy/static/media/CircleCheck.f98fd6ca.svg +0 -1
  468. zenml/zen_server/dashboard_legacy/static/media/Clock.ffc9de95.svg +0 -3
  469. zenml/zen_server/dashboard_legacy/static/media/Close.74e9efbc.svg +0 -5
  470. zenml/zen_server/dashboard_legacy/static/media/CloseWithBorder.6960930a.svg +0 -3
  471. zenml/zen_server/dashboard_legacy/static/media/CloseWithoutBorder.cd6f71df.svg +0 -3
  472. zenml/zen_server/dashboard_legacy/static/media/CloudArrowUp.0aecb235.svg +0 -6
  473. zenml/zen_server/dashboard_legacy/static/media/Code.ef0f33b5.svg +0 -3
  474. zenml/zen_server/dashboard_legacy/static/media/Config.0be63f8a.svg +0 -1
  475. zenml/zen_server/dashboard_legacy/static/media/Connector.9fd46ef1.svg +0 -10
  476. zenml/zen_server/dashboard_legacy/static/media/Copy.36e2112a.svg +0 -1
  477. zenml/zen_server/dashboard_legacy/static/media/Dashboard.d05787e0.svg +0 -3
  478. zenml/zen_server/dashboard_legacy/static/media/Data.b1c3b5f8.svg +0 -3
  479. zenml/zen_server/dashboard_legacy/static/media/Delete.3c361b28.svg +0 -8
  480. zenml/zen_server/dashboard_legacy/static/media/Docs.7541d478.svg +0 -7
  481. zenml/zen_server/dashboard_legacy/static/media/Download.fba04d87.svg +0 -5
  482. zenml/zen_server/dashboard_legacy/static/media/Edit.490eb294.svg +0 -6
  483. zenml/zen_server/dashboard_legacy/static/media/EmptyRightArrow.23749d01.svg +0 -3
  484. zenml/zen_server/dashboard_legacy/static/media/Example.6396cd37.svg +0 -5
  485. zenml/zen_server/dashboard_legacy/static/media/Extension.1394cd4a.svg +0 -3
  486. zenml/zen_server/dashboard_legacy/static/media/Eye.d9e4ee62.svg +0 -4
  487. zenml/zen_server/dashboard_legacy/static/media/Failed.0213c1a0.svg +0 -1
  488. zenml/zen_server/dashboard_legacy/static/media/FileText.1f15bacd.svg +0 -7
  489. zenml/zen_server/dashboard_legacy/static/media/Filter.ab6b9c0d.svg +0 -3
  490. zenml/zen_server/dashboard_legacy/static/media/Folders.12b29887.svg +0 -5
  491. zenml/zen_server/dashboard_legacy/static/media/FunnelFill.6df4c143.svg +0 -3
  492. zenml/zen_server/dashboard_legacy/static/media/GitCommit.7dd9c2aa.svg +0 -5
  493. zenml/zen_server/dashboard_legacy/static/media/GitHub_Logo.cefc2023.png +0 -0
  494. zenml/zen_server/dashboard_legacy/static/media/Graph.2c63a892.svg +0 -11
  495. zenml/zen_server/dashboard_legacy/static/media/History.08329240.svg +0 -3
  496. zenml/zen_server/dashboard_legacy/static/media/Home.0843b0d5.svg +0 -3
  497. zenml/zen_server/dashboard_legacy/static/media/ImageBuilder.ea762d9c.svg +0 -6
  498. zenml/zen_server/dashboard_legacy/static/media/InProgress.304a0edc.svg +0 -1
  499. zenml/zen_server/dashboard_legacy/static/media/Info.9fe10c5c.svg +0 -3
  500. zenml/zen_server/dashboard_legacy/static/media/KeyboardReturn.491afbe3.svg +0 -3
  501. zenml/zen_server/dashboard_legacy/static/media/Link.72bbb55d.svg +0 -4
  502. zenml/zen_server/dashboard_legacy/static/media/Lock.30f5e1fe.svg +0 -5
  503. zenml/zen_server/dashboard_legacy/static/media/Lock2.a769ea52.svg +0 -3
  504. zenml/zen_server/dashboard_legacy/static/media/LockKey.92f21621.svg +0 -6
  505. zenml/zen_server/dashboard_legacy/static/media/Logs.8bf4d005.svg +0 -5
  506. zenml/zen_server/dashboard_legacy/static/media/MinusCircle.4188f418.svg +0 -4
  507. zenml/zen_server/dashboard_legacy/static/media/ModelRegistry.f0de050a.svg +0 -6
  508. zenml/zen_server/dashboard_legacy/static/media/MultiUser.a2ba7c67.svg +0 -10
  509. zenml/zen_server/dashboard_legacy/static/media/PaginationFirst.92628634.svg +0 -4
  510. zenml/zen_server/dashboard_legacy/static/media/PaginationLast.00d3c732.svg +0 -4
  511. zenml/zen_server/dashboard_legacy/static/media/PaginationNext.86158845.svg +0 -3
  512. zenml/zen_server/dashboard_legacy/static/media/PaginationPrev.60c18a88.svg +0 -3
  513. zenml/zen_server/dashboard_legacy/static/media/Pen.f2d831d4.svg +0 -6
  514. zenml/zen_server/dashboard_legacy/static/media/PhotoCamera.179d6d4c.svg +0 -3
  515. zenml/zen_server/dashboard_legacy/static/media/Pipeline.30d298b0.svg +0 -7
  516. zenml/zen_server/dashboard_legacy/static/media/Plus.5aa1c16b.svg +0 -3
  517. zenml/zen_server/dashboard_legacy/static/media/PlusCircle.92d860dd.svg +0 -5
  518. zenml/zen_server/dashboard_legacy/static/media/Repositories.71a36b8c.svg +0 -3
  519. zenml/zen_server/dashboard_legacy/static/media/RightArrow.f30d3871.svg +0 -29
  520. zenml/zen_server/dashboard_legacy/static/media/Rocket.63bf7b9d.svg +0 -3
  521. zenml/zen_server/dashboard_legacy/static/media/RocketLaunch.1bff2b59.svg +0 -6
  522. zenml/zen_server/dashboard_legacy/static/media/Rubik-Medium.c87313aa.ttf +0 -0
  523. zenml/zen_server/dashboard_legacy/static/media/Rubik-Regular.b3d0902b.ttf +0 -0
  524. zenml/zen_server/dashboard_legacy/static/media/Run.daec4fb2.svg +0 -6
  525. zenml/zen_server/dashboard_legacy/static/media/Search.d1afcce5.svg +0 -4
  526. zenml/zen_server/dashboard_legacy/static/media/Settings.59ca73ae.svg +0 -4
  527. zenml/zen_server/dashboard_legacy/static/media/Share2.46c3ff66.svg +0 -3
  528. zenml/zen_server/dashboard_legacy/static/media/SignOut.6aa718c5.svg +0 -3
  529. zenml/zen_server/dashboard_legacy/static/media/SimplePlus.5cf7ec20.svg +0 -3
  530. zenml/zen_server/dashboard_legacy/static/media/SingleUser.bef3a095.svg +0 -4
  531. zenml/zen_server/dashboard_legacy/static/media/SourceCodePro-Regular.b484b32f.ttf +0 -0
  532. zenml/zen_server/dashboard_legacy/static/media/Stack.19b604ac.svg +0 -5
  533. zenml/zen_server/dashboard_legacy/static/media/StackComponent.b1ba90b5.svg +0 -4
  534. zenml/zen_server/dashboard_legacy/static/media/Star.f0c25022.svg +0 -9
  535. zenml/zen_server/dashboard_legacy/static/media/StarOutline.94ca8cd9.svg +0 -3
  536. zenml/zen_server/dashboard_legacy/static/media/Storefront.4b4796fe.svg +0 -3
  537. zenml/zen_server/dashboard_legacy/static/media/Stream.543e3039.svg +0 -3
  538. zenml/zen_server/dashboard_legacy/static/media/SupportAgent.510ddf1f.svg +0 -8
  539. zenml/zen_server/dashboard_legacy/static/media/Table.77033750.svg +0 -6
  540. zenml/zen_server/dashboard_legacy/static/media/Tool.d5785486.svg +0 -3
  541. zenml/zen_server/dashboard_legacy/static/media/UserPlus.741a99d7.svg +0 -6
  542. zenml/zen_server/dashboard_legacy/static/media/Verified.0625b2a0.svg +0 -3
  543. zenml/zen_server/dashboard_legacy/static/media/addNew.4fb6c939.svg +0 -8
  544. zenml/zen_server/dashboard_legacy/static/media/arrowClose.cbd53f3f.svg +0 -3
  545. zenml/zen_server/dashboard_legacy/static/media/arrowOpen.6ceef0af.svg +0 -3
  546. zenml/zen_server/dashboard_legacy/static/media/check_small.30bc0138.svg +0 -3
  547. zenml/zen_server/dashboard_legacy/static/media/circleArrowSideClose.98d6013e.svg +0 -18
  548. zenml/zen_server/dashboard_legacy/static/media/circleArrowSideOpen.63653df6.svg +0 -18
  549. zenml/zen_server/dashboard_legacy/static/media/image.104fd14b.png +0 -0
  550. zenml/zen_server/dashboard_legacy/static/media/imageAddIcon.e83004a9.svg +0 -7
  551. zenml/zen_server/dashboard_legacy/static/media/logo.93333e5c.svg +0 -1
  552. zenml/zen_server/dashboard_legacy/static/media/logo_small.4204397d.svg +0 -3
  553. zenml/zen_server/dashboard_legacy/static/media/logo_white.d4b4414e.svg +0 -20
  554. zenml/zen_server/dashboard_legacy/static/media/notConnected.5e2c8ea7.svg +0 -8
  555. zenml/zen_server/dashboard_legacy/static/media/plugin-fallback.72c294e6.svg +0 -6
  556. zenml/zen_server/dashboard_legacy/static/media/share.bcd998b0.svg +0 -5
  557. zenml/zen_server/dashboard_legacy/static/media/stars.08a9b19a.svg +0 -8
  558. zenml/zen_server/deploy/terraform/__init__.py +0 -41
  559. zenml/zen_server/deploy/terraform/providers/aws_provider.py +0 -61
  560. zenml/zen_server/deploy/terraform/providers/azure_provider.py +0 -59
  561. zenml/zen_server/deploy/terraform/providers/gcp_provider.py +0 -59
  562. zenml/zen_server/deploy/terraform/providers/terraform_provider.py +0 -331
  563. zenml/zen_server/deploy/terraform/recipes/aws/.gitignore +0 -8
  564. zenml/zen_server/deploy/terraform/recipes/aws/helm.tf +0 -20
  565. zenml/zen_server/deploy/terraform/recipes/aws/ingress.tf +0 -30
  566. zenml/zen_server/deploy/terraform/recipes/aws/outputs.tf +0 -7
  567. zenml/zen_server/deploy/terraform/recipes/aws/printf.cmd +0 -2
  568. zenml/zen_server/deploy/terraform/recipes/aws/sql.tf +0 -62
  569. zenml/zen_server/deploy/terraform/recipes/aws/terraform.tf +0 -44
  570. zenml/zen_server/deploy/terraform/recipes/aws/variables.tf +0 -167
  571. zenml/zen_server/deploy/terraform/recipes/aws/vpc.tf +0 -47
  572. zenml/zen_server/deploy/terraform/recipes/aws/zen_server.tf +0 -103
  573. zenml/zen_server/deploy/terraform/recipes/azure/.gitignore +0 -8
  574. zenml/zen_server/deploy/terraform/recipes/azure/helm.tf +0 -20
  575. zenml/zen_server/deploy/terraform/recipes/azure/ingress.tf +0 -30
  576. zenml/zen_server/deploy/terraform/recipes/azure/key_vault.tf +0 -73
  577. zenml/zen_server/deploy/terraform/recipes/azure/outputs.tf +0 -7
  578. zenml/zen_server/deploy/terraform/recipes/azure/printf.cmd +0 -2
  579. zenml/zen_server/deploy/terraform/recipes/azure/rg.tf +0 -36
  580. zenml/zen_server/deploy/terraform/recipes/azure/sql.tf +0 -65
  581. zenml/zen_server/deploy/terraform/recipes/azure/terraform.tf +0 -52
  582. zenml/zen_server/deploy/terraform/recipes/azure/variables.tf +0 -176
  583. zenml/zen_server/deploy/terraform/recipes/azure/zen_server.tf +0 -103
  584. zenml/zen_server/deploy/terraform/recipes/gcp/.gitignore +0 -8
  585. zenml/zen_server/deploy/terraform/recipes/gcp/helm.tf +0 -20
  586. zenml/zen_server/deploy/terraform/recipes/gcp/ingress.tf +0 -30
  587. zenml/zen_server/deploy/terraform/recipes/gcp/outputs.tf +0 -7
  588. zenml/zen_server/deploy/terraform/recipes/gcp/printf.cmd +0 -2
  589. zenml/zen_server/deploy/terraform/recipes/gcp/sql.tf +0 -64
  590. zenml/zen_server/deploy/terraform/recipes/gcp/terraform.tf +0 -44
  591. zenml/zen_server/deploy/terraform/recipes/gcp/variables.tf +0 -171
  592. zenml/zen_server/deploy/terraform/recipes/gcp/zen_server.tf +0 -114
  593. zenml/zen_server/deploy/terraform/terraform_zen_server.py +0 -246
  594. /zenml/{new/pipelines → pipelines}/build_utils.py +0 -0
  595. /zenml/{new/steps → steps}/decorated_step.py +0 -0
  596. {zenml_nightly-0.66.0.dev20240927.dist-info → zenml_nightly-0.68.1.dev20241102.dist-info}/LICENSE +0 -0
  597. {zenml_nightly-0.66.0.dev20240927.dist-info → zenml_nightly-0.68.1.dev20241102.dist-info}/entry_points.txt +0 -0
zenml/cli/server.py CHANGED
@@ -14,36 +14,36 @@
14
14
  """CLI for managing ZenML server deployments."""
15
15
 
16
16
  import ipaddress
17
- import os
18
- import sys
19
- from typing import Any, Dict, Optional, Union
17
+ import re
18
+ from typing import List, Optional, Union
20
19
 
21
20
  import click
22
- import yaml
23
21
  from rich.errors import MarkupError
24
22
 
25
23
  import zenml
26
- from zenml.analytics.enums import AnalyticsEvent
27
- from zenml.analytics.utils import track_handler
28
24
  from zenml.cli import utils as cli_utils
29
- from zenml.cli.cli import cli
30
- from zenml.cli.web_login import web_login
25
+ from zenml.cli.cli import TagGroup, cli
26
+ from zenml.cli.login import login, logout
31
27
  from zenml.client import Client
32
28
  from zenml.config.global_config import GlobalConfiguration
33
29
  from zenml.console import console
34
- from zenml.constants import ENV_ZENML_LOCAL_SERVER
35
- from zenml.enums import ServerProviderType, StoreType
36
- from zenml.exceptions import AuthorizationException, IllegalOperationError
30
+ from zenml.enums import CliCategories, StoreType
31
+ from zenml.exceptions import AuthorizationException
37
32
  from zenml.logger import get_logger
38
- from zenml.utils import terraform_utils, yaml_utils
39
- from zenml.zen_server.utils import get_active_deployment
33
+ from zenml.login.credentials import ServerCredentials, ServerType
34
+ from zenml.services.service_status import ServiceState
35
+ from zenml.zen_server.utils import connected_to_local_server, get_local_server
40
36
 
41
37
  logger = get_logger(__name__)
42
38
 
43
- LOCAL_ZENML_SERVER_NAME = "local"
44
39
 
40
+ @cli.command(
41
+ "up",
42
+ help="""Start the ZenML dashboard locally.
45
43
 
46
- @cli.command("up", help="Start the ZenML dashboard locally.")
44
+ DEPRECATED: Please use `zenml login --local` instead.
45
+ """,
46
+ )
47
47
  @click.option(
48
48
  "--docker",
49
49
  is_flag=True,
@@ -73,14 +73,6 @@ LOCAL_ZENML_SERVER_NAME = "local"
73
73
  default=False,
74
74
  type=click.BOOL,
75
75
  )
76
- @click.option(
77
- "--connect",
78
- is_flag=True,
79
- help="Connect the client to the local server even when already connected "
80
- "to a remote ZenML server.",
81
- default=False,
82
- type=click.BOOL,
83
- )
84
76
  @click.option(
85
77
  "--image",
86
78
  type=str,
@@ -94,13 +86,6 @@ LOCAL_ZENML_SERVER_NAME = "local"
94
86
  default=None,
95
87
  help="Specify an ngrok auth token to use for exposing the ZenML server.",
96
88
  )
97
- @click.option(
98
- "--legacy",
99
- is_flag=True,
100
- help="Start the legacy ZenML dashboard instead of the new ZenML dashboard.",
101
- default=False,
102
- type=click.BOOL,
103
- )
104
89
  def up(
105
90
  docker: bool = False,
106
91
  ip_address: Union[
@@ -108,10 +93,8 @@ def up(
108
93
  ] = None,
109
94
  port: Optional[int] = None,
110
95
  blocking: bool = False,
111
- connect: bool = False,
112
96
  image: Optional[str] = None,
113
97
  ngrok_token: Optional[str] = None,
114
- legacy: bool = False,
115
98
  ) -> None:
116
99
  """Start the ZenML dashboard locally and connect the client to it.
117
100
 
@@ -120,136 +103,44 @@ def up(
120
103
  ip_address: The IP address to bind the server to.
121
104
  port: The port to bind the server to.
122
105
  blocking: Block the CLI while the server is running.
123
- connect: Connect the client to the local server even when already
124
- connected to a remote ZenML server.
125
106
  image: A custom Docker image to use for the server, when the
126
107
  `--docker` flag is set.
127
108
  ngrok_token: An ngrok auth token to use for exposing the ZenML dashboard
128
109
  on a public domain. Primarily used for accessing the dashboard in
129
110
  Colab.
130
- legacy: Start the legacy ZenML dashboard instead of the new ZenML
131
- dashboard.
132
111
  """
133
- from zenml.zen_server.deploy.deployer import ServerDeployer
134
-
135
- if connect:
136
- logger.warning(
137
- "The `--connect` flag is deprecated, has no effect, and will be "
138
- "removed in a future release."
139
- )
140
-
141
- gc = GlobalConfiguration()
142
-
143
- # Raise an error if the client is already connected to a remote server.
144
- if gc.store_configuration.type == StoreType.REST:
145
- if not gc.zen_store.is_local_store():
146
- cli_utils.error(
147
- "Your ZenML client is already connected to a remote server. If "
148
- "you want to spin up a local ZenML server, please disconnect "
149
- "from the remote server first by running `zenml disconnect`."
150
- )
151
-
152
- if docker:
153
- from zenml.utils.docker_utils import check_docker
154
-
155
- if not check_docker():
156
- cli_utils.error(
157
- "Docker does not seem to be installed on your system. Please "
158
- "install Docker to use the Docker ZenML server local "
159
- "deployment or use one of the other deployment options."
160
- )
161
- provider = ServerProviderType.DOCKER
162
- else:
163
- if sys.platform == "win32" and not blocking:
164
- cli_utils.error(
165
- "Running the ZenML server locally as a background process is "
166
- "not supported on Windows. Please use the `--blocking` flag "
167
- "to run the server in blocking mode, or run the server in "
168
- "a Docker container by setting `--docker` instead."
169
- )
170
- else:
171
- pass
172
- provider = ServerProviderType.LOCAL
173
- if cli_utils.requires_mac_env_var_warning():
174
- cli_utils.error(
175
- "The `OBJC_DISABLE_INITIALIZE_FORK_SAFETY` environment variable "
176
- "is recommended to run the ZenML server locally on a Mac. "
177
- "Please set it to `YES` and try again."
178
- )
179
-
180
- os.environ[ENV_ZENML_LOCAL_SERVER] = str(True)
181
-
182
- deployer = ServerDeployer()
183
-
184
- server = get_active_deployment(local=True)
185
- if server and server.config.provider != provider:
186
- deployer.remove_server(LOCAL_ZENML_SERVER_NAME)
187
-
188
- config_attrs: Dict[str, Any] = dict(
189
- name=LOCAL_ZENML_SERVER_NAME,
190
- provider=provider,
112
+ cli_utils.warning(
113
+ "The `zenml up` command is deprecated and will be removed in a "
114
+ "future release. Please use the `zenml login --local` command instead."
191
115
  )
192
- if not docker:
193
- config_attrs["blocking"] = blocking
194
- elif image:
195
- config_attrs["image"] = image
196
- if port is not None:
197
- config_attrs["port"] = port
198
- if ip_address is not None and provider in [
199
- ServerProviderType.LOCAL,
200
- ServerProviderType.DOCKER,
201
- ]:
202
- config_attrs["ip_address"] = ip_address
203
- config_attrs["use_legacy_dashboard"] = legacy
204
-
205
- from zenml.zen_server.deploy.deployment import ServerDeploymentConfig
206
-
207
- server_config = ServerDeploymentConfig(**config_attrs)
208
- if blocking:
209
- from zenml.constants import (
210
- DEFAULT_USERNAME,
211
- )
212
-
213
- cli_utils.declare(
214
- "The local ZenML dashboard is about to deploy in a "
215
- "blocking process. You can connect to it using the "
216
- f"'{DEFAULT_USERNAME}' username and an empty password."
217
- )
218
- server = deployer.deploy_server(server_config)
219
-
220
- if not blocking:
221
- from zenml.constants import (
222
- DEFAULT_PASSWORD,
223
- DEFAULT_USERNAME,
224
- )
225
116
 
226
- deployer.connect_to_server(
227
- LOCAL_ZENML_SERVER_NAME,
228
- DEFAULT_USERNAME,
229
- DEFAULT_PASSWORD,
230
- )
117
+ # Calling the `zenml login` command
118
+ cli_utils.declare("Calling `zenml login --local`...")
119
+ login.callback( # type: ignore[misc]
120
+ local=True,
121
+ docker=docker,
122
+ ip_address=ip_address,
123
+ port=port,
124
+ blocking=blocking,
125
+ image=image,
126
+ ngrok_token=ngrok_token,
127
+ )
231
128
 
232
- if server.status and server.status.url:
233
- cli_utils.declare(
234
- f"The local ZenML dashboard is available at "
235
- f"'{server.status.url}'. You can connect to it using the "
236
- f"'{DEFAULT_USERNAME}' username and an empty password. "
237
- )
238
- zenml.show(
239
- ngrok_token=ngrok_token,
240
- username=DEFAULT_USERNAME,
241
- password=DEFAULT_PASSWORD,
242
- )
243
129
 
130
+ @cli.command(
131
+ "show",
132
+ help="""Show the ZenML dashboard.
244
133
 
134
+ DEPRECATED: Please use `zenml server show` instead.
135
+ """,
136
+ )
245
137
  @click.option(
246
138
  "--ngrok-token",
247
139
  type=str,
248
140
  default=None,
249
141
  help="Specify an ngrok auth token to use for exposing the ZenML server.",
250
142
  )
251
- @cli.command("show", help="Show the ZenML dashboard.")
252
- def show(ngrok_token: Optional[str] = None) -> None:
143
+ def legacy_show(ngrok_token: Optional[str] = None) -> None:
253
144
  """Show the ZenML dashboard.
254
145
 
255
146
  Args:
@@ -257,204 +148,35 @@ def show(ngrok_token: Optional[str] = None) -> None:
257
148
  on a public domain. Primarily used for accessing the dashboard in
258
149
  Colab.
259
150
  """
260
- try:
261
- zenml.show(ngrok_token=ngrok_token)
262
- except RuntimeError as e:
263
- cli_utils.error(str(e))
264
-
265
-
266
- @cli.command("down", help="Shut down the local ZenML dashboard.")
267
- def down() -> None:
268
- """Shut down the local ZenML dashboard."""
269
- server = get_active_deployment(local=True)
270
-
271
- if not server:
272
- cli_utils.declare("The local ZenML dashboard is not running.")
273
-
274
- else:
275
- from zenml.zen_server.deploy.deployer import ServerDeployer
276
-
277
- deployer = ServerDeployer()
278
- deployer.remove_server(server.config.name)
279
- cli_utils.declare("The local ZenML dashboard has been shut down.")
280
-
281
- os.environ[ENV_ZENML_LOCAL_SERVER] = str(False)
282
-
283
- gc = GlobalConfiguration()
284
- gc.set_default_store()
285
-
286
-
287
- @cli.command("deploy", help="Deploy ZenML in the cloud.")
288
- @click.option(
289
- "--provider",
290
- "-p",
291
- type=click.Choice(
292
- [
293
- ServerProviderType.AWS.value,
294
- ServerProviderType.GCP.value,
295
- ServerProviderType.AZURE.value,
296
- ],
297
- case_sensitive=True,
298
- ),
299
- default=None,
300
- help="Server deployment provider.",
301
- )
302
- @click.option(
303
- "--name",
304
- type=str,
305
- help="A name for the ZenML server deployment. This is used as a prefix for "
306
- "the names of deployed resources, such as database services and Kubernetes "
307
- "resources.",
308
- )
309
- @click.option(
310
- "--timeout",
311
- "-t",
312
- type=click.INT,
313
- default=None,
314
- help="Time in seconds to wait for the server to be deployed.",
315
- )
316
- @click.option(
317
- "--config",
318
- help="Use a YAML or JSON configuration or configuration file.",
319
- required=False,
320
- type=str,
321
- )
322
- @click.option(
323
- "--gcp-project-id",
324
- help="The project in GCP to deploy the server to. ",
325
- required=False,
326
- type=str,
327
- )
328
- def deploy(
329
- provider: Optional[str] = None,
330
- name: Optional[str] = None,
331
- timeout: Optional[int] = None,
332
- config: Optional[str] = None,
333
- gcp_project_id: Optional[str] = None,
334
- ) -> None:
335
- """Deploy the ZenML server in a cloud provider.
336
-
337
- Args:
338
- name: Name for the ZenML server deployment.
339
- provider: ZenML server provider name.
340
- timeout: Time in seconds to wait for the server to start.
341
- config: A YAML or JSON configuration or configuration file to use.
342
- gcp_project_id: The project in GCP to deploy the server to.
343
- """
344
- with track_handler(
345
- event=AnalyticsEvent.ZENML_SERVER_DEPLOYED
346
- ) as analytics_handler:
347
- try:
348
- terraform_utils.verify_terraform_installation()
349
- except RuntimeError as e:
350
- cli_utils.error(str(e))
351
-
352
- config_dict: Dict[str, Any] = {}
353
-
354
- if config:
355
- if os.path.isfile(config):
356
- config_dict = yaml_utils.read_yaml(config)
357
- else:
358
- config_dict = yaml.safe_load(config)
359
- if not isinstance(config_dict, dict):
360
- cli_utils.error(
361
- "The configuration argument must be JSON/YAML content or "
362
- "point to a valid configuration file."
363
- )
364
-
365
- name = config_dict.get("name", name)
366
- provider = config_dict.get("provider", provider)
367
-
368
- if not name:
369
- name = click.prompt(
370
- "ZenML server name (used as a prefix for the names of deployed "
371
- "resources)",
372
- default="zenml",
373
- )
374
- config_dict["name"] = name
375
-
376
- if not provider:
377
- provider = click.prompt(
378
- "ZenML server provider",
379
- type=click.Choice(
380
- [
381
- ServerProviderType.AWS.value,
382
- ServerProviderType.GCP.value,
383
- ServerProviderType.AZURE.value,
384
- ],
385
- case_sensitive=True,
386
- ),
387
- default=ServerProviderType.AWS.value,
388
- )
389
- config_dict["provider"] = provider
390
-
391
- if provider == ServerProviderType.GCP.value:
392
- if "project_id" not in config_dict:
393
- if not gcp_project_id:
394
- gcp_project_id = click.prompt(
395
- "GCP project ID",
396
- )
397
- config_dict["project_id"] = gcp_project_id
398
-
399
- from zenml.zen_server.deploy.deployment import ServerDeploymentConfig
400
-
401
- server_config = ServerDeploymentConfig.model_validate(config_dict)
402
-
403
- from zenml.zen_server.deploy.deployer import ServerDeployer
404
-
405
- deployer = ServerDeployer()
406
-
407
- server = get_active_deployment(local=False)
408
- if server:
409
- if server.config.provider != provider:
410
- cli_utils.error(
411
- "ZenML is already deployed using a different provider "
412
- f"({server.config.provider}). Please tear down the "
413
- "existing deployment by running `zenml destroy` before "
414
- "deploying a new one."
415
- )
416
-
417
- if server.config.name != name:
418
- cli_utils.error(
419
- f"An existing deployment with a different name "
420
- f"'{server.config.name}' already exists. Please tear down "
421
- f"the existing deployment by running `zenml destroy` "
422
- f"before deploying a new one."
423
- )
424
-
425
- server = deployer.deploy_server(server_config, timeout=timeout)
426
-
427
- metadata = {
428
- "server_deployment": str(server.config.provider),
429
- }
430
-
431
- analytics_handler.metadata = metadata
151
+ cli_utils.warning(
152
+ "The `zenml show` command is deprecated and will be removed in a "
153
+ "future release. Please use the `zenml server show` command "
154
+ "instead."
155
+ )
432
156
 
433
- if server.status and server.status.url:
434
- cli_utils.declare(
435
- f"ZenML server '{name}' running at '{server.status.url}'. To "
436
- "connect to the server, run `zenml connect --url "
437
- f"{server.status.url}`."
438
- )
157
+ # Calling the `zenml server show` command
158
+ cli_utils.declare("Calling `zenml server show`...")
159
+ show(local=False, ngrok_token=ngrok_token)
439
160
 
440
161
 
441
162
  @cli.command(
442
- "destroy", help="Tear down and clean up the cloud ZenML deployment."
443
- )
444
- def destroy() -> None:
445
- """Tear down and clean up a cloud ZenML deployment."""
446
- server = get_active_deployment(local=False)
447
- if not server:
448
- cli_utils.declare("No cloud ZenML server has been deployed.")
449
- return
450
-
451
- from zenml.zen_server.deploy.deployer import ServerDeployer
163
+ "down",
164
+ help="""Shut down the local ZenML dashboard.
452
165
 
453
- deployer = ServerDeployer()
454
- deployer.remove_server(server.config.name)
166
+ DEPRECATED: Please use `zenml logout local` instead.
167
+ """,
168
+ )
169
+ def down() -> None:
170
+ """Shut down the local ZenML dashboard."""
171
+ cli_utils.warning(
172
+ "The `zenml down` command is deprecated and will be removed in a "
173
+ "future release. Please use the `zenml logout --local` command instead."
174
+ )
455
175
 
456
- cli_utils.declare(
457
- "The ZenML server has been torn down and all resources removed."
176
+ # Calling the `zenml logout` command
177
+ cli_utils.declare("Calling `zenml logout --local`...")
178
+ logout.callback( # type: ignore[misc]
179
+ local=True
458
180
  )
459
181
 
460
182
 
@@ -463,30 +185,87 @@ def destroy() -> None:
463
185
  )
464
186
  def status() -> None:
465
187
  """Show details about the current configuration."""
188
+ from zenml.login.credentials_store import get_credentials_store
189
+ from zenml.login.pro.client import ZenMLProClient
190
+
466
191
  gc = GlobalConfiguration()
467
192
  client = Client()
468
193
 
469
194
  store_cfg = gc.store_configuration
470
195
 
471
- # Write about the current ZenML server
472
- cli_utils.declare("-----ZenML Server Status-----")
196
+ # Write about the current ZenML client
197
+ cli_utils.declare("-----ZenML Client Status-----")
473
198
  if gc.uses_default_store():
474
199
  cli_utils.declare(
475
- f"Connected to a local ZenML database: ('{store_cfg.url}')"
200
+ f"Connected to the local ZenML database: '{store_cfg.url}'"
201
+ )
202
+ elif connected_to_local_server():
203
+ cli_utils.declare(
204
+ f"Connected to the local ZenML server: {store_cfg.url}"
205
+ )
206
+ elif re.match(r"^mysql://", store_cfg.url):
207
+ cli_utils.declare(
208
+ f"Connected directly to a SQL database: '{store_cfg.url}'"
476
209
  )
477
210
  else:
478
- cli_utils.declare(f"Connected to a ZenML server: '{store_cfg.url}'")
211
+ credentials_store = get_credentials_store()
212
+ server = credentials_store.get_credentials(store_cfg.url)
213
+ if server:
214
+ if server.type == ServerType.PRO:
215
+ # If connected to a ZenML Pro server, refresh the server info
216
+ pro_credentials = credentials_store.get_pro_credentials(
217
+ allow_expired=False
218
+ )
219
+ if pro_credentials:
220
+ pro_client = ZenMLProClient()
221
+ pro_servers = pro_client.tenant.list(
222
+ url=store_cfg.url, member_only=True
223
+ )
224
+ if pro_servers:
225
+ credentials_store.update_server_info(
226
+ server_url=store_cfg.url,
227
+ server_info=pro_servers[0],
228
+ )
229
+
230
+ cli_utils.declare(
231
+ f"Connected to a ZenML Pro server: `{server.server_name_hyperlink}`"
232
+ f" [{server.server_id_hyperlink}]"
233
+ )
479
234
 
480
- # Write about the active entities
481
- scope = "repository" if client.uses_local_configuration else "global"
482
- cli_utils.declare(f" The active user is: '{client.active_user.name}'")
483
- cli_utils.declare(
484
- f" The active workspace is: '{client.active_workspace.name}' "
485
- f"({scope})"
486
- )
487
- cli_utils.declare(
488
- f" The active stack is: '{client.active_stack_model.name}' ({scope})"
489
- )
235
+ cli_utils.declare(
236
+ f" ZenML Pro Organization: {server.organization_hyperlink}"
237
+ )
238
+ if pro_credentials:
239
+ cli_utils.declare(
240
+ f" ZenML Pro authentication: {pro_credentials.auth_status}"
241
+ )
242
+ else:
243
+ cli_utils.declare(
244
+ f"Connected to a remote ZenML server: `{server.dashboard_hyperlink}`"
245
+ )
246
+
247
+ cli_utils.declare(f" Dashboard: {server.dashboard_hyperlink}")
248
+ cli_utils.declare(f" API: {server.api_hyperlink}")
249
+ cli_utils.declare(f" Server status: '{server.status}'")
250
+ cli_utils.declare(f" Server authentication: {server.auth_status}")
251
+
252
+ else:
253
+ cli_utils.declare(
254
+ f"Connected to a remote ZenML server: [link={store_cfg.url}]"
255
+ f"{store_cfg.url}[/link]"
256
+ )
257
+
258
+ try:
259
+ client.zen_store.get_store_info()
260
+ except Exception as e:
261
+ cli_utils.warning(f"Error while initializing client: {e}")
262
+ else:
263
+ # Write about the active entities
264
+ scope = "repository" if client.uses_local_configuration else "global"
265
+ cli_utils.declare(f" The active user is: '{client.active_user.name}'")
266
+ cli_utils.declare(
267
+ f" The active stack is: '{client.active_stack_model.name}' ({scope})"
268
+ )
490
269
 
491
270
  if client.root:
492
271
  cli_utils.declare(f"Active repository root: {client.root}")
@@ -497,17 +276,34 @@ def status() -> None:
497
276
  f"Local store files are located at: '{gc.local_stores_path}'"
498
277
  )
499
278
 
500
- server = get_active_deployment(local=True)
501
- if server:
502
- cli_utils.declare("The status of the local dashboard:")
503
- cli_utils.print_server_deployment(server)
504
-
505
- server = get_active_deployment(local=False)
506
- if server:
507
- cli_utils.declare(
508
- "The status of the cloud ZenML server deployed from this host:"
509
- )
510
- cli_utils.print_server_deployment(server)
279
+ cli_utils.declare("\n-----Local ZenML Server Status-----")
280
+ local_server = get_local_server()
281
+ if local_server:
282
+ if local_server.status:
283
+ if local_server.status.status == ServiceState.ACTIVE:
284
+ cli_utils.declare(
285
+ f"The local {local_server.config.provider} server is "
286
+ f"running at: {local_server.status.url}"
287
+ )
288
+ else:
289
+ cli_utils.declare(
290
+ f"The local {local_server.config.provider} server is not "
291
+ "available."
292
+ )
293
+ cli_utils.declare(
294
+ f" Server state: {local_server.status.status}"
295
+ )
296
+ if local_server.status.status_message:
297
+ cli_utils.declare(
298
+ f" Status message: {local_server.status.status_message}"
299
+ )
300
+ else:
301
+ cli_utils.declare(
302
+ f"The local {local_server.config.provider} server is not "
303
+ "running."
304
+ )
305
+ else:
306
+ cli_utils.declare("The local server has not been started.")
511
307
 
512
308
 
513
309
  @cli.command(
@@ -515,57 +311,17 @@ def status() -> None:
515
311
  help=(
516
312
  """Connect to a remote ZenML server.
517
313
 
518
- Examples:
519
-
520
- * to connect to a ZenML deployment using web login:
521
-
522
- zenml connect --url=http://zenml.example.com:8080
314
+ DEPRECATED: Please use `zenml login` instead.
523
315
 
524
- * to connect to a ZenML deployment using command line arguments:
525
-
526
- zenml connect --url=http://zenml.example.com:8080 --username=admin
527
-
528
- * to use a configuration file:
529
-
530
- zenml connect --config=/path/to/zenml_config.yaml
531
-
532
- * when no arguments are supplied, ZenML will attempt to connect to the
533
- last ZenML server deployed from the local host using the 'zenml deploy'
534
- command.
535
-
536
- The configuration file must be a YAML or JSON file with the following
537
- attributes:
538
-
539
- url: The URL of the ZenML server.
540
-
541
- username: The username to use for authentication.
542
-
543
- password: The password to use for authentication.
544
-
545
- verify_ssl: Either a boolean, in which case it controls whether the
546
- server's TLS certificate is verified, or a string, in which case it
547
- must be a path to a CA certificate bundle to use or the CA bundle
548
- value itself.
316
+ Examples:
549
317
 
550
- http_timeout: The number of seconds to wait for HTTP requests to the
551
- ZenML server to be successful before issuing a timeout error
552
- (default: 5).
318
+ * to re-login to the current ZenML server or connect to a ZenML Pro server:
553
319
 
554
- Example configuration:
320
+ zenml connect
555
321
 
556
- url: https://ac8ef63af203226194a7725ee71d85a-7635928635.us-east-1.elb.amazonaws.com/zenml\n
557
- username: admin\n
558
- password: Pa$$word123\n
559
- verify_ssl: |\n
560
- -----BEGIN CERTIFICATE-----
561
- MIIDETCCAfmgAwIBAgIQYUmQg2LR/pHAMZb/vQwwXjANBgkqhkiG9w0BAQsFADAT
562
- MREwDwYDVQQDEwh6ZW5tbC1jYTAeFw0yMjA5MjYxMzI3NDhaFw0yMzA5MjYxMzI3\n
563
- ...\n
564
- ULnzA0JkRWRnFqH6uXeJo1KAVqtxn1xf8PYxx3NlNDr9wi8KKwARf2lwm6sH4mvq
565
- 1aZ/0iYnGKCu7rLJzxeguliMf69E\n
566
- -----END CERTIFICATE-----
567
- http_timeout: 10
322
+ * to log in to a particular ZenML server:
568
323
 
324
+ zenml connect --url=http://zenml.example.com:8080
569
325
  """
570
326
  ),
571
327
  )
@@ -578,15 +334,15 @@ def status() -> None:
578
334
  )
579
335
  @click.option(
580
336
  "--username",
581
- help="The username that is used to authenticate with a ZenML server. If "
582
- "omitted, the web login will be used.",
337
+ help="(Deprecated) The username that is used to authenticate with a ZenML "
338
+ "server. If omitted, the web login will be used.",
583
339
  required=False,
584
340
  type=str,
585
341
  )
586
342
  @click.option(
587
343
  "--password",
588
- help="The password that is used to authenticate with a ZenML server. If "
589
- "omitted, a prompt will be shown to enter the password.",
344
+ help="(Deprecated) The password that is used to authenticate with a ZenML "
345
+ "server. If omitted, a prompt will be shown to enter the password.",
590
346
  required=False,
591
347
  type=str,
592
348
  )
@@ -610,19 +366,6 @@ def status() -> None:
610
366
  required=False,
611
367
  type=str,
612
368
  )
613
- @click.option(
614
- "--config",
615
- help="Use a YAML or JSON configuration or configuration file.",
616
- required=False,
617
- type=str,
618
- )
619
- @click.option(
620
- "--raw-config",
621
- is_flag=True,
622
- help="Whether to use the configuration without prompting for missing "
623
- "fields.",
624
- default=False,
625
- )
626
369
  def connect(
627
370
  url: Optional[str] = None,
628
371
  username: Optional[str] = None,
@@ -630,8 +373,6 @@ def connect(
630
373
  api_key: Optional[str] = None,
631
374
  no_verify_ssl: bool = False,
632
375
  ssl_ca_cert: Optional[str] = None,
633
- config: Optional[str] = None,
634
- raw_config: bool = False,
635
376
  ) -> None:
636
377
  """Connect to a remote ZenML server.
637
378
 
@@ -646,158 +387,53 @@ def connect(
646
387
  no_verify_ssl: Whether to verify the server's TLS certificate.
647
388
  ssl_ca_cert: A path to a CA bundle to use to verify the server's TLS
648
389
  certificate or the CA bundle value itself.
649
- config: A YAML or JSON configuration or configuration file to use.
650
- raw_config: Whether to use the configuration without prompting for
651
- missing fields.
652
390
  """
653
- from zenml.config.store_config import StoreConfiguration
654
- from zenml.zen_stores.base_zen_store import BaseZenStore
655
-
656
- if password is not None:
657
- cli_utils.warning(
658
- "Supplying password values in the command line is not safe. "
659
- "Please consider using the prompt option."
660
- )
661
-
662
- # Raise an error if a local server is running when trying to connect to
663
- # another server
664
- active_deployment = get_active_deployment(local=True)
665
- if (
666
- active_deployment
667
- and active_deployment.status
668
- and active_deployment.status.url != url
669
- ):
670
- cli_utils.error(
671
- "You're trying to connect to a remote ZenML server but already "
672
- "have a local server running. This can lead to unexpected "
673
- "behavior. Please shut down the local server by running "
674
- "`zenml down` before connecting to a remote server."
675
- )
676
-
677
- store_dict: Dict[str, Any] = {}
678
- verify_ssl: Union[str, bool] = (
679
- ssl_ca_cert if ssl_ca_cert is not None else not no_verify_ssl
391
+ cli_utils.warning(
392
+ "The `zenml connect` command is deprecated and will be removed in a "
393
+ "future release. Please use the `zenml login` command instead. "
680
394
  )
681
395
 
682
- if config:
683
- if os.path.isfile(config):
684
- store_dict = yaml_utils.read_yaml(config)
685
- else:
686
- store_dict = yaml.safe_load(config)
687
- if not isinstance(store_dict, dict):
688
- cli_utils.error(
689
- "The configuration argument must be JSON/YAML content or "
690
- "point to a valid configuration file."
691
- )
692
-
693
- if raw_config:
694
- store_config = StoreConfiguration.model_validate(store_dict)
695
- GlobalConfiguration().set_store(store_config)
696
- return
697
-
698
- url = store_dict.get("url", url)
699
- username = username or store_dict.get("username")
700
- password = password or store_dict.get("password")
701
- api_key = api_key or store_dict.get("api_key")
702
- verify_ssl = store_dict.get("verify_ssl", verify_ssl)
703
-
704
- elif url is None:
705
- server = get_active_deployment(local=False)
706
-
707
- if server is None or not server.status or not server.status.url:
708
- cli_utils.warning(
709
- "Running `zenml connect` without arguments can only be used to "
710
- "connect to a ZenML server previously deployed from this host "
711
- "with `zenml deploy`, but no such active deployment was found. "
712
- "Please use the `--url` or `--config` command line arguments "
713
- "to configure how to connect to a remote third party ZenML "
714
- "server. Alternatively, call `zenml up` to start the ZenML "
715
- "dashboard locally."
716
- )
717
- return
718
- url = server.status.url
719
- if server.status.ca_crt:
720
- verify_ssl = server.status.ca_crt
721
-
722
- if not url:
723
- url = click.prompt("ZenML server URL", type=str)
724
- else:
725
- cli_utils.declare(f"Connecting to: '{url}'...")
726
- assert url is not None
727
-
728
- store_dict["url"] = url
729
- store_type = BaseZenStore.get_store_type(url)
730
- if store_type == StoreType.REST:
731
- store_dict["verify_ssl"] = verify_ssl
732
-
733
- if not username and not api_key:
734
- if store_type == StoreType.REST:
735
- store_dict["api_token"] = web_login(url=url, verify_ssl=verify_ssl)
736
- else:
737
- username = click.prompt("Username", type=str)
738
-
739
- if username:
396
+ if password is not None or username is not None:
740
397
  cli_utils.warning(
741
398
  "Connecting to a ZenML server using a username and password is "
742
- "not recommended because the password is locally stored on your "
743
- "filesystem. You should consider using the web login workflow by "
744
- "omitting the `--username` and `--password` flags. An alternative "
745
- "for non-interactive environments is to create and use a service "
746
- "account API key (see https://docs.zenml.io/how-to/connecting-to-zenml/connect-with-a-service-account "
399
+ "insecure because the password is locally stored on your "
400
+ "filesystem and is no longer supported. The web login workflow will "
401
+ "be used instead. An alternative for non-interactive environments "
402
+ "is to create and use a service account API key (see "
403
+ "https://docs.zenml.io/how-to/connecting-to-zenml/connect-with-a-service-account "
747
404
  "for more information)."
748
405
  )
749
406
 
750
- store_dict["username"] = username
751
-
752
- if password is None:
753
- password = click.prompt(
754
- f"Password for user {username} (press ENTER for empty password)",
755
- default="",
756
- hide_input=True,
757
- )
758
- store_dict["password"] = password
759
- elif api_key:
760
- store_dict["api_key"] = api_key
761
-
762
- store_config_class = BaseZenStore.get_store_config_class(store_type)
763
- assert store_config_class is not None
407
+ # Calling the `zenml login` command
408
+ cli_utils.declare("Calling `zenml login`...")
409
+ login.callback( # type: ignore[misc]
410
+ server=url,
411
+ api_key=api_key,
412
+ no_verify_ssl=no_verify_ssl,
413
+ ssl_ca_cert=ssl_ca_cert,
414
+ )
764
415
 
765
- store_config = store_config_class.model_validate(store_dict)
766
- try:
767
- GlobalConfiguration().set_store(store_config)
768
- except IllegalOperationError:
769
- cli_utils.warning(
770
- f"User '{username}' does not have sufficient permissions to "
771
- f"access the server at '{url}'."
772
- )
773
- except AuthorizationException as e:
774
- cli_utils.warning(f"Authorization error: {e}")
775
416
 
417
+ @cli.command(
418
+ "disconnect",
419
+ help="""Disconnect from a ZenML server.
776
420
 
777
- @cli.command("disconnect", help="Disconnect from a ZenML server.")
421
+ DEPRECATED: Please use `zenml logout` instead.
422
+ """,
423
+ )
778
424
  def disconnect_server() -> None:
779
425
  """Disconnect from a ZenML server."""
780
- from zenml.zen_server.deploy.deployer import ServerDeployer
781
- from zenml.zen_stores.base_zen_store import BaseZenStore
782
-
783
- gc = GlobalConfiguration()
426
+ cli_utils.warning(
427
+ "The `zenml disconnect` command is deprecated and will be removed in a "
428
+ "future release. Please use the `zenml logout` command instead."
429
+ )
784
430
 
785
- url = gc.store_configuration.url
786
- store_type = BaseZenStore.get_store_type(url)
787
- if store_type == StoreType.REST:
788
- deployer = ServerDeployer()
789
- deployer.disconnect_from_server()
790
- else:
791
- gc.set_default_store()
792
- cli_utils.declare("Restored default store configuration.")
431
+ # Calling the `zenml logout` command
432
+ cli_utils.declare("Calling `zenml logout`...")
433
+ logout.callback() # type: ignore[misc]
793
434
 
794
435
 
795
- @cli.command("logs", help="Show the logs for the local or cloud ZenML server.")
796
- @click.option(
797
- "--local",
798
- is_flag=True,
799
- help="Show the logs for the local ZenML server.",
800
- )
436
+ @cli.command("logs", help="Show the logs for the local ZenML server.")
801
437
  @click.option(
802
438
  "--follow",
803
439
  "-f",
@@ -818,7 +454,6 @@ def disconnect_server() -> None:
818
454
  help="Show raw log contents (don't pretty-print logs).",
819
455
  )
820
456
  def logs(
821
- local: bool = False,
822
457
  follow: bool = False,
823
458
  raw: bool = False,
824
459
  tail: Optional[int] = None,
@@ -826,37 +461,31 @@ def logs(
826
461
  """Display the logs for a ZenML server.
827
462
 
828
463
  Args:
829
- local: Whether to show the logs for the local ZenML server.
830
464
  follow: Continue to output new log data as it becomes available.
831
465
  tail: Only show the last NUM lines of log output.
832
466
  raw: Show raw log contents (don't pretty-print logs).
833
467
  """
834
- server = get_active_deployment(local=True)
835
- if not local:
836
- remote_server = get_active_deployment(local=False)
837
- if remote_server is not None:
838
- server = remote_server
839
-
468
+ server = get_local_server()
840
469
  if server is None:
841
470
  cli_utils.error(
842
471
  "The local ZenML dashboard is not running. Please call `zenml "
843
472
  "up` first to start the ZenML dashboard locally."
844
473
  )
845
474
 
846
- server_name = server.config.name
475
+ from zenml.zen_server.deploy.deployer import LocalServerDeployer
847
476
 
848
- from zenml.zen_server.deploy.deployer import ServerDeployer
477
+ deployer = LocalServerDeployer()
849
478
 
850
- deployer = ServerDeployer()
851
-
852
- cli_utils.declare(f"Showing logs for server: {server_name}")
479
+ cli_utils.declare(
480
+ f"Showing logs for the local {server.config.provider} server"
481
+ )
853
482
 
854
483
  from zenml.zen_server.deploy.exceptions import (
855
484
  ServerDeploymentNotFoundError,
856
485
  )
857
486
 
858
487
  try:
859
- logs = deployer.get_server_logs(server_name, follow=follow, tail=tail)
488
+ logs = deployer.get_server_logs(follow=follow, tail=tail)
860
489
  except ServerDeploymentNotFoundError as e:
861
490
  cli_utils.error(f"Server not found: {e}")
862
491
 
@@ -869,3 +498,259 @@ def logs(
869
498
  console.print(line)
870
499
  except MarkupError:
871
500
  console.print(line, markup=False)
501
+
502
+
503
+ @cli.group(cls=TagGroup, tag=CliCategories.MANAGEMENT_TOOLS)
504
+ def server() -> None:
505
+ """Commands for managing ZenML servers."""
506
+
507
+
508
+ @server.command(
509
+ "list",
510
+ help="""List all ZenML servers that this client is authenticated to.
511
+
512
+ The CLI can be authenticated to multiple ZenML servers at the same time,
513
+ even though it can only be connected to one server at a time. You can list
514
+ all the ZenML servers that the client is currently authenticated to by
515
+ using this command.
516
+
517
+ When logged in to ZenML Pro, this list will also include all ZenML Pro
518
+ servers that the authenticated user can access or could potentially access,
519
+ including details such as their current state and the organization they
520
+ belong to.
521
+
522
+ The complete list of servers displayed by this command includes the
523
+ following:
524
+
525
+ * ZenML Pro servers that the authenticated ZenML Pro user can or could
526
+ access. The client needs to be logged to ZenML Pro via
527
+ `zenml login --pro` to access these servers.
528
+
529
+ * ZenML servers that the client has logged in to via
530
+ `zenml login --url` in the past.
531
+
532
+ * the local ZenML server started with `zenml login --local`, if one is
533
+ running.
534
+
535
+ By default, this command does not display ZenML servers that are not
536
+ accessible: servers that are not running, are no longer accessible due to
537
+ an expired authentication and ZenML Pro servers where the user is not a
538
+ member. To include these servers in the list, use the `--all` flag.
539
+ """,
540
+ )
541
+ @click.option(
542
+ "--verbose",
543
+ "-v",
544
+ is_flag=True,
545
+ help="Show verbose output.",
546
+ )
547
+ @click.option(
548
+ "--all",
549
+ "-a",
550
+ is_flag=True,
551
+ help="Show all ZenML servers, including those that are not running "
552
+ "and those with an expired authentication.",
553
+ )
554
+ def server_list(verbose: bool = False, all: bool = False) -> None:
555
+ """List all ZenML servers that this client is authorized to access.
556
+
557
+ Args:
558
+ verbose: Whether to show verbose output.
559
+ all: Whether to show all ZenML servers.
560
+ """
561
+ from zenml.login.credentials_store import get_credentials_store
562
+ from zenml.login.pro.client import ZenMLProClient
563
+ from zenml.login.pro.tenant.models import TenantRead, TenantStatus
564
+
565
+ credentials_store = get_credentials_store()
566
+ pro_token = credentials_store.get_pro_token(allow_expired=True)
567
+ current_store_config = GlobalConfiguration().store_configuration
568
+
569
+ # The list of ZenML Pro servers kept in the credentials store
570
+ pro_servers = credentials_store.list_credentials(type=ServerType.PRO)
571
+ # The list of regular remote ZenML servers kept in the credentials store
572
+ servers = list(credentials_store.list_credentials(type=ServerType.REMOTE))
573
+ # The list of local ZenML servers kept in the credentials store
574
+ local_servers = list(
575
+ credentials_store.list_credentials(type=ServerType.LOCAL)
576
+ )
577
+
578
+ if pro_token and not pro_token.expired:
579
+ # If the ZenML Pro authentication is still valid, we include all ZenML
580
+ # Pro servers that the current ZenML Pro user can access, even those
581
+ # that the user has never connected to (and are therefore not stored in
582
+ # the credentials store).
583
+
584
+ accessible_pro_servers: List[TenantRead] = []
585
+ try:
586
+ client = ZenMLProClient()
587
+ accessible_pro_servers = client.tenant.list(member_only=not all)
588
+ except AuthorizationException as e:
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
+
610
+ # We update the list of stored ZenML Pro servers with the ones that the
611
+ # client is a member of
612
+ for accessible_server in accessible_pro_servers:
613
+ for idx, stored_server in enumerate(pro_servers):
614
+ if stored_server.server_id == accessible_server.id:
615
+ # All ZenML Pro servers accessible by the current ZenML Pro
616
+ # user have an authentication that is valid at least until
617
+ # the current ZenML Pro authentication token expires.
618
+ stored_server.update_server_info(
619
+ accessible_server,
620
+ )
621
+ updated_server = stored_server.model_copy()
622
+ # Replace the current server API token with the current
623
+ # ZenML Pro API token to reflect the current authentication
624
+ # status.
625
+ updated_server.api_token = pro_token
626
+ pro_servers[idx] = updated_server
627
+ break
628
+ else:
629
+ stored_server = ServerCredentials(
630
+ url=accessible_server.url or "",
631
+ api_token=pro_token,
632
+ )
633
+ stored_server.update_server_info(accessible_server)
634
+ pro_servers.append(stored_server)
635
+
636
+ elif pro_servers:
637
+ cli_utils.warning(
638
+ "The ZenML Pro authentication has expired. Please re-login "
639
+ "to ZenML Pro using `zenml login` to include all ZenML Pro servers "
640
+ "that you are a member of in the list."
641
+ )
642
+
643
+ # We add the local server to the list of servers, if it is running
644
+ local_server = get_local_server()
645
+ if local_server:
646
+ url = (
647
+ local_server.status.url if local_server.status else None
648
+ ) or local_server.config.url
649
+ status = local_server.status.status if local_server.status else ""
650
+ local_servers.append(
651
+ ServerCredentials(
652
+ url=url or "",
653
+ status=status,
654
+ version=zenml.__version__,
655
+ server_id=GlobalConfiguration().user_id,
656
+ server_name=f"local {local_server.config.provider} server",
657
+ )
658
+ )
659
+
660
+ all_servers = pro_servers + local_servers + servers
661
+
662
+ if not all:
663
+ # Filter out servers that are expired or not running
664
+ all_servers = [s for s in all_servers if s.is_available]
665
+
666
+ if verbose:
667
+ columns = [
668
+ "type",
669
+ "server_id_hyperlink",
670
+ "server_name_hyperlink",
671
+ "organization_hyperlink" if pro_servers else "",
672
+ "version",
673
+ "status",
674
+ "dashboard_url",
675
+ "api_hyperlink",
676
+ "auth_status",
677
+ ]
678
+ elif all:
679
+ columns = [
680
+ "type",
681
+ "server_id_hyperlink",
682
+ "server_name_hyperlink",
683
+ "organization_hyperlink" if pro_servers else "",
684
+ "version",
685
+ "status",
686
+ "api_hyperlink",
687
+ ]
688
+ else:
689
+ columns = [
690
+ "type",
691
+ "server_id_hyperlink" if pro_servers else "",
692
+ "server_name_hyperlink",
693
+ "organization_hyperlink" if pro_servers else "",
694
+ "version",
695
+ "api_hyperlink" if servers else "",
696
+ ]
697
+
698
+ # Remove empty columns
699
+ columns = [c for c in columns if c]
700
+
701
+ # Figure out if the client is already connected to one of the
702
+ # servers in the list
703
+ current_server: List[ServerCredentials] = []
704
+ if current_store_config.type == StoreType.REST:
705
+ current_server = [
706
+ s for s in all_servers if s.url == current_store_config.url
707
+ ]
708
+
709
+ cli_utils.print_pydantic_models( # type: ignore[type-var]
710
+ all_servers,
711
+ columns=columns,
712
+ rename_columns={
713
+ "server_name_hyperlink": "name",
714
+ "server_id_hyperlink": "ID",
715
+ "organization_hyperlink": "organization",
716
+ "dashboard_url": "dashboard URL",
717
+ "api_hyperlink": "API URL",
718
+ "auth_status": "auth status",
719
+ },
720
+ active_models=current_server,
721
+ show_active=True,
722
+ )
723
+
724
+
725
+ @server.command(
726
+ "show",
727
+ help="Show the ZenML dashboard for the server that the client is connected to.",
728
+ )
729
+ @click.option(
730
+ "--local",
731
+ is_flag=True,
732
+ help="Show the ZenML dashboard for the local server.",
733
+ default=False,
734
+ type=click.BOOL,
735
+ )
736
+ @click.option(
737
+ "--ngrok-token",
738
+ type=str,
739
+ default=None,
740
+ help="Specify an ngrok auth token to use for exposing the local ZenML "
741
+ "server. Only used when `--local` is set. Primarily used for accessing the "
742
+ "local dashboard in Colab.",
743
+ )
744
+ def show(local: bool = False, ngrok_token: Optional[str] = None) -> None:
745
+ """Show the ZenML dashboard.
746
+
747
+ Args:
748
+ local: Whether to show the ZenML dashboard for the local server.
749
+ ngrok_token: An ngrok auth token to use for exposing the ZenML dashboard
750
+ on a public domain. Primarily used for accessing the local dashboard
751
+ in Colab.
752
+ """
753
+ try:
754
+ zenml.show(ngrok_token=ngrok_token)
755
+ except RuntimeError as e:
756
+ cli_utils.error(str(e))