zenml-nightly 0.58.2.dev20240615__py3-none-any.whl → 0.58.2.dev20240623__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 +1 -1
- 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 +1 -5
- 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/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.dev20240615.dist-info → zenml_nightly-0.58.2.dev20240623.dist-info}/METADATA +9 -7
- {zenml_nightly-0.58.2.dev20240615.dist-info → zenml_nightly-0.58.2.dev20240623.dist-info}/RECORD +310 -307
- 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.dev20240615.dist-info → zenml_nightly-0.58.2.dev20240623.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.58.2.dev20240615.dist-info → zenml_nightly-0.58.2.dev20240623.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.58.2.dev20240615.dist-info → zenml_nightly-0.58.2.dev20240623.dist-info}/entry_points.txt +0 -0
@@ -35,18 +35,7 @@ class TensorBoardIntegration(Integration):
|
|
35
35
|
Returns:
|
36
36
|
A list of requirements.
|
37
37
|
"""
|
38
|
-
|
39
|
-
tf_version = "2.13"
|
40
|
-
else:
|
41
|
-
# Capping tensorflow to 2.11 for Python 3.10 and below because it
|
42
|
-
# is not compatible with Pytorch
|
43
|
-
# (see https://github.com/pytorch/pytorch/issues/99637).
|
44
|
-
tf_version = "2.11"
|
45
|
-
|
46
|
-
requirements = [
|
47
|
-
f"tensorboard=={tf_version}",
|
48
|
-
"protobuf>=3.6.0,<4.0.0",
|
49
|
-
]
|
38
|
+
requirements = ["tensorboard>=2.12,<=2.15"]
|
50
39
|
return requirements
|
51
40
|
|
52
41
|
@classmethod
|
@@ -17,9 +17,6 @@ import uuid
|
|
17
17
|
from typing import Any, Dict, Union
|
18
18
|
|
19
19
|
from tensorboard import default, program # type: ignore [import-untyped]
|
20
|
-
from tensorboard.uploader import ( # type: ignore [import-untyped]
|
21
|
-
uploader_subcommand,
|
22
|
-
)
|
23
20
|
|
24
21
|
from zenml.logger import get_logger
|
25
22
|
from zenml.services import (
|
@@ -104,7 +101,9 @@ class TensorboardService(LocalDaemonService):
|
|
104
101
|
),
|
105
102
|
)
|
106
103
|
attrs["endpoint"] = endpoint
|
107
|
-
|
104
|
+
if "uuid" not in attrs:
|
105
|
+
attrs["uuid"] = uuid.uuid4()
|
106
|
+
super().__init__(config=config, **attrs)
|
108
107
|
|
109
108
|
def run(self) -> None:
|
110
109
|
"""Initialize and run the TensorBoard server."""
|
@@ -118,7 +117,6 @@ class TensorboardService(LocalDaemonService):
|
|
118
117
|
try:
|
119
118
|
tensorboard = program.TensorBoard(
|
120
119
|
plugins=default.get_plugins(),
|
121
|
-
subcommands=[uploader_subcommand.UploaderSubcommand()],
|
122
120
|
)
|
123
121
|
tensorboard.configure(
|
124
122
|
logdir=self.config.logdir,
|
@@ -194,19 +194,19 @@ def get_step(pipeline_name: str, step_name: str) -> "StepRunResponse":
|
|
194
194
|
Raises:
|
195
195
|
RuntimeError: If the step is not found.
|
196
196
|
"""
|
197
|
-
|
198
|
-
if
|
197
|
+
runs = Client().list_pipeline_runs(pipeline_name=pipeline_name)
|
198
|
+
if runs.total == 0:
|
199
199
|
raise RuntimeError(
|
200
|
-
f"No pipeline
|
200
|
+
f"No pipeline runs for pipeline `{pipeline_name}` were found"
|
201
201
|
)
|
202
202
|
|
203
|
-
last_run =
|
204
|
-
|
205
|
-
if step is None:
|
203
|
+
last_run = runs[0]
|
204
|
+
if step_name not in last_run.steps:
|
206
205
|
raise RuntimeError(
|
207
206
|
f"No pipeline step with name `{step_name}` was found in "
|
208
207
|
f"pipeline `{pipeline_name}`"
|
209
208
|
)
|
209
|
+
step = last_run.steps[step_name]
|
210
210
|
return step
|
211
211
|
|
212
212
|
|
@@ -49,23 +49,15 @@ class TensorflowIntegration(Integration):
|
|
49
49
|
Returns:
|
50
50
|
A list of requirements.
|
51
51
|
"""
|
52
|
-
if sys.version_info > (3, 11):
|
53
|
-
tf_version = "2.13"
|
54
|
-
else:
|
55
|
-
# Capping tensorflow to 2.11 for Python 3.10 and below because it
|
56
|
-
# is not compatible with Pytorch
|
57
|
-
# (see https://github.com/pytorch/pytorch/issues/99637).
|
58
|
-
tf_version = "2.11"
|
59
52
|
target_os = target_os or platform.system()
|
60
53
|
if target_os == "Darwin" and platform.machine() == "arm64":
|
61
54
|
requirements = [
|
62
|
-
f"tensorflow-macos
|
55
|
+
f"tensorflow-macos>=2.12,<=2.15",
|
63
56
|
]
|
64
57
|
else:
|
65
58
|
requirements = [
|
66
|
-
f"tensorflow
|
59
|
+
f"tensorflow>=2.12,<=2.15",
|
67
60
|
"tensorflow_io>=0.24.0",
|
68
|
-
"protobuf>=3.6.0,<4.0.0",
|
69
61
|
]
|
70
62
|
return requirements
|
71
63
|
|
@@ -13,10 +13,12 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Implementation of the TensorFlow Keras materializer."""
|
15
15
|
|
16
|
+
import os
|
16
17
|
import tempfile
|
17
18
|
from typing import TYPE_CHECKING, Any, ClassVar, Dict, Tuple, Type
|
18
19
|
|
19
|
-
|
20
|
+
import tensorflow as tf
|
21
|
+
from tensorflow.python import keras as tf_keras
|
20
22
|
from tensorflow.python.keras.utils.layer_utils import count_params
|
21
23
|
|
22
24
|
from zenml.enums import ArtifactType
|
@@ -31,48 +33,54 @@ if TYPE_CHECKING:
|
|
31
33
|
class KerasMaterializer(BaseMaterializer):
|
32
34
|
"""Materializer to read/write Keras models."""
|
33
35
|
|
34
|
-
ASSOCIATED_TYPES: ClassVar[Tuple[Type[Any], ...]] = (
|
36
|
+
ASSOCIATED_TYPES: ClassVar[Tuple[Type[Any], ...]] = (
|
37
|
+
tf.keras.Model,
|
38
|
+
tf_keras.Model,
|
39
|
+
)
|
35
40
|
ASSOCIATED_ARTIFACT_TYPE: ClassVar[ArtifactType] = ArtifactType.MODEL
|
41
|
+
MODEL_FILE_NAME = "model.keras"
|
36
42
|
|
37
|
-
def load(self, data_type: Type[Any]) ->
|
43
|
+
def load(self, data_type: Type[Any]) -> tf_keras.Model:
|
38
44
|
"""Reads and returns a Keras model after copying it to temporary path.
|
39
45
|
|
40
46
|
Args:
|
41
47
|
data_type: The type of the data to read.
|
42
48
|
|
43
49
|
Returns:
|
44
|
-
A
|
50
|
+
A keras.Model model.
|
45
51
|
"""
|
46
52
|
# Create a temporary directory to store the model
|
47
53
|
temp_dir = tempfile.TemporaryDirectory()
|
48
54
|
|
49
55
|
# Copy from artifact store to temporary directory
|
56
|
+
temp_model_file = os.path.join(temp_dir.name, self.MODEL_FILE_NAME)
|
50
57
|
io_utils.copy_dir(self.uri, temp_dir.name)
|
51
58
|
|
52
59
|
# Load the model from the temporary directory
|
53
|
-
model = keras.models.load_model(
|
60
|
+
model = tf.keras.models.load_model(temp_model_file)
|
54
61
|
|
55
62
|
# Cleanup and return
|
56
63
|
fileio.rmtree(temp_dir.name)
|
57
64
|
|
58
65
|
return model
|
59
66
|
|
60
|
-
def save(self, model:
|
67
|
+
def save(self, model: tf_keras.Model) -> None:
|
61
68
|
"""Writes a keras model to the artifact store.
|
62
69
|
|
63
70
|
Args:
|
64
|
-
model: A
|
71
|
+
model: A keras.Model model.
|
65
72
|
"""
|
66
73
|
# Create a temporary directory to store the model
|
67
74
|
temp_dir = tempfile.TemporaryDirectory()
|
68
|
-
|
75
|
+
temp_model_file = os.path.join(temp_dir.name, self.MODEL_FILE_NAME)
|
76
|
+
model.save(temp_model_file)
|
69
77
|
io_utils.copy_dir(temp_dir.name, self.uri)
|
70
78
|
|
71
79
|
# Remove the temporary directory
|
72
80
|
fileio.rmtree(temp_dir.name)
|
73
81
|
|
74
82
|
def extract_metadata(
|
75
|
-
self, model:
|
83
|
+
self, model: tf_keras.Model
|
76
84
|
) -> Dict[str, "MetadataType"]:
|
77
85
|
"""Extract metadata from the given `Model` object.
|
78
86
|
|
@@ -20,11 +20,10 @@ from typing import (
|
|
20
20
|
List,
|
21
21
|
Optional,
|
22
22
|
Type,
|
23
|
-
Union,
|
24
23
|
cast,
|
25
24
|
)
|
26
25
|
|
27
|
-
from pydantic import
|
26
|
+
from pydantic import field_validator
|
28
27
|
|
29
28
|
from zenml.config.base_settings import BaseSettings
|
30
29
|
from zenml.experiment_trackers.base_experiment_tracker import (
|
@@ -35,8 +34,6 @@ from zenml.integrations.wandb import WANDB_EXPERIMENT_TRACKER_FLAVOR
|
|
35
34
|
from zenml.utils.secret_utils import SecretField
|
36
35
|
|
37
36
|
if TYPE_CHECKING:
|
38
|
-
from wandb import Settings
|
39
|
-
|
40
37
|
from zenml.integrations.wandb.experiment_trackers import (
|
41
38
|
WandbExperimentTracker,
|
42
39
|
)
|
@@ -55,11 +52,9 @@ class WandbExperimentTrackerSettings(BaseSettings):
|
|
55
52
|
tags: List[str] = []
|
56
53
|
settings: Dict[str, Any] = {}
|
57
54
|
|
58
|
-
@
|
59
|
-
|
60
|
-
|
61
|
-
value: Union[Dict[str, Any], "Settings"],
|
62
|
-
) -> Dict[str, Any]:
|
55
|
+
@field_validator("settings", mode="before")
|
56
|
+
@classmethod
|
57
|
+
def _convert_settings(cls, value: Any) -> Any:
|
63
58
|
"""Converts settings to a dictionary.
|
64
59
|
|
65
60
|
Args:
|
@@ -81,7 +76,7 @@ class WandbExperimentTrackerSettings(BaseSettings):
|
|
81
76
|
return value
|
82
77
|
|
83
78
|
|
84
|
-
class WandbExperimentTrackerConfig(
|
79
|
+
class WandbExperimentTrackerConfig(
|
85
80
|
BaseExperimentTrackerConfig, WandbExperimentTrackerSettings
|
86
81
|
):
|
87
82
|
"""Config for the Wandb experiment tracker.
|
@@ -112,7 +107,7 @@ class WandbExperimentTrackerFlavor(BaseExperimentTrackerFlavor):
|
|
112
107
|
|
113
108
|
@property
|
114
109
|
def docs_url(self) -> Optional[str]:
|
115
|
-
"""A
|
110
|
+
"""A URL to point at docs explaining this flavor.
|
116
111
|
|
117
112
|
Returns:
|
118
113
|
A flavor docs url.
|
@@ -121,7 +116,7 @@ class WandbExperimentTrackerFlavor(BaseExperimentTrackerFlavor):
|
|
121
116
|
|
122
117
|
@property
|
123
118
|
def sdk_docs_url(self) -> Optional[str]:
|
124
|
-
"""A
|
119
|
+
"""A URL to point at SDK docs explaining this flavor.
|
125
120
|
|
126
121
|
Returns:
|
127
122
|
A flavor SDK docs url.
|
@@ -130,7 +125,7 @@ class WandbExperimentTrackerFlavor(BaseExperimentTrackerFlavor):
|
|
130
125
|
|
131
126
|
@property
|
132
127
|
def logo_url(self) -> str:
|
133
|
-
"""A
|
128
|
+
"""A URL to represent the flavor in the dashboard.
|
134
129
|
|
135
130
|
Returns:
|
136
131
|
The flavor logo.
|
@@ -142,7 +137,7 @@ class WandbExperimentTrackerFlavor(BaseExperimentTrackerFlavor):
|
|
142
137
|
"""Returns `WandbExperimentTrackerConfig` config class.
|
143
138
|
|
144
139
|
Returns:
|
145
|
-
|
140
|
+
The config class.
|
146
141
|
"""
|
147
142
|
return WandbExperimentTrackerConfig
|
148
143
|
|
@@ -41,7 +41,7 @@ class WhylogsDataValidatorSettings(BaseSettings):
|
|
41
41
|
dataset_id: Optional[str] = None
|
42
42
|
|
43
43
|
|
44
|
-
class WhylogsDataValidatorConfig(
|
44
|
+
class WhylogsDataValidatorConfig(
|
45
45
|
BaseDataValidatorConfig,
|
46
46
|
AuthenticationConfigMixin,
|
47
47
|
WhylogsDataValidatorSettings,
|
zenml/logging/step_logging.py
CHANGED
@@ -98,7 +98,7 @@ def prepare_logs_uri(
|
|
98
98
|
artifact_store.makedirs(logs_uri_folder)
|
99
99
|
return logs_uri_folder
|
100
100
|
else:
|
101
|
-
logs_uri = os.path.join(logs_base_uri, f"{log_key}
|
101
|
+
logs_uri = os.path.join(logs_base_uri, f"{log_key}{LOGS_EXTENSION}")
|
102
102
|
if artifact_store.exists(logs_uri):
|
103
103
|
logger.warning(
|
104
104
|
f"Logs file {logs_uri} already exists! Removing old log file..."
|
@@ -238,7 +238,7 @@ class StepLogsStorage:
|
|
238
238
|
# Immutable filesystems state
|
239
239
|
self.last_merge_time = time.time()
|
240
240
|
self.log_files_not_merged: List[str] = []
|
241
|
-
self.next_merged_file_name: str =
|
241
|
+
self.next_merged_file_name: str = self._get_timestamped_filename()
|
242
242
|
|
243
243
|
@property
|
244
244
|
def artifact_store(self) -> "BaseArtifactStore":
|
@@ -276,6 +276,14 @@ class StepLogsStorage:
|
|
276
276
|
or time.time() - self.last_save_time >= self.time_interval
|
277
277
|
)
|
278
278
|
|
279
|
+
def _get_timestamped_filename(self) -> str:
|
280
|
+
"""Returns a timestamped filename.
|
281
|
+
|
282
|
+
Returns:
|
283
|
+
The timestamped filename.
|
284
|
+
"""
|
285
|
+
return f"{time.time()}{LOGS_EXTENSION}"
|
286
|
+
|
279
287
|
def save_to_file(self, force: bool = False) -> None:
|
280
288
|
"""Method to save the buffer to the given URI.
|
281
289
|
|
@@ -293,14 +301,14 @@ class StepLogsStorage:
|
|
293
301
|
if self.artifact_store.config.IS_IMMUTABLE_FILESYSTEM:
|
294
302
|
if not self.log_files_not_merged:
|
295
303
|
self.next_merged_file_name = (
|
296
|
-
|
304
|
+
self._get_timestamped_filename()
|
297
305
|
)
|
298
|
-
|
299
|
-
self.log_files_not_merged.append(
|
306
|
+
_logs_uri = self._get_timestamped_filename()
|
307
|
+
self.log_files_not_merged.append(_logs_uri)
|
300
308
|
with self.artifact_store.open(
|
301
309
|
os.path.join(
|
302
310
|
self.logs_uri,
|
303
|
-
|
311
|
+
_logs_uri,
|
304
312
|
),
|
305
313
|
"w",
|
306
314
|
) as file:
|
@@ -360,7 +368,7 @@ class StepLogsStorage:
|
|
360
368
|
"""
|
361
369
|
if self.artifact_store.config.IS_IMMUTABLE_FILESYSTEM:
|
362
370
|
files_ = files or self.artifact_store.listdir(self.logs_uri)
|
363
|
-
file_name_ = file_name or
|
371
|
+
file_name_ = file_name or self._get_timestamped_filename()
|
364
372
|
if len(files_) > 1:
|
365
373
|
files_.sort()
|
366
374
|
logger.debug("Log files count: %s", len(files_))
|
@@ -339,11 +339,11 @@ class BuiltInContainerMaterializer(BaseMaterializer):
|
|
339
339
|
# Cast the data to the correct type.
|
340
340
|
if issubclass(data_type, dict) and not isinstance(outputs, dict):
|
341
341
|
keys, values = outputs
|
342
|
-
return
|
342
|
+
return data_type(zip(keys, values))
|
343
343
|
if issubclass(data_type, tuple) and not isinstance(outputs, tuple):
|
344
|
-
return
|
344
|
+
return data_type(outputs)
|
345
345
|
if issubclass(data_type, set) and not isinstance(outputs, set):
|
346
|
-
return
|
346
|
+
return data_type(outputs)
|
347
347
|
return outputs
|
348
348
|
|
349
349
|
def save(self, data: Any) -> None:
|
@@ -45,7 +45,7 @@ class PydanticMaterializer(BaseMaterializer):
|
|
45
45
|
"""
|
46
46
|
data_path = os.path.join(self.uri, DEFAULT_FILENAME)
|
47
47
|
contents = yaml_utils.read_json(data_path)
|
48
|
-
return data_type.
|
48
|
+
return data_type.model_validate_json(contents)
|
49
49
|
|
50
50
|
def save(self, data: BaseModel) -> None:
|
51
51
|
"""Serialize a BaseModel to JSON.
|
@@ -54,7 +54,7 @@ class PydanticMaterializer(BaseMaterializer):
|
|
54
54
|
data: The data to store.
|
55
55
|
"""
|
56
56
|
data_path = os.path.join(self.uri, DEFAULT_FILENAME)
|
57
|
-
yaml_utils.write_json(data_path, data.
|
57
|
+
yaml_utils.write_json(data_path, data.model_dump_json())
|
58
58
|
|
59
59
|
def extract_metadata(self, data: BaseModel) -> Dict[str, "MetadataType"]:
|
60
60
|
"""Extract metadata from the given BaseModel object.
|
zenml/metadata/lazy_load.py
CHANGED
@@ -57,8 +57,8 @@ class RunMetadataLazyGetter:
|
|
57
57
|
from zenml.models.v2.core.run_metadata import LazyRunMetadataResponse
|
58
58
|
|
59
59
|
return LazyRunMetadataResponse(
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
60
|
+
lazy_load_model=self._lazy_load_model,
|
61
|
+
lazy_load_artifact_name=self._lazy_load_artifact_name,
|
62
|
+
lazy_load_artifact_version=self._lazy_load_artifact_version,
|
63
|
+
lazy_load_metadata_name=key,
|
64
64
|
)
|
zenml/metadata/metadata_types.py
CHANGED
@@ -13,29 +13,89 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Custom types that can be used as metadata of ZenML artifacts."""
|
15
15
|
|
16
|
-
from typing import
|
16
|
+
from typing import Any, Dict, List, Set, Tuple, Union
|
17
17
|
|
18
|
-
from
|
18
|
+
from pydantic import GetCoreSchemaHandler
|
19
|
+
from pydantic_core import CoreSchema, core_schema
|
19
20
|
|
20
|
-
|
21
|
-
pass
|
21
|
+
from zenml.utils.enum_utils import StrEnum
|
22
22
|
|
23
23
|
|
24
24
|
class Uri(str):
|
25
25
|
"""Special string class to indicate a URI."""
|
26
26
|
|
27
|
+
@classmethod
|
28
|
+
def __get_pydantic_core_schema__(
|
29
|
+
cls, source_type: Any, handler: GetCoreSchemaHandler
|
30
|
+
) -> CoreSchema:
|
31
|
+
"""Additional method for pydantic to recognize it as a valid type.
|
32
|
+
|
33
|
+
Args:
|
34
|
+
source_type: the source type
|
35
|
+
handler: the handler
|
36
|
+
|
37
|
+
Returns:
|
38
|
+
the schema for the custom type.
|
39
|
+
"""
|
40
|
+
return core_schema.no_info_after_validator_function(cls, handler(str))
|
41
|
+
|
27
42
|
|
28
43
|
class Path(str):
|
29
44
|
"""Special string class to indicate a path."""
|
30
45
|
|
46
|
+
@classmethod
|
47
|
+
def __get_pydantic_core_schema__(
|
48
|
+
cls, source_type: Any, handler: GetCoreSchemaHandler
|
49
|
+
) -> CoreSchema:
|
50
|
+
"""Additional method for pydantic to recognize it as a valid type.
|
51
|
+
|
52
|
+
Args:
|
53
|
+
source_type: the source type
|
54
|
+
handler: the handler
|
55
|
+
|
56
|
+
Returns:
|
57
|
+
the schema for the custom type.
|
58
|
+
"""
|
59
|
+
return core_schema.no_info_after_validator_function(cls, handler(str))
|
60
|
+
|
31
61
|
|
32
62
|
class DType(str):
|
33
63
|
"""Special string class to indicate a data type."""
|
34
64
|
|
65
|
+
@classmethod
|
66
|
+
def __get_pydantic_core_schema__(
|
67
|
+
cls, source_type: Any, handler: GetCoreSchemaHandler
|
68
|
+
) -> CoreSchema:
|
69
|
+
"""Additional method for pydantic to recognize it as a valid type.
|
70
|
+
|
71
|
+
Args:
|
72
|
+
source_type: the source type
|
73
|
+
handler: the handler
|
74
|
+
|
75
|
+
Returns:
|
76
|
+
the schema for the custom type.
|
77
|
+
"""
|
78
|
+
return core_schema.no_info_after_validator_function(cls, handler(str))
|
79
|
+
|
35
80
|
|
36
81
|
class StorageSize(int):
|
37
82
|
"""Special int class to indicate the storage size in number of bytes."""
|
38
83
|
|
84
|
+
@classmethod
|
85
|
+
def __get_pydantic_core_schema__(
|
86
|
+
cls, source_type: Any, handler: GetCoreSchemaHandler
|
87
|
+
) -> CoreSchema:
|
88
|
+
"""Additional method for pydantic to recognize it as a valid type.
|
89
|
+
|
90
|
+
Args:
|
91
|
+
source_type: the source type
|
92
|
+
handler: the handler
|
93
|
+
|
94
|
+
Returns:
|
95
|
+
the schema for the custom type.
|
96
|
+
"""
|
97
|
+
return core_schema.no_info_after_validator_function(cls, handler(int))
|
98
|
+
|
39
99
|
|
40
100
|
# Union of all types that can be used as metadata. Used for type annotations.
|
41
101
|
MetadataType = Union[
|