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
@@ -24,12 +24,13 @@ from typing import (
|
|
24
24
|
)
|
25
25
|
from uuid import UUID
|
26
26
|
|
27
|
-
from pydantic import BaseModel, Field
|
27
|
+
from pydantic import BaseModel, Field, field_validator
|
28
28
|
|
29
|
-
from zenml.config.source import Source,
|
29
|
+
from zenml.config.source import Source, SourceWithValidator
|
30
30
|
from zenml.constants import STR_FIELD_MAX_LENGTH, TEXT_FIELD_MAX_LENGTH
|
31
31
|
from zenml.enums import ArtifactType, GenericFilterOps
|
32
32
|
from zenml.logger import get_logger
|
33
|
+
from zenml.model.model import Model
|
33
34
|
from zenml.models.v2.base.filter import StrFilter
|
34
35
|
from zenml.models.v2.base.scoped import (
|
35
36
|
WorkspaceScopedRequest,
|
@@ -43,9 +44,8 @@ from zenml.models.v2.core.artifact import ArtifactResponse
|
|
43
44
|
from zenml.models.v2.core.tag import TagResponse
|
44
45
|
|
45
46
|
if TYPE_CHECKING:
|
46
|
-
from sqlalchemy.sql.elements import
|
47
|
+
from sqlalchemy.sql.elements import ColumnElement
|
47
48
|
|
48
|
-
from zenml.model.model import Model
|
49
49
|
from zenml.models.v2.core.artifact_visualization import (
|
50
50
|
ArtifactVisualizationRequest,
|
51
51
|
ArtifactVisualizationResponse,
|
@@ -68,8 +68,7 @@ class ArtifactVersionRequest(WorkspaceScopedRequest):
|
|
68
68
|
title="ID of the artifact to which this version belongs.",
|
69
69
|
)
|
70
70
|
version: Union[str, int] = Field(
|
71
|
-
title="Version of the artifact.",
|
72
|
-
max_length=STR_FIELD_MAX_LENGTH,
|
71
|
+
title="Version of the artifact.", union_mode="left_to_right"
|
73
72
|
)
|
74
73
|
has_custom_name: bool = Field(
|
75
74
|
title="Whether the name is custom (True) or auto-generated (False).",
|
@@ -83,10 +82,10 @@ class ArtifactVersionRequest(WorkspaceScopedRequest):
|
|
83
82
|
uri: str = Field(
|
84
83
|
title="URI of the artifact.", max_length=TEXT_FIELD_MAX_LENGTH
|
85
84
|
)
|
86
|
-
materializer:
|
85
|
+
materializer: SourceWithValidator = Field(
|
87
86
|
title="Materializer class to use for this artifact.",
|
88
87
|
)
|
89
|
-
data_type:
|
88
|
+
data_type: SourceWithValidator = Field(
|
90
89
|
title="Data type of the artifact.",
|
91
90
|
)
|
92
91
|
tags: Optional[List[str]] = Field(
|
@@ -98,7 +97,26 @@ class ArtifactVersionRequest(WorkspaceScopedRequest):
|
|
98
97
|
default=None, title="Visualizations of the artifact."
|
99
98
|
)
|
100
99
|
|
101
|
-
|
100
|
+
@field_validator("version")
|
101
|
+
@classmethod
|
102
|
+
def str_field_max_length_check(cls, value: Any) -> Any:
|
103
|
+
"""Checks if the length of the value exceeds the maximum str length.
|
104
|
+
|
105
|
+
Args:
|
106
|
+
value: the value set in the field
|
107
|
+
|
108
|
+
Returns:
|
109
|
+
the value itself.
|
110
|
+
|
111
|
+
Raises:
|
112
|
+
AssertionError: if the length of the field is longer than the
|
113
|
+
maximum threshold.
|
114
|
+
"""
|
115
|
+
assert len(str(value)) < STR_FIELD_MAX_LENGTH, (
|
116
|
+
"The length of the value for this field can not "
|
117
|
+
f"exceed {STR_FIELD_MAX_LENGTH}"
|
118
|
+
)
|
119
|
+
return value
|
102
120
|
|
103
121
|
|
104
122
|
# ------------------ Update Model ------------------
|
@@ -121,28 +139,45 @@ class ArtifactVersionResponseBody(WorkspaceScopedResponseBody):
|
|
121
139
|
artifact: ArtifactResponse = Field(
|
122
140
|
title="Artifact to which this version belongs."
|
123
141
|
)
|
124
|
-
version:
|
125
|
-
title="Version of the artifact.",
|
126
|
-
max_length=STR_FIELD_MAX_LENGTH,
|
127
|
-
)
|
142
|
+
version: str = Field(title="Version of the artifact.")
|
128
143
|
uri: str = Field(
|
129
144
|
title="URI of the artifact.", max_length=TEXT_FIELD_MAX_LENGTH
|
130
145
|
)
|
131
146
|
type: ArtifactType = Field(title="Type of the artifact.")
|
132
|
-
materializer:
|
147
|
+
materializer: SourceWithValidator = Field(
|
133
148
|
title="Materializer class to use for this artifact.",
|
134
149
|
)
|
135
|
-
data_type:
|
150
|
+
data_type: SourceWithValidator = Field(
|
136
151
|
title="Data type of the artifact.",
|
137
152
|
)
|
138
153
|
tags: List[TagResponse] = Field(
|
139
154
|
title="Tags associated with the model",
|
140
155
|
)
|
141
156
|
producer_pipeline_run_id: Optional[UUID] = Field(
|
142
|
-
title="The ID of the pipeline run that generated this artifact version."
|
157
|
+
title="The ID of the pipeline run that generated this artifact version.",
|
158
|
+
default=None,
|
143
159
|
)
|
144
160
|
|
145
|
-
|
161
|
+
@field_validator("version")
|
162
|
+
@classmethod
|
163
|
+
def str_field_max_length_check(cls, value: Any) -> Any:
|
164
|
+
"""Checks if the length of the value exceeds the maximum str length.
|
165
|
+
|
166
|
+
Args:
|
167
|
+
value: the value set in the field
|
168
|
+
|
169
|
+
Returns:
|
170
|
+
the value itself.
|
171
|
+
|
172
|
+
Raises:
|
173
|
+
AssertionError: if the length of the field is longer than the
|
174
|
+
maximum threshold.
|
175
|
+
"""
|
176
|
+
assert len(str(value)) < STR_FIELD_MAX_LENGTH, (
|
177
|
+
"The length of the value for this field can not "
|
178
|
+
f"exceed {STR_FIELD_MAX_LENGTH}"
|
179
|
+
)
|
180
|
+
return value
|
146
181
|
|
147
182
|
|
148
183
|
class ArtifactVersionResponseMetadata(WorkspaceScopedResponseMetadata):
|
@@ -396,7 +431,7 @@ class ArtifactVersionFilter(WorkspaceScopedTaggableFilter):
|
|
396
431
|
"""Model to enable advanced filtering of artifact versions."""
|
397
432
|
|
398
433
|
# `name` and `only_unused` refer to properties related to other entities
|
399
|
-
# rather than a field in the db, hence they
|
434
|
+
# rather than a field in the db, hence they need to be handled
|
400
435
|
# explicitly
|
401
436
|
FILTER_EXCLUDE_FIELDS: ClassVar[List[str]] = [
|
402
437
|
*WorkspaceScopedTaggableFilter.FILTER_EXCLUDE_FIELDS,
|
@@ -407,6 +442,7 @@ class ArtifactVersionFilter(WorkspaceScopedTaggableFilter):
|
|
407
442
|
artifact_id: Optional[Union[UUID, str]] = Field(
|
408
443
|
default=None,
|
409
444
|
description="ID of the artifact to which this version belongs.",
|
445
|
+
union_mode="left_to_right",
|
410
446
|
)
|
411
447
|
name: Optional[str] = Field(
|
412
448
|
default=None,
|
@@ -419,6 +455,7 @@ class ArtifactVersionFilter(WorkspaceScopedTaggableFilter):
|
|
419
455
|
version_number: Optional[Union[int, str]] = Field(
|
420
456
|
default=None,
|
421
457
|
description="Version of the artifact if it is an integer",
|
458
|
+
union_mode="left_to_right",
|
422
459
|
)
|
423
460
|
uri: Optional[str] = Field(
|
424
461
|
default=None,
|
@@ -437,13 +474,19 @@ class ArtifactVersionFilter(WorkspaceScopedTaggableFilter):
|
|
437
474
|
description="Datatype of the artifact",
|
438
475
|
)
|
439
476
|
artifact_store_id: Optional[Union[UUID, str]] = Field(
|
440
|
-
default=None,
|
477
|
+
default=None,
|
478
|
+
description="Artifact store for this artifact",
|
479
|
+
union_mode="left_to_right",
|
441
480
|
)
|
442
481
|
workspace_id: Optional[Union[UUID, str]] = Field(
|
443
|
-
default=None,
|
482
|
+
default=None,
|
483
|
+
description="Workspace for this artifact",
|
484
|
+
union_mode="left_to_right",
|
444
485
|
)
|
445
486
|
user_id: Optional[Union[UUID, str]] = Field(
|
446
|
-
default=None,
|
487
|
+
default=None,
|
488
|
+
description="User that produced this artifact",
|
489
|
+
union_mode="left_to_right",
|
447
490
|
)
|
448
491
|
only_unused: Optional[bool] = Field(
|
449
492
|
default=False, description="Filter only for unused artifacts"
|
@@ -453,9 +496,7 @@ class ArtifactVersionFilter(WorkspaceScopedTaggableFilter):
|
|
453
496
|
description="Filter only artifacts with/without custom names.",
|
454
497
|
)
|
455
498
|
|
456
|
-
def get_custom_filters(
|
457
|
-
self,
|
458
|
-
) -> List[Union["BinaryExpression[Any]", "BooleanClauseList[Any]"]]:
|
499
|
+
def get_custom_filters(self) -> List[Union["ColumnElement[bool]"]]:
|
459
500
|
"""Get custom filters.
|
460
501
|
|
461
502
|
Returns:
|
@@ -463,8 +504,7 @@ class ArtifactVersionFilter(WorkspaceScopedTaggableFilter):
|
|
463
504
|
"""
|
464
505
|
custom_filters = super().get_custom_filters()
|
465
506
|
|
466
|
-
from
|
467
|
-
from sqlmodel import select
|
507
|
+
from sqlmodel import and_, select
|
468
508
|
|
469
509
|
from zenml.zen_stores.schemas.artifact_schemas import (
|
470
510
|
ArtifactSchema,
|
@@ -482,7 +522,7 @@ class ArtifactVersionFilter(WorkspaceScopedTaggableFilter):
|
|
482
522
|
column="name",
|
483
523
|
value=value,
|
484
524
|
)
|
485
|
-
artifact_name_filter = and_(
|
525
|
+
artifact_name_filter = and_(
|
486
526
|
ArtifactVersionSchema.artifact_id == ArtifactSchema.id,
|
487
527
|
filter_.generate_query_conditions(ArtifactSchema),
|
488
528
|
)
|
@@ -500,7 +540,7 @@ class ArtifactVersionFilter(WorkspaceScopedTaggableFilter):
|
|
500
540
|
custom_filters.append(unused_filter)
|
501
541
|
|
502
542
|
if self.has_custom_name is not None:
|
503
|
-
custom_name_filter = and_(
|
543
|
+
custom_name_filter = and_(
|
504
544
|
ArtifactVersionSchema.artifact_id == ArtifactSchema.id,
|
505
545
|
ArtifactSchema.has_custom_name == self.has_custom_name,
|
506
546
|
)
|
@@ -520,9 +560,9 @@ class LazyArtifactVersionResponse(ArtifactVersionResponse):
|
|
520
560
|
"""
|
521
561
|
|
522
562
|
id: Optional[UUID] = None # type: ignore[assignment]
|
523
|
-
|
524
|
-
|
525
|
-
|
563
|
+
lazy_load_name: Optional[str] = None
|
564
|
+
lazy_load_version: Optional[str] = None
|
565
|
+
lazy_load_model: Model
|
526
566
|
|
527
567
|
def get_body(self) -> None: # type: ignore[override]
|
528
568
|
"""Protects from misuse of the lazy loader.
|
@@ -552,13 +592,7 @@ class LazyArtifactVersionResponse(ArtifactVersionResponse):
|
|
552
592
|
from zenml.metadata.lazy_load import RunMetadataLazyGetter
|
553
593
|
|
554
594
|
return RunMetadataLazyGetter( # type: ignore[return-value]
|
555
|
-
self.
|
556
|
-
self.
|
557
|
-
self.
|
595
|
+
self.lazy_load_model,
|
596
|
+
self.lazy_load_name,
|
597
|
+
self.lazy_load_version,
|
558
598
|
)
|
559
|
-
|
560
|
-
class Config:
|
561
|
-
"""Pydantic configuration class."""
|
562
|
-
|
563
|
-
# Allow extras to include the lazy load attributes
|
564
|
-
extra = "allow"
|
@@ -20,6 +20,7 @@ from pydantic import Field
|
|
20
20
|
|
21
21
|
from zenml.config.source import Source
|
22
22
|
from zenml.constants import STR_FIELD_MAX_LENGTH, TEXT_FIELD_MAX_LENGTH
|
23
|
+
from zenml.models.v2.base.base import BaseUpdate
|
23
24
|
from zenml.models.v2.base.scoped import (
|
24
25
|
WorkspaceScopedFilter,
|
25
26
|
WorkspaceScopedRequest,
|
@@ -28,9 +29,6 @@ from zenml.models.v2.base.scoped import (
|
|
28
29
|
WorkspaceScopedResponseMetadata,
|
29
30
|
WorkspaceScopedResponseResources,
|
30
31
|
)
|
31
|
-
from zenml.models.v2.base.update import (
|
32
|
-
update_model,
|
33
|
-
)
|
34
32
|
|
35
33
|
# ------------------ Request Model ------------------
|
36
34
|
|
@@ -48,21 +46,45 @@ class CodeRepositoryRequest(WorkspaceScopedRequest):
|
|
48
46
|
source: Source = Field(description="The code repository source.")
|
49
47
|
logo_url: Optional[str] = Field(
|
50
48
|
description="Optional URL of a logo (png, jpg or svg) for the "
|
51
|
-
"code repository."
|
49
|
+
"code repository.",
|
50
|
+
default=None,
|
52
51
|
)
|
53
52
|
description: Optional[str] = Field(
|
54
53
|
description="Code repository description.",
|
55
54
|
max_length=TEXT_FIELD_MAX_LENGTH,
|
55
|
+
default=None,
|
56
56
|
)
|
57
57
|
|
58
58
|
|
59
59
|
# ------------------ Update Model ------------------
|
60
60
|
|
61
61
|
|
62
|
-
|
63
|
-
class CodeRepositoryUpdate(CodeRepositoryRequest):
|
62
|
+
class CodeRepositoryUpdate(BaseUpdate):
|
64
63
|
"""Update model for code repositories."""
|
65
64
|
|
65
|
+
name: Optional[str] = Field(
|
66
|
+
title="The name of the code repository.",
|
67
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
68
|
+
default=None,
|
69
|
+
)
|
70
|
+
config: Optional[Dict[str, Any]] = Field(
|
71
|
+
description="Configuration for the code repository.",
|
72
|
+
default=None,
|
73
|
+
)
|
74
|
+
source: Optional[Source] = Field(
|
75
|
+
description="The code repository source.", default=None
|
76
|
+
)
|
77
|
+
logo_url: Optional[str] = Field(
|
78
|
+
description="Optional URL of a logo (png, jpg or svg) for the "
|
79
|
+
"code repository.",
|
80
|
+
default=None,
|
81
|
+
)
|
82
|
+
description: Optional[str] = Field(
|
83
|
+
description="Code repository description.",
|
84
|
+
max_length=TEXT_FIELD_MAX_LENGTH,
|
85
|
+
default=None,
|
86
|
+
)
|
87
|
+
|
66
88
|
|
67
89
|
# ------------------ Response Model ------------------
|
68
90
|
|
@@ -165,10 +187,15 @@ class CodeRepositoryFilter(WorkspaceScopedFilter):
|
|
165
187
|
|
166
188
|
name: Optional[str] = Field(
|
167
189
|
description="Name of the code repository.",
|
190
|
+
default=None,
|
168
191
|
)
|
169
|
-
workspace_id: Union[UUID, str
|
170
|
-
description="Workspace of the code repository."
|
192
|
+
workspace_id: Optional[Union[UUID, str]] = Field(
|
193
|
+
description="Workspace of the code repository.",
|
194
|
+
default=None,
|
195
|
+
union_mode="left_to_right",
|
171
196
|
)
|
172
|
-
user_id: Union[UUID, str
|
173
|
-
description="User that created the code repository."
|
197
|
+
user_id: Optional[Union[UUID, str]] = Field(
|
198
|
+
description="User that created the code repository.",
|
199
|
+
default=None,
|
200
|
+
union_mode="left_to_right",
|
174
201
|
)
|
@@ -25,11 +25,11 @@ from typing import (
|
|
25
25
|
)
|
26
26
|
from uuid import UUID
|
27
27
|
|
28
|
-
from pydantic import BaseModel, Field,
|
28
|
+
from pydantic import BaseModel, Field, field_validator
|
29
29
|
|
30
30
|
from zenml.constants import STR_FIELD_MAX_LENGTH
|
31
31
|
from zenml.enums import LogicalOperators, StackComponentType
|
32
|
-
from zenml.models.v2.base.
|
32
|
+
from zenml.models.v2.base.base import BaseUpdate
|
33
33
|
from zenml.models.v2.base.scoped import (
|
34
34
|
WorkspaceScopedFilter,
|
35
35
|
WorkspaceScopedRequest,
|
@@ -38,11 +38,10 @@ from zenml.models.v2.base.scoped import (
|
|
38
38
|
WorkspaceScopedResponseMetadata,
|
39
39
|
WorkspaceScopedResponseResources,
|
40
40
|
)
|
41
|
-
from zenml.models.v2.base.update import update_model
|
42
41
|
from zenml.utils import secret_utils
|
43
42
|
|
44
43
|
if TYPE_CHECKING:
|
45
|
-
from sqlalchemy.sql.elements import
|
44
|
+
from sqlalchemy.sql.elements import ColumnElement
|
46
45
|
from sqlmodel import SQLModel
|
47
46
|
|
48
47
|
from zenml.models.v2.core.service_connector import (
|
@@ -103,7 +102,8 @@ class ComponentRequest(ComponentBase, WorkspaceScopedRequest):
|
|
103
102
|
title="The service connector linked to this stack component.",
|
104
103
|
)
|
105
104
|
|
106
|
-
@
|
105
|
+
@field_validator("name")
|
106
|
+
@classmethod
|
107
107
|
def name_cant_be_a_secret_reference(cls, name: str) -> str:
|
108
108
|
"""Validator to ensure that the given name is not a secret reference.
|
109
109
|
|
@@ -124,22 +124,63 @@ class ComponentRequest(ComponentBase, WorkspaceScopedRequest):
|
|
124
124
|
return name
|
125
125
|
|
126
126
|
|
127
|
-
@server_owned_request_model
|
128
127
|
class InternalComponentRequest(ComponentRequest):
|
129
128
|
"""Internal component request model."""
|
130
129
|
|
131
|
-
|
130
|
+
user: Optional[UUID] = Field( # type: ignore[assignment]
|
131
|
+
title="The id of the user that created this resource.",
|
132
|
+
default=None,
|
133
|
+
)
|
132
134
|
|
133
135
|
|
134
136
|
# ------------------ Update Model ------------------
|
135
137
|
|
136
138
|
|
137
|
-
|
138
|
-
class ComponentUpdate(ComponentRequest):
|
139
|
+
class ComponentUpdate(BaseUpdate):
|
139
140
|
"""Update model for stack components."""
|
140
141
|
|
142
|
+
ANALYTICS_FIELDS: ClassVar[List[str]] = ["type", "flavor"]
|
143
|
+
|
144
|
+
name: Optional[str] = Field(
|
145
|
+
title="The name of the stack component.",
|
146
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
147
|
+
default=None,
|
148
|
+
)
|
149
|
+
type: Optional[StackComponentType] = Field(
|
150
|
+
title="The type of the stack component.",
|
151
|
+
default=None,
|
152
|
+
)
|
153
|
+
flavor: Optional[str] = Field(
|
154
|
+
title="The flavor of the stack component.",
|
155
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
156
|
+
default=None,
|
157
|
+
)
|
158
|
+
configuration: Optional[Dict[str, Any]] = Field(
|
159
|
+
title="The stack component configuration.",
|
160
|
+
default=None,
|
161
|
+
)
|
162
|
+
connector_resource_id: Optional[str] = Field(
|
163
|
+
description="The ID of a specific resource instance to "
|
164
|
+
"gain access to through the connector",
|
165
|
+
default=None,
|
166
|
+
)
|
167
|
+
labels: Optional[Dict[str, Any]] = Field(
|
168
|
+
title="The stack component labels.",
|
169
|
+
default=None,
|
170
|
+
)
|
171
|
+
component_spec_path: Optional[str] = Field(
|
172
|
+
title="The path to the component spec used for mlstacks deployments.",
|
173
|
+
default=None,
|
174
|
+
)
|
175
|
+
connector: Optional[UUID] = Field(
|
176
|
+
title="The service connector linked to this stack component.",
|
177
|
+
default=None,
|
178
|
+
)
|
179
|
+
|
141
180
|
|
142
181
|
# ------------------ Response Model ------------------
|
182
|
+
|
183
|
+
|
143
184
|
class ComponentResponseBody(WorkspaceScopedResponseBody):
|
144
185
|
"""Response body for components."""
|
145
186
|
|
@@ -311,16 +352,24 @@ class ComponentFilter(WorkspaceScopedFilter):
|
|
311
352
|
description="Type of the stack component",
|
312
353
|
)
|
313
354
|
workspace_id: Optional[Union[UUID, str]] = Field(
|
314
|
-
default=None,
|
355
|
+
default=None,
|
356
|
+
description="Workspace of the stack component",
|
357
|
+
union_mode="left_to_right",
|
315
358
|
)
|
316
359
|
user_id: Optional[Union[UUID, str]] = Field(
|
317
|
-
default=None,
|
360
|
+
default=None,
|
361
|
+
description="User of the stack component",
|
362
|
+
union_mode="left_to_right",
|
318
363
|
)
|
319
364
|
connector_id: Optional[Union[UUID, str]] = Field(
|
320
|
-
default=None,
|
365
|
+
default=None,
|
366
|
+
description="Connector linked to the stack component",
|
367
|
+
union_mode="left_to_right",
|
321
368
|
)
|
322
369
|
stack_id: Optional[Union[UUID, str]] = Field(
|
323
|
-
default=None,
|
370
|
+
default=None,
|
371
|
+
description="Stack of the stack component",
|
372
|
+
union_mode="left_to_right",
|
324
373
|
)
|
325
374
|
|
326
375
|
def set_scope_type(self, component_type: str) -> None:
|
@@ -333,7 +382,7 @@ class ComponentFilter(WorkspaceScopedFilter):
|
|
333
382
|
|
334
383
|
def generate_filter(
|
335
384
|
self, table: Type["SQLModel"]
|
336
|
-
) -> Union["
|
385
|
+
) -> Union["ColumnElement[bool]"]:
|
337
386
|
"""Generate the filter for the query.
|
338
387
|
|
339
388
|
Stack components can be scoped by type to narrow the search.
|
@@ -344,7 +393,7 @@ class ComponentFilter(WorkspaceScopedFilter):
|
|
344
393
|
Returns:
|
345
394
|
The filter expression for the query.
|
346
395
|
"""
|
347
|
-
from
|
396
|
+
from sqlmodel import and_, or_
|
348
397
|
|
349
398
|
from zenml.zen_stores.schemas import (
|
350
399
|
StackComponentSchema,
|
@@ -361,7 +410,7 @@ class ComponentFilter(WorkspaceScopedFilter):
|
|
361
410
|
or_ if self.logical_operator == LogicalOperators.OR else and_
|
362
411
|
)
|
363
412
|
|
364
|
-
stack_filter = and_(
|
413
|
+
stack_filter = and_(
|
365
414
|
StackCompositionSchema.stack_id == self.stack_id,
|
366
415
|
StackCompositionSchema.component_id == StackComponentSchema.id,
|
367
416
|
)
|
zenml/models/v2/core/device.py
CHANGED
@@ -440,22 +440,32 @@ class OAuthDeviceFilter(UserScopedFilter):
|
|
440
440
|
"""Model to enable advanced filtering of OAuth2 devices."""
|
441
441
|
|
442
442
|
expires: Optional[Union[datetime, str, None]] = Field(
|
443
|
-
default=None,
|
443
|
+
default=None,
|
444
|
+
description="The expiration date of the OAuth2 device.",
|
445
|
+
union_mode="left_to_right",
|
444
446
|
)
|
445
447
|
client_id: Union[UUID, str, None] = Field(
|
446
|
-
default=None,
|
448
|
+
default=None,
|
449
|
+
description="The client ID of the OAuth2 device.",
|
450
|
+
union_mode="left_to_right",
|
447
451
|
)
|
448
452
|
status: Union[OAuthDeviceStatus, str, None] = Field(
|
449
|
-
default=None,
|
453
|
+
default=None,
|
454
|
+
description="The status of the OAuth2 device.",
|
455
|
+
union_mode="left_to_right",
|
450
456
|
)
|
451
457
|
trusted_device: Union[bool, str, None] = Field(
|
452
458
|
default=None,
|
453
459
|
description="Whether the OAuth2 device was marked as trusted.",
|
460
|
+
union_mode="left_to_right",
|
454
461
|
)
|
455
462
|
failed_auth_attempts: Union[int, str, None] = Field(
|
456
463
|
default=None,
|
457
464
|
description="The number of failed authentication attempts.",
|
465
|
+
union_mode="left_to_right",
|
458
466
|
)
|
459
467
|
last_login: Optional[Union[datetime, str, None]] = Field(
|
460
|
-
default=None,
|
468
|
+
default=None,
|
469
|
+
description="The date of the last successful login.",
|
470
|
+
union_mode="left_to_right",
|
461
471
|
)
|
@@ -48,7 +48,6 @@ class EventSourceRequest(WorkspaceScopedRequest):
|
|
48
48
|
)
|
49
49
|
plugin_subtype: PluginSubType = Field(
|
50
50
|
title="The plugin subtype of the event source.",
|
51
|
-
max_length=STR_FIELD_MAX_LENGTH,
|
52
51
|
)
|
53
52
|
description: str = Field(
|
54
53
|
default="",
|
@@ -118,7 +117,6 @@ class EventSourceResponseBody(WorkspaceScopedResponseBody):
|
|
118
117
|
)
|
119
118
|
plugin_subtype: PluginSubType = Field(
|
120
119
|
title="The plugin subtype of the event source.",
|
121
|
-
max_length=STR_FIELD_MAX_LENGTH,
|
122
120
|
)
|
123
121
|
is_active: bool = Field(
|
124
122
|
title="Whether the event source is active.",
|
@@ -240,6 +238,7 @@ class EventSourceFilter(WorkspaceScopedFilter):
|
|
240
238
|
description="Flavor of the event source",
|
241
239
|
)
|
242
240
|
plugin_subtype: Optional[str] = Field(
|
241
|
+
default=None,
|
243
242
|
title="The plugin sub type of the event source.",
|
244
243
|
max_length=STR_FIELD_MAX_LENGTH,
|
245
244
|
)
|
zenml/models/v2/core/flavor.py
CHANGED
@@ -20,7 +20,7 @@ from pydantic import Field
|
|
20
20
|
|
21
21
|
from zenml.constants import STR_FIELD_MAX_LENGTH
|
22
22
|
from zenml.enums import StackComponentType
|
23
|
-
from zenml.models.v2.base.
|
23
|
+
from zenml.models.v2.base.base import BaseUpdate
|
24
24
|
from zenml.models.v2.base.scoped import (
|
25
25
|
UserScopedRequest,
|
26
26
|
UserScopedResponse,
|
@@ -29,7 +29,6 @@ from zenml.models.v2.base.scoped import (
|
|
29
29
|
UserScopedResponseResources,
|
30
30
|
WorkspaceScopedFilter,
|
31
31
|
)
|
32
|
-
from zenml.models.v2.base.update import update_model
|
33
32
|
|
34
33
|
if TYPE_CHECKING:
|
35
34
|
from zenml.models import (
|
@@ -104,20 +103,83 @@ class FlavorRequest(UserScopedRequest):
|
|
104
103
|
)
|
105
104
|
|
106
105
|
|
107
|
-
@server_owned_request_model
|
108
106
|
class InternalFlavorRequest(FlavorRequest):
|
109
107
|
"""Internal flavor request model."""
|
110
108
|
|
111
|
-
|
109
|
+
user: Optional[UUID] = Field( # type: ignore[assignment]
|
110
|
+
title="The id of the user that created this resource.",
|
111
|
+
default=None,
|
112
|
+
)
|
112
113
|
|
113
114
|
|
114
115
|
# ------------------ Update Model ------------------
|
115
116
|
|
116
117
|
|
117
|
-
|
118
|
-
class FlavorUpdate(FlavorRequest):
|
118
|
+
class FlavorUpdate(BaseUpdate):
|
119
119
|
"""Update model for flavors."""
|
120
120
|
|
121
|
+
name: Optional[str] = Field(
|
122
|
+
title="The name of the Flavor.",
|
123
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
124
|
+
default=None,
|
125
|
+
)
|
126
|
+
type: Optional[StackComponentType] = Field(
|
127
|
+
title="The type of the Flavor.", default=None
|
128
|
+
)
|
129
|
+
config_schema: Optional[Dict[str, Any]] = Field(
|
130
|
+
title="The JSON schema of this flavor's corresponding configuration.",
|
131
|
+
default=None,
|
132
|
+
)
|
133
|
+
connector_type: Optional[str] = Field(
|
134
|
+
title="The type of the connector that this flavor uses.",
|
135
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
136
|
+
default=None,
|
137
|
+
)
|
138
|
+
connector_resource_type: Optional[str] = Field(
|
139
|
+
title="The resource type of the connector that this flavor uses.",
|
140
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
141
|
+
default=None,
|
142
|
+
)
|
143
|
+
connector_resource_id_attr: Optional[str] = Field(
|
144
|
+
title="The name of an attribute in the stack component configuration "
|
145
|
+
"that plays the role of resource ID when linked to a service "
|
146
|
+
"connector.",
|
147
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
148
|
+
default=None,
|
149
|
+
)
|
150
|
+
source: Optional[str] = Field(
|
151
|
+
title="The path to the module which contains this Flavor.",
|
152
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
153
|
+
default=None,
|
154
|
+
)
|
155
|
+
integration: Optional[str] = Field(
|
156
|
+
title="The name of the integration that the Flavor belongs to.",
|
157
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
158
|
+
default=None,
|
159
|
+
)
|
160
|
+
logo_url: Optional[str] = Field(
|
161
|
+
title="Optionally, a url pointing to a png,"
|
162
|
+
"svg or jpg can be attached.",
|
163
|
+
default=None,
|
164
|
+
)
|
165
|
+
docs_url: Optional[str] = Field(
|
166
|
+
title="Optionally, a url pointing to docs, within docs.zenml.io.",
|
167
|
+
default=None,
|
168
|
+
)
|
169
|
+
sdk_docs_url: Optional[str] = Field(
|
170
|
+
title="Optionally, a url pointing to SDK docs,"
|
171
|
+
"within sdkdocs.zenml.io.",
|
172
|
+
default=None,
|
173
|
+
)
|
174
|
+
is_custom: Optional[bool] = Field(
|
175
|
+
title="Whether or not this flavor is a custom, user created flavor.",
|
176
|
+
default=None,
|
177
|
+
)
|
178
|
+
workspace: Optional[UUID] = Field(
|
179
|
+
title="The workspace to which this resource belongs.",
|
180
|
+
default=None,
|
181
|
+
)
|
182
|
+
|
121
183
|
|
122
184
|
# ------------------ Response Model ------------------
|
123
185
|
|
@@ -367,8 +429,12 @@ class FlavorFilter(WorkspaceScopedFilter):
|
|
367
429
|
description="Integration associated with the flavor",
|
368
430
|
)
|
369
431
|
workspace_id: Optional[Union[UUID, str]] = Field(
|
370
|
-
default=None,
|
432
|
+
default=None,
|
433
|
+
description="Workspace of the stack",
|
434
|
+
union_mode="left_to_right",
|
371
435
|
)
|
372
436
|
user_id: Optional[Union[UUID, str]] = Field(
|
373
|
-
default=None,
|
437
|
+
default=None,
|
438
|
+
description="User of the stack",
|
439
|
+
union_mode="left_to_right",
|
374
440
|
)
|