zenml-nightly 0.61.0.dev20240712__py3-none-any.whl → 0.62.0.dev20240727__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 +2 -2
- RELEASE_NOTES.md +40 -0
- zenml/VERSION +1 -1
- zenml/__init__.py +2 -0
- zenml/cli/stack.py +114 -248
- zenml/cli/stack_components.py +5 -3
- zenml/config/pipeline_spec.py +2 -2
- zenml/config/step_configurations.py +3 -3
- zenml/constants.py +3 -0
- zenml/enums.py +16 -0
- zenml/integrations/__init__.py +1 -0
- zenml/integrations/azure/__init__.py +2 -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/gcp/orchestrators/vertex_orchestrator.py +44 -28
- zenml/integrations/great_expectations/data_validators/ge_data_validator.py +12 -8
- zenml/integrations/huggingface/materializers/huggingface_datasets_materializer.py +88 -3
- zenml/integrations/huggingface/steps/accelerate_runner.py +1 -7
- zenml/integrations/kubernetes/__init__.py +3 -2
- zenml/integrations/kubernetes/flavors/__init__.py +8 -0
- zenml/integrations/kubernetes/flavors/kubernetes_step_operator_flavor.py +166 -0
- 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/kubernetes/step_operators/__init__.py +22 -0
- zenml/integrations/kubernetes/step_operators/kubernetes_step_operator.py +235 -0
- zenml/integrations/lightgbm/__init__.py +1 -0
- zenml/integrations/mlflow/__init__.py +1 -1
- zenml/integrations/mlflow/model_registries/mlflow_model_registry.py +6 -2
- zenml/integrations/mlflow/services/mlflow_deployment.py +1 -1
- zenml/integrations/skypilot_azure/__init__.py +1 -3
- zenml/integrations/skypilot_lambda/__init__.py +1 -1
- 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/v2/core/code_repository.py +2 -2
- zenml/models/v2/core/component.py +29 -0
- zenml/models/v2/core/server_settings.py +0 -20
- zenml/models/v2/misc/full_stack.py +32 -0
- zenml/models/v2/misc/stack_deployment.py +5 -0
- zenml/new/pipelines/run_utils.py +1 -1
- zenml/orchestrators/__init__.py +4 -0
- 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_deployments/azure_stack_deployment.py +179 -0
- zenml/stack_deployments/gcp_stack_deployment.py +13 -4
- zenml/stack_deployments/stack_deployment.py +10 -0
- zenml/stack_deployments/utils.py +4 -0
- zenml/steps/base_step.py +7 -5
- zenml/utils/function_utils.py +1 -1
- zenml/utils/pipeline_docker_image_builder.py +8 -0
- zenml/utils/source_utils.py +4 -1
- zenml/zen_server/dashboard/assets/{404-DpJaNHKF.js → 404-B_YdvmwS.js} +1 -1
- zenml/zen_server/dashboard/assets/{@reactflow-DJfzkHO1.js → @reactflow-l_1hUr1S.js} +1 -1
- zenml/zen_server/dashboard/assets/{AwarenessChannel-BYDLT2xC.js → AwarenessChannel-CFg5iX4Z.js} +1 -1
- zenml/zen_server/dashboard/assets/{CodeSnippet-BkOuRmyq.js → CodeSnippet-Dvkx_82E.js} +1 -1
- zenml/zen_server/dashboard/assets/CollapsibleCard-opiuBHHc.js +1 -0
- zenml/zen_server/dashboard/assets/{Commands-ZvWR1BRs.js → Commands-DoN1xrEq.js} +1 -1
- zenml/zen_server/dashboard/assets/{CopyButton-DVwLkafa.js → CopyButton-Cr7xYEPb.js} +1 -1
- zenml/zen_server/dashboard/assets/{CsvVizualization-C2IiqX4I.js → CsvVizualization-Ck-nZ43m.js} +3 -3
- zenml/zen_server/dashboard/assets/{Error-CqX0VqW_.js → Error-kLtljEOM.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-BoLUXR9t.js → ExecutionStatus-DguLLgTK.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-LFydyVwh.js → Helpbox-BXUMP21n.js} +1 -1
- zenml/zen_server/dashboard/assets/{Infobox-DnENC0sh.js → Infobox-DSt0O-dm.js} +1 -1
- zenml/zen_server/dashboard/assets/{InlineAvatar-CbJtYr0t.js → InlineAvatar-xsrsIGE-.js} +1 -1
- zenml/zen_server/dashboard/assets/Pagination-C6X-mifw.js +1 -0
- zenml/zen_server/dashboard/assets/{SetPassword-BYBdbQDo.js → SetPassword-BXGTWiwj.js} +1 -1
- zenml/zen_server/dashboard/assets/{SuccessStep-Nx743hll.js → SuccessStep-DZC60t0x.js} +1 -1
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-DF9gSzE0.js → UpdatePasswordSchemas-DGvwFWO1.js} +1 -1
- zenml/zen_server/dashboard/assets/{chevron-right-double-BiEMg7rd.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/index-BczVOqUf.js +55 -0
- zenml/zen_server/dashboard/assets/index-EpMIKgrI.css +1 -0
- zenml/zen_server/dashboard/assets/{login-mutation-BUnVASxp.js → login-mutation-CrHrndTI.js} +1 -1
- zenml/zen_server/dashboard/assets/logs-D8k8BVFf.js +1 -0
- zenml/zen_server/dashboard/assets/{not-found-B4VnX8gK.js → not-found-DYa4pC-C.js} +1 -1
- zenml/zen_server/dashboard/assets/{package-CsUhPmou.js → package-B3fWP-Dh.js} +1 -1
- zenml/zen_server/dashboard/assets/page-1h_sD1jz.js +1 -0
- zenml/zen_server/dashboard/assets/{page-Sxn82W-5.js → page-1iL8aMqs.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DMOYZppS.js → page-2grKx_MY.js} +1 -1
- zenml/zen_server/dashboard/assets/page-5NCOHOsy.js +1 -0
- zenml/zen_server/dashboard/assets/{page-JyfeDUfu.js → page-8a4UMKXZ.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Bx6o0ARS.js → page-B6h3iaHJ.js} +1 -1
- zenml/zen_server/dashboard/assets/page-BDns21Iz.js +1 -0
- zenml/zen_server/dashboard/assets/{page-3efNCDeb.js → page-BhgCDInH.js} +2 -2
- zenml/zen_server/dashboard/assets/{page-DKlIdAe5.js → page-Bi-wtWiO.js} +2 -2
- zenml/zen_server/dashboard/assets/{page-7zTHbhhI.js → page-BkeAAYwp.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CRTJ0UuR.js → page-BkuQDIf-.js} +1 -1
- zenml/zen_server/dashboard/assets/page-BnaevhnB.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BEs6jK71.js → page-Bq0YxkLV.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Bs2F4eoD.js +2 -0
- zenml/zen_server/dashboard/assets/{page-CUZIGO-3.js → page-C6-UGEbH.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Xu8JEjSU.js → page-CCNRIt_f.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DvCvroOM.js → page-CHNxpz3n.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BpSqIf4B.js → page-DgorQFqi.js} +1 -1
- zenml/zen_server/dashboard/assets/page-K8ebxVIs.js +1 -0
- zenml/zen_server/dashboard/assets/{page-Cx67M0QT.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-Dc_7KMQE.js → page-uA5prJGY.js} +1 -1
- zenml/zen_server/dashboard/assets/persist-D7HJNBWx.js +1 -0
- 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/update-server-settings-mutation-7d8xi1tS.js +1 -0
- zenml/zen_server/dashboard/assets/{url-DuQMeqYA.js → url-D7mAQGUM.js} +1 -1
- zenml/zen_server/dashboard/index.html +4 -4
- 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.c8c57fb0d2132b1d3c2119e776b7dfb3.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.382439a7.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/rbac/utils.py +10 -2
- 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/steps_endpoints.py +2 -1
- zenml/zen_stores/migrations/versions/0.62.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/b4fca5241eea_migrate_onboarding_state.py +167 -0
- zenml/zen_stores/rest_zen_store.py +4 -0
- zenml/zen_stores/schemas/component_schemas.py +14 -0
- zenml/zen_stores/schemas/server_settings_schemas.py +23 -11
- zenml/zen_stores/sql_zen_store.py +151 -1
- {zenml_nightly-0.61.0.dev20240712.dist-info → zenml_nightly-0.62.0.dev20240727.dist-info}/METADATA +5 -5
- {zenml_nightly-0.61.0.dev20240712.dist-info → zenml_nightly-0.62.0.dev20240727.dist-info}/RECORD +144 -121
- zenml/zen_server/dashboard/assets/Pagination-DEbVUupy.js +0 -1
- zenml/zen_server/dashboard/assets/chevron-down-D_ZlKMqH.js +0 -1
- zenml/zen_server/dashboard/assets/cloud-only-DVbIeckv.js +0 -1
- zenml/zen_server/dashboard/assets/index-C_CrU4vI.js +0 -1
- zenml/zen_server/dashboard/assets/index-DK1ynKjA.js +0 -55
- zenml/zen_server/dashboard/assets/index-inApY3KQ.css +0 -1
- zenml/zen_server/dashboard/assets/page-C43QGHTt.js +0 -9
- zenml/zen_server/dashboard/assets/page-CR0OG7ss.js +0 -1
- zenml/zen_server/dashboard/assets/page-CaopxiU1.js +0 -1
- zenml/zen_server/dashboard/assets/page-D7Z399xy.js +0 -1
- zenml/zen_server/dashboard/assets/page-D93kd7Xj.js +0 -1
- zenml/zen_server/dashboard/assets/page-DMsSn3dv.js +0 -2
- zenml/zen_server/dashboard/assets/page-Hus2pr9T.js +0 -1
- zenml/zen_server/dashboard/assets/page-TKXERe16.js +0 -1
- zenml/zen_server/dashboard/assets/plus-DOeLmm7C.js +0 -1
- zenml/zen_server/dashboard/assets/update-server-settings-mutation-CR8e3Sir.js +0 -1
- zenml/zen_server/dashboard_legacy/static/js/main.382439a7.chunk.js +0 -2
- {zenml_nightly-0.61.0.dev20240712.dist-info → zenml_nightly-0.62.0.dev20240727.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.61.0.dev20240712.dist-info → zenml_nightly-0.62.0.dev20240727.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.61.0.dev20240712.dist-info → zenml_nightly-0.62.0.dev20240727.dist-info}/entry_points.txt +0 -0
zenml/constants.py
CHANGED
@@ -173,6 +173,7 @@ ENV_ZENML_PIPELINE_API_TOKEN_EXPIRES_MINUTES = (
|
|
173
173
|
"ZENML_PIPELINE_API_TOKEN_EXPIRES_MINUTES"
|
174
174
|
)
|
175
175
|
ENV_ZENML_IGNORE_FAILURE_HOOK = "ZENML_IGNORE_FAILURE_HOOK"
|
176
|
+
ENV_ZENML_CUSTOM_SOURCE_ROOT = "ZENML_CUSTOM_SOURCE_ROOT"
|
176
177
|
|
177
178
|
# ZenML Server environment variables
|
178
179
|
ENV_ZENML_SERVER_PREFIX = "ZENML_SERVER_"
|
@@ -375,6 +376,7 @@ SERVICE_CONNECTOR_CLIENT = "/client"
|
|
375
376
|
SERVICE_CONNECTOR_RESOURCES = "/resources"
|
376
377
|
SERVICE_CONNECTOR_TYPES = "/service_connector_types"
|
377
378
|
SERVICE_CONNECTOR_VERIFY = "/verify"
|
379
|
+
SERVICE_CONNECTOR_FULL_STACK = "/full_stack_resources"
|
378
380
|
MODELS = "/models"
|
379
381
|
MODEL_VERSIONS = "/model_versions"
|
380
382
|
MODEL_VERSION_ARTIFACTS = "/model_version_artifacts"
|
@@ -392,6 +394,7 @@ STEPS = "/steps"
|
|
392
394
|
TAGS = "/tags"
|
393
395
|
TRIGGERS = "/triggers"
|
394
396
|
TRIGGER_EXECUTIONS = "/trigger_executions"
|
397
|
+
ONBOARDING_STATE = "/onboarding_state"
|
395
398
|
USERS = "/users"
|
396
399
|
URL = "/url"
|
397
400
|
VERSION_1 = "/v1"
|
zenml/enums.py
CHANGED
@@ -386,8 +386,24 @@ class PluginSubType(StrEnum):
|
|
386
386
|
PIPELINE_RUN = "pipeline_run"
|
387
387
|
|
388
388
|
|
389
|
+
class OnboardingStep(StrEnum):
|
390
|
+
"""All onboarding steps."""
|
391
|
+
|
392
|
+
DEVICE_VERIFIED = "device_verified"
|
393
|
+
PIPELINE_RUN = "pipeline_run"
|
394
|
+
STARTER_SETUP_COMPLETED = "starter_setup_completed"
|
395
|
+
STACK_WITH_REMOTE_ORCHESTRATOR_CREATED = (
|
396
|
+
"stack_with_remote_orchestrator_created"
|
397
|
+
)
|
398
|
+
PIPELINE_RUN_WITH_REMOTE_ORCHESTRATOR = (
|
399
|
+
"pipeline_run_with_remote_orchestrator"
|
400
|
+
)
|
401
|
+
PRODUCTION_SETUP_COMPLETED = "production_setup_completed"
|
402
|
+
|
403
|
+
|
389
404
|
class StackDeploymentProvider(StrEnum):
|
390
405
|
"""All possible stack deployment providers."""
|
391
406
|
|
392
407
|
AWS = "aws"
|
393
408
|
GCP = "gcp"
|
409
|
+
AZURE = "azure"
|
zenml/integrations/__init__.py
CHANGED
@@ -23,6 +23,7 @@ from zenml.integrations.aws import AWSIntegration # noqa
|
|
23
23
|
from zenml.integrations.azure import AzureIntegration # noqa
|
24
24
|
from zenml.integrations.bentoml import BentoMLIntegration # noqa
|
25
25
|
from zenml.integrations.bitbucket import BitbucketIntegration # noqa
|
26
|
+
from zenml.integrations.databricks import DatabricksIntegration # noqa
|
26
27
|
from zenml.integrations.comet import CometIntegration # noqa
|
27
28
|
from zenml.integrations.deepchecks import DeepchecksIntegration # noqa
|
28
29
|
from zenml.integrations.discord import DiscordIntegration # noqa
|
@@ -42,8 +42,8 @@ class AzureIntegration(Integration):
|
|
42
42
|
"adlfs>=2021.10.0",
|
43
43
|
"azure-keyvault-keys",
|
44
44
|
"azure-keyvault-secrets",
|
45
|
-
"azure-identity
|
46
|
-
"azureml-core==1.
|
45
|
+
"azure-identity",
|
46
|
+
"azureml-core==1.56.0",
|
47
47
|
"azure-mgmt-containerservice>=20.0.0",
|
48
48
|
"azure-storage-blob==12.17.0", # temporary fix for https://github.com/Azure/azure-sdk-for-python/issues/32056
|
49
49
|
"kubernetes",
|
zenml/integrations/constants.py
CHANGED
@@ -0,0 +1,52 @@
|
|
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
|
+
"""Initialization of the Databricks integration for ZenML."""
|
15
|
+
|
16
|
+
from typing import List, Type
|
17
|
+
|
18
|
+
from zenml.integrations.constants import (
|
19
|
+
DATABRICKS,
|
20
|
+
)
|
21
|
+
from zenml.integrations.integration import Integration
|
22
|
+
from zenml.stack import Flavor
|
23
|
+
|
24
|
+
DATABRICKS_ORCHESTRATOR_FLAVOR = "databricks"
|
25
|
+
DATABRICKS_MODEL_DEPLOYER_FLAVOR = "databricks"
|
26
|
+
DATABRICKS_SERVICE_ARTIFACT = "databricks_deployment_service"
|
27
|
+
|
28
|
+
|
29
|
+
class DatabricksIntegration(Integration):
|
30
|
+
"""Definition of Databricks Integration for ZenML."""
|
31
|
+
|
32
|
+
NAME = DATABRICKS
|
33
|
+
REQUIREMENTS = ["databricks-sdk==0.28.0"]
|
34
|
+
|
35
|
+
@classmethod
|
36
|
+
def flavors(cls) -> List[Type[Flavor]]:
|
37
|
+
"""Declare the stack component flavors for the Databricks integration.
|
38
|
+
|
39
|
+
Returns:
|
40
|
+
List of stack component flavors for this integration.
|
41
|
+
"""
|
42
|
+
from zenml.integrations.databricks.flavors import (
|
43
|
+
DatabricksOrchestratorFlavor,
|
44
|
+
DatabricksModelDeployerFlavor,
|
45
|
+
)
|
46
|
+
|
47
|
+
return [
|
48
|
+
DatabricksOrchestratorFlavor,
|
49
|
+
DatabricksModelDeployerFlavor,
|
50
|
+
]
|
51
|
+
|
52
|
+
DatabricksIntegration.check_installation()
|
@@ -0,0 +1,30 @@
|
|
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
|
+
"""Databricks integration flavors."""
|
15
|
+
|
16
|
+
from zenml.integrations.databricks.flavors.databricks_orchestrator_flavor import (
|
17
|
+
DatabricksOrchestratorConfig,
|
18
|
+
DatabricksOrchestratorFlavor,
|
19
|
+
)
|
20
|
+
from zenml.integrations.databricks.flavors.databricks_model_deployer_flavor import (
|
21
|
+
DatabricksModelDeployerConfig,
|
22
|
+
DatabricksModelDeployerFlavor,
|
23
|
+
)
|
24
|
+
|
25
|
+
__all__ = [
|
26
|
+
"DatabricksOrchestratorFlavor",
|
27
|
+
"DatabricksOrchestratorConfig",
|
28
|
+
"DatabricksModelDeployerFlavor",
|
29
|
+
"DatabricksModelDeployerConfig",
|
30
|
+
]
|
@@ -0,0 +1,118 @@
|
|
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
|
+
"""Databricks model deployer flavor."""
|
15
|
+
|
16
|
+
from typing import TYPE_CHECKING, Dict, Optional, Type
|
17
|
+
|
18
|
+
from pydantic import BaseModel
|
19
|
+
|
20
|
+
from zenml.integrations.databricks import DATABRICKS_MODEL_DEPLOYER_FLAVOR
|
21
|
+
from zenml.model_deployers.base_model_deployer import (
|
22
|
+
BaseModelDeployerConfig,
|
23
|
+
BaseModelDeployerFlavor,
|
24
|
+
)
|
25
|
+
from zenml.utils.secret_utils import SecretField
|
26
|
+
|
27
|
+
if TYPE_CHECKING:
|
28
|
+
from zenml.integrations.databricks.model_deployers.databricks_model_deployer import (
|
29
|
+
DatabricksModelDeployer,
|
30
|
+
)
|
31
|
+
|
32
|
+
|
33
|
+
class DatabricksBaseConfig(BaseModel):
|
34
|
+
"""Databricks Inference Endpoint configuration."""
|
35
|
+
|
36
|
+
workload_size: str
|
37
|
+
scale_to_zero_enabled: bool = False
|
38
|
+
env_vars: Optional[Dict[str, str]] = None
|
39
|
+
workload_type: Optional[str] = None
|
40
|
+
endpoint_secret_name: Optional[str] = None
|
41
|
+
|
42
|
+
|
43
|
+
class DatabricksModelDeployerConfig(BaseModelDeployerConfig):
|
44
|
+
"""Configuration for the Databricks model deployer.
|
45
|
+
|
46
|
+
Attributes:
|
47
|
+
host: Databricks host.
|
48
|
+
secret_name: Secret name to use for authentication.
|
49
|
+
client_id: Databricks client id.
|
50
|
+
client_secret: Databricks client secret.
|
51
|
+
"""
|
52
|
+
|
53
|
+
host: str
|
54
|
+
secret_name: Optional[str] = None
|
55
|
+
client_id: Optional[str] = SecretField(default=None)
|
56
|
+
client_secret: Optional[str] = SecretField(default=None)
|
57
|
+
|
58
|
+
|
59
|
+
class DatabricksModelDeployerFlavor(BaseModelDeployerFlavor):
|
60
|
+
"""Databricks Endpoint model deployer flavor."""
|
61
|
+
|
62
|
+
@property
|
63
|
+
def name(self) -> str:
|
64
|
+
"""Name of the flavor.
|
65
|
+
|
66
|
+
Returns:
|
67
|
+
The name of the flavor.
|
68
|
+
"""
|
69
|
+
return DATABRICKS_MODEL_DEPLOYER_FLAVOR
|
70
|
+
|
71
|
+
@property
|
72
|
+
def docs_url(self) -> Optional[str]:
|
73
|
+
"""A url to point at docs explaining this flavor.
|
74
|
+
|
75
|
+
Returns:
|
76
|
+
A flavor docs url.
|
77
|
+
"""
|
78
|
+
return self.generate_default_docs_url()
|
79
|
+
|
80
|
+
@property
|
81
|
+
def sdk_docs_url(self) -> Optional[str]:
|
82
|
+
"""A url to point at SDK docs explaining this flavor.
|
83
|
+
|
84
|
+
Returns:
|
85
|
+
A flavor SDK docs url.
|
86
|
+
"""
|
87
|
+
return self.generate_default_sdk_docs_url()
|
88
|
+
|
89
|
+
@property
|
90
|
+
def logo_url(self) -> str:
|
91
|
+
"""A url to represent the flavor in the dashboard.
|
92
|
+
|
93
|
+
Returns:
|
94
|
+
The flavor logo.
|
95
|
+
"""
|
96
|
+
return "https://public-flavor-logos.s3.eu-central-1.amazonaws.com/model_deployer/databricks.png"
|
97
|
+
|
98
|
+
@property
|
99
|
+
def config_class(self) -> Type[DatabricksModelDeployerConfig]:
|
100
|
+
"""Returns `DatabricksModelDeployerConfig` config class.
|
101
|
+
|
102
|
+
Returns:
|
103
|
+
The config class.
|
104
|
+
"""
|
105
|
+
return DatabricksModelDeployerConfig
|
106
|
+
|
107
|
+
@property
|
108
|
+
def implementation_class(self) -> Type["DatabricksModelDeployer"]:
|
109
|
+
"""Implementation class for this flavor.
|
110
|
+
|
111
|
+
Returns:
|
112
|
+
The implementation class.
|
113
|
+
"""
|
114
|
+
from zenml.integrations.databricks.model_deployers.databricks_model_deployer import (
|
115
|
+
DatabricksModelDeployer,
|
116
|
+
)
|
117
|
+
|
118
|
+
return DatabricksModelDeployer
|
@@ -0,0 +1,147 @@
|
|
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
|
+
"""Databricks orchestrator base config and settings."""
|
15
|
+
|
16
|
+
from typing import TYPE_CHECKING, Dict, Optional, Tuple, Type
|
17
|
+
|
18
|
+
from zenml.config.base_settings import BaseSettings
|
19
|
+
from zenml.integrations.databricks import DATABRICKS_ORCHESTRATOR_FLAVOR
|
20
|
+
from zenml.logger import get_logger
|
21
|
+
from zenml.orchestrators import BaseOrchestratorConfig
|
22
|
+
from zenml.orchestrators.base_orchestrator import BaseOrchestratorFlavor
|
23
|
+
from zenml.utils.secret_utils import SecretField
|
24
|
+
|
25
|
+
if TYPE_CHECKING:
|
26
|
+
from zenml.integrations.databricks.orchestrators import (
|
27
|
+
DatabricksOrchestrator,
|
28
|
+
)
|
29
|
+
|
30
|
+
|
31
|
+
logger = get_logger(__name__)
|
32
|
+
|
33
|
+
|
34
|
+
class DatabricksOrchestratorSettings(BaseSettings):
|
35
|
+
"""Databricks orchestrator base settings.
|
36
|
+
|
37
|
+
Attributes:
|
38
|
+
spark_version: Spark version.
|
39
|
+
num_workers: Number of workers.
|
40
|
+
node_type_id: Node type id.
|
41
|
+
policy_id: Policy id.
|
42
|
+
autotermination_minutes: Autotermination minutes.
|
43
|
+
autoscale: Autoscale.
|
44
|
+
single_user_name: Single user name.
|
45
|
+
spark_conf: Spark configuration.
|
46
|
+
spark_env_vars: Spark environment variables.
|
47
|
+
schedule_timezone: Schedule timezone.
|
48
|
+
"""
|
49
|
+
|
50
|
+
# Resources
|
51
|
+
spark_version: Optional[str] = None
|
52
|
+
num_workers: Optional[int] = None
|
53
|
+
node_type_id: Optional[str] = None
|
54
|
+
policy_id: Optional[str] = None
|
55
|
+
autotermination_minutes: Optional[int] = None
|
56
|
+
autoscale: Tuple[int, int] = (2, 3)
|
57
|
+
single_user_name: Optional[str] = None
|
58
|
+
spark_conf: Optional[Dict[str, str]] = None
|
59
|
+
spark_env_vars: Optional[Dict[str, str]] = None
|
60
|
+
schedule_timezone: Optional[str] = None
|
61
|
+
|
62
|
+
|
63
|
+
class DatabricksOrchestratorConfig(
|
64
|
+
BaseOrchestratorConfig, DatabricksOrchestratorSettings
|
65
|
+
):
|
66
|
+
"""Databricks orchestrator base config.
|
67
|
+
|
68
|
+
Attributes:
|
69
|
+
host: Databricks host.
|
70
|
+
client_id: Databricks client id.
|
71
|
+
client_secret: Databricks client secret.
|
72
|
+
"""
|
73
|
+
|
74
|
+
host: str
|
75
|
+
client_id: str = SecretField(default=None)
|
76
|
+
client_secret: str = SecretField(default=None)
|
77
|
+
|
78
|
+
@property
|
79
|
+
def is_local(self) -> bool:
|
80
|
+
"""Checks if this stack component is running locally.
|
81
|
+
|
82
|
+
Returns:
|
83
|
+
True if this config is for a local component, False otherwise.
|
84
|
+
"""
|
85
|
+
return False
|
86
|
+
|
87
|
+
|
88
|
+
class DatabricksOrchestratorFlavor(BaseOrchestratorFlavor):
|
89
|
+
"""Databricks orchestrator flavor."""
|
90
|
+
|
91
|
+
@property
|
92
|
+
def name(self) -> str:
|
93
|
+
"""Name of the flavor.
|
94
|
+
|
95
|
+
Returns:
|
96
|
+
The name of the flavor.
|
97
|
+
"""
|
98
|
+
return DATABRICKS_ORCHESTRATOR_FLAVOR
|
99
|
+
|
100
|
+
@property
|
101
|
+
def docs_url(self) -> Optional[str]:
|
102
|
+
"""A url to point at docs explaining this flavor.
|
103
|
+
|
104
|
+
Returns:
|
105
|
+
A flavor docs url.
|
106
|
+
"""
|
107
|
+
return self.generate_default_docs_url()
|
108
|
+
|
109
|
+
@property
|
110
|
+
def sdk_docs_url(self) -> Optional[str]:
|
111
|
+
"""A url to point at SDK docs explaining this flavor.
|
112
|
+
|
113
|
+
Returns:
|
114
|
+
A flavor SDK docs url.
|
115
|
+
"""
|
116
|
+
return self.generate_default_sdk_docs_url()
|
117
|
+
|
118
|
+
@property
|
119
|
+
def logo_url(self) -> str:
|
120
|
+
"""A url to represent the flavor in the dashboard.
|
121
|
+
|
122
|
+
Returns:
|
123
|
+
The flavor logo.
|
124
|
+
"""
|
125
|
+
return "https://public-flavor-logos.s3.eu-central-1.amazonaws.com/orchestrator/databricks.png"
|
126
|
+
|
127
|
+
@property
|
128
|
+
def config_class(self) -> Type[DatabricksOrchestratorConfig]:
|
129
|
+
"""Returns `KubeflowOrchestratorConfig` config class.
|
130
|
+
|
131
|
+
Returns:
|
132
|
+
The config class.
|
133
|
+
"""
|
134
|
+
return DatabricksOrchestratorConfig
|
135
|
+
|
136
|
+
@property
|
137
|
+
def implementation_class(self) -> Type["DatabricksOrchestrator"]:
|
138
|
+
"""Implementation class for this flavor.
|
139
|
+
|
140
|
+
Returns:
|
141
|
+
The implementation class.
|
142
|
+
"""
|
143
|
+
from zenml.integrations.databricks.orchestrators import (
|
144
|
+
DatabricksOrchestrator,
|
145
|
+
)
|
146
|
+
|
147
|
+
return DatabricksOrchestrator
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Copyright (c) ZenML GmbH 2023. 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
|
+
# http://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
|
+
"""Initialization of the Databricks model deployers."""
|
15
|
+
|
16
|
+
from zenml.integrations.databricks.model_deployers.databricks_model_deployer import ( # noqa
|
17
|
+
DatabricksModelDeployer,
|
18
|
+
)
|
19
|
+
|
20
|
+
__all__ = ["DatabricksModelDeployer"]
|