zenml-nightly 0.58.2.dev20240614__py3-none-any.whl → 0.58.2.dev20240622__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.
- zenml/VERSION +1 -1
- zenml/_hub/client.py +8 -5
- zenml/actions/base_action.py +8 -10
- zenml/artifact_stores/base_artifact_store.py +20 -15
- zenml/artifact_stores/local_artifact_store.py +3 -2
- zenml/artifacts/artifact_config.py +34 -19
- zenml/artifacts/external_artifact.py +18 -8
- zenml/artifacts/external_artifact_config.py +14 -6
- zenml/artifacts/unmaterialized_artifact.py +2 -11
- zenml/cli/__init__.py +6 -0
- zenml/cli/artifact.py +20 -2
- zenml/cli/base.py +2 -2
- zenml/cli/served_model.py +0 -1
- zenml/cli/server.py +3 -3
- zenml/cli/utils.py +36 -40
- zenml/cli/web_login.py +2 -2
- zenml/client.py +198 -24
- zenml/client_lazy_loader.py +20 -14
- zenml/config/base_settings.py +5 -6
- zenml/config/build_configuration.py +1 -1
- zenml/config/compiler.py +3 -3
- zenml/config/docker_settings.py +27 -28
- zenml/config/global_config.py +33 -37
- zenml/config/pipeline_configurations.py +8 -11
- zenml/config/pipeline_run_configuration.py +6 -2
- zenml/config/pipeline_spec.py +3 -4
- zenml/config/resource_settings.py +8 -9
- zenml/config/schedule.py +16 -20
- zenml/config/secret_reference_mixin.py +6 -3
- zenml/config/secrets_store_config.py +16 -23
- zenml/config/server_config.py +50 -46
- zenml/config/settings_resolver.py +1 -1
- zenml/config/source.py +45 -35
- zenml/config/step_configurations.py +53 -31
- zenml/config/step_run_info.py +3 -0
- zenml/config/store_config.py +20 -19
- zenml/config/strict_base_model.py +2 -6
- zenml/constants.py +26 -2
- zenml/container_registries/base_container_registry.py +3 -2
- zenml/container_registries/default_container_registry.py +3 -3
- zenml/event_hub/base_event_hub.py +1 -1
- zenml/event_sources/base_event_source.py +11 -16
- zenml/exceptions.py +4 -0
- zenml/integrations/airflow/__init__.py +2 -6
- zenml/integrations/airflow/flavors/airflow_orchestrator_flavor.py +6 -7
- zenml/integrations/airflow/orchestrators/airflow_orchestrator.py +13 -249
- zenml/integrations/airflow/orchestrators/dag_generator.py +5 -3
- zenml/integrations/argilla/flavors/argilla_annotator_flavor.py +5 -4
- zenml/integrations/aws/__init__.py +1 -1
- zenml/integrations/aws/flavors/aws_container_registry_flavor.py +3 -2
- zenml/integrations/aws/flavors/sagemaker_orchestrator_flavor.py +11 -5
- zenml/integrations/aws/flavors/sagemaker_step_operator_flavor.py +6 -2
- zenml/integrations/aws/service_connectors/aws_service_connector.py +5 -4
- zenml/integrations/aws/step_operators/sagemaker_step_operator.py +1 -1
- zenml/integrations/azure/flavors/azureml_step_operator_flavor.py +4 -4
- zenml/integrations/azure/service_connectors/azure_service_connector.py +4 -3
- zenml/integrations/azure/step_operators/azureml_step_operator.py +2 -1
- zenml/integrations/bentoml/steps/bentoml_deployer.py +1 -1
- zenml/integrations/bitbucket/plugins/event_sources/bitbucket_webhook_event_source.py +8 -12
- zenml/integrations/comet/flavors/comet_experiment_tracker_flavor.py +1 -1
- zenml/integrations/constants.py +0 -1
- zenml/integrations/deepchecks/__init__.py +1 -0
- zenml/integrations/evidently/__init__.py +5 -3
- zenml/integrations/evidently/column_mapping.py +11 -3
- zenml/integrations/evidently/data_validators/evidently_data_validator.py +21 -3
- zenml/integrations/evidently/metrics.py +5 -6
- zenml/integrations/evidently/tests.py +5 -6
- zenml/integrations/facets/models.py +2 -6
- zenml/integrations/feast/__init__.py +3 -1
- zenml/integrations/feast/feature_stores/feast_feature_store.py +0 -23
- zenml/integrations/gcp/__init__.py +1 -1
- zenml/integrations/gcp/flavors/vertex_orchestrator_flavor.py +1 -1
- zenml/integrations/gcp/flavors/vertex_step_operator_flavor.py +1 -1
- zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +234 -103
- zenml/integrations/gcp/service_connectors/gcp_service_connector.py +57 -42
- zenml/integrations/gcp/step_operators/vertex_step_operator.py +1 -0
- zenml/integrations/github/code_repositories/github_code_repository.py +1 -1
- zenml/integrations/github/plugins/event_sources/github_webhook_event_source.py +9 -13
- zenml/integrations/great_expectations/__init__.py +1 -1
- zenml/integrations/great_expectations/data_validators/ge_data_validator.py +44 -44
- zenml/integrations/great_expectations/flavors/great_expectations_data_validator_flavor.py +35 -2
- zenml/integrations/great_expectations/ge_store_backend.py +24 -11
- zenml/integrations/great_expectations/materializers/ge_materializer.py +3 -3
- zenml/integrations/great_expectations/utils.py +5 -5
- zenml/integrations/huggingface/__init__.py +3 -0
- zenml/integrations/huggingface/flavors/huggingface_model_deployer_flavor.py +1 -1
- zenml/integrations/huggingface/steps/__init__.py +3 -0
- zenml/integrations/huggingface/steps/accelerate_runner.py +149 -0
- zenml/integrations/huggingface/steps/huggingface_deployer.py +2 -2
- zenml/integrations/hyperai/flavors/hyperai_orchestrator_flavor.py +1 -1
- zenml/integrations/hyperai/service_connectors/hyperai_service_connector.py +4 -3
- zenml/integrations/kubeflow/__init__.py +1 -1
- zenml/integrations/kubeflow/flavors/kubeflow_orchestrator_flavor.py +48 -81
- zenml/integrations/kubeflow/orchestrators/kubeflow_orchestrator.py +295 -245
- zenml/integrations/kubernetes/flavors/kubernetes_orchestrator_flavor.py +1 -1
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint.py +11 -2
- zenml/integrations/kubernetes/pod_settings.py +17 -31
- zenml/integrations/kubernetes/service_connectors/kubernetes_service_connector.py +8 -7
- zenml/integrations/label_studio/__init__.py +1 -3
- zenml/integrations/label_studio/annotators/label_studio_annotator.py +3 -4
- zenml/integrations/label_studio/flavors/label_studio_annotator_flavor.py +2 -2
- zenml/integrations/langchain/__init__.py +5 -1
- zenml/integrations/langchain/materializers/document_materializer.py +44 -8
- zenml/integrations/mlflow/__init__.py +9 -3
- zenml/integrations/mlflow/experiment_trackers/mlflow_experiment_tracker.py +1 -1
- zenml/integrations/mlflow/flavors/mlflow_experiment_tracker_flavor.py +29 -37
- zenml/integrations/mlflow/model_registries/mlflow_model_registry.py +4 -4
- zenml/integrations/mlflow/steps/mlflow_deployer.py +1 -1
- zenml/integrations/neptune/flavors/neptune_experiment_tracker_flavor.py +1 -1
- zenml/integrations/neural_prophet/__init__.py +5 -1
- zenml/integrations/pigeon/flavors/pigeon_annotator_flavor.py +1 -1
- zenml/integrations/s3/flavors/s3_artifact_store_flavor.py +9 -8
- zenml/integrations/seldon/seldon_client.py +52 -67
- zenml/integrations/seldon/services/seldon_deployment.py +3 -3
- zenml/integrations/seldon/steps/seldon_deployer.py +4 -4
- zenml/integrations/skypilot/flavors/skypilot_orchestrator_base_vm_config.py +15 -5
- zenml/integrations/skypilot_aws/__init__.py +1 -1
- zenml/integrations/skypilot_aws/flavors/skypilot_orchestrator_aws_vm_flavor.py +1 -1
- zenml/integrations/skypilot_azure/__init__.py +1 -1
- zenml/integrations/skypilot_azure/flavors/skypilot_orchestrator_azure_vm_flavor.py +1 -1
- zenml/integrations/skypilot_gcp/__init__.py +2 -1
- zenml/integrations/skypilot_gcp/flavors/skypilot_orchestrator_gcp_vm_flavor.py +1 -1
- zenml/integrations/skypilot_lambda/flavors/skypilot_orchestrator_lambda_vm_flavor.py +2 -2
- zenml/integrations/spark/flavors/spark_step_operator_flavor.py +1 -1
- zenml/integrations/spark/step_operators/spark_step_operator.py +2 -0
- zenml/integrations/tekton/__init__.py +1 -1
- zenml/integrations/tekton/flavors/tekton_orchestrator_flavor.py +66 -23
- zenml/integrations/tekton/orchestrators/tekton_orchestrator.py +547 -233
- zenml/integrations/tensorboard/__init__.py +1 -12
- zenml/integrations/tensorboard/services/tensorboard_service.py +3 -5
- zenml/integrations/tensorboard/visualizers/tensorboard_visualizer.py +6 -6
- zenml/integrations/tensorflow/__init__.py +2 -10
- zenml/integrations/tensorflow/materializers/keras_materializer.py +17 -9
- zenml/integrations/wandb/flavors/wandb_experiment_tracker_flavor.py +9 -14
- zenml/integrations/whylogs/flavors/whylogs_data_validator_flavor.py +1 -1
- zenml/lineage_graph/lineage_graph.py +1 -1
- zenml/logging/step_logging.py +15 -7
- zenml/materializers/built_in_materializer.py +3 -3
- zenml/materializers/pydantic_materializer.py +2 -2
- zenml/metadata/lazy_load.py +4 -4
- zenml/metadata/metadata_types.py +64 -4
- zenml/model/model.py +79 -54
- zenml/model_deployers/base_model_deployer.py +14 -12
- zenml/model_registries/base_model_registry.py +17 -15
- zenml/models/__init__.py +79 -206
- zenml/models/v2/base/base.py +54 -41
- zenml/models/v2/base/base_plugin_flavor.py +2 -6
- zenml/models/v2/base/filter.py +91 -76
- zenml/models/v2/base/page.py +2 -12
- zenml/models/v2/base/scoped.py +4 -7
- zenml/models/v2/core/api_key.py +22 -8
- zenml/models/v2/core/artifact.py +2 -2
- zenml/models/v2/core/artifact_version.py +74 -40
- zenml/models/v2/core/code_repository.py +37 -10
- zenml/models/v2/core/component.py +65 -16
- zenml/models/v2/core/device.py +14 -4
- zenml/models/v2/core/event_source.py +1 -2
- zenml/models/v2/core/flavor.py +74 -8
- zenml/models/v2/core/logs.py +68 -8
- zenml/models/v2/core/model.py +8 -4
- zenml/models/v2/core/model_version.py +25 -6
- zenml/models/v2/core/model_version_artifact.py +51 -21
- zenml/models/v2/core/model_version_pipeline_run.py +45 -13
- zenml/models/v2/core/pipeline.py +37 -72
- zenml/models/v2/core/pipeline_build.py +29 -17
- zenml/models/v2/core/pipeline_deployment.py +18 -6
- zenml/models/v2/core/pipeline_namespace.py +113 -0
- zenml/models/v2/core/pipeline_run.py +50 -22
- zenml/models/v2/core/run_metadata.py +59 -36
- zenml/models/v2/core/schedule.py +37 -24
- zenml/models/v2/core/secret.py +31 -12
- zenml/models/v2/core/service.py +64 -36
- zenml/models/v2/core/service_account.py +24 -11
- zenml/models/v2/core/service_connector.py +219 -44
- zenml/models/v2/core/stack.py +45 -17
- zenml/models/v2/core/step_run.py +28 -8
- zenml/models/v2/core/tag.py +8 -4
- zenml/models/v2/core/trigger.py +2 -2
- zenml/models/v2/core/trigger_execution.py +1 -0
- zenml/models/v2/core/user.py +18 -21
- zenml/models/v2/core/workspace.py +13 -3
- zenml/models/v2/misc/build_item.py +3 -3
- zenml/models/v2/misc/external_user.py +2 -6
- zenml/models/v2/misc/hub_plugin_models.py +9 -9
- zenml/models/v2/misc/loaded_visualization.py +2 -2
- zenml/models/v2/misc/service_connector_type.py +8 -17
- zenml/models/v2/misc/user_auth.py +7 -2
- zenml/new/pipelines/build_utils.py +3 -3
- zenml/new/pipelines/pipeline.py +17 -13
- zenml/new/pipelines/run_utils.py +103 -1
- zenml/orchestrators/base_orchestrator.py +10 -7
- zenml/orchestrators/local_docker/local_docker_orchestrator.py +1 -1
- zenml/orchestrators/step_launcher.py +28 -4
- zenml/orchestrators/step_runner.py +3 -6
- zenml/orchestrators/utils.py +1 -1
- zenml/plugins/base_plugin_flavor.py +6 -10
- zenml/plugins/plugin_flavor_registry.py +3 -7
- zenml/secret/base_secret.py +7 -8
- zenml/service_connectors/docker_service_connector.py +4 -3
- zenml/service_connectors/service_connector.py +5 -12
- zenml/service_connectors/service_connector_registry.py +2 -4
- zenml/services/container/container_service.py +1 -1
- zenml/services/container/container_service_endpoint.py +1 -1
- zenml/services/local/local_service.py +1 -1
- zenml/services/local/local_service_endpoint.py +1 -1
- zenml/services/service.py +16 -10
- zenml/services/service_type.py +4 -5
- zenml/services/terraform/terraform_service.py +1 -1
- zenml/stack/flavor.py +2 -6
- zenml/stack/flavor_registry.py +4 -4
- zenml/stack/stack.py +4 -1
- zenml/stack/stack_component.py +55 -31
- zenml/step_operators/step_operator_entrypoint_configuration.py +1 -0
- zenml/steps/base_step.py +34 -28
- zenml/steps/entrypoint_function_utils.py +3 -5
- zenml/steps/utils.py +12 -14
- zenml/utils/cuda_utils.py +50 -0
- zenml/utils/deprecation_utils.py +18 -20
- zenml/utils/dict_utils.py +1 -1
- zenml/utils/filesync_model.py +65 -28
- zenml/utils/function_utils.py +260 -0
- zenml/utils/json_utils.py +131 -0
- zenml/utils/mlstacks_utils.py +2 -2
- zenml/utils/package_utils.py +1 -1
- zenml/utils/pipeline_docker_image_builder.py +9 -0
- zenml/utils/pydantic_utils.py +270 -62
- zenml/utils/secret_utils.py +65 -12
- zenml/utils/source_utils.py +2 -2
- zenml/utils/typed_model.py +5 -3
- zenml/utils/typing_utils.py +243 -0
- zenml/utils/yaml_utils.py +1 -1
- zenml/zen_server/auth.py +2 -2
- zenml/zen_server/cloud_utils.py +6 -6
- zenml/zen_server/deploy/base_provider.py +1 -1
- zenml/zen_server/deploy/deployment.py +6 -8
- zenml/zen_server/deploy/docker/docker_zen_server.py +3 -4
- zenml/zen_server/deploy/local/local_provider.py +0 -1
- zenml/zen_server/deploy/local/local_zen_server.py +6 -6
- zenml/zen_server/deploy/terraform/terraform_zen_server.py +4 -6
- zenml/zen_server/exceptions.py +4 -1
- zenml/zen_server/feature_gate/zenml_cloud_feature_gate.py +1 -1
- zenml/zen_server/pipeline_deployment/utils.py +48 -68
- zenml/zen_server/rbac/models.py +2 -5
- zenml/zen_server/rbac/utils.py +11 -14
- zenml/zen_server/routers/auth_endpoints.py +2 -2
- zenml/zen_server/routers/pipeline_builds_endpoints.py +1 -1
- zenml/zen_server/routers/runs_endpoints.py +1 -1
- zenml/zen_server/routers/secrets_endpoints.py +3 -2
- zenml/zen_server/routers/server_endpoints.py +1 -1
- zenml/zen_server/routers/steps_endpoints.py +1 -1
- zenml/zen_server/routers/workspaces_endpoints.py +1 -1
- zenml/zen_stores/base_zen_store.py +46 -9
- zenml/zen_stores/migrations/utils.py +42 -46
- zenml/zen_stores/migrations/versions/0701da9951a0_added_service_table.py +1 -1
- zenml/zen_stores/migrations/versions/1041bc644e0d_remove_secrets_manager.py +5 -3
- zenml/zen_stores/migrations/versions/10a907dad202_delete_mlmd_tables.py +1 -1
- zenml/zen_stores/migrations/versions/26b776ad583e_redesign_artifacts.py +8 -10
- zenml/zen_stores/migrations/versions/37835ce041d2_optimizing_database.py +3 -3
- zenml/zen_stores/migrations/versions/46506f72f0ed_add_server_settings.py +10 -12
- zenml/zen_stores/migrations/versions/5994f9ad0489_introduce_role_permissions.py +3 -2
- zenml/zen_stores/migrations/versions/6917bce75069_add_pipeline_run_unique_constraint.py +4 -4
- zenml/zen_stores/migrations/versions/728c6369cfaa_add_name_column_to_input_artifact_pk.py +3 -2
- zenml/zen_stores/migrations/versions/743ec82b1b3c_update_size_of_build_images.py +2 -2
- zenml/zen_stores/migrations/versions/7500f434b71c_remove_shared_columns.py +3 -2
- zenml/zen_stores/migrations/versions/7834208cc3f6_artifact_project_scoping.py +8 -7
- zenml/zen_stores/migrations/versions/7b651bf6822e_track_secrets_in_db.py +6 -4
- zenml/zen_stores/migrations/versions/7e4a481d17f7_add_identity_table.py +2 -2
- zenml/zen_stores/migrations/versions/7f603e583dd7_fixed_migration.py +1 -1
- zenml/zen_stores/migrations/versions/a39c4184c8ce_remove_secrets_manager_flavors.py +2 -2
- zenml/zen_stores/migrations/versions/a91762e6be36_artifact_version_table.py +4 -4
- zenml/zen_stores/migrations/versions/alembic_start.py +1 -1
- zenml/zen_stores/migrations/versions/fbd7f18ced1e_increase_step_run_field_lengths.py +4 -4
- zenml/zen_stores/rest_zen_store.py +109 -49
- zenml/zen_stores/schemas/api_key_schemas.py +1 -1
- zenml/zen_stores/schemas/artifact_schemas.py +8 -8
- zenml/zen_stores/schemas/artifact_visualization_schemas.py +3 -3
- zenml/zen_stores/schemas/code_repository_schemas.py +1 -1
- zenml/zen_stores/schemas/component_schemas.py +8 -3
- zenml/zen_stores/schemas/device_schemas.py +8 -6
- zenml/zen_stores/schemas/event_source_schemas.py +3 -4
- zenml/zen_stores/schemas/flavor_schemas.py +5 -3
- zenml/zen_stores/schemas/model_schemas.py +26 -1
- zenml/zen_stores/schemas/pipeline_build_schemas.py +1 -1
- zenml/zen_stores/schemas/pipeline_deployment_schemas.py +4 -4
- zenml/zen_stores/schemas/pipeline_run_schemas.py +6 -6
- zenml/zen_stores/schemas/pipeline_schemas.py +5 -2
- zenml/zen_stores/schemas/run_metadata_schemas.py +2 -2
- zenml/zen_stores/schemas/secret_schemas.py +8 -5
- zenml/zen_stores/schemas/server_settings_schemas.py +3 -1
- zenml/zen_stores/schemas/service_connector_schemas.py +1 -1
- zenml/zen_stores/schemas/service_schemas.py +11 -2
- zenml/zen_stores/schemas/stack_schemas.py +1 -1
- zenml/zen_stores/schemas/step_run_schemas.py +11 -11
- zenml/zen_stores/schemas/tag_schemas.py +6 -2
- zenml/zen_stores/schemas/trigger_schemas.py +2 -2
- zenml/zen_stores/schemas/user_schemas.py +2 -2
- zenml/zen_stores/schemas/workspace_schemas.py +3 -1
- zenml/zen_stores/secrets_stores/aws_secrets_store.py +19 -20
- zenml/zen_stores/secrets_stores/azure_secrets_store.py +17 -20
- zenml/zen_stores/secrets_stores/base_secrets_store.py +79 -12
- zenml/zen_stores/secrets_stores/gcp_secrets_store.py +17 -20
- zenml/zen_stores/secrets_stores/hashicorp_secrets_store.py +4 -8
- zenml/zen_stores/secrets_stores/service_connector_secrets_store.py +10 -7
- zenml/zen_stores/secrets_stores/sql_secrets_store.py +5 -6
- zenml/zen_stores/sql_zen_store.py +196 -120
- zenml/zen_stores/zen_store_interface.py +33 -0
- {zenml_nightly-0.58.2.dev20240614.dist-info → zenml_nightly-0.58.2.dev20240622.dist-info}/METADATA +9 -7
- {zenml_nightly-0.58.2.dev20240614.dist-info → zenml_nightly-0.58.2.dev20240622.dist-info}/RECORD +311 -308
- zenml/integrations/kubeflow/utils.py +0 -95
- zenml/models/v2/base/internal.py +0 -37
- zenml/models/v2/base/update.py +0 -44
- {zenml_nightly-0.58.2.dev20240614.dist-info → zenml_nightly-0.58.2.dev20240622.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.58.2.dev20240614.dist-info → zenml_nightly-0.58.2.dev20240622.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.58.2.dev20240614.dist-info → zenml_nightly-0.58.2.dev20240622.dist-info}/entry_points.txt +0 -0
zenml/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.58.2.
|
1
|
+
0.58.2.dev20240622
|
zenml/_hub/client.py
CHANGED
@@ -76,7 +76,8 @@ class HubClient:
|
|
76
76
|
if not isinstance(response, list):
|
77
77
|
return []
|
78
78
|
return [
|
79
|
-
HubPluginResponseModel.
|
79
|
+
HubPluginResponseModel.model_validate(plugin)
|
80
|
+
for plugin in response
|
80
81
|
]
|
81
82
|
|
82
83
|
def get_plugin(
|
@@ -113,7 +114,7 @@ class HubClient:
|
|
113
114
|
return None
|
114
115
|
if not isinstance(response, list) or len(response) == 0:
|
115
116
|
return None
|
116
|
-
return HubPluginResponseModel.
|
117
|
+
return HubPluginResponseModel.model_validate(response[0])
|
117
118
|
|
118
119
|
def create_plugin(
|
119
120
|
self, plugin_request: HubPluginRequestModel
|
@@ -127,8 +128,10 @@ class HubClient:
|
|
127
128
|
The plugin response model.
|
128
129
|
"""
|
129
130
|
route = "/plugins"
|
130
|
-
response = self._request(
|
131
|
-
|
131
|
+
response = self._request(
|
132
|
+
"POST", route, data=plugin_request.model_dump_json()
|
133
|
+
)
|
134
|
+
return HubPluginResponseModel.model_validate(response)
|
132
135
|
|
133
136
|
# TODO: Potentially reenable this later if hub adds logs streaming endpoint
|
134
137
|
# def stream_plugin_build_logs(
|
@@ -224,7 +227,7 @@ class HubClient:
|
|
224
227
|
"""
|
225
228
|
try:
|
226
229
|
response = self._request("GET", "/users/me")
|
227
|
-
return HubUserResponseModel.
|
230
|
+
return HubUserResponseModel.model_validate(response)
|
228
231
|
except HubAPIError:
|
229
232
|
return None
|
230
233
|
|
zenml/actions/base_action.py
CHANGED
@@ -13,7 +13,6 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Base implementation of actions."""
|
15
15
|
|
16
|
-
import json
|
17
16
|
from abc import ABC, abstractmethod
|
18
17
|
from typing import Any, ClassVar, Dict, Optional, Type
|
19
18
|
|
@@ -66,10 +65,7 @@ class BaseActionFlavor(BasePluginFlavor, ABC):
|
|
66
65
|
Returns:
|
67
66
|
The config schema.
|
68
67
|
"""
|
69
|
-
|
70
|
-
cls.ACTION_CONFIG_CLASS.schema_json()
|
71
|
-
)
|
72
|
-
return config_schema
|
68
|
+
return cls.ACTION_CONFIG_CLASS.model_json_schema()
|
73
69
|
|
74
70
|
@classmethod
|
75
71
|
def get_flavor_response_model(cls, hydrate: bool) -> ActionFlavorResponse:
|
@@ -260,7 +256,7 @@ class BaseActionHandler(BasePlugin, ABC):
|
|
260
256
|
# before it is sent to the database
|
261
257
|
self._validate_trigger_request(trigger=trigger, config=config)
|
262
258
|
# Serialize the configuration back into the request
|
263
|
-
trigger.action = config.
|
259
|
+
trigger.action = config.model_dump(exclude_none=True)
|
264
260
|
# Create the trigger in the database
|
265
261
|
trigger_response = self.zen_store.create_trigger(trigger=trigger)
|
266
262
|
try:
|
@@ -290,7 +286,7 @@ class BaseActionHandler(BasePlugin, ABC):
|
|
290
286
|
raise
|
291
287
|
|
292
288
|
# Serialize the configuration back into the response
|
293
|
-
trigger_response.set_action(config.
|
289
|
+
trigger_response.set_action(config.model_dump(exclude_none=True))
|
294
290
|
# Return the response to the user
|
295
291
|
return trigger_response
|
296
292
|
|
@@ -330,7 +326,7 @@ class BaseActionHandler(BasePlugin, ABC):
|
|
330
326
|
config_update=config_update,
|
331
327
|
)
|
332
328
|
# Serialize the configuration update back into the update request
|
333
|
-
trigger_update.action = config_update.
|
329
|
+
trigger_update.action = config_update.model_dump(exclude_none=True)
|
334
330
|
|
335
331
|
# Update the trigger in the database
|
336
332
|
trigger_response = self.zen_store.update_trigger(
|
@@ -373,7 +369,9 @@ class BaseActionHandler(BasePlugin, ABC):
|
|
373
369
|
raise
|
374
370
|
|
375
371
|
# Serialize the configuration back into the response
|
376
|
-
trigger_response.set_action(
|
372
|
+
trigger_response.set_action(
|
373
|
+
response_config.model_dump(exclude_none=True)
|
374
|
+
)
|
377
375
|
# Return the response to the user
|
378
376
|
return trigger_response
|
379
377
|
|
@@ -436,7 +434,7 @@ class BaseActionHandler(BasePlugin, ABC):
|
|
436
434
|
# Call the implementation specific method to process the response
|
437
435
|
self._process_trigger_response(trigger=trigger, config=config)
|
438
436
|
# Serialize the configuration back into the response
|
439
|
-
trigger.set_action(config.
|
437
|
+
trigger.set_action(config.model_dump(exclude_none=True))
|
440
438
|
# Add any implementation specific related resources to the trigger
|
441
439
|
# response
|
442
440
|
self._populate_trigger_response_resources(
|
@@ -32,7 +32,7 @@ from typing import (
|
|
32
32
|
cast,
|
33
33
|
)
|
34
34
|
|
35
|
-
from pydantic import
|
35
|
+
from pydantic import model_validator
|
36
36
|
|
37
37
|
from zenml.enums import StackComponentType
|
38
38
|
from zenml.exceptions import ArtifactStoreInterfaceError
|
@@ -40,6 +40,7 @@ from zenml.io import fileio
|
|
40
40
|
from zenml.logger import get_logger
|
41
41
|
from zenml.stack import Flavor, StackComponent, StackComponentConfig
|
42
42
|
from zenml.utils import io_utils
|
43
|
+
from zenml.utils.pydantic_utils import before_validator_handler
|
43
44
|
|
44
45
|
logger = get_logger(__name__)
|
45
46
|
|
@@ -173,15 +174,17 @@ class BaseArtifactStoreConfig(StackComponentConfig):
|
|
173
174
|
SUPPORTED_SCHEMES: ClassVar[Set[str]]
|
174
175
|
IS_IMMUTABLE_FILESYSTEM: ClassVar[bool] = False
|
175
176
|
|
176
|
-
@
|
177
|
-
|
177
|
+
@model_validator(mode="before")
|
178
|
+
@classmethod
|
179
|
+
@before_validator_handler
|
180
|
+
def _ensure_artifact_store(cls, data: Dict[str, Any]) -> Dict[str, Any]:
|
178
181
|
"""Validator function for the Artifact Stores.
|
179
182
|
|
180
183
|
Checks whether supported schemes are defined and the given path is
|
181
184
|
supported.
|
182
185
|
|
183
186
|
Args:
|
184
|
-
|
187
|
+
data: the input data to construct the artifact store.
|
185
188
|
|
186
189
|
Returns:
|
187
190
|
The validated values.
|
@@ -211,18 +214,20 @@ class BaseArtifactStoreConfig(StackComponentConfig):
|
|
211
214
|
"""
|
212
215
|
)
|
213
216
|
)
|
214
|
-
values["path"] = values["path"].strip("'\"`")
|
215
|
-
if not any(
|
216
|
-
values["path"].startswith(i) for i in cls.SUPPORTED_SCHEMES
|
217
|
-
):
|
218
|
-
raise ArtifactStoreInterfaceError(
|
219
|
-
f"The path: '{values['path']}' you defined for your "
|
220
|
-
f"artifact store is not supported by the implementation of "
|
221
|
-
f"{cls.schema()['title']}, because it does not start with "
|
222
|
-
f"one of its supported schemes: {cls.SUPPORTED_SCHEMES}."
|
223
|
-
)
|
224
217
|
|
225
|
-
|
218
|
+
if "path" in data:
|
219
|
+
data["path"] = data["path"].strip("'\"`")
|
220
|
+
if not any(
|
221
|
+
data["path"].startswith(i) for i in cls.SUPPORTED_SCHEMES
|
222
|
+
):
|
223
|
+
raise ArtifactStoreInterfaceError(
|
224
|
+
f"The path: '{data['path']}' you defined for your "
|
225
|
+
f"artifact store is not supported by the implementation of "
|
226
|
+
f"{cls.schema()['title']}, because it does not start with "
|
227
|
+
f"one of its supported schemes: {cls.SUPPORTED_SCHEMES}."
|
228
|
+
)
|
229
|
+
|
230
|
+
return data
|
226
231
|
|
227
232
|
|
228
233
|
class BaseArtifactStore(StackComponent):
|
@@ -21,7 +21,7 @@ artifacts get stored.
|
|
21
21
|
import os
|
22
22
|
from typing import TYPE_CHECKING, ClassVar, Optional, Set, Type, Union
|
23
23
|
|
24
|
-
from pydantic import
|
24
|
+
from pydantic import field_validator
|
25
25
|
|
26
26
|
from zenml.artifact_stores import (
|
27
27
|
BaseArtifactStore,
|
@@ -50,7 +50,8 @@ class LocalArtifactStoreConfig(BaseArtifactStoreConfig):
|
|
50
50
|
|
51
51
|
path: str = ""
|
52
52
|
|
53
|
-
@
|
53
|
+
@field_validator("path")
|
54
|
+
@classmethod
|
54
55
|
def ensure_path_local(cls, path: str) -> str:
|
55
56
|
"""Pydantic validator which ensures that the given path is a local path.
|
56
57
|
|
@@ -13,9 +13,9 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Artifact Config classes to support Model Control Plane feature."""
|
15
15
|
|
16
|
-
from typing import TYPE_CHECKING,
|
16
|
+
from typing import TYPE_CHECKING, Dict, List, Optional, Union
|
17
17
|
|
18
|
-
from pydantic import BaseModel,
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, model_validator
|
19
19
|
|
20
20
|
from zenml.enums import ModelStages
|
21
21
|
from zenml.exceptions import StepContextError
|
@@ -63,32 +63,47 @@ class ArtifactConfig(BaseModel):
|
|
63
63
|
"""
|
64
64
|
|
65
65
|
name: Optional[str] = None
|
66
|
-
version: Optional[Union[str, int]] =
|
66
|
+
version: Optional[Union[str, int]] = Field(
|
67
|
+
default=None, union_mode="smart"
|
68
|
+
)
|
67
69
|
tags: Optional[List[str]] = None
|
68
70
|
run_metadata: Optional[Dict[str, MetadataType]] = None
|
69
71
|
|
70
72
|
model_name: Optional[str] = None
|
71
|
-
model_version: Optional[Union[ModelStages, str, int]] =
|
73
|
+
model_version: Optional[Union[ModelStages, str, int]] = Field(
|
74
|
+
default=None, union_mode="smart"
|
75
|
+
)
|
72
76
|
is_model_artifact: bool = False
|
73
77
|
is_deployment_artifact: bool = False
|
74
78
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
"`None` to get the model version from the step context or "
|
83
|
-
"specify both at the same time. You can use `ModelStages.LATEST` "
|
84
|
-
"as `model_version` when latest model version is desired."
|
85
|
-
)
|
86
|
-
return values
|
79
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
80
|
+
# fields defined under base models. If not handled, this raises a warning.
|
81
|
+
# It is possible to suppress this warning message with the following
|
82
|
+
# configuration, however the ultimate solution is to rename these fields.
|
83
|
+
# Even though they do not cause any problems right now, if we are not
|
84
|
+
# careful we might overwrite some fields protected by pydantic.
|
85
|
+
model_config = ConfigDict(protected_namespaces=())
|
87
86
|
|
88
|
-
|
89
|
-
|
87
|
+
@model_validator(mode="after")
|
88
|
+
def artifact_config_validator(self) -> "ArtifactConfig":
|
89
|
+
"""Model validator for the artifact config.
|
90
90
|
|
91
|
-
|
91
|
+
Raises:
|
92
|
+
ValueError: If both model_name and model_version is set incorrectly.
|
93
|
+
|
94
|
+
Returns:
|
95
|
+
the validated instance.
|
96
|
+
"""
|
97
|
+
if self.model_name is not None and self.model_version is None:
|
98
|
+
raise ValueError(
|
99
|
+
f"Creation of new model version from {self.__class__.__name__} "
|
100
|
+
"is not allowed. Please either keep `model_name` and "
|
101
|
+
"`model_version` both `None` to get the model version from the "
|
102
|
+
"step context or specify both at the same time. You can use "
|
103
|
+
"`ModelStages.LATEST` as `model_version` when latest model "
|
104
|
+
"version is desired."
|
105
|
+
)
|
106
|
+
return self
|
92
107
|
|
93
108
|
@property
|
94
109
|
def _model(self) -> Optional["Model"]:
|
@@ -14,10 +14,10 @@
|
|
14
14
|
"""External artifact definition."""
|
15
15
|
|
16
16
|
import os
|
17
|
-
from typing import Any,
|
17
|
+
from typing import Any, Optional, Type, Union
|
18
18
|
from uuid import UUID, uuid4
|
19
19
|
|
20
|
-
from pydantic import
|
20
|
+
from pydantic import Field, model_validator
|
21
21
|
|
22
22
|
from zenml.artifacts.external_artifact_config import (
|
23
23
|
ExternalArtifactConfiguration,
|
@@ -79,12 +79,22 @@ class ExternalArtifact(ExternalArtifactConfiguration):
|
|
79
79
|
"""
|
80
80
|
|
81
81
|
value: Optional[Any] = None
|
82
|
-
materializer: Optional[MaterializerClassOrSource] =
|
82
|
+
materializer: Optional[MaterializerClassOrSource] = Field(
|
83
|
+
default=None, union_mode="left_to_right"
|
84
|
+
)
|
83
85
|
store_artifact_metadata: bool = True
|
84
86
|
store_artifact_visualizations: bool = True
|
85
87
|
|
86
|
-
@
|
87
|
-
def
|
88
|
+
@model_validator(mode="after")
|
89
|
+
def external_artifact_validator(self) -> "ExternalArtifact":
|
90
|
+
"""Model validator for the external artifact.
|
91
|
+
|
92
|
+
Raises:
|
93
|
+
ValueError: if the value, id and name fields are set incorrectly.
|
94
|
+
|
95
|
+
Returns:
|
96
|
+
the validated instance.
|
97
|
+
"""
|
88
98
|
deprecation_msg = (
|
89
99
|
"Parameter `{param}` or `ExternalArtifact` will be deprecated "
|
90
100
|
"in upcoming releases. Please use `{substitute}` instead."
|
@@ -104,7 +114,7 @@ class ExternalArtifact(ExternalArtifactConfiguration):
|
|
104
114
|
"Client().get_model_version(<model_name>,<model_version>).get_artifact(name)",
|
105
115
|
],
|
106
116
|
]:
|
107
|
-
if
|
117
|
+
if getattr(self, param, None):
|
108
118
|
logger.warning(
|
109
119
|
deprecation_msg.format(
|
110
120
|
param=param,
|
@@ -112,7 +122,7 @@ class ExternalArtifact(ExternalArtifactConfiguration):
|
|
112
122
|
)
|
113
123
|
)
|
114
124
|
options = [
|
115
|
-
|
125
|
+
getattr(self, field, None) is not None
|
116
126
|
for field in ["value", "id", "name"]
|
117
127
|
]
|
118
128
|
if sum(options) > 1:
|
@@ -125,7 +135,7 @@ class ExternalArtifact(ExternalArtifactConfiguration):
|
|
125
135
|
"Either `value`, `id`, or `name` must be provided when "
|
126
136
|
"creating an external artifact."
|
127
137
|
)
|
128
|
-
return
|
138
|
+
return self
|
129
139
|
|
130
140
|
def upload_by_value(self) -> UUID:
|
131
141
|
"""Uploads the artifact by value.
|
@@ -13,10 +13,10 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""External artifact definition."""
|
15
15
|
|
16
|
-
from typing import
|
16
|
+
from typing import Optional
|
17
17
|
from uuid import UUID
|
18
18
|
|
19
|
-
from pydantic import BaseModel,
|
19
|
+
from pydantic import BaseModel, model_validator
|
20
20
|
|
21
21
|
from zenml.logger import get_logger
|
22
22
|
from zenml.model.model import Model
|
@@ -36,14 +36,22 @@ class ExternalArtifactConfiguration(BaseModel):
|
|
36
36
|
version: Optional[str] = None
|
37
37
|
model: Optional[Model] = None
|
38
38
|
|
39
|
-
@
|
40
|
-
def
|
41
|
-
|
39
|
+
@model_validator(mode="after")
|
40
|
+
def external_artifact_validator(self) -> "ExternalArtifactConfiguration":
|
41
|
+
"""Model validator for the external artifact configuration.
|
42
|
+
|
43
|
+
Raises:
|
44
|
+
ValueError: if both version and model fields are set.
|
45
|
+
|
46
|
+
Returns:
|
47
|
+
the validated instance.
|
48
|
+
"""
|
49
|
+
if self.version and self.model:
|
42
50
|
raise ValueError(
|
43
51
|
"Cannot provide both `version` and `model` when "
|
44
52
|
"creating an external artifact."
|
45
53
|
)
|
46
|
-
return
|
54
|
+
return self
|
47
55
|
|
48
56
|
def get_artifact_version_id(self) -> UUID:
|
49
57
|
"""Get the artifact.
|
@@ -13,12 +13,7 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Unmaterialized artifact class."""
|
15
15
|
|
16
|
-
from zenml.models import
|
17
|
-
ArtifactVersionResponse,
|
18
|
-
RunMetadataResponse,
|
19
|
-
UserResponse,
|
20
|
-
WorkspaceResponse,
|
21
|
-
)
|
16
|
+
from zenml.models import ArtifactVersionResponse
|
22
17
|
|
23
18
|
|
24
19
|
class UnmaterializedArtifact(ArtifactVersionResponse):
|
@@ -41,8 +36,4 @@ class UnmaterializedArtifact(ArtifactVersionResponse):
|
|
41
36
|
"""
|
42
37
|
|
43
38
|
|
44
|
-
UnmaterializedArtifact.
|
45
|
-
UserResponseModel=UserResponse,
|
46
|
-
WorkspaceResponseModel=WorkspaceResponse,
|
47
|
-
RunMetadataResponseModel=RunMetadataResponse,
|
48
|
-
)
|
39
|
+
UnmaterializedArtifact.model_rebuild()
|
zenml/cli/__init__.py
CHANGED
@@ -1746,6 +1746,12 @@ pipeline runs, use:
|
|
1746
1746
|
zenml artifact prune
|
1747
1747
|
```
|
1748
1748
|
|
1749
|
+
You might find that some artifacts throw errors when you try to prune them,
|
1750
|
+
likely because they were stored locally and no longer exist. If you wish to
|
1751
|
+
continue pruning and to ignore these errors, please add the `--ignore-errors`
|
1752
|
+
flag. Warning messages will still be output to the terminal during this
|
1753
|
+
process.
|
1754
|
+
|
1749
1755
|
Each pipeline run that requires Docker images also stores a build which
|
1750
1756
|
contains the image names used for this run. To list all builds, use:
|
1751
1757
|
|
zenml/cli/artifact.py
CHANGED
@@ -229,8 +229,17 @@ def update_artifact_version(
|
|
229
229
|
is_flag=True,
|
230
230
|
help="Don't ask for confirmation.",
|
231
231
|
)
|
232
|
+
@click.option(
|
233
|
+
"--ignore-errors",
|
234
|
+
"-i",
|
235
|
+
is_flag=True,
|
236
|
+
help="Ignore errors and continue with the next artifact version.",
|
237
|
+
)
|
232
238
|
def prune_artifacts(
|
233
|
-
only_artifact: bool = False,
|
239
|
+
only_artifact: bool = False,
|
240
|
+
only_metadata: bool = False,
|
241
|
+
yes: bool = False,
|
242
|
+
ignore_errors: bool = False,
|
234
243
|
) -> None:
|
235
244
|
"""Delete all unused artifacts and artifact versions.
|
236
245
|
|
@@ -244,6 +253,8 @@ def prune_artifacts(
|
|
244
253
|
only_metadata: If set, only delete metadata and not the actual artifact
|
245
254
|
objects stored in the artifact store.
|
246
255
|
yes: If set, don't ask for confirmation.
|
256
|
+
ignore_errors: If set, ignore errors and continue with the next
|
257
|
+
artifact version.
|
247
258
|
"""
|
248
259
|
client = Client()
|
249
260
|
unused_artifact_versions = depaginate(
|
@@ -275,7 +286,14 @@ def prune_artifacts(
|
|
275
286
|
Client().delete_artifact(unused_artifact.id)
|
276
287
|
|
277
288
|
except Exception as e:
|
278
|
-
|
289
|
+
if ignore_errors:
|
290
|
+
cli_utils.warning(
|
291
|
+
f"Failed to delete artifact version {unused_artifact_version.id}: {str(e)}"
|
292
|
+
)
|
293
|
+
else:
|
294
|
+
cli_utils.error(
|
295
|
+
f"Failed to delete artifact version {unused_artifact_version.id}: {str(e)}"
|
296
|
+
)
|
279
297
|
cli_utils.declare("All unused artifacts and artifact versions deleted.")
|
280
298
|
|
281
299
|
|
zenml/cli/base.py
CHANGED
@@ -87,11 +87,11 @@ ZENML_PROJECT_TEMPLATES = dict(
|
|
87
87
|
),
|
88
88
|
nlp=ZenMLProjectTemplateLocation(
|
89
89
|
github_url="zenml-io/template-nlp",
|
90
|
-
github_tag="2024.06.
|
90
|
+
github_tag="2024.06.14", # Make sure it is aligned with .github/workflows/update-templates-to-examples.yml
|
91
91
|
),
|
92
92
|
llm_finetuning=ZenMLProjectTemplateLocation(
|
93
93
|
github_url="zenml-io/template-llm-finetuning",
|
94
|
-
github_tag="2024.06.
|
94
|
+
github_tag="2024.06.20", # Make sure it is aligned with .github/workflows/update-templates-to-examples.yml
|
95
95
|
),
|
96
96
|
)
|
97
97
|
|
zenml/cli/served_model.py
CHANGED
zenml/cli/server.py
CHANGED
@@ -392,7 +392,7 @@ def deploy(
|
|
392
392
|
|
393
393
|
from zenml.zen_server.deploy.deployment import ServerDeploymentConfig
|
394
394
|
|
395
|
-
server_config = ServerDeploymentConfig.
|
395
|
+
server_config = ServerDeploymentConfig.model_validate(config_dict)
|
396
396
|
|
397
397
|
from zenml.zen_server.deploy.deployer import ServerDeployer
|
398
398
|
|
@@ -685,7 +685,7 @@ def connect(
|
|
685
685
|
)
|
686
686
|
|
687
687
|
if raw_config:
|
688
|
-
store_config = StoreConfiguration.
|
688
|
+
store_config = StoreConfiguration.model_validate(store_dict)
|
689
689
|
GlobalConfiguration().set_store(store_config)
|
690
690
|
return
|
691
691
|
|
@@ -756,7 +756,7 @@ def connect(
|
|
756
756
|
store_config_class = BaseZenStore.get_store_config_class(store_type)
|
757
757
|
assert store_config_class is not None
|
758
758
|
|
759
|
-
store_config = store_config_class.
|
759
|
+
store_config = store_config_class.model_validate(store_dict)
|
760
760
|
try:
|
761
761
|
GlobalConfiguration().set_store(store_config)
|
762
762
|
except IllegalOperationError:
|