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
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
import json
|
17
17
|
from datetime import datetime
|
18
|
-
from typing import Any, Optional
|
18
|
+
from typing import Any, Optional, Set
|
19
19
|
from uuid import UUID
|
20
20
|
|
21
21
|
from sqlmodel import Field, SQLModel
|
@@ -59,16 +59,33 @@ class ServerSettingsSchema(SQLModel, table=True):
|
|
59
59
|
for field, value in settings_update.model_dump(
|
60
60
|
exclude_unset=True
|
61
61
|
).items():
|
62
|
-
if field
|
63
|
-
if value is not None:
|
64
|
-
self.onboarding_state = json.dumps(value)
|
65
|
-
elif hasattr(self, field):
|
62
|
+
if hasattr(self, field):
|
66
63
|
setattr(self, field, value)
|
67
64
|
|
68
65
|
self.updated = datetime.utcnow()
|
69
66
|
|
70
67
|
return self
|
71
68
|
|
69
|
+
def update_onboarding_state(
|
70
|
+
self, completed_steps: Set[str]
|
71
|
+
) -> "ServerSettingsSchema":
|
72
|
+
"""Update the onboarding state.
|
73
|
+
|
74
|
+
Args:
|
75
|
+
completed_steps: Newly completed onboarding steps.
|
76
|
+
|
77
|
+
Returns:
|
78
|
+
The updated schema.
|
79
|
+
"""
|
80
|
+
old_state = set(
|
81
|
+
json.loads(self.onboarding_state) if self.onboarding_state else []
|
82
|
+
)
|
83
|
+
new_state = old_state.union(completed_steps)
|
84
|
+
self.onboarding_state = json.dumps(list(new_state))
|
85
|
+
self.updated = datetime.utcnow()
|
86
|
+
|
87
|
+
return self
|
88
|
+
|
72
89
|
def to_model(
|
73
90
|
self,
|
74
91
|
include_metadata: bool = False,
|
@@ -82,7 +99,6 @@ class ServerSettingsSchema(SQLModel, table=True):
|
|
82
99
|
include_resources: Whether the resources will be filled.
|
83
100
|
**kwargs: Keyword arguments to allow schema specific logic
|
84
101
|
|
85
|
-
|
86
102
|
Returns:
|
87
103
|
The created `SettingsResponse`.
|
88
104
|
"""
|
@@ -101,11 +117,7 @@ class ServerSettingsSchema(SQLModel, table=True):
|
|
101
117
|
resources = None
|
102
118
|
|
103
119
|
if include_metadata:
|
104
|
-
metadata = ServerSettingsResponseMetadata(
|
105
|
-
onboarding_state=json.loads(self.onboarding_state)
|
106
|
-
if self.onboarding_state
|
107
|
-
else {},
|
108
|
-
)
|
120
|
+
metadata = ServerSettingsResponseMetadata()
|
109
121
|
|
110
122
|
if include_resources:
|
111
123
|
resources = ServerSettingsResponseResources()
|
@@ -13,6 +13,8 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""SQL Model Implementations for Stacks."""
|
15
15
|
|
16
|
+
import base64
|
17
|
+
import json
|
16
18
|
from datetime import datetime
|
17
19
|
from typing import TYPE_CHECKING, Any, List, Optional
|
18
20
|
from uuid import UUID
|
@@ -75,6 +77,7 @@ class StackSchema(NamedSchema, table=True):
|
|
75
77
|
|
76
78
|
__tablename__ = "stack"
|
77
79
|
stack_spec_path: Optional[str]
|
80
|
+
labels: Optional[bytes]
|
78
81
|
|
79
82
|
workspace_id: UUID = build_foreign_key_field(
|
80
83
|
source=__tablename__,
|
@@ -124,6 +127,10 @@ class StackSchema(NamedSchema, table=True):
|
|
124
127
|
).items():
|
125
128
|
if field == "components":
|
126
129
|
self.components = components
|
130
|
+
elif field == "labels":
|
131
|
+
self.labels = base64.b64encode(
|
132
|
+
json.dumps(stack_update.labels).encode("utf-8")
|
133
|
+
)
|
127
134
|
else:
|
128
135
|
setattr(self, field, value)
|
129
136
|
|
@@ -158,6 +165,9 @@ class StackSchema(NamedSchema, table=True):
|
|
158
165
|
workspace=self.workspace.to_model(),
|
159
166
|
components={c.type: [c.to_model()] for c in self.components},
|
160
167
|
stack_spec_path=self.stack_spec_path,
|
168
|
+
labels=json.loads(base64.b64decode(self.labels).decode())
|
169
|
+
if self.labels
|
170
|
+
else None,
|
161
171
|
)
|
162
172
|
|
163
173
|
return StackResponse(
|
@@ -192,6 +192,7 @@ class StepRunSchema(NamedSchema, table=True):
|
|
192
192
|
The created StepRunResponse.
|
193
193
|
|
194
194
|
Raises:
|
195
|
+
ValueError: In case the step run configuration can not be loaded.
|
195
196
|
RuntimeError: If the step run schema does not have a deployment_id
|
196
197
|
or a step_configuration.
|
197
198
|
"""
|
@@ -212,19 +213,34 @@ class StepRunSchema(NamedSchema, table=True):
|
|
212
213
|
for artifact in self.output_artifacts
|
213
214
|
}
|
214
215
|
|
216
|
+
full_step_config = None
|
215
217
|
if self.deployment is not None:
|
216
|
-
|
217
|
-
|
218
|
-
)
|
219
|
-
elif self.step_configuration is not None:
|
220
|
-
full_step_config = Step.model_validate_json(
|
221
|
-
self.step_configuration
|
222
|
-
)
|
223
|
-
else:
|
224
|
-
raise RuntimeError(
|
225
|
-
"Step run model creation has failed. Each step run entry "
|
226
|
-
"should either have a deployment_id or step_configuration."
|
218
|
+
step_configuration = json.loads(
|
219
|
+
self.deployment.step_configurations
|
227
220
|
)
|
221
|
+
if self.name in step_configuration:
|
222
|
+
full_step_config = Step.model_validate(
|
223
|
+
step_configuration[self.name]
|
224
|
+
)
|
225
|
+
elif not self.step_configuration:
|
226
|
+
raise ValueError(
|
227
|
+
f"Unable to load the configuration for step `{self.name}` from the"
|
228
|
+
f"database. To solve this please delete the pipeline run that this"
|
229
|
+
f"step run belongs to. Pipeline Run ID: `{self.pipeline_run_id}`."
|
230
|
+
)
|
231
|
+
|
232
|
+
# the step configuration moved into the deployment - the following case is to ensure
|
233
|
+
# backwards compatibility
|
234
|
+
if full_step_config is None:
|
235
|
+
if self.step_configuration:
|
236
|
+
full_step_config = Step.model_validate_json(
|
237
|
+
self.step_configuration
|
238
|
+
)
|
239
|
+
else:
|
240
|
+
raise RuntimeError(
|
241
|
+
"Step run model creation has failed. Each step run entry "
|
242
|
+
"should either have a deployment_id or step_configuration."
|
243
|
+
)
|
228
244
|
|
229
245
|
body = StepRunResponseBody(
|
230
246
|
user=self.user.to_model() if self.user else None,
|