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.
- README.md +31 -10
- RELEASE_NOTES.md +280 -0
- zenml/VERSION +1 -1
- zenml/__init__.py +2 -0
- zenml/analytics/enums.py +3 -0
- zenml/cli/__init__.py +28 -0
- zenml/cli/artifact.py +1 -2
- zenml/cli/integration.py +9 -8
- zenml/cli/server.py +6 -0
- zenml/cli/stack.py +812 -39
- zenml/cli/stack_components.py +9 -0
- zenml/cli/text_utils.py +35 -1
- zenml/cli/utils.py +127 -10
- zenml/client.py +23 -14
- zenml/config/docker_settings.py +8 -5
- zenml/constants.py +13 -1
- zenml/container_registries/base_container_registry.py +1 -0
- zenml/enums.py +23 -0
- zenml/event_hub/event_hub.py +5 -8
- zenml/integrations/__init__.py +1 -0
- zenml/integrations/aws/__init__.py +1 -0
- zenml/integrations/azure/__init__.py +3 -2
- zenml/integrations/constants.py +1 -0
- zenml/integrations/databricks/__init__.py +52 -0
- zenml/integrations/databricks/flavors/__init__.py +30 -0
- zenml/integrations/databricks/flavors/databricks_model_deployer_flavor.py +118 -0
- zenml/integrations/databricks/flavors/databricks_orchestrator_flavor.py +147 -0
- zenml/integrations/databricks/model_deployers/__init__.py +20 -0
- zenml/integrations/databricks/model_deployers/databricks_model_deployer.py +249 -0
- zenml/integrations/databricks/orchestrators/__init__.py +20 -0
- zenml/integrations/databricks/orchestrators/databricks_orchestrator.py +497 -0
- zenml/integrations/databricks/orchestrators/databricks_orchestrator_entrypoint_config.py +97 -0
- zenml/integrations/databricks/services/__init__.py +19 -0
- zenml/integrations/databricks/services/databricks_deployment.py +407 -0
- zenml/integrations/databricks/utils/__init__.py +14 -0
- zenml/integrations/databricks/utils/databricks_utils.py +87 -0
- zenml/integrations/deepchecks/__init__.py +1 -0
- zenml/integrations/discord/__init__.py +1 -0
- zenml/integrations/evidently/__init__.py +1 -0
- zenml/integrations/facets/__init__.py +1 -0
- zenml/integrations/feast/__init__.py +1 -0
- zenml/integrations/gcp/__init__.py +3 -1
- zenml/integrations/gcp/google_credentials_mixin.py +1 -1
- zenml/integrations/gcp/service_connectors/gcp_service_connector.py +320 -64
- zenml/integrations/great_expectations/data_validators/ge_data_validator.py +12 -8
- zenml/integrations/huggingface/__init__.py +1 -0
- zenml/integrations/huggingface/materializers/huggingface_datasets_materializer.py +88 -3
- zenml/integrations/huggingface/steps/accelerate_runner.py +1 -7
- zenml/integrations/integration.py +24 -0
- zenml/integrations/kubeflow/__init__.py +3 -0
- zenml/integrations/kubeflow/flavors/kubeflow_orchestrator_flavor.py +1 -1
- zenml/integrations/kubeflow/orchestrators/kubeflow_orchestrator.py +0 -1
- zenml/integrations/kubernetes/__init__.py +3 -1
- zenml/integrations/kubernetes/orchestrators/kube_utils.py +4 -1
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py +1 -13
- zenml/integrations/kubernetes/orchestrators/manifest_utils.py +22 -4
- zenml/integrations/kubernetes/pod_settings.py +4 -0
- zenml/integrations/label_studio/annotators/label_studio_annotator.py +1 -0
- zenml/integrations/langchain/__init__.py +1 -0
- zenml/integrations/lightgbm/__init__.py +1 -0
- zenml/integrations/mlflow/__init__.py +4 -2
- zenml/integrations/mlflow/model_registries/mlflow_model_registry.py +6 -2
- zenml/integrations/mlflow/services/mlflow_deployment.py +1 -1
- zenml/integrations/neural_prophet/__init__.py +1 -0
- zenml/integrations/polars/__init__.py +1 -0
- zenml/integrations/prodigy/__init__.py +1 -0
- zenml/integrations/pycaret/__init__.py +6 -0
- zenml/integrations/registry.py +37 -0
- zenml/integrations/s3/artifact_stores/s3_artifact_store.py +17 -6
- zenml/integrations/seldon/__init__.py +1 -0
- zenml/integrations/seldon/model_deployers/seldon_model_deployer.py +1 -0
- zenml/integrations/skypilot/flavors/skypilot_orchestrator_base_vm_config.py +2 -2
- zenml/integrations/skypilot/orchestrators/skypilot_base_vm_orchestrator.py +1 -1
- zenml/integrations/skypilot/orchestrators/skypilot_orchestrator_entrypoint.py +2 -2
- zenml/integrations/skypilot_aws/__init__.py +2 -1
- zenml/integrations/skypilot_azure/__init__.py +1 -3
- zenml/integrations/skypilot_gcp/__init__.py +1 -1
- zenml/integrations/skypilot_lambda/__init__.py +1 -1
- zenml/integrations/skypilot_lambda/flavors/skypilot_orchestrator_lambda_vm_flavor.py +1 -1
- zenml/integrations/slack/__init__.py +1 -0
- zenml/integrations/tekton/__init__.py +1 -0
- zenml/integrations/tensorboard/__init__.py +0 -1
- zenml/integrations/tensorflow/__init__.py +18 -6
- zenml/integrations/wandb/__init__.py +1 -0
- zenml/logging/step_logging.py +34 -35
- zenml/materializers/built_in_materializer.py +1 -1
- zenml/materializers/cloudpickle_materializer.py +1 -1
- zenml/model/model.py +1 -1
- zenml/models/__init__.py +11 -0
- zenml/models/v2/core/component.py +47 -0
- zenml/models/v2/core/model.py +1 -2
- zenml/models/v2/core/server_settings.py +0 -20
- zenml/models/v2/core/service_connector.py +17 -0
- zenml/models/v2/core/stack.py +31 -0
- zenml/models/v2/misc/full_stack.py +129 -0
- zenml/models/v2/misc/stack_deployment.py +91 -0
- zenml/new/pipelines/pipeline.py +1 -1
- zenml/new/pipelines/run_utils.py +1 -1
- zenml/orchestrators/__init__.py +4 -0
- zenml/orchestrators/input_utils.py +3 -6
- zenml/orchestrators/step_launcher.py +1 -0
- zenml/orchestrators/wheeled_orchestrator.py +147 -0
- zenml/service_connectors/service_connector_utils.py +408 -0
- zenml/stack/stack.py +3 -6
- zenml/stack_deployments/__init__.py +14 -0
- zenml/stack_deployments/aws_stack_deployment.py +254 -0
- zenml/stack_deployments/azure_stack_deployment.py +179 -0
- zenml/stack_deployments/gcp_stack_deployment.py +269 -0
- zenml/stack_deployments/stack_deployment.py +218 -0
- zenml/stack_deployments/utils.py +48 -0
- zenml/steps/base_step.py +7 -5
- zenml/utils/function_utils.py +2 -2
- zenml/utils/pagination_utils.py +7 -5
- zenml/utils/pipeline_docker_image_builder.py +105 -68
- zenml/utils/pydantic_utils.py +6 -5
- zenml/utils/source_utils.py +4 -1
- zenml/zen_server/cloud_utils.py +18 -3
- zenml/zen_server/dashboard/assets/{404-CDPQCl4D.js → 404-B_YdvmwS.js} +1 -1
- zenml/zen_server/dashboard/assets/@radix-CFOkMR_E.js +85 -0
- zenml/zen_server/dashboard/assets/{@react-router-DYovave8.js → @react-router-CO-OsFwI.js} +2 -2
- zenml/zen_server/dashboard/assets/{@reactflow-CHBapDaj.js → @reactflow-l_1hUr1S.js} +2 -2
- zenml/zen_server/dashboard/assets/@tanstack-DYiOyJUL.js +22 -0
- zenml/zen_server/dashboard/assets/AwarenessChannel-CFg5iX4Z.js +1 -0
- zenml/zen_server/dashboard/assets/{CodeSnippet-BidtnWOi.js → CodeSnippet-Dvkx_82E.js} +2 -2
- zenml/zen_server/dashboard/assets/CollapsibleCard-opiuBHHc.js +1 -0
- zenml/zen_server/dashboard/assets/Commands-DoN1xrEq.js +1 -0
- zenml/zen_server/dashboard/assets/CopyButton-Cr7xYEPb.js +2 -0
- zenml/zen_server/dashboard/assets/{CsvVizualization-BOuez-fG.js → CsvVizualization-Ck-nZ43m.js} +7 -7
- zenml/zen_server/dashboard/assets/DisplayDate-DYgIjlDF.js +1 -0
- zenml/zen_server/dashboard/assets/EmptyState-BMLnFVlB.js +1 -0
- zenml/zen_server/dashboard/assets/Error-kLtljEOM.js +1 -0
- zenml/zen_server/dashboard/assets/ExecutionStatus-DguLLgTK.js +1 -0
- zenml/zen_server/dashboard/assets/Helpbox-BXUMP21n.js +1 -0
- zenml/zen_server/dashboard/assets/Infobox-DSt0O-dm.js +1 -0
- zenml/zen_server/dashboard/assets/InlineAvatar-xsrsIGE-.js +1 -0
- zenml/zen_server/dashboard/assets/{MarkdownVisualization-DsB2QZiK.js → MarkdownVisualization-xp3hhULl.js} +2 -2
- zenml/zen_server/dashboard/assets/Pagination-C6X-mifw.js +1 -0
- zenml/zen_server/dashboard/assets/PasswordChecker-DUveqlva.js +1 -0
- zenml/zen_server/dashboard/assets/SetPassword-BXGTWiwj.js +1 -0
- zenml/zen_server/dashboard/assets/SuccessStep-DZC60t0x.js +1 -0
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-DnM-c11H.js → UpdatePasswordSchemas-DGvwFWO1.js} +1 -1
- zenml/zen_server/dashboard/assets/{aws-t0gKCj_R.js → aws-BgKTfTfx.js} +1 -1
- zenml/zen_server/dashboard/assets/{check-circle-BVvhm5dy.js → check-circle-i56092KI.js} +1 -1
- zenml/zen_server/dashboard/assets/{chevron-right-double-CJ50E9Gr.js → chevron-right-double-CZBOf6JM.js} +1 -1
- zenml/zen_server/dashboard/assets/cloud-only-C_yFCAkP.js +1 -0
- zenml/zen_server/dashboard/assets/{copy-BRhQz3j-.js → copy-BXNk6BjL.js} +1 -1
- zenml/zen_server/dashboard/assets/{database-CRRnyFWh.js → database-1xWSgZfO.js} +1 -1
- zenml/zen_server/dashboard/assets/{docker-BAonhm6G.js → docker-CQMVm_4d.js} +1 -1
- zenml/zen_server/dashboard/assets/{file-text-CbVERUON.js → file-text-CqD_iu6l.js} +1 -1
- zenml/zen_server/dashboard/assets/{help-B8rqCvqn.js → help-bu_DgLKI.js} +1 -1
- zenml/zen_server/dashboard/assets/index-BczVOqUf.js +55 -0
- zenml/zen_server/dashboard/assets/index-EpMIKgrI.css +1 -0
- zenml/zen_server/dashboard/assets/index-rK_Wuy2W.js +1 -0
- zenml/zen_server/dashboard/assets/index.esm-Corw4lXQ.js +1 -0
- zenml/zen_server/dashboard/assets/{login-mutation-wzzl23C6.js → login-mutation-CrHrndTI.js} +1 -1
- zenml/zen_server/dashboard/assets/logs-D8k8BVFf.js +1 -0
- zenml/zen_server/dashboard/assets/not-found-DYa4pC-C.js +1 -0
- zenml/zen_server/dashboard/assets/package-B3fWP-Dh.js +1 -0
- zenml/zen_server/dashboard/assets/page-1h_sD1jz.js +1 -0
- zenml/zen_server/dashboard/assets/{page-yN4rZ-ZS.js → page-1iL8aMqs.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Bi5AI0S7.js → page-2grKx_MY.js} +1 -1
- zenml/zen_server/dashboard/assets/page-5NCOHOsy.js +1 -0
- zenml/zen_server/dashboard/assets/page-8a4UMKXZ.js +1 -0
- zenml/zen_server/dashboard/assets/{page-AQKopn_4.js → page-B6h3iaHJ.js} +1 -1
- zenml/zen_server/dashboard/assets/page-BDns21Iz.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BmkSiYeQ.js → page-BhgCDInH.js} +2 -2
- zenml/zen_server/dashboard/assets/{page-BzVZGExK.js → page-Bi-wtWiO.js} +2 -2
- zenml/zen_server/dashboard/assets/page-BkeAAYwp.js +1 -0
- zenml/zen_server/dashboard/assets/page-BkuQDIf-.js +1 -0
- zenml/zen_server/dashboard/assets/page-BnaevhnB.js +1 -0
- zenml/zen_server/dashboard/assets/page-Bq0YxkLV.js +1 -0
- zenml/zen_server/dashboard/assets/page-Bs2F4eoD.js +2 -0
- zenml/zen_server/dashboard/assets/page-C6-UGEbH.js +1 -0
- zenml/zen_server/dashboard/assets/page-CCNRIt_f.js +1 -0
- zenml/zen_server/dashboard/assets/page-CHNxpz3n.js +1 -0
- zenml/zen_server/dashboard/assets/page-DgorQFqi.js +1 -0
- zenml/zen_server/dashboard/assets/page-K8ebxVIs.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CuT1SUik.js → page-MFQyIJd3.js} +1 -1
- zenml/zen_server/dashboard/assets/page-TgCF0P_U.js +1 -0
- zenml/zen_server/dashboard/assets/page-ZnCEe-eK.js +9 -0
- zenml/zen_server/dashboard/assets/{page-BW6Ket3a.js → page-uA5prJGY.js} +1 -1
- zenml/zen_server/dashboard/assets/persist-D7HJNBWx.js +1 -0
- zenml/zen_server/dashboard/assets/{play-circle-DK5QMJyp.js → play-circle-CNtZKDnW.js} +1 -1
- zenml/zen_server/dashboard/assets/plus-C8WOyCzt.js +1 -0
- zenml/zen_server/dashboard/assets/stack-detail-query-Cficsl6d.js +1 -0
- zenml/zen_server/dashboard/assets/{terminal-B2ovgWuz.js → terminal-By9cErXc.js} +1 -1
- zenml/zen_server/dashboard/assets/update-server-settings-mutation-7d8xi1tS.js +1 -0
- zenml/zen_server/dashboard/assets/{url-6_xv0WJS.js → url-D7mAQGUM.js} +1 -1
- zenml/zen_server/dashboard/assets/{zod-DrZvVLjd.js → zod-BhoGpZ63.js} +1 -1
- zenml/zen_server/dashboard/index.html +7 -7
- zenml/zen_server/dashboard_legacy/asset-manifest.json +4 -4
- zenml/zen_server/dashboard_legacy/index.html +1 -1
- zenml/zen_server/dashboard_legacy/{precache-manifest.f4abc5b7cfa7d90c1caf5521918e29a8.js → precache-manifest.12246c7548e71e2c4438e496360de80c.js} +4 -4
- zenml/zen_server/dashboard_legacy/service-worker.js +1 -1
- zenml/zen_server/dashboard_legacy/static/js/main.3b27024b.chunk.js +2 -0
- zenml/zen_server/dashboard_legacy/static/js/{main.ac2f17d0.chunk.js.map → main.3b27024b.chunk.js.map} +1 -1
- zenml/zen_server/deploy/helm/Chart.yaml +1 -1
- zenml/zen_server/deploy/helm/README.md +2 -2
- zenml/zen_server/feature_gate/zenml_cloud_feature_gate.py +11 -5
- zenml/zen_server/pipeline_deployment/utils.py +57 -44
- zenml/zen_server/rbac/utils.py +10 -2
- zenml/zen_server/rbac/zenml_cloud_rbac.py +11 -5
- zenml/zen_server/routers/devices_endpoints.py +4 -1
- zenml/zen_server/routers/server_endpoints.py +29 -2
- zenml/zen_server/routers/service_connectors_endpoints.py +57 -0
- zenml/zen_server/routers/stack_deployment_endpoints.py +158 -0
- zenml/zen_server/routers/steps_endpoints.py +2 -1
- zenml/zen_server/routers/workspaces_endpoints.py +64 -0
- zenml/zen_server/zen_server_api.py +2 -0
- zenml/zen_stores/migrations/utils.py +1 -1
- zenml/zen_stores/migrations/versions/0.60.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.61.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.62.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0d707865f404_adding_labels_to_stacks.py +30 -0
- zenml/zen_stores/migrations/versions/b4fca5241eea_migrate_onboarding_state.py +167 -0
- zenml/zen_stores/rest_zen_store.py +149 -4
- zenml/zen_stores/schemas/component_schemas.py +14 -0
- zenml/zen_stores/schemas/server_settings_schemas.py +23 -11
- zenml/zen_stores/schemas/stack_schemas.py +10 -0
- zenml/zen_stores/schemas/step_run_schemas.py +27 -11
- zenml/zen_stores/sql_zen_store.py +450 -6
- zenml/zen_stores/zen_store_interface.py +80 -0
- {zenml_nightly-0.58.2.dev20240626.dist-info → zenml_nightly-0.62.0.dev20240726.dist-info}/METADATA +35 -13
- {zenml_nightly-0.58.2.dev20240626.dist-info → zenml_nightly-0.62.0.dev20240726.dist-info}/RECORD +227 -191
- zenml/zen_server/dashboard/assets/@radix-C9DBgJhe.js +0 -77
- zenml/zen_server/dashboard/assets/@tanstack-CEbkxrhX.js +0 -30
- zenml/zen_server/dashboard/assets/AwarenessChannel-nXGpmj_f.js +0 -1
- zenml/zen_server/dashboard/assets/Cards-nwsvQLVS.js +0 -1
- zenml/zen_server/dashboard/assets/Commands-DuIWKg_Q.js +0 -1
- zenml/zen_server/dashboard/assets/CopyButton-B_YSm-Ds.js +0 -2
- zenml/zen_server/dashboard/assets/DisplayDate-BdguISQF.js +0 -1
- zenml/zen_server/dashboard/assets/EmptyState-BkooiGtL.js +0 -1
- zenml/zen_server/dashboard/assets/Error-B6M0dPph.js +0 -1
- zenml/zen_server/dashboard/assets/Helpbox-BQoqCm04.js +0 -1
- zenml/zen_server/dashboard/assets/Infobox-Ce9mefqU.js +0 -1
- zenml/zen_server/dashboard/assets/InlineAvatar-DGf3dVhV.js +0 -1
- zenml/zen_server/dashboard/assets/PageHeader-DGaemzjc.js +0 -1
- zenml/zen_server/dashboard/assets/Pagination-DVYfBCCc.js +0 -1
- zenml/zen_server/dashboard/assets/PasswordChecker-DSLBp7Vl.js +0 -1
- zenml/zen_server/dashboard/assets/SetPassword-B5s7DJug.js +0 -1
- zenml/zen_server/dashboard/assets/SuccessStep-ZzczaM7g.js +0 -1
- zenml/zen_server/dashboard/assets/chevron-down-zcvCWmyP.js +0 -1
- zenml/zen_server/dashboard/assets/cloud-only-Ba_ShBR5.js +0 -1
- zenml/zen_server/dashboard/assets/index-CWJ3xbIf.css +0 -1
- zenml/zen_server/dashboard/assets/index-QORVVTMN.js +0 -55
- zenml/zen_server/dashboard/assets/index.esm-F7nqy9zY.js +0 -1
- zenml/zen_server/dashboard/assets/not-found-Dh2la7kh.js +0 -1
- zenml/zen_server/dashboard/assets/page-B-5jAKoO.js +0 -1
- zenml/zen_server/dashboard/assets/page-B-vWk8a6.js +0 -1
- zenml/zen_server/dashboard/assets/page-B0BrqfS8.js +0 -1
- zenml/zen_server/dashboard/assets/page-BQxVFlUl.js +0 -1
- zenml/zen_server/dashboard/assets/page-ByrHy6Ss.js +0 -1
- zenml/zen_server/dashboard/assets/page-CPtY4Kv_.js +0 -1
- zenml/zen_server/dashboard/assets/page-CmmukLsl.js +0 -1
- zenml/zen_server/dashboard/assets/page-D2D-7qyr.js +0 -9
- zenml/zen_server/dashboard/assets/page-DAQQyLxT.js +0 -1
- zenml/zen_server/dashboard/assets/page-DHkUMl_E.js +0 -1
- zenml/zen_server/dashboard/assets/page-DZCbwOEs.js +0 -2
- zenml/zen_server/dashboard/assets/page-DdaIt20-.js +0 -1
- zenml/zen_server/dashboard/assets/page-LqLs24Ot.js +0 -1
- zenml/zen_server/dashboard/assets/page-lebv0c7C.js +0 -1
- zenml/zen_server/dashboard/assets/update-server-settings-mutation-0Wgz8pUE.js +0 -1
- zenml/zen_server/dashboard_legacy/static/js/main.ac2f17d0.chunk.js +0 -2
- {zenml_nightly-0.58.2.dev20240626.dist-info → zenml_nightly-0.62.0.dev20240726.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.58.2.dev20240626.dist-info → zenml_nightly-0.62.0.dev20240726.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.58.2.dev20240626.dist-info → zenml_nightly-0.62.0.dev20240726.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,129 @@
|
|
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
|
+
"""Models representing full stack requests."""
|
15
|
+
|
16
|
+
from typing import Any, Dict, List, Optional, Union
|
17
|
+
from uuid import UUID
|
18
|
+
|
19
|
+
from pydantic import BaseModel, Field, model_validator
|
20
|
+
|
21
|
+
from zenml.constants import STR_FIELD_MAX_LENGTH
|
22
|
+
from zenml.enums import StackComponentType
|
23
|
+
from zenml.models.v2.base.base import BaseRequest
|
24
|
+
from zenml.models.v2.core.component import ComponentResponse
|
25
|
+
|
26
|
+
|
27
|
+
class ServiceConnectorInfo(BaseModel):
|
28
|
+
"""Information about the service connector when creating a full stack."""
|
29
|
+
|
30
|
+
type: str
|
31
|
+
auth_method: str
|
32
|
+
configuration: Dict[str, Any] = {}
|
33
|
+
|
34
|
+
|
35
|
+
class ComponentInfo(BaseModel):
|
36
|
+
"""Information about each stack components when creating a full stack."""
|
37
|
+
|
38
|
+
flavor: str
|
39
|
+
service_connector_index: Optional[int] = Field(
|
40
|
+
default=None,
|
41
|
+
title="The id of the service connector from the list "
|
42
|
+
"`service_connectors`.",
|
43
|
+
description="The id of the service connector from the list "
|
44
|
+
"`service_connectors` from `FullStackRequest`.",
|
45
|
+
)
|
46
|
+
service_connector_resource_id: Optional[str] = None
|
47
|
+
configuration: Dict[str, Any] = {}
|
48
|
+
|
49
|
+
|
50
|
+
class FullStackRequest(BaseRequest):
|
51
|
+
"""Request model for a full-stack."""
|
52
|
+
|
53
|
+
user: Optional[UUID] = None
|
54
|
+
workspace: Optional[UUID] = None
|
55
|
+
|
56
|
+
name: str = Field(
|
57
|
+
title="The name of the stack.", max_length=STR_FIELD_MAX_LENGTH
|
58
|
+
)
|
59
|
+
description: Optional[str] = Field(
|
60
|
+
default="",
|
61
|
+
title="The description of the stack",
|
62
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
63
|
+
)
|
64
|
+
labels: Optional[Dict[str, Any]] = Field(
|
65
|
+
default=None,
|
66
|
+
title="The stack labels.",
|
67
|
+
)
|
68
|
+
service_connectors: List[Union[UUID, ServiceConnectorInfo]] = Field(
|
69
|
+
default=[],
|
70
|
+
title="The service connectors dictionary for the full stack "
|
71
|
+
"registration.",
|
72
|
+
description="The UUID of an already existing service connector or "
|
73
|
+
"request information to create a service connector from "
|
74
|
+
"scratch.",
|
75
|
+
)
|
76
|
+
components: Dict[StackComponentType, Union[UUID, ComponentInfo]] = Field(
|
77
|
+
title="The mapping for the components of the full stack registration.",
|
78
|
+
description="The mapping from component types to either UUIDs of "
|
79
|
+
"existing components or request information for brand new "
|
80
|
+
"components.",
|
81
|
+
)
|
82
|
+
|
83
|
+
@model_validator(mode="after")
|
84
|
+
def _validate_indexes_in_components(self) -> "FullStackRequest":
|
85
|
+
for component in self.components.values():
|
86
|
+
if isinstance(component, ComponentInfo):
|
87
|
+
if component.service_connector_index is not None:
|
88
|
+
if (
|
89
|
+
component.service_connector_index < 0
|
90
|
+
or component.service_connector_index
|
91
|
+
>= len(self.service_connectors)
|
92
|
+
):
|
93
|
+
raise ValueError(
|
94
|
+
f"Service connector index {component.service_connector_index} "
|
95
|
+
"is out of range. Please provide a valid index referring to "
|
96
|
+
"the position in the list of service connectors."
|
97
|
+
)
|
98
|
+
return self
|
99
|
+
|
100
|
+
|
101
|
+
class ResourcesInfo(BaseModel):
|
102
|
+
"""Information about the resources needed for CLI and UI."""
|
103
|
+
|
104
|
+
flavor: str
|
105
|
+
flavor_display_name: str
|
106
|
+
required_configuration: Dict[str, str] = {}
|
107
|
+
use_resource_value_as_fixed_config: bool = False
|
108
|
+
|
109
|
+
accessible_by_service_connector: List[str]
|
110
|
+
connected_through_service_connector: List[ComponentResponse]
|
111
|
+
|
112
|
+
@model_validator(mode="after")
|
113
|
+
def _validate_resource_info(self) -> "ResourcesInfo":
|
114
|
+
if (
|
115
|
+
self.use_resource_value_as_fixed_config
|
116
|
+
and len(self.required_configuration) > 1
|
117
|
+
):
|
118
|
+
raise ValueError(
|
119
|
+
"Cannot use resource value as fixed config if more than one required configuration key is provided."
|
120
|
+
)
|
121
|
+
return self
|
122
|
+
|
123
|
+
|
124
|
+
class ServiceConnectorResourcesInfo(BaseModel):
|
125
|
+
"""Information about the service connector resources needed for CLI and UI."""
|
126
|
+
|
127
|
+
connector_type: str
|
128
|
+
|
129
|
+
components_resources_info: Dict[StackComponentType, List[ResourcesInfo]]
|
@@ -0,0 +1,91 @@
|
|
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
|
+
"""Models related to cloud stack deployments."""
|
15
|
+
|
16
|
+
from typing import Dict, List, Optional
|
17
|
+
|
18
|
+
from pydantic import BaseModel, Field
|
19
|
+
|
20
|
+
from zenml.enums import StackDeploymentProvider
|
21
|
+
from zenml.models.v2.core.service_connector import ServiceConnectorResponse
|
22
|
+
from zenml.models.v2.core.stack import StackResponse
|
23
|
+
|
24
|
+
|
25
|
+
class StackDeploymentInfo(BaseModel):
|
26
|
+
"""Information about a stack deployment."""
|
27
|
+
|
28
|
+
provider: StackDeploymentProvider = Field(
|
29
|
+
title="The provider of the stack deployment."
|
30
|
+
)
|
31
|
+
description: str = Field(
|
32
|
+
title="The description of the stack deployment.",
|
33
|
+
description="The description of the stack deployment.",
|
34
|
+
)
|
35
|
+
instructions: str = Field(
|
36
|
+
title="The instructions for deploying the stack.",
|
37
|
+
description="The instructions for deploying the stack.",
|
38
|
+
)
|
39
|
+
post_deploy_instructions: str = Field(
|
40
|
+
title="The instructions for post-deployment.",
|
41
|
+
description="The instructions for post-deployment.",
|
42
|
+
)
|
43
|
+
integrations: List[str] = Field(
|
44
|
+
title="ZenML integrations required for the stack.",
|
45
|
+
description="The list of ZenML integrations that need to be installed "
|
46
|
+
"for the stack to be usable.",
|
47
|
+
)
|
48
|
+
permissions: Dict[str, List[str]] = Field(
|
49
|
+
title="The permissions granted to ZenML to access the cloud resources.",
|
50
|
+
description="The permissions granted to ZenML to access the cloud "
|
51
|
+
"resources, as a dictionary grouping permissions by resource.",
|
52
|
+
)
|
53
|
+
locations: Dict[str, str] = Field(
|
54
|
+
title="The locations where the stack can be deployed.",
|
55
|
+
description="The locations where the stack can be deployed, as a "
|
56
|
+
"dictionary mapping location names to descriptions.",
|
57
|
+
)
|
58
|
+
skypilot_default_regions: Dict[str, str] = Field(
|
59
|
+
title="The locations where the Skypilot clusters can be deployed by default.",
|
60
|
+
description="The locations where the Skypilot clusters can be deployed by default, as a "
|
61
|
+
"dictionary mapping location names to descriptions.",
|
62
|
+
)
|
63
|
+
|
64
|
+
|
65
|
+
class StackDeploymentConfig(BaseModel):
|
66
|
+
"""Configuration about a stack deployment."""
|
67
|
+
|
68
|
+
deployment_url: str = Field(
|
69
|
+
title="The cloud provider console URL where the stack will be deployed.",
|
70
|
+
)
|
71
|
+
deployment_url_text: str = Field(
|
72
|
+
title="A textual description for the cloud provider console URL.",
|
73
|
+
)
|
74
|
+
configuration: Optional[str] = Field(
|
75
|
+
title="Configuration for the stack deployment that the user must "
|
76
|
+
"manually configure into the cloud provider console.",
|
77
|
+
)
|
78
|
+
|
79
|
+
|
80
|
+
class DeployedStack(BaseModel):
|
81
|
+
"""Information about a deployed stack."""
|
82
|
+
|
83
|
+
stack: StackResponse = Field(
|
84
|
+
title="The stack that was deployed.",
|
85
|
+
description="The stack that was deployed.",
|
86
|
+
)
|
87
|
+
service_connector: Optional[ServiceConnectorResponse] = Field(
|
88
|
+
default=None,
|
89
|
+
title="The service connector for the deployed stack.",
|
90
|
+
description="The service connector for the deployed stack.",
|
91
|
+
)
|
zenml/new/pipelines/pipeline.py
CHANGED
@@ -281,7 +281,7 @@ class Pipeline:
|
|
281
281
|
raise RuntimeError(
|
282
282
|
f"Cannot get the model of pipeline '{self.name}' because it has "
|
283
283
|
f"not been registered yet. Please ensure that the pipeline has "
|
284
|
-
f"been run
|
284
|
+
f"been run or built and try again."
|
285
285
|
)
|
286
286
|
|
287
287
|
@contextmanager
|
zenml/new/pipelines/run_utils.py
CHANGED
@@ -250,7 +250,7 @@ def _validate_new_version_requests(
|
|
250
250
|
if not is_cloud_model:
|
251
251
|
logger.info(
|
252
252
|
"Models can be viewed in the dashboard using ZenML Pro. Sign up "
|
253
|
-
"for a free trial at https://www.zenml.io/
|
253
|
+
"for a free trial at https://www.zenml.io/pro/"
|
254
254
|
)
|
255
255
|
|
256
256
|
|
zenml/orchestrators/__init__.py
CHANGED
@@ -30,6 +30,9 @@ from zenml.orchestrators.base_orchestrator import (
|
|
30
30
|
from zenml.orchestrators.containerized_orchestrator import (
|
31
31
|
ContainerizedOrchestrator,
|
32
32
|
)
|
33
|
+
from zenml.orchestrators.wheeled_orchestrator import (
|
34
|
+
WheeledOrchestrator,
|
35
|
+
)
|
33
36
|
from zenml.orchestrators.local.local_orchestrator import (
|
34
37
|
LocalOrchestrator,
|
35
38
|
LocalOrchestratorFlavor,
|
@@ -44,6 +47,7 @@ __all__ = [
|
|
44
47
|
"BaseOrchestratorConfig",
|
45
48
|
"BaseOrchestratorFlavor",
|
46
49
|
"ContainerizedOrchestrator",
|
50
|
+
"WheeledOrchestrator",
|
47
51
|
"LocalOrchestrator",
|
48
52
|
"LocalOrchestratorFlavor",
|
49
53
|
"LocalDockerOrchestrator",
|
@@ -13,7 +13,6 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Utilities for inputs."""
|
15
15
|
|
16
|
-
import functools
|
17
16
|
from typing import TYPE_CHECKING, Dict, List, Tuple
|
18
17
|
from uuid import UUID
|
19
18
|
|
@@ -48,13 +47,11 @@ def resolve_step_inputs(
|
|
48
47
|
"""
|
49
48
|
from zenml.models import ArtifactVersionResponse, RunMetadataResponse
|
50
49
|
|
51
|
-
list_run_steps = functools.partial(
|
52
|
-
Client().list_run_steps, pipeline_run_id=run_id
|
53
|
-
)
|
54
|
-
|
55
50
|
current_run_steps = {
|
56
51
|
run_step.name: run_step
|
57
|
-
for run_step in pagination_utils.depaginate(
|
52
|
+
for run_step in pagination_utils.depaginate(
|
53
|
+
Client().list_run_steps, pipeline_run_id=run_id
|
54
|
+
)
|
58
55
|
}
|
59
56
|
|
60
57
|
input_artifacts: Dict[str, "ArtifactVersionResponse"] = {}
|
@@ -0,0 +1,147 @@
|
|
1
|
+
# Copyright (c) ZenML GmbH 2021. 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
|
+
"""Wheeled orchestrator class."""
|
15
|
+
|
16
|
+
import os
|
17
|
+
import re
|
18
|
+
import subprocess
|
19
|
+
import tempfile
|
20
|
+
from abc import ABC
|
21
|
+
|
22
|
+
from zenml import __version__
|
23
|
+
from zenml.io import fileio
|
24
|
+
from zenml.logger import get_logger
|
25
|
+
from zenml.orchestrators import BaseOrchestrator
|
26
|
+
from zenml.utils.io_utils import copy_dir
|
27
|
+
from zenml.utils.source_utils import get_source_root
|
28
|
+
|
29
|
+
logger = get_logger(__name__)
|
30
|
+
|
31
|
+
DEFAULT_PACKAGE_NAME = "zenmlproject"
|
32
|
+
|
33
|
+
|
34
|
+
class WheeledOrchestrator(BaseOrchestrator, ABC):
|
35
|
+
"""Base class for wheeled orchestrators."""
|
36
|
+
|
37
|
+
package_name = DEFAULT_PACKAGE_NAME
|
38
|
+
package_version = __version__
|
39
|
+
|
40
|
+
def copy_repository_to_temp_dir_and_add_setup_py(self) -> str:
|
41
|
+
"""Copy the repository to a temporary directory and add a setup.py file.
|
42
|
+
|
43
|
+
Returns:
|
44
|
+
Path to the temporary directory containing the copied repository.
|
45
|
+
"""
|
46
|
+
repo_path = get_source_root()
|
47
|
+
|
48
|
+
self.package_name = f"{DEFAULT_PACKAGE_NAME}_{self.sanitize_name(os.path.basename(repo_path))}"
|
49
|
+
|
50
|
+
# Create a temporary folder
|
51
|
+
temp_dir = tempfile.mkdtemp(prefix="zenml-temp-")
|
52
|
+
|
53
|
+
# Create a folder within the temporary directory
|
54
|
+
temp_repo_path = os.path.join(temp_dir, self.package_name)
|
55
|
+
fileio.mkdir(temp_repo_path)
|
56
|
+
|
57
|
+
# Copy the repository to the temporary directory
|
58
|
+
copy_dir(repo_path, temp_repo_path)
|
59
|
+
|
60
|
+
# Create init file in the copied directory
|
61
|
+
init_file_path = os.path.join(temp_repo_path, "__init__.py")
|
62
|
+
with fileio.open(init_file_path, "w") as f:
|
63
|
+
f.write("")
|
64
|
+
|
65
|
+
# Create a setup.py file
|
66
|
+
setup_py_content = f"""
|
67
|
+
from setuptools import setup, find_packages
|
68
|
+
|
69
|
+
setup(
|
70
|
+
name="{self.package_name}",
|
71
|
+
version="{self.package_version}",
|
72
|
+
packages=find_packages(),
|
73
|
+
)
|
74
|
+
"""
|
75
|
+
setup_py_path = os.path.join(temp_dir, "setup.py")
|
76
|
+
with fileio.open(setup_py_path, "w") as f:
|
77
|
+
f.write(setup_py_content)
|
78
|
+
|
79
|
+
return temp_dir
|
80
|
+
|
81
|
+
def create_wheel(self, temp_dir: str) -> str:
|
82
|
+
"""Create a wheel for the package in the given temporary directory.
|
83
|
+
|
84
|
+
Args:
|
85
|
+
temp_dir (str): Path to the temporary directory containing the package.
|
86
|
+
|
87
|
+
Raises:
|
88
|
+
RuntimeError: If the wheel file could not be created.
|
89
|
+
|
90
|
+
Returns:
|
91
|
+
str: Path to the created wheel file.
|
92
|
+
"""
|
93
|
+
# Change to the temporary directory
|
94
|
+
original_dir = os.getcwd()
|
95
|
+
os.chdir(temp_dir)
|
96
|
+
|
97
|
+
try:
|
98
|
+
# Run the `pip wheel` command to create the wheel
|
99
|
+
result = subprocess.run(
|
100
|
+
["pip", "wheel", "."], check=True, capture_output=True
|
101
|
+
)
|
102
|
+
logger.debug(f"Wheel creation stdout: {result.stdout.decode()}")
|
103
|
+
logger.debug(f"Wheel creation stderr: {result.stderr.decode()}")
|
104
|
+
|
105
|
+
# Find the created wheel file
|
106
|
+
wheel_file = next(
|
107
|
+
(
|
108
|
+
file
|
109
|
+
for file in os.listdir(temp_dir)
|
110
|
+
if file.endswith(".whl")
|
111
|
+
),
|
112
|
+
None,
|
113
|
+
)
|
114
|
+
|
115
|
+
if wheel_file is None:
|
116
|
+
raise RuntimeError("Failed to create wheel file.")
|
117
|
+
|
118
|
+
wheel_path = os.path.join(temp_dir, wheel_file)
|
119
|
+
|
120
|
+
# Verify the wheel file is a valid zip file
|
121
|
+
import zipfile
|
122
|
+
|
123
|
+
if not zipfile.is_zipfile(wheel_path):
|
124
|
+
raise RuntimeError(
|
125
|
+
f"The file {wheel_path} is not a valid zip file."
|
126
|
+
)
|
127
|
+
|
128
|
+
return wheel_path
|
129
|
+
finally:
|
130
|
+
# Change back to the original directory
|
131
|
+
os.chdir(original_dir)
|
132
|
+
|
133
|
+
def sanitize_name(self, name: str) -> str:
|
134
|
+
"""Sanitize the value to be used in a cluster name.
|
135
|
+
|
136
|
+
Args:
|
137
|
+
name: Arbitrary input cluster name.
|
138
|
+
|
139
|
+
Returns:
|
140
|
+
Sanitized cluster name.
|
141
|
+
"""
|
142
|
+
name = re.sub(
|
143
|
+
r"[^a-z0-9-]", "-", name.lower()
|
144
|
+
) # replaces any character that is not a lowercase letter, digit, or hyphen with a hyphen
|
145
|
+
name = re.sub(r"^[-]+", "", name) # trim leading hyphens
|
146
|
+
name = re.sub(r"[-]+$", "", name) # trim trailing hyphens
|
147
|
+
return name
|