zenml-nightly 0.58.2.dev20240626__py3-none-any.whl → 0.62.0.dev20240726__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 (266) hide show
  1. README.md +31 -10
  2. RELEASE_NOTES.md +280 -0
  3. zenml/VERSION +1 -1
  4. zenml/__init__.py +2 -0
  5. zenml/analytics/enums.py +3 -0
  6. zenml/cli/__init__.py +28 -0
  7. zenml/cli/artifact.py +1 -2
  8. zenml/cli/integration.py +9 -8
  9. zenml/cli/server.py +6 -0
  10. zenml/cli/stack.py +812 -39
  11. zenml/cli/stack_components.py +9 -0
  12. zenml/cli/text_utils.py +35 -1
  13. zenml/cli/utils.py +127 -10
  14. zenml/client.py +23 -14
  15. zenml/config/docker_settings.py +8 -5
  16. zenml/constants.py +13 -1
  17. zenml/container_registries/base_container_registry.py +1 -0
  18. zenml/enums.py +23 -0
  19. zenml/event_hub/event_hub.py +5 -8
  20. zenml/integrations/__init__.py +1 -0
  21. zenml/integrations/aws/__init__.py +1 -0
  22. zenml/integrations/azure/__init__.py +3 -2
  23. zenml/integrations/constants.py +1 -0
  24. zenml/integrations/databricks/__init__.py +52 -0
  25. zenml/integrations/databricks/flavors/__init__.py +30 -0
  26. zenml/integrations/databricks/flavors/databricks_model_deployer_flavor.py +118 -0
  27. zenml/integrations/databricks/flavors/databricks_orchestrator_flavor.py +147 -0
  28. zenml/integrations/databricks/model_deployers/__init__.py +20 -0
  29. zenml/integrations/databricks/model_deployers/databricks_model_deployer.py +249 -0
  30. zenml/integrations/databricks/orchestrators/__init__.py +20 -0
  31. zenml/integrations/databricks/orchestrators/databricks_orchestrator.py +497 -0
  32. zenml/integrations/databricks/orchestrators/databricks_orchestrator_entrypoint_config.py +97 -0
  33. zenml/integrations/databricks/services/__init__.py +19 -0
  34. zenml/integrations/databricks/services/databricks_deployment.py +407 -0
  35. zenml/integrations/databricks/utils/__init__.py +14 -0
  36. zenml/integrations/databricks/utils/databricks_utils.py +87 -0
  37. zenml/integrations/deepchecks/__init__.py +1 -0
  38. zenml/integrations/discord/__init__.py +1 -0
  39. zenml/integrations/evidently/__init__.py +1 -0
  40. zenml/integrations/facets/__init__.py +1 -0
  41. zenml/integrations/feast/__init__.py +1 -0
  42. zenml/integrations/gcp/__init__.py +3 -1
  43. zenml/integrations/gcp/google_credentials_mixin.py +1 -1
  44. zenml/integrations/gcp/service_connectors/gcp_service_connector.py +320 -64
  45. zenml/integrations/great_expectations/data_validators/ge_data_validator.py +12 -8
  46. zenml/integrations/huggingface/__init__.py +1 -0
  47. zenml/integrations/huggingface/materializers/huggingface_datasets_materializer.py +88 -3
  48. zenml/integrations/huggingface/steps/accelerate_runner.py +1 -7
  49. zenml/integrations/integration.py +24 -0
  50. zenml/integrations/kubeflow/__init__.py +3 -0
  51. zenml/integrations/kubeflow/flavors/kubeflow_orchestrator_flavor.py +1 -1
  52. zenml/integrations/kubeflow/orchestrators/kubeflow_orchestrator.py +0 -1
  53. zenml/integrations/kubernetes/__init__.py +3 -1
  54. zenml/integrations/kubernetes/orchestrators/kube_utils.py +4 -1
  55. zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py +1 -13
  56. zenml/integrations/kubernetes/orchestrators/manifest_utils.py +22 -4
  57. zenml/integrations/kubernetes/pod_settings.py +4 -0
  58. zenml/integrations/label_studio/annotators/label_studio_annotator.py +1 -0
  59. zenml/integrations/langchain/__init__.py +1 -0
  60. zenml/integrations/lightgbm/__init__.py +1 -0
  61. zenml/integrations/mlflow/__init__.py +4 -2
  62. zenml/integrations/mlflow/model_registries/mlflow_model_registry.py +6 -2
  63. zenml/integrations/mlflow/services/mlflow_deployment.py +1 -1
  64. zenml/integrations/neural_prophet/__init__.py +1 -0
  65. zenml/integrations/polars/__init__.py +1 -0
  66. zenml/integrations/prodigy/__init__.py +1 -0
  67. zenml/integrations/pycaret/__init__.py +6 -0
  68. zenml/integrations/registry.py +37 -0
  69. zenml/integrations/s3/artifact_stores/s3_artifact_store.py +17 -6
  70. zenml/integrations/seldon/__init__.py +1 -0
  71. zenml/integrations/seldon/model_deployers/seldon_model_deployer.py +1 -0
  72. zenml/integrations/skypilot/flavors/skypilot_orchestrator_base_vm_config.py +2 -2
  73. zenml/integrations/skypilot/orchestrators/skypilot_base_vm_orchestrator.py +1 -1
  74. zenml/integrations/skypilot/orchestrators/skypilot_orchestrator_entrypoint.py +2 -2
  75. zenml/integrations/skypilot_aws/__init__.py +2 -1
  76. zenml/integrations/skypilot_azure/__init__.py +1 -3
  77. zenml/integrations/skypilot_gcp/__init__.py +1 -1
  78. zenml/integrations/skypilot_lambda/__init__.py +1 -1
  79. zenml/integrations/skypilot_lambda/flavors/skypilot_orchestrator_lambda_vm_flavor.py +1 -1
  80. zenml/integrations/slack/__init__.py +1 -0
  81. zenml/integrations/tekton/__init__.py +1 -0
  82. zenml/integrations/tensorboard/__init__.py +0 -1
  83. zenml/integrations/tensorflow/__init__.py +18 -6
  84. zenml/integrations/wandb/__init__.py +1 -0
  85. zenml/logging/step_logging.py +34 -35
  86. zenml/materializers/built_in_materializer.py +1 -1
  87. zenml/materializers/cloudpickle_materializer.py +1 -1
  88. zenml/model/model.py +1 -1
  89. zenml/models/__init__.py +11 -0
  90. zenml/models/v2/core/component.py +47 -0
  91. zenml/models/v2/core/model.py +1 -2
  92. zenml/models/v2/core/server_settings.py +0 -20
  93. zenml/models/v2/core/service_connector.py +17 -0
  94. zenml/models/v2/core/stack.py +31 -0
  95. zenml/models/v2/misc/full_stack.py +129 -0
  96. zenml/models/v2/misc/stack_deployment.py +91 -0
  97. zenml/new/pipelines/pipeline.py +1 -1
  98. zenml/new/pipelines/run_utils.py +1 -1
  99. zenml/orchestrators/__init__.py +4 -0
  100. zenml/orchestrators/input_utils.py +3 -6
  101. zenml/orchestrators/step_launcher.py +1 -0
  102. zenml/orchestrators/wheeled_orchestrator.py +147 -0
  103. zenml/service_connectors/service_connector_utils.py +408 -0
  104. zenml/stack/stack.py +3 -6
  105. zenml/stack_deployments/__init__.py +14 -0
  106. zenml/stack_deployments/aws_stack_deployment.py +254 -0
  107. zenml/stack_deployments/azure_stack_deployment.py +179 -0
  108. zenml/stack_deployments/gcp_stack_deployment.py +269 -0
  109. zenml/stack_deployments/stack_deployment.py +218 -0
  110. zenml/stack_deployments/utils.py +48 -0
  111. zenml/steps/base_step.py +7 -5
  112. zenml/utils/function_utils.py +2 -2
  113. zenml/utils/pagination_utils.py +7 -5
  114. zenml/utils/pipeline_docker_image_builder.py +105 -68
  115. zenml/utils/pydantic_utils.py +6 -5
  116. zenml/utils/source_utils.py +4 -1
  117. zenml/zen_server/cloud_utils.py +18 -3
  118. zenml/zen_server/dashboard/assets/{404-CDPQCl4D.js → 404-B_YdvmwS.js} +1 -1
  119. zenml/zen_server/dashboard/assets/@radix-CFOkMR_E.js +85 -0
  120. zenml/zen_server/dashboard/assets/{@react-router-DYovave8.js → @react-router-CO-OsFwI.js} +2 -2
  121. zenml/zen_server/dashboard/assets/{@reactflow-CHBapDaj.js → @reactflow-l_1hUr1S.js} +2 -2
  122. zenml/zen_server/dashboard/assets/@tanstack-DYiOyJUL.js +22 -0
  123. zenml/zen_server/dashboard/assets/AwarenessChannel-CFg5iX4Z.js +1 -0
  124. zenml/zen_server/dashboard/assets/{CodeSnippet-BidtnWOi.js → CodeSnippet-Dvkx_82E.js} +2 -2
  125. zenml/zen_server/dashboard/assets/CollapsibleCard-opiuBHHc.js +1 -0
  126. zenml/zen_server/dashboard/assets/Commands-DoN1xrEq.js +1 -0
  127. zenml/zen_server/dashboard/assets/CopyButton-Cr7xYEPb.js +2 -0
  128. zenml/zen_server/dashboard/assets/{CsvVizualization-BOuez-fG.js → CsvVizualization-Ck-nZ43m.js} +7 -7
  129. zenml/zen_server/dashboard/assets/DisplayDate-DYgIjlDF.js +1 -0
  130. zenml/zen_server/dashboard/assets/EmptyState-BMLnFVlB.js +1 -0
  131. zenml/zen_server/dashboard/assets/Error-kLtljEOM.js +1 -0
  132. zenml/zen_server/dashboard/assets/ExecutionStatus-DguLLgTK.js +1 -0
  133. zenml/zen_server/dashboard/assets/Helpbox-BXUMP21n.js +1 -0
  134. zenml/zen_server/dashboard/assets/Infobox-DSt0O-dm.js +1 -0
  135. zenml/zen_server/dashboard/assets/InlineAvatar-xsrsIGE-.js +1 -0
  136. zenml/zen_server/dashboard/assets/{MarkdownVisualization-DsB2QZiK.js → MarkdownVisualization-xp3hhULl.js} +2 -2
  137. zenml/zen_server/dashboard/assets/Pagination-C6X-mifw.js +1 -0
  138. zenml/zen_server/dashboard/assets/PasswordChecker-DUveqlva.js +1 -0
  139. zenml/zen_server/dashboard/assets/SetPassword-BXGTWiwj.js +1 -0
  140. zenml/zen_server/dashboard/assets/SuccessStep-DZC60t0x.js +1 -0
  141. zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-DnM-c11H.js → UpdatePasswordSchemas-DGvwFWO1.js} +1 -1
  142. zenml/zen_server/dashboard/assets/{aws-t0gKCj_R.js → aws-BgKTfTfx.js} +1 -1
  143. zenml/zen_server/dashboard/assets/{check-circle-BVvhm5dy.js → check-circle-i56092KI.js} +1 -1
  144. zenml/zen_server/dashboard/assets/{chevron-right-double-CJ50E9Gr.js → chevron-right-double-CZBOf6JM.js} +1 -1
  145. zenml/zen_server/dashboard/assets/cloud-only-C_yFCAkP.js +1 -0
  146. zenml/zen_server/dashboard/assets/{copy-BRhQz3j-.js → copy-BXNk6BjL.js} +1 -1
  147. zenml/zen_server/dashboard/assets/{database-CRRnyFWh.js → database-1xWSgZfO.js} +1 -1
  148. zenml/zen_server/dashboard/assets/{docker-BAonhm6G.js → docker-CQMVm_4d.js} +1 -1
  149. zenml/zen_server/dashboard/assets/{file-text-CbVERUON.js → file-text-CqD_iu6l.js} +1 -1
  150. zenml/zen_server/dashboard/assets/{help-B8rqCvqn.js → help-bu_DgLKI.js} +1 -1
  151. zenml/zen_server/dashboard/assets/index-BczVOqUf.js +55 -0
  152. zenml/zen_server/dashboard/assets/index-EpMIKgrI.css +1 -0
  153. zenml/zen_server/dashboard/assets/index-rK_Wuy2W.js +1 -0
  154. zenml/zen_server/dashboard/assets/index.esm-Corw4lXQ.js +1 -0
  155. zenml/zen_server/dashboard/assets/{login-mutation-wzzl23C6.js → login-mutation-CrHrndTI.js} +1 -1
  156. zenml/zen_server/dashboard/assets/logs-D8k8BVFf.js +1 -0
  157. zenml/zen_server/dashboard/assets/not-found-DYa4pC-C.js +1 -0
  158. zenml/zen_server/dashboard/assets/package-B3fWP-Dh.js +1 -0
  159. zenml/zen_server/dashboard/assets/page-1h_sD1jz.js +1 -0
  160. zenml/zen_server/dashboard/assets/{page-yN4rZ-ZS.js → page-1iL8aMqs.js} +1 -1
  161. zenml/zen_server/dashboard/assets/{page-Bi5AI0S7.js → page-2grKx_MY.js} +1 -1
  162. zenml/zen_server/dashboard/assets/page-5NCOHOsy.js +1 -0
  163. zenml/zen_server/dashboard/assets/page-8a4UMKXZ.js +1 -0
  164. zenml/zen_server/dashboard/assets/{page-AQKopn_4.js → page-B6h3iaHJ.js} +1 -1
  165. zenml/zen_server/dashboard/assets/page-BDns21Iz.js +1 -0
  166. zenml/zen_server/dashboard/assets/{page-BmkSiYeQ.js → page-BhgCDInH.js} +2 -2
  167. zenml/zen_server/dashboard/assets/{page-BzVZGExK.js → page-Bi-wtWiO.js} +2 -2
  168. zenml/zen_server/dashboard/assets/page-BkeAAYwp.js +1 -0
  169. zenml/zen_server/dashboard/assets/page-BkuQDIf-.js +1 -0
  170. zenml/zen_server/dashboard/assets/page-BnaevhnB.js +1 -0
  171. zenml/zen_server/dashboard/assets/page-Bq0YxkLV.js +1 -0
  172. zenml/zen_server/dashboard/assets/page-Bs2F4eoD.js +2 -0
  173. zenml/zen_server/dashboard/assets/page-C6-UGEbH.js +1 -0
  174. zenml/zen_server/dashboard/assets/page-CCNRIt_f.js +1 -0
  175. zenml/zen_server/dashboard/assets/page-CHNxpz3n.js +1 -0
  176. zenml/zen_server/dashboard/assets/page-DgorQFqi.js +1 -0
  177. zenml/zen_server/dashboard/assets/page-K8ebxVIs.js +1 -0
  178. zenml/zen_server/dashboard/assets/{page-CuT1SUik.js → page-MFQyIJd3.js} +1 -1
  179. zenml/zen_server/dashboard/assets/page-TgCF0P_U.js +1 -0
  180. zenml/zen_server/dashboard/assets/page-ZnCEe-eK.js +9 -0
  181. zenml/zen_server/dashboard/assets/{page-BW6Ket3a.js → page-uA5prJGY.js} +1 -1
  182. zenml/zen_server/dashboard/assets/persist-D7HJNBWx.js +1 -0
  183. zenml/zen_server/dashboard/assets/{play-circle-DK5QMJyp.js → play-circle-CNtZKDnW.js} +1 -1
  184. zenml/zen_server/dashboard/assets/plus-C8WOyCzt.js +1 -0
  185. zenml/zen_server/dashboard/assets/stack-detail-query-Cficsl6d.js +1 -0
  186. zenml/zen_server/dashboard/assets/{terminal-B2ovgWuz.js → terminal-By9cErXc.js} +1 -1
  187. zenml/zen_server/dashboard/assets/update-server-settings-mutation-7d8xi1tS.js +1 -0
  188. zenml/zen_server/dashboard/assets/{url-6_xv0WJS.js → url-D7mAQGUM.js} +1 -1
  189. zenml/zen_server/dashboard/assets/{zod-DrZvVLjd.js → zod-BhoGpZ63.js} +1 -1
  190. zenml/zen_server/dashboard/index.html +7 -7
  191. zenml/zen_server/dashboard_legacy/asset-manifest.json +4 -4
  192. zenml/zen_server/dashboard_legacy/index.html +1 -1
  193. zenml/zen_server/dashboard_legacy/{precache-manifest.f4abc5b7cfa7d90c1caf5521918e29a8.js → precache-manifest.12246c7548e71e2c4438e496360de80c.js} +4 -4
  194. zenml/zen_server/dashboard_legacy/service-worker.js +1 -1
  195. zenml/zen_server/dashboard_legacy/static/js/main.3b27024b.chunk.js +2 -0
  196. zenml/zen_server/dashboard_legacy/static/js/{main.ac2f17d0.chunk.js.map → main.3b27024b.chunk.js.map} +1 -1
  197. zenml/zen_server/deploy/helm/Chart.yaml +1 -1
  198. zenml/zen_server/deploy/helm/README.md +2 -2
  199. zenml/zen_server/feature_gate/zenml_cloud_feature_gate.py +11 -5
  200. zenml/zen_server/pipeline_deployment/utils.py +57 -44
  201. zenml/zen_server/rbac/utils.py +10 -2
  202. zenml/zen_server/rbac/zenml_cloud_rbac.py +11 -5
  203. zenml/zen_server/routers/devices_endpoints.py +4 -1
  204. zenml/zen_server/routers/server_endpoints.py +29 -2
  205. zenml/zen_server/routers/service_connectors_endpoints.py +57 -0
  206. zenml/zen_server/routers/stack_deployment_endpoints.py +158 -0
  207. zenml/zen_server/routers/steps_endpoints.py +2 -1
  208. zenml/zen_server/routers/workspaces_endpoints.py +64 -0
  209. zenml/zen_server/zen_server_api.py +2 -0
  210. zenml/zen_stores/migrations/utils.py +1 -1
  211. zenml/zen_stores/migrations/versions/0.60.0_release.py +23 -0
  212. zenml/zen_stores/migrations/versions/0.61.0_release.py +23 -0
  213. zenml/zen_stores/migrations/versions/0.62.0_release.py +23 -0
  214. zenml/zen_stores/migrations/versions/0d707865f404_adding_labels_to_stacks.py +30 -0
  215. zenml/zen_stores/migrations/versions/b4fca5241eea_migrate_onboarding_state.py +167 -0
  216. zenml/zen_stores/rest_zen_store.py +149 -4
  217. zenml/zen_stores/schemas/component_schemas.py +14 -0
  218. zenml/zen_stores/schemas/server_settings_schemas.py +23 -11
  219. zenml/zen_stores/schemas/stack_schemas.py +10 -0
  220. zenml/zen_stores/schemas/step_run_schemas.py +27 -11
  221. zenml/zen_stores/sql_zen_store.py +450 -6
  222. zenml/zen_stores/zen_store_interface.py +80 -0
  223. {zenml_nightly-0.58.2.dev20240626.dist-info → zenml_nightly-0.62.0.dev20240726.dist-info}/METADATA +35 -13
  224. {zenml_nightly-0.58.2.dev20240626.dist-info → zenml_nightly-0.62.0.dev20240726.dist-info}/RECORD +227 -191
  225. zenml/zen_server/dashboard/assets/@radix-C9DBgJhe.js +0 -77
  226. zenml/zen_server/dashboard/assets/@tanstack-CEbkxrhX.js +0 -30
  227. zenml/zen_server/dashboard/assets/AwarenessChannel-nXGpmj_f.js +0 -1
  228. zenml/zen_server/dashboard/assets/Cards-nwsvQLVS.js +0 -1
  229. zenml/zen_server/dashboard/assets/Commands-DuIWKg_Q.js +0 -1
  230. zenml/zen_server/dashboard/assets/CopyButton-B_YSm-Ds.js +0 -2
  231. zenml/zen_server/dashboard/assets/DisplayDate-BdguISQF.js +0 -1
  232. zenml/zen_server/dashboard/assets/EmptyState-BkooiGtL.js +0 -1
  233. zenml/zen_server/dashboard/assets/Error-B6M0dPph.js +0 -1
  234. zenml/zen_server/dashboard/assets/Helpbox-BQoqCm04.js +0 -1
  235. zenml/zen_server/dashboard/assets/Infobox-Ce9mefqU.js +0 -1
  236. zenml/zen_server/dashboard/assets/InlineAvatar-DGf3dVhV.js +0 -1
  237. zenml/zen_server/dashboard/assets/PageHeader-DGaemzjc.js +0 -1
  238. zenml/zen_server/dashboard/assets/Pagination-DVYfBCCc.js +0 -1
  239. zenml/zen_server/dashboard/assets/PasswordChecker-DSLBp7Vl.js +0 -1
  240. zenml/zen_server/dashboard/assets/SetPassword-B5s7DJug.js +0 -1
  241. zenml/zen_server/dashboard/assets/SuccessStep-ZzczaM7g.js +0 -1
  242. zenml/zen_server/dashboard/assets/chevron-down-zcvCWmyP.js +0 -1
  243. zenml/zen_server/dashboard/assets/cloud-only-Ba_ShBR5.js +0 -1
  244. zenml/zen_server/dashboard/assets/index-CWJ3xbIf.css +0 -1
  245. zenml/zen_server/dashboard/assets/index-QORVVTMN.js +0 -55
  246. zenml/zen_server/dashboard/assets/index.esm-F7nqy9zY.js +0 -1
  247. zenml/zen_server/dashboard/assets/not-found-Dh2la7kh.js +0 -1
  248. zenml/zen_server/dashboard/assets/page-B-5jAKoO.js +0 -1
  249. zenml/zen_server/dashboard/assets/page-B-vWk8a6.js +0 -1
  250. zenml/zen_server/dashboard/assets/page-B0BrqfS8.js +0 -1
  251. zenml/zen_server/dashboard/assets/page-BQxVFlUl.js +0 -1
  252. zenml/zen_server/dashboard/assets/page-ByrHy6Ss.js +0 -1
  253. zenml/zen_server/dashboard/assets/page-CPtY4Kv_.js +0 -1
  254. zenml/zen_server/dashboard/assets/page-CmmukLsl.js +0 -1
  255. zenml/zen_server/dashboard/assets/page-D2D-7qyr.js +0 -9
  256. zenml/zen_server/dashboard/assets/page-DAQQyLxT.js +0 -1
  257. zenml/zen_server/dashboard/assets/page-DHkUMl_E.js +0 -1
  258. zenml/zen_server/dashboard/assets/page-DZCbwOEs.js +0 -2
  259. zenml/zen_server/dashboard/assets/page-DdaIt20-.js +0 -1
  260. zenml/zen_server/dashboard/assets/page-LqLs24Ot.js +0 -1
  261. zenml/zen_server/dashboard/assets/page-lebv0c7C.js +0 -1
  262. zenml/zen_server/dashboard/assets/update-server-settings-mutation-0Wgz8pUE.js +0 -1
  263. zenml/zen_server/dashboard_legacy/static/js/main.ac2f17d0.chunk.js +0 -2
  264. {zenml_nightly-0.58.2.dev20240626.dist-info → zenml_nightly-0.62.0.dev20240726.dist-info}/LICENSE +0 -0
  265. {zenml_nightly-0.58.2.dev20240626.dist-info → zenml_nightly-0.62.0.dev20240726.dist-info}/WHEEL +0 -0
  266. {zenml_nightly-0.58.2.dev20240626.dist-info → zenml_nightly-0.62.0.dev20240726.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,254 @@
1
+ # Copyright (c) ZenML GmbH 2024. All Rights Reserved.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at:
6
+
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12
+ # or implied. See the License for the specific language governing
13
+ # permissions and limitations under the License.
14
+ """Functionality to deploy a ZenML stack to AWS."""
15
+
16
+ from typing import ClassVar, Dict, List
17
+
18
+ from zenml.enums import StackDeploymentProvider
19
+ from zenml.models import StackDeploymentConfig
20
+ from zenml.stack_deployments.stack_deployment import ZenMLCloudStackDeployment
21
+ from zenml.utils.string_utils import random_str
22
+
23
+ AWS_DEPLOYMENT_TYPE = "cloud-formation"
24
+
25
+
26
+ class AWSZenMLCloudStackDeployment(ZenMLCloudStackDeployment):
27
+ """AWS ZenML Cloud Stack Deployment."""
28
+
29
+ provider: ClassVar[StackDeploymentProvider] = StackDeploymentProvider.AWS
30
+ deployment: ClassVar[str] = AWS_DEPLOYMENT_TYPE
31
+
32
+ @classmethod
33
+ def description(cls) -> str:
34
+ """Return a description of the ZenML Cloud Stack Deployment.
35
+
36
+ This will be displayed when the user is prompted to deploy
37
+ the ZenML stack.
38
+
39
+ Returns:
40
+ A MarkDown description of the ZenML Cloud Stack Deployment.
41
+ """
42
+ return """
43
+ Provision and register a basic AWS ZenML stack authenticated and connected to
44
+ all the necessary cloud infrastructure resources required to run pipelines in
45
+ AWS.
46
+ """
47
+
48
+ @classmethod
49
+ def instructions(cls) -> str:
50
+ """Return instructions on how to deploy the ZenML stack to the specified cloud provider.
51
+
52
+ This will be displayed before the user is prompted to deploy the ZenML
53
+ stack.
54
+
55
+ Returns:
56
+ MarkDown instructions on how to deploy the ZenML stack to the
57
+ specified cloud provider.
58
+ """
59
+ return """
60
+ You will be redirected to the AWS console in your browser where you'll be asked
61
+ to log into your AWS account and create a CloudFormation ZenML stack. The stack
62
+ parameters will be pre-filled with the necessary information to connect ZenML to
63
+ your AWS account, so you should only need to review and confirm the stack.
64
+
65
+ **NOTE**: The CloudFormation stack will create the following new resources in
66
+ your AWS account. Please ensure you have the necessary permissions and are aware
67
+ of any potential costs:
68
+
69
+ - An S3 bucket registered as a [ZenML artifact store](https://docs.zenml.io/stack-components/artifact-stores/s3).
70
+ - An ECR repository registered as a [ZenML container registry](https://docs.zenml.io/stack-components/container-registries/aws).
71
+ - Sagemaker registered as a [ZenML orchestrator](https://docs.zenml.io/stack-components/orchestrators/sagemaker).
72
+ - An IAM user and IAM role with the minimum necessary permissions to access the
73
+ above resources.
74
+ - An AWS access key used to give access to ZenML to connect to the above
75
+ resources through a [ZenML service connector](https://docs.zenml.io/how-to/auth-management/aws-service-connector).
76
+
77
+ The CloudFormation stack will automatically create an AWS secret key and
78
+ will share it with ZenML to give it permission to access the resources created
79
+ by the stack. You can revoke these permissions at any time by deleting the
80
+ CloudFormation stack.
81
+
82
+ **Estimated costs**
83
+
84
+ A small training job would cost around: $0.60
85
+
86
+ These are rough estimates and actual costs may vary based on your usage and specific AWS pricing.
87
+ Some services may be eligible for the AWS Free Tier. Use [the AWS Pricing Calculator](https://calculator.aws)
88
+ for a detailed estimate based on your usage.
89
+
90
+ 💡 **After the CloudFormation stack is deployed, you can return to the CLI to
91
+ view details about the associated ZenML stack automatically registered with
92
+ ZenML.**
93
+ """
94
+
95
+ @classmethod
96
+ def post_deploy_instructions(cls) -> str:
97
+ """Return instructions on what to do after the deployment is complete.
98
+
99
+ This will be displayed after the deployment is complete.
100
+
101
+ Returns:
102
+ MarkDown instructions on what to do after the deployment is
103
+ complete.
104
+ """
105
+ return """
106
+ The ZenML stack has been successfully deployed and registered. You can delete
107
+ the CloudFormation at any time to revoke ZenML's access to your AWS account and
108
+ to clean up the resources created by the stack by using the AWS CloudFormation
109
+ console.
110
+ """
111
+
112
+ @classmethod
113
+ def integrations(cls) -> List[str]:
114
+ """Return the ZenML integrations required for the stack.
115
+
116
+ Returns:
117
+ The list of ZenML integrations that need to be installed for the
118
+ stack to be usable.
119
+ """
120
+ return [
121
+ "aws",
122
+ "s3",
123
+ ]
124
+
125
+ @classmethod
126
+ def permissions(cls) -> Dict[str, List[str]]:
127
+ """Return the permissions granted to ZenML to access the cloud resources.
128
+
129
+ Returns:
130
+ The permissions granted to ZenML to access the cloud resources, as
131
+ a dictionary grouping permissions by resource.
132
+ """
133
+ return {
134
+ "S3 Bucket": [
135
+ "s3:ListBucket",
136
+ "s3:GetObject",
137
+ "s3:PutObject",
138
+ "s3:DeleteObject",
139
+ ],
140
+ "ECR Repository": [
141
+ "ecr:DescribeRepositories",
142
+ "ecr:ListRepositories",
143
+ "ecr:DescribeRegistry",
144
+ "ecr:BatchGetImage",
145
+ "ecr:DescribeImages",
146
+ "ecr:BatchCheckLayerAvailability",
147
+ "ecr:GetDownloadUrlForLayer",
148
+ "ecr:InitiateLayerUpload",
149
+ "ecr:UploadLayerPart",
150
+ "ecr:CompleteLayerUpload",
151
+ "ecr:PutImage",
152
+ "ecr:GetAuthorizationToken",
153
+ ],
154
+ "SageMaker (Client)": [
155
+ "sagemaker:CreatePipeline",
156
+ "sagemaker:StartPipelineExecution",
157
+ "sagemaker:DescribePipeline",
158
+ "sagemaker:DescribePipelineExecution",
159
+ ],
160
+ "SageMaker (Jobs)": [
161
+ "AmazonSageMakerFullAccess",
162
+ ],
163
+ }
164
+
165
+ @classmethod
166
+ def locations(cls) -> Dict[str, str]:
167
+ """Return the locations where the ZenML stack can be deployed.
168
+
169
+ Returns:
170
+ The regions where the ZenML stack can be deployed as a map of region
171
+ names to region descriptions.
172
+ """
173
+ # Return a list of all possible AWS regions
174
+
175
+ # Based on the AWS regions listed at
176
+ # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html
177
+ return {
178
+ "US East (Ohio)": "us-east-2",
179
+ "US East (N. Virginia)": "us-east-1",
180
+ "US West (N. California)": "us-west-1",
181
+ "US West (Oregon)": "us-west-2",
182
+ "Africa (Cape Town)": "af-south-1",
183
+ "Asia Pacific (Hong Kong)": "ap-east-1",
184
+ "Asia Pacific (Hyderabad)": "ap-south-2",
185
+ "Asia Pacific (Jakarta)": "ap-southeast-3",
186
+ "Asia Pacific (Melbourne)": "ap-southeast-4",
187
+ "Asia Pacific (Mumbai)": "ap-south-1",
188
+ "Asia Pacific (Osaka)": "ap-northeast-3",
189
+ "Asia Pacific (Seoul)": "ap-northeast-2",
190
+ "Asia Pacific (Singapore)": "ap-southeast-1",
191
+ "Asia Pacific (Sydney)": "ap-southeast-2",
192
+ "Asia Pacific (Tokyo)": "ap-northeast-1",
193
+ "Canada (Central)": "ca-central-1",
194
+ "Canada West (Calgary)": "ca-west-1",
195
+ "Europe (Frankfurt)": "eu-central-1",
196
+ "Europe (Ireland)": "eu-west-1",
197
+ "Europe (London)": "eu-west-2",
198
+ "Europe (Milan)": "eu-south-1",
199
+ "Europe (Paris)": "eu-west-3",
200
+ "Europe (Spain)": "eu-south-2",
201
+ "Europe (Stockholm)": "eu-north-1",
202
+ "Europe (Zurich)": "eu-central-2",
203
+ "Israel (Tel Aviv)": "il-central-1",
204
+ "Middle East (Bahrain)": "me-south-1",
205
+ "Middle East (UAE)": "me-central-1",
206
+ "South America (São Paulo)": "sa-east-1",
207
+ }
208
+
209
+ def get_deployment_config(
210
+ self,
211
+ ) -> StackDeploymentConfig:
212
+ """Return the configuration to deploy the ZenML stack to the specified cloud provider.
213
+
214
+ The configuration should include:
215
+
216
+ * a cloud provider console URL where the user will be redirected to
217
+ deploy the ZenML stack. The URL should include as many pre-filled
218
+ URL query parameters as possible.
219
+ * a textual description of the URL
220
+ * some deployment providers may require additional configuration
221
+ parameters to be passed to the cloud provider in addition to the
222
+ deployment URL query parameters. Where that is the case, this method
223
+ should also return a string that the user can copy and paste into the
224
+ cloud provider console to deploy the ZenML stack (e.g. a set of
225
+ environment variables, or YAML configuration snippet etc.).
226
+
227
+ Returns:
228
+ The configuration to deploy the ZenML stack to the specified cloud
229
+ provider.
230
+ """
231
+ params = dict(
232
+ stackName=self.stack_name,
233
+ templateURL="https://zenml-cf-templates.s3.eu-central-1.amazonaws.com/aws-ecr-s3-sagemaker.yaml",
234
+ param_ResourceName=f"zenml-{random_str(6).lower()}",
235
+ param_ZenMLServerURL=self.zenml_server_url,
236
+ param_ZenMLServerAPIToken=self.zenml_server_api_token,
237
+ )
238
+ # Encode the parameters as URL query parameters
239
+ query_params = "&".join([f"{k}={v}" for k, v in params.items()])
240
+
241
+ region = ""
242
+ if self.location:
243
+ region = f"region={self.location}"
244
+
245
+ url = (
246
+ f"https://console.aws.amazon.com/cloudformation/home?"
247
+ f"{region}#/stacks/create/review?{query_params}"
248
+ )
249
+
250
+ return StackDeploymentConfig(
251
+ deployment_url=url,
252
+ deployment_url_text="AWS CloudFormation Console",
253
+ configuration=None,
254
+ )
@@ -0,0 +1,179 @@
1
+ # Copyright (c) ZenML GmbH 2024. All Rights Reserved.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at:
6
+
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12
+ # or implied. See the License for the specific language governing
13
+ # permissions and limitations under the License.
14
+ """Functionality to deploy a ZenML stack to Azure."""
15
+
16
+ import re
17
+ from typing import ClassVar, Dict, List
18
+
19
+ from zenml.enums import StackDeploymentProvider
20
+ from zenml.stack_deployments.stack_deployment import ZenMLCloudStackDeployment
21
+
22
+
23
+ # TODO: this class just implements the regions list, and is not suitable for other
24
+ # deployment tasks.
25
+ class AZUREZenMLCloudStackDeployment(ZenMLCloudStackDeployment):
26
+ """Azure ZenML Cloud Stack Deployment."""
27
+
28
+ provider: ClassVar[StackDeploymentProvider] = StackDeploymentProvider.AZURE
29
+
30
+ @classmethod
31
+ def description(cls) -> str:
32
+ """Return a description of the ZenML Cloud Stack Deployment.
33
+
34
+ This will be displayed when the user is prompted to deploy
35
+ the ZenML stack.
36
+
37
+ Returns:
38
+ A MarkDown description of the ZenML Cloud Stack Deployment.
39
+ """
40
+ # TODO: Implement this
41
+ return ""
42
+
43
+ @classmethod
44
+ def instructions(cls) -> str:
45
+ """Return instructions on how to deploy the ZenML stack to the specified cloud provider.
46
+
47
+ This will be displayed before the user is prompted to deploy the ZenML
48
+ stack.
49
+
50
+ Returns:
51
+ MarkDown instructions on how to deploy the ZenML stack to the
52
+ specified cloud provider.
53
+ """
54
+ # TODO: Implement this
55
+ return ""
56
+
57
+ @classmethod
58
+ def post_deploy_instructions(cls) -> str:
59
+ """Return instructions on what to do after the deployment is complete.
60
+
61
+ This will be displayed after the deployment is complete.
62
+
63
+ Returns:
64
+ MarkDown instructions on what to do after the deployment is
65
+ complete.
66
+ """
67
+ # TODO: Implement this
68
+ return ""
69
+
70
+ @classmethod
71
+ def integrations(cls) -> List[str]:
72
+ """Return the ZenML integrations required for the stack.
73
+
74
+ Returns:
75
+ The list of ZenML integrations that need to be installed for the
76
+ stack to be usable.
77
+ """
78
+ return ["azure"]
79
+
80
+ @classmethod
81
+ def permissions(cls) -> Dict[str, List[str]]:
82
+ """Return the permissions granted to ZenML to access the cloud resources.
83
+
84
+ Returns:
85
+ The permissions granted to ZenML to access the cloud resources, as
86
+ a dictionary grouping permissions by resource.
87
+ """
88
+ # TODO: Implement this
89
+ return {}
90
+
91
+ @classmethod
92
+ def locations(cls) -> Dict[str, str]:
93
+ """Return the locations where the ZenML stack can be deployed.
94
+
95
+ Returns:
96
+ The regions where the ZenML stack can be deployed as a map of region
97
+ names to region descriptions.
98
+ """
99
+ # Based on `az account list-locations -o table` on 16.07.2024
100
+ return {
101
+ "(US) East US": "eastus",
102
+ "(US) South Central US": "southcentralus",
103
+ "(US) West US 2": "westus2",
104
+ "(US) West US 3": "westus3",
105
+ "(Asia Pacific) Australia East": "australiaeast",
106
+ "(Asia Pacific) Southeast Asia": "southeastasia",
107
+ "(Europe) North Europe": "northeurope",
108
+ "(Europe) Sweden Central": "swedencentral",
109
+ "(Europe) UK South": "uksouth",
110
+ "(Europe) West Europe": "westeurope",
111
+ "(US) Central US": "centralus",
112
+ "(Africa) South Africa North": "southafricanorth",
113
+ "(Asia Pacific) Central India": "centralindia",
114
+ "(Asia Pacific) East Asia": "eastasia",
115
+ "(Asia Pacific) Japan East": "japaneast",
116
+ "(Asia Pacific) Korea Central": "koreacentral",
117
+ "(Canada) Canada Central": "canadacentral",
118
+ "(Europe) France Central": "francecentral",
119
+ "(Europe) Germany West Central": "germanywestcentral",
120
+ "(Europe) Italy North": "italynorth",
121
+ "(Europe) Norway East": "norwayeast",
122
+ "(Europe) Poland Central": "polandcentral",
123
+ "(Europe) Spain Central": "spaincentral",
124
+ "(Europe) Switzerland North": "switzerlandnorth",
125
+ "(Mexico) Mexico Central": "mexicocentral",
126
+ "(Middle East) UAE North": "uaenorth",
127
+ "(South America) Brazil South": "brazilsouth",
128
+ "(Middle East) Israel Central": "israelcentral",
129
+ "(Middle East) Qatar Central": "qatarcentral",
130
+ "(US) Central US (Stage)": "centralusstage",
131
+ "(US) East US (Stage)": "eastusstage",
132
+ "(US) East US 2 (Stage)": "eastus2stage",
133
+ "(US) North Central US (Stage)": "northcentralusstage",
134
+ "(US) South Central US (Stage)": "southcentralusstage",
135
+ "(US) West US (Stage)": "westusstage",
136
+ "(US) West US 2 (Stage)": "westus2stage",
137
+ "(Asia Pacific) East Asia (Stage)": "eastasiastage",
138
+ "(Asia Pacific) Southeast Asia (Stage)": "southeastasiastage",
139
+ "(South America) Brazil US": "brazilus",
140
+ "(US) East US 2": "eastus2",
141
+ "(US) East US STG": "eastusstg",
142
+ "(US) North Central US": "northcentralus",
143
+ "(US) West US": "westus",
144
+ "(Asia Pacific) Japan West": "japanwest",
145
+ "(Asia Pacific) Jio India West": "jioindiawest",
146
+ "(US) Central US EUAP": "centraluseuap",
147
+ "(US) East US 2 EUAP": "eastus2euap",
148
+ "(US) West Central US": "westcentralus",
149
+ "(Africa) South Africa West": "southafricawest",
150
+ "(Asia Pacific) Australia Central": "australiacentral",
151
+ "(Asia Pacific) Australia Central 2": "australiacentral2",
152
+ "(Asia Pacific) Australia Southeast": "australiasoutheast",
153
+ "(Asia Pacific) Jio India Central": "jioindiacentral",
154
+ "(Asia Pacific) Korea South": "koreasouth",
155
+ "(Asia Pacific) South India": "southindia",
156
+ "(Asia Pacific) West India": "westindia",
157
+ "(Canada) Canada East": "canadaeast",
158
+ "(Europe) France South": "francesouth",
159
+ "(Europe) Germany North": "germanynorth",
160
+ "(Europe) Norway West": "norwaywest",
161
+ "(Europe) Switzerland West": "switzerlandwest",
162
+ "(Europe) UK West": "ukwest",
163
+ "(Middle East) UAE Central": "uaecentral",
164
+ "(South America) Brazil Southeast": "brazilsoutheast",
165
+ }
166
+
167
+ @classmethod
168
+ def skypilot_default_regions(cls) -> Dict[str, str]:
169
+ """Returns the regions supported by default for the Skypilot.
170
+
171
+ Returns:
172
+ The regions supported by default for the Skypilot.
173
+ """
174
+ matcher = re.compile(r".*us\d*( |$)")
175
+ return {
176
+ k: v
177
+ for k, v in cls.locations().items()
178
+ if "(US)" in k and matcher.match(v)
179
+ }