zenml-nightly 0.55.0.dev20240124__py3-none-any.whl → 0.72.0.dev20250116__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/__init__.py +9 -12
- zenml/actions/__init__.py +14 -0
- zenml/actions/base_action.py +682 -0
- zenml/actions/pipeline_run/__init__.py +0 -0
- zenml/actions/pipeline_run/pipeline_run_action.py +223 -0
- zenml/analytics/context.py +70 -15
- zenml/analytics/enums.py +21 -17
- zenml/analytics/models.py +1 -0
- zenml/analytics/utils.py +19 -7
- zenml/annotators/base_annotator.py +4 -3
- zenml/artifact_stores/base_artifact_store.py +155 -72
- zenml/artifact_stores/local_artifact_store.py +3 -2
- zenml/artifacts/artifact_config.py +67 -58
- zenml/artifacts/external_artifact.py +24 -39
- zenml/artifacts/external_artifact_config.py +27 -37
- zenml/artifacts/preexisting_data_materializer.py +90 -0
- zenml/artifacts/unmaterialized_artifact.py +2 -12
- zenml/artifacts/utils.py +521 -220
- zenml/cli/__init__.py +1511 -456
- zenml/cli/annotator.py +48 -14
- zenml/cli/artifact.py +22 -4
- zenml/cli/authorized_device.py +1 -0
- zenml/cli/base.py +185 -22
- zenml/cli/code_repository.py +1 -0
- zenml/cli/formatter.py +1 -1
- zenml/cli/integration.py +119 -24
- zenml/cli/login.py +1053 -0
- zenml/cli/model.py +42 -15
- zenml/cli/model_registry.py +1 -2
- zenml/cli/pipeline.py +168 -82
- zenml/cli/secret.py +1 -2
- zenml/cli/served_model.py +56 -26
- zenml/cli/server.py +486 -619
- zenml/cli/service_accounts.py +55 -14
- zenml/cli/service_connectors.py +97 -6
- zenml/cli/stack.py +821 -531
- zenml/cli/stack_components.py +15 -598
- zenml/cli/tag.py +1 -0
- zenml/cli/text_utils.py +36 -2
- zenml/cli/user_management.py +204 -6
- zenml/cli/utils.py +411 -290
- zenml/client.py +1742 -298
- zenml/client_lazy_loader.py +224 -0
- zenml/code_repositories/base_code_repository.py +5 -4
- zenml/code_repositories/git/local_git_repository_context.py +1 -0
- zenml/code_repositories/local_repository_context.py +1 -0
- zenml/config/__init__.py +2 -0
- zenml/config/base_settings.py +6 -6
- zenml/config/build_configuration.py +43 -17
- zenml/config/compiler.py +82 -49
- zenml/config/docker_settings.py +139 -83
- zenml/config/global_config.py +260 -234
- zenml/config/pipeline_configurations.py +32 -11
- zenml/config/pipeline_run_configuration.py +15 -3
- zenml/config/pipeline_spec.py +6 -6
- zenml/config/resource_settings.py +8 -9
- zenml/config/retry_config.py +27 -0
- zenml/config/schedule.py +27 -18
- zenml/config/secret_reference_mixin.py +8 -4
- zenml/config/secrets_store_config.py +16 -24
- zenml/config/server_config.py +434 -51
- zenml/config/settings_resolver.py +2 -1
- zenml/config/source.py +97 -31
- zenml/config/step_configurations.py +83 -39
- zenml/config/step_run_info.py +3 -0
- zenml/config/store_config.py +20 -54
- zenml/config/strict_base_model.py +2 -6
- zenml/console.py +0 -1
- zenml/constants.py +232 -74
- zenml/container_registries/azure_container_registry.py +1 -0
- zenml/container_registries/base_container_registry.py +7 -3
- zenml/container_registries/default_container_registry.py +4 -3
- zenml/container_registries/dockerhub_container_registry.py +1 -0
- zenml/container_registries/gcp_container_registry.py +1 -0
- zenml/container_registries/github_container_registry.py +2 -10
- zenml/data_validators/base_data_validator.py +2 -2
- zenml/entrypoints/base_entrypoint_configuration.py +76 -17
- zenml/entrypoints/pipeline_entrypoint_configuration.py +1 -0
- zenml/entrypoints/step_entrypoint_configuration.py +21 -2
- zenml/enums.py +91 -9
- zenml/environment.py +52 -319
- zenml/{steps/base_parameters.py → event_hub/__init__.py} +5 -7
- zenml/event_hub/base_event_hub.py +196 -0
- zenml/event_hub/event_hub.py +181 -0
- zenml/event_sources/__init__.py +14 -0
- zenml/{lineage_graph/edge.py → event_sources/base_event.py} +5 -7
- zenml/event_sources/base_event_source.py +695 -0
- zenml/event_sources/webhooks/__init__.py +14 -0
- zenml/event_sources/webhooks/base_webhook_event_source.py +231 -0
- zenml/exceptions.py +40 -41
- zenml/feature_stores/base_feature_store.py +4 -6
- zenml/hooks/hook_validators.py +3 -11
- zenml/image_builders/base_image_builder.py +5 -2
- zenml/image_builders/build_context.py +24 -80
- zenml/image_builders/local_image_builder.py +14 -6
- zenml/integrations/__init__.py +16 -4
- zenml/integrations/airflow/__init__.py +3 -5
- zenml/integrations/airflow/flavors/airflow_orchestrator_flavor.py +15 -7
- zenml/integrations/airflow/orchestrators/airflow_orchestrator.py +15 -252
- zenml/integrations/airflow/orchestrators/dag_generator.py +5 -3
- zenml/integrations/argilla/__init__.py +46 -0
- zenml/integrations/argilla/annotators/__init__.py +20 -0
- zenml/integrations/argilla/annotators/argilla_annotator.py +443 -0
- zenml/{post_execution → integrations/argilla/flavors}/__init__.py +9 -13
- zenml/integrations/argilla/flavors/argilla_annotator_flavor.py +150 -0
- zenml/integrations/aws/__init__.py +7 -3
- zenml/integrations/aws/container_registries/aws_container_registry.py +44 -8
- zenml/integrations/aws/flavors/__init__.py +6 -0
- zenml/integrations/aws/flavors/aws_container_registry_flavor.py +3 -2
- zenml/integrations/aws/flavors/aws_image_builder_flavor.py +146 -0
- zenml/integrations/aws/flavors/sagemaker_orchestrator_flavor.py +104 -16
- zenml/integrations/aws/flavors/sagemaker_step_operator_flavor.py +6 -2
- zenml/integrations/aws/image_builders/__init__.py +20 -0
- zenml/integrations/aws/image_builders/aws_image_builder.py +307 -0
- zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +421 -133
- zenml/integrations/aws/service_connectors/aws_service_connector.py +175 -48
- zenml/integrations/aws/step_operators/sagemaker_step_operator.py +1 -1
- zenml/integrations/azure/__init__.py +14 -5
- zenml/integrations/azure/azureml_utils.py +201 -0
- zenml/integrations/azure/flavors/__init__.py +11 -0
- zenml/integrations/azure/flavors/azureml.py +139 -0
- zenml/integrations/azure/flavors/azureml_orchestrator_flavor.py +166 -0
- zenml/integrations/azure/flavors/azureml_step_operator_flavor.py +71 -18
- zenml/integrations/azure/orchestrators/__init__.py +19 -0
- zenml/integrations/azure/orchestrators/azureml_orchestrator.py +583 -0
- zenml/integrations/azure/orchestrators/azureml_orchestrator_entrypoint_config.py +82 -0
- zenml/integrations/azure/service_connectors/azure_service_connector.py +15 -6
- zenml/integrations/azure/step_operators/azureml_step_operator.py +78 -173
- zenml/integrations/bentoml/__init__.py +1 -1
- zenml/integrations/bentoml/constants.py +1 -1
- zenml/integrations/bentoml/materializers/bentoml_bento_materializer.py +19 -31
- zenml/integrations/bentoml/model_deployers/bentoml_model_deployer.py +128 -239
- zenml/integrations/bentoml/services/__init__.py +15 -4
- zenml/integrations/bentoml/services/bentoml_container_deployment.py +399 -0
- zenml/integrations/bentoml/services/{bentoml_deployment.py → bentoml_local_deployment.py} +85 -43
- zenml/integrations/bentoml/services/deployment_type.py +23 -0
- zenml/integrations/bentoml/steps/bento_builder.py +2 -0
- zenml/integrations/bentoml/steps/bentoml_deployer.py +97 -47
- zenml/integrations/bitbucket/__init__.py +42 -0
- zenml/integrations/bitbucket/plugins/__init__.py +20 -0
- zenml/integrations/bitbucket/plugins/bitbucket_webhook_event_source_flavor.py +43 -0
- zenml/integrations/bitbucket/plugins/event_sources/__init__.py +0 -0
- zenml/integrations/bitbucket/plugins/event_sources/bitbucket_webhook_event_source.py +486 -0
- zenml/integrations/comet/__init__.py +49 -0
- zenml/integrations/{kserve/services → comet/experiment_trackers}/__init__.py +5 -6
- zenml/integrations/comet/experiment_trackers/comet_experiment_tracker.py +175 -0
- zenml/integrations/comet/flavors/__init__.py +24 -0
- zenml/integrations/comet/flavors/comet_experiment_tracker_flavor.py +129 -0
- zenml/integrations/constants.py +14 -2
- zenml/integrations/databricks/__init__.py +70 -0
- zenml/{lineage_graph → integrations/databricks/flavors}/__init__.py +14 -18
- zenml/integrations/databricks/flavors/databricks_model_deployer_flavor.py +118 -0
- zenml/integrations/databricks/flavors/databricks_orchestrator_flavor.py +174 -0
- zenml/integrations/{kserve → databricks}/model_deployers/__init__.py +5 -5
- zenml/integrations/databricks/model_deployers/databricks_model_deployer.py +249 -0
- zenml/integrations/databricks/orchestrators/__init__.py +20 -0
- zenml/integrations/databricks/orchestrators/databricks_orchestrator.py +501 -0
- zenml/integrations/databricks/orchestrators/databricks_orchestrator_entrypoint_config.py +97 -0
- zenml/integrations/databricks/services/__init__.py +19 -0
- zenml/integrations/databricks/services/databricks_deployment.py +407 -0
- zenml/integrations/{gcp/orchestrators/vertex_scheduler → databricks/utils}/__init__.py +2 -2
- zenml/integrations/databricks/utils/databricks_utils.py +87 -0
- zenml/integrations/deepchecks/__init__.py +30 -10
- zenml/integrations/deepchecks/data_validators/deepchecks_data_validator.py +59 -18
- zenml/integrations/deepchecks/materializers/deepchecks_dataset_materializer.py +3 -1
- zenml/integrations/deepchecks/materializers/deepchecks_results_materializer.py +3 -3
- zenml/integrations/deepchecks/validation_checks.py +62 -35
- zenml/integrations/discord/__init__.py +1 -0
- zenml/integrations/discord/steps/discord_alerter_ask_step.py +1 -0
- zenml/integrations/discord/steps/discord_alerter_post_step.py +1 -0
- zenml/integrations/evidently/__init__.py +22 -4
- zenml/integrations/evidently/column_mapping.py +11 -3
- zenml/integrations/evidently/data_validators/evidently_data_validator.py +24 -6
- zenml/integrations/evidently/metrics.py +7 -8
- zenml/integrations/evidently/tests.py +7 -8
- zenml/integrations/facets/__init__.py +22 -5
- zenml/integrations/facets/models.py +2 -7
- zenml/integrations/feast/__init__.py +19 -3
- zenml/integrations/feast/feature_stores/feast_feature_store.py +13 -32
- zenml/integrations/gcp/__init__.py +6 -6
- zenml/integrations/gcp/artifact_stores/gcp_artifact_store.py +6 -0
- zenml/integrations/gcp/flavors/gcp_artifact_store_flavor.py +1 -0
- zenml/integrations/gcp/flavors/vertex_orchestrator_flavor.py +24 -2
- zenml/integrations/gcp/flavors/vertex_step_operator_flavor.py +14 -1
- zenml/integrations/gcp/google_credentials_mixin.py +1 -1
- zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +519 -296
- zenml/integrations/gcp/service_connectors/gcp_service_connector.py +788 -113
- zenml/integrations/gcp/step_operators/vertex_step_operator.py +9 -1
- zenml/integrations/github/__init__.py +15 -0
- zenml/integrations/github/code_repositories/github_code_repository.py +3 -2
- zenml/integrations/github/plugins/__init__.py +19 -0
- zenml/integrations/github/plugins/event_sources/__init__.py +0 -0
- zenml/integrations/github/plugins/event_sources/github_webhook_event_source.py +510 -0
- zenml/integrations/github/plugins/github_webhook_event_source_flavor.py +43 -0
- zenml/integrations/gitlab/code_repositories/gitlab_code_repository.py +7 -1
- zenml/integrations/great_expectations/__init__.py +22 -10
- zenml/integrations/great_expectations/data_validators/ge_data_validator.py +61 -57
- 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 +9 -9
- zenml/integrations/great_expectations/utils.py +5 -5
- zenml/integrations/huggingface/__init__.py +52 -1
- zenml/integrations/huggingface/flavors/__init__.py +26 -0
- zenml/integrations/huggingface/flavors/huggingface_model_deployer_flavor.py +130 -0
- zenml/integrations/huggingface/materializers/__init__.py +3 -0
- zenml/integrations/huggingface/materializers/huggingface_datasets_materializer.py +102 -19
- zenml/integrations/huggingface/materializers/huggingface_pt_model_materializer.py +18 -19
- zenml/integrations/huggingface/materializers/huggingface_t5_materializer.py +104 -0
- zenml/integrations/huggingface/materializers/huggingface_tf_model_materializer.py +18 -19
- zenml/integrations/huggingface/materializers/huggingface_tokenizer_materializer.py +13 -15
- zenml/integrations/huggingface/model_deployers/__init__.py +20 -0
- zenml/integrations/huggingface/model_deployers/huggingface_model_deployer.py +247 -0
- zenml/integrations/huggingface/services/__init__.py +19 -0
- zenml/integrations/huggingface/services/huggingface_deployment.py +292 -0
- zenml/integrations/huggingface/steps/__init__.py +21 -0
- zenml/integrations/huggingface/steps/accelerate_runner.py +166 -0
- zenml/integrations/huggingface/steps/huggingface_deployer.py +110 -0
- zenml/integrations/hyperai/__init__.py +53 -0
- zenml/integrations/hyperai/flavors/__init__.py +20 -0
- zenml/integrations/hyperai/flavors/hyperai_orchestrator_flavor.py +170 -0
- zenml/integrations/hyperai/orchestrators/__init__.py +21 -0
- zenml/integrations/hyperai/orchestrators/hyperai_orchestrator.py +510 -0
- zenml/integrations/hyperai/service_connectors/__init__.py +20 -0
- zenml/integrations/hyperai/service_connectors/hyperai_service_connector.py +375 -0
- zenml/integrations/integration.py +101 -47
- zenml/integrations/kaniko/flavors/kaniko_image_builder_flavor.py +6 -44
- zenml/integrations/kaniko/image_builders/kaniko_image_builder.py +9 -6
- zenml/integrations/kubeflow/__init__.py +4 -1
- zenml/integrations/kubeflow/flavors/kubeflow_orchestrator_flavor.py +67 -82
- zenml/integrations/kubeflow/orchestrators/kubeflow_orchestrator.py +306 -248
- zenml/integrations/kubernetes/__init__.py +6 -3
- zenml/integrations/kubernetes/flavors/__init__.py +8 -0
- zenml/integrations/kubernetes/flavors/kubernetes_orchestrator_flavor.py +43 -2
- zenml/integrations/kubernetes/flavors/kubernetes_step_operator_flavor.py +166 -0
- zenml/integrations/kubernetes/orchestrators/kube_utils.py +67 -12
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py +89 -21
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint.py +39 -7
- zenml/integrations/kubernetes/orchestrators/manifest_utils.py +42 -19
- zenml/integrations/kubernetes/pod_settings.py +21 -31
- zenml/integrations/kubernetes/serialization_utils.py +3 -3
- zenml/integrations/kubernetes/service_connectors/kubernetes_service_connector.py +14 -11
- zenml/integrations/kubernetes/step_operators/__init__.py +22 -0
- zenml/integrations/kubernetes/step_operators/kubernetes_step_operator.py +236 -0
- zenml/integrations/label_studio/__init__.py +1 -3
- zenml/integrations/label_studio/annotators/label_studio_annotator.py +46 -14
- zenml/integrations/label_studio/flavors/__init__.py +2 -0
- zenml/integrations/label_studio/flavors/label_studio_annotator_flavor.py +20 -5
- zenml/integrations/langchain/__init__.py +7 -1
- zenml/integrations/langchain/materializers/document_materializer.py +44 -8
- zenml/integrations/langchain/materializers/openai_embedding_materializer.py +28 -2
- zenml/integrations/lightgbm/__init__.py +1 -0
- zenml/integrations/lightgbm/materializers/lightgbm_booster_materializer.py +8 -15
- zenml/integrations/lightgbm/materializers/lightgbm_dataset_materializer.py +11 -16
- zenml/integrations/lightning/__init__.py +48 -0
- zenml/integrations/lightning/flavors/__init__.py +23 -0
- zenml/integrations/lightning/flavors/lightning_orchestrator_flavor.py +168 -0
- zenml/integrations/lightning/orchestrators/__init__.py +23 -0
- zenml/integrations/lightning/orchestrators/lightning_orchestrator.py +617 -0
- zenml/integrations/lightning/orchestrators/lightning_orchestrator_entrypoint.py +303 -0
- zenml/integrations/lightning/orchestrators/lightning_orchestrator_entrypoint_configuration.py +77 -0
- zenml/integrations/lightning/orchestrators/utils.py +67 -0
- zenml/integrations/mlflow/__init__.py +55 -8
- zenml/integrations/mlflow/experiment_trackers/mlflow_experiment_tracker.py +31 -13
- zenml/integrations/mlflow/flavors/mlflow_experiment_tracker_flavor.py +32 -37
- zenml/integrations/mlflow/model_deployers/mlflow_model_deployer.py +42 -233
- zenml/integrations/mlflow/model_registries/mlflow_model_registry.py +42 -49
- zenml/integrations/mlflow/services/mlflow_deployment.py +30 -5
- zenml/integrations/mlflow/steps/mlflow_deployer.py +25 -27
- zenml/integrations/mlflow/steps/mlflow_registry.py +3 -1
- zenml/integrations/modal/__init__.py +46 -0
- zenml/integrations/modal/flavors/__init__.py +26 -0
- zenml/integrations/modal/flavors/modal_step_operator_flavor.py +125 -0
- zenml/integrations/modal/step_operators/__init__.py +22 -0
- zenml/integrations/modal/step_operators/modal_step_operator.py +242 -0
- zenml/integrations/neptune/experiment_trackers/neptune_experiment_tracker.py +7 -5
- zenml/integrations/neptune/experiment_trackers/run_state.py +71 -55
- zenml/integrations/neptune/flavors/neptune_experiment_tracker_flavor.py +1 -1
- zenml/integrations/neural_prophet/__init__.py +6 -1
- zenml/integrations/numpy/__init__.py +32 -0
- zenml/integrations/{kserve/constants.py → numpy/materializers/__init__.py} +5 -4
- zenml/integrations/numpy/materializers/numpy_materializer.py +246 -0
- zenml/integrations/openai/__init__.py +1 -1
- zenml/integrations/openai/hooks/open_ai_failure_hook.py +39 -14
- zenml/{steps/external_artifact.py → integrations/pandas/__init__.py} +17 -11
- zenml/integrations/{kserve/custom_deployer → pandas/materializers}/__init__.py +5 -5
- zenml/integrations/pandas/materializers/pandas_materializer.py +192 -0
- zenml/integrations/pigeon/__init__.py +44 -0
- zenml/integrations/pigeon/annotators/__init__.py +20 -0
- zenml/integrations/pigeon/annotators/pigeon_annotator.py +330 -0
- zenml/integrations/{kserve → pigeon}/flavors/__init__.py +7 -7
- zenml/integrations/pigeon/flavors/pigeon_annotator_flavor.py +104 -0
- zenml/integrations/pillow/materializers/pillow_image_materializer.py +17 -20
- zenml/integrations/polars/__init__.py +1 -0
- zenml/integrations/polars/materializers/dataframe_materializer.py +26 -39
- zenml/integrations/prodigy/__init__.py +48 -0
- zenml/integrations/prodigy/annotators/__init__.py +20 -0
- zenml/integrations/prodigy/annotators/prodigy_annotator.py +275 -0
- zenml/integrations/prodigy/flavors/__init__.py +24 -0
- zenml/integrations/prodigy/flavors/prodigy_annotator_flavor.py +101 -0
- zenml/integrations/pycaret/__init__.py +6 -0
- zenml/integrations/pycaret/materializers/model_materializer.py +7 -22
- zenml/integrations/pytorch/materializers/base_pytorch_materializer.py +8 -2
- zenml/integrations/pytorch/materializers/pytorch_module_materializer.py +4 -1
- zenml/integrations/registry.py +38 -1
- zenml/integrations/s3/__init__.py +2 -3
- zenml/integrations/s3/artifact_stores/s3_artifact_store.py +191 -9
- zenml/integrations/s3/flavors/s3_artifact_store_flavor.py +22 -45
- zenml/integrations/s3/utils.py +39 -0
- zenml/integrations/seldon/__init__.py +18 -2
- zenml/integrations/seldon/model_deployers/seldon_model_deployer.py +19 -141
- zenml/integrations/seldon/secret_schemas/secret_schemas.py +2 -2
- zenml/integrations/seldon/seldon_client.py +55 -70
- zenml/integrations/seldon/services/seldon_deployment.py +4 -5
- zenml/integrations/seldon/steps/seldon_deployer.py +21 -20
- zenml/integrations/sklearn/__init__.py +1 -1
- zenml/integrations/skypilot/flavors/skypilot_orchestrator_base_vm_config.py +29 -7
- zenml/integrations/skypilot/orchestrators/skypilot_base_vm_orchestrator.py +47 -28
- zenml/integrations/skypilot/orchestrators/skypilot_orchestrator_entrypoint.py +2 -2
- zenml/integrations/skypilot_aws/__init__.py +3 -2
- zenml/integrations/skypilot_aws/flavors/skypilot_orchestrator_aws_vm_flavor.py +1 -1
- zenml/integrations/skypilot_azure/__init__.py +2 -4
- zenml/integrations/skypilot_azure/flavors/skypilot_orchestrator_azure_vm_flavor.py +1 -1
- zenml/integrations/skypilot_gcp/__init__.py +3 -2
- zenml/integrations/skypilot_gcp/flavors/skypilot_orchestrator_gcp_vm_flavor.py +1 -1
- zenml/integrations/skypilot_kubernetes/__init__.py +52 -0
- zenml/integrations/skypilot_kubernetes/flavors/__init__.py +26 -0
- zenml/integrations/skypilot_kubernetes/flavors/skypilot_orchestrator_kubernetes_vm_flavor.py +125 -0
- zenml/integrations/skypilot_kubernetes/orchestrators/__init__.py +25 -0
- zenml/integrations/skypilot_kubernetes/orchestrators/skypilot_kubernetes_vm_orchestrator.py +74 -0
- zenml/integrations/skypilot_lambda/__init__.py +50 -0
- zenml/integrations/{kserve/secret_schemas → skypilot_lambda/flavors}/__init__.py +9 -12
- zenml/integrations/skypilot_lambda/flavors/skypilot_orchestrator_lambda_vm_flavor.py +130 -0
- zenml/{lineage_graph/node → integrations/skypilot_lambda/orchestrators}/__init__.py +8 -15
- zenml/integrations/skypilot_lambda/orchestrators/skypilot_lambda_vm_orchestrator.py +92 -0
- zenml/integrations/slack/__init__.py +1 -0
- zenml/integrations/slack/alerters/slack_alerter.py +22 -2
- zenml/integrations/slack/flavors/__init__.py +2 -0
- zenml/integrations/slack/flavors/slack_alerter_flavor.py +13 -4
- zenml/integrations/slack/steps/slack_alerter_ask_step.py +1 -0
- zenml/integrations/slack/steps/slack_alerter_post_step.py +1 -0
- zenml/integrations/spark/flavors/spark_step_operator_flavor.py +2 -39
- zenml/integrations/spark/step_operators/kubernetes_step_operator.py +1 -0
- zenml/integrations/spark/step_operators/spark_entrypoint_configuration.py +1 -0
- zenml/integrations/spark/step_operators/spark_step_operator.py +2 -0
- zenml/integrations/tekton/__init__.py +2 -1
- zenml/integrations/tekton/flavors/tekton_orchestrator_flavor.py +66 -23
- zenml/integrations/tekton/orchestrators/tekton_orchestrator.py +549 -235
- zenml/integrations/tensorboard/__init__.py +1 -13
- zenml/integrations/tensorboard/services/tensorboard_service.py +3 -4
- zenml/integrations/tensorboard/visualizers/tensorboard_visualizer.py +66 -59
- zenml/integrations/tensorflow/__init__.py +10 -15
- zenml/integrations/tensorflow/materializers/keras_materializer.py +24 -27
- zenml/integrations/tensorflow/materializers/tf_dataset_materializer.py +9 -16
- zenml/integrations/vllm/__init__.py +50 -0
- zenml/integrations/vllm/flavors/__init__.py +21 -0
- zenml/integrations/vllm/flavors/vllm_model_deployer_flavor.py +91 -0
- zenml/integrations/vllm/model_deployers/__init__.py +19 -0
- zenml/integrations/vllm/model_deployers/vllm_model_deployer.py +263 -0
- zenml/integrations/vllm/services/__init__.py +19 -0
- zenml/integrations/vllm/services/vllm_deployment.py +206 -0
- zenml/integrations/wandb/__init__.py +1 -0
- zenml/integrations/wandb/flavors/wandb_experiment_tracker_flavor.py +21 -18
- zenml/integrations/whylogs/__init__.py +18 -2
- zenml/integrations/whylogs/data_validators/whylogs_data_validator.py +3 -3
- zenml/integrations/whylogs/flavors/whylogs_data_validator_flavor.py +1 -1
- zenml/integrations/whylogs/materializers/whylogs_materializer.py +14 -21
- zenml/integrations/xgboost/materializers/xgboost_booster_materializer.py +11 -22
- zenml/integrations/xgboost/materializers/xgboost_dmatrix_materializer.py +10 -19
- zenml/io/fileio.py +1 -0
- zenml/io/filesystem.py +2 -2
- zenml/io/local_filesystem.py +3 -3
- zenml/logger.py +41 -17
- zenml/logging/__init__.py +5 -0
- zenml/logging/step_logging.py +280 -32
- zenml/{new/steps → login}/__init__.py +4 -1
- zenml/login/credentials.py +370 -0
- zenml/login/credentials_store.py +638 -0
- zenml/{new/pipelines → login/pro}/__init__.py +4 -1
- zenml/login/pro/client.py +492 -0
- zenml/login/pro/constants.py +28 -0
- zenml/{zen_stores/schemas/identity_schemas.py → login/pro/models.py} +9 -11
- zenml/login/pro/organization/__init__.py +14 -0
- zenml/login/pro/organization/client.py +79 -0
- zenml/{lineage_graph/node/base_node.py → login/pro/organization/models.py} +13 -12
- zenml/{_hub → login/pro/tenant}/__init__.py +2 -2
- zenml/login/pro/tenant/client.py +92 -0
- zenml/login/pro/tenant/models.py +176 -0
- zenml/login/pro/utils.py +107 -0
- zenml/login/server_info.py +52 -0
- zenml/{cli → login}/web_login.py +71 -21
- zenml/materializers/__init__.py +2 -4
- zenml/materializers/base_materializer.py +180 -51
- zenml/materializers/built_in_materializer.py +50 -23
- zenml/materializers/cloudpickle_materializer.py +4 -5
- zenml/materializers/numpy_materializer.py +23 -233
- zenml/materializers/pandas_materializer.py +22 -174
- zenml/materializers/pydantic_materializer.py +2 -2
- zenml/materializers/service_materializer.py +12 -10
- zenml/materializers/structured_string_materializer.py +12 -6
- zenml/materializers/uuid_materializer.py +79 -0
- zenml/metadata/lazy_load.py +33 -17
- zenml/metadata/metadata_types.py +112 -3
- zenml/model/lazy_load.py +85 -4
- zenml/model/model.py +236 -226
- zenml/model/utils.py +99 -141
- zenml/model_deployers/base_model_deployer.py +319 -47
- zenml/model_registries/base_model_registry.py +17 -15
- zenml/models/__init__.py +254 -175
- zenml/models/v2/base/base.py +254 -112
- zenml/models/v2/base/base_plugin_flavor.py +76 -0
- zenml/models/v2/base/filter.py +530 -199
- zenml/models/v2/base/page.py +2 -12
- zenml/models/v2/base/scoped.py +292 -22
- zenml/models/v2/core/action.py +276 -0
- zenml/models/v2/core/action_flavor.py +57 -0
- zenml/models/v2/core/api_key.py +35 -12
- zenml/models/v2/core/artifact.py +126 -6
- zenml/models/v2/core/artifact_version.py +289 -65
- zenml/models/v2/core/artifact_visualization.py +10 -4
- zenml/models/v2/core/code_reference.py +13 -4
- zenml/models/v2/core/code_repository.py +39 -16
- zenml/models/v2/core/component.py +113 -61
- zenml/models/v2/core/device.py +25 -5
- zenml/models/v2/core/event_source.py +244 -0
- zenml/models/v2/core/event_source_flavor.py +67 -0
- zenml/models/v2/core/flavor.py +90 -27
- zenml/models/v2/core/logs.py +81 -12
- zenml/models/v2/core/model.py +91 -42
- zenml/models/v2/core/model_version.py +100 -55
- zenml/models/v2/core/model_version_artifact.py +96 -89
- zenml/models/v2/core/model_version_pipeline_run.py +86 -53
- zenml/models/v2/core/pipeline.py +205 -80
- zenml/models/v2/core/pipeline_build.py +110 -21
- zenml/models/v2/core/pipeline_deployment.py +101 -36
- zenml/models/v2/core/pipeline_run.py +545 -33
- zenml/models/v2/core/run_metadata.py +23 -181
- zenml/models/v2/core/run_template.py +439 -0
- zenml/models/v2/core/schedule.py +66 -29
- zenml/models/v2/core/secret.py +33 -21
- zenml/models/v2/core/server_settings.py +224 -0
- zenml/models/v2/core/service.py +500 -0
- zenml/models/v2/core/service_account.py +40 -15
- zenml/models/v2/core/service_connector.py +247 -49
- zenml/models/v2/core/stack.py +163 -70
- zenml/models/v2/core/step_run.py +210 -48
- zenml/models/v2/core/tag.py +21 -8
- zenml/models/v2/core/tag_resource.py +13 -4
- zenml/models/v2/core/trigger.py +422 -0
- zenml/models/v2/core/trigger_execution.py +119 -0
- zenml/models/v2/core/user.py +136 -69
- zenml/models/v2/core/workspace.py +26 -7
- zenml/models/v2/misc/auth_models.py +11 -2
- zenml/models/v2/misc/build_item.py +3 -3
- zenml/models/v2/misc/external_user.py +3 -6
- zenml/models/v2/misc/info_models.py +78 -0
- zenml/models/v2/misc/loaded_visualization.py +2 -2
- zenml/models/v2/misc/run_metadata.py +38 -0
- zenml/models/v2/misc/server_models.py +100 -0
- zenml/models/v2/misc/service_connector_type.py +9 -17
- zenml/models/v2/misc/stack_deployment.py +96 -0
- zenml/models/v2/misc/user_auth.py +7 -9
- zenml/orchestrators/__init__.py +4 -0
- zenml/orchestrators/base_orchestrator.py +136 -25
- zenml/orchestrators/containerized_orchestrator.py +1 -0
- zenml/orchestrators/dag_runner.py +18 -3
- zenml/orchestrators/input_utils.py +109 -48
- zenml/orchestrators/local/local_orchestrator.py +10 -0
- zenml/orchestrators/local_docker/local_docker_orchestrator.py +14 -42
- zenml/orchestrators/output_utils.py +16 -6
- zenml/orchestrators/publish_utils.py +12 -5
- zenml/orchestrators/step_launcher.py +142 -194
- zenml/orchestrators/step_run_utils.py +386 -0
- zenml/orchestrators/step_runner.py +181 -270
- zenml/orchestrators/utils.py +219 -84
- zenml/orchestrators/wheeled_orchestrator.py +147 -0
- zenml/pipelines/__init__.py +3 -16
- zenml/{new/pipelines → pipelines}/build_utils.py +287 -47
- zenml/{new/pipelines → pipelines}/pipeline_context.py +6 -2
- zenml/pipelines/pipeline_decorator.py +40 -64
- zenml/{new/pipelines/pipeline.py → pipelines/pipeline_definition.py} +376 -440
- zenml/pipelines/run_utils.py +358 -0
- zenml/plugins/__init__.py +0 -0
- zenml/plugins/base_plugin_flavor.py +88 -0
- zenml/plugins/plugin_flavor_registry.py +342 -0
- zenml/secret/base_secret.py +7 -8
- zenml/secret/schemas/basic_auth_secret_schema.py +0 -1
- zenml/service_connectors/docker_service_connector.py +19 -4
- zenml/service_connectors/service_connector.py +12 -14
- zenml/service_connectors/service_connector_registry.py +71 -55
- zenml/service_connectors/service_connector_utils.py +418 -0
- zenml/services/__init__.py +0 -2
- zenml/services/container/container_service.py +9 -6
- zenml/services/container/container_service_endpoint.py +1 -1
- zenml/services/container/entrypoint.py +3 -2
- zenml/services/local/local_daemon_entrypoint.py +9 -6
- zenml/services/local/local_service.py +1 -1
- zenml/services/local/local_service_endpoint.py +1 -1
- zenml/services/service.py +222 -130
- zenml/services/service_status.py +2 -1
- zenml/services/service_type.py +6 -5
- zenml/stack/flavor.py +25 -18
- zenml/stack/flavor_registry.py +4 -4
- zenml/stack/stack.py +20 -131
- zenml/stack/stack_component.py +136 -110
- zenml/stack/utils.py +36 -15
- zenml/stack_deployments/__init__.py +14 -0
- zenml/stack_deployments/aws_stack_deployment.py +320 -0
- zenml/stack_deployments/azure_stack_deployment.py +315 -0
- zenml/stack_deployments/gcp_stack_deployment.py +315 -0
- zenml/stack_deployments/stack_deployment.py +232 -0
- zenml/stack_deployments/utils.py +48 -0
- zenml/step_operators/step_operator_entrypoint_configuration.py +2 -1
- zenml/steps/__init__.py +3 -9
- zenml/steps/base_step.py +172 -315
- zenml/{new/steps → steps}/decorated_step.py +1 -0
- zenml/steps/entrypoint_function_utils.py +33 -93
- zenml/{new/steps → steps}/step_context.py +70 -50
- zenml/steps/step_decorator.py +47 -93
- zenml/steps/step_invocation.py +22 -60
- zenml/steps/utils.py +161 -48
- zenml/types.py +14 -1
- zenml/utils/archivable.py +178 -0
- zenml/utils/callback_registry.py +71 -0
- zenml/utils/code_repository_utils.py +1 -0
- zenml/utils/code_utils.py +346 -0
- zenml/utils/cuda_utils.py +50 -0
- zenml/utils/dashboard_utils.py +67 -21
- zenml/utils/deprecation_utils.py +22 -24
- zenml/utils/dict_utils.py +22 -0
- zenml/utils/docker_utils.py +34 -5
- zenml/utils/downloaded_repository_context.py +1 -0
- zenml/utils/env_utils.py +55 -1
- zenml/utils/filesync_model.py +65 -28
- zenml/utils/function_utils.py +260 -0
- zenml/utils/integration_utils.py +1 -0
- zenml/utils/json_utils.py +131 -0
- zenml/utils/materializer_utils.py +1 -1
- zenml/utils/metadata_utils.py +368 -0
- zenml/utils/notebook_utils.py +136 -0
- zenml/utils/package_utils.py +89 -0
- zenml/utils/pagination_utils.py +9 -7
- zenml/utils/pipeline_docker_image_builder.py +152 -149
- zenml/utils/pydantic_utils.py +276 -66
- zenml/utils/requirements_utils.py +71 -0
- zenml/utils/secret_utils.py +66 -12
- zenml/utils/settings_utils.py +2 -1
- zenml/utils/singleton.py +15 -3
- zenml/utils/source_code_utils.py +1 -0
- zenml/utils/source_utils.py +236 -14
- zenml/utils/string_utils.py +140 -0
- zenml/utils/typed_model.py +5 -3
- zenml/utils/typing_utils.py +223 -0
- zenml/utils/visualization_utils.py +5 -3
- zenml/utils/yaml_utils.py +1 -1
- zenml/zen_server/auth.py +387 -55
- zenml/zen_server/cache.py +208 -0
- zenml/zen_server/cloud_utils.py +253 -0
- zenml/zen_server/csrf.py +91 -0
- zenml/zen_server/dashboard/assets/404-Dfq64Boz.js +1 -0
- zenml/zen_server/dashboard/assets/@radix-DeK6qiuw.js +85 -0
- zenml/zen_server/dashboard/assets/@react-router-B3Z5rLr2.js +29 -0
- zenml/zen_server/dashboard/assets/@reactflow-BUNIMFeC.js +17 -0
- zenml/zen_server/dashboard/assets/@reactflow-C26Olbza.css +1 -0
- zenml/zen_server/dashboard/assets/@tanstack-DT5WLu9C.js +22 -0
- zenml/zen_server/dashboard/assets/AlertDialogDropdownItem-B73Vs10T.js +1 -0
- zenml/zen_server/dashboard/assets/CodeSnippet-Bbx6fIb6.css +1 -0
- zenml/zen_server/dashboard/assets/CodeSnippet-DIJRT2NT.js +9 -0
- zenml/zen_server/dashboard/assets/CollapsibleCard-BzUHGZOU.js +1 -0
- zenml/zen_server/dashboard/assets/Commands-BEGyld4c.js +1 -0
- zenml/zen_server/dashboard/assets/ComponentBadge-xyKiek1s.js +1 -0
- zenml/zen_server/dashboard/assets/CopyButton-DhW-mapu.js +2 -0
- zenml/zen_server/dashboard/assets/CsvVizualization-D8oazBiE.js +15 -0
- zenml/zen_server/dashboard/assets/DeleteAlertDialog-WkSIIgfy.js +1 -0
- zenml/zen_server/dashboard/assets/DialogItem-Bgroeg29.js +1 -0
- zenml/zen_server/dashboard/assets/DisplayDate-CDMUcQHS.js +1 -0
- zenml/zen_server/dashboard/assets/EmptyState-BzdlCwp3.js +1 -0
- zenml/zen_server/dashboard/assets/Error-CY5tlu17.js +1 -0
- zenml/zen_server/dashboard/assets/ExecutionStatus-G8mjIaeA.js +1 -0
- zenml/zen_server/dashboard/assets/Helpbox-Bb1ed--O.js +1 -0
- zenml/zen_server/dashboard/assets/Infobox-Da6-76M2.js +1 -0
- zenml/zen_server/dashboard/assets/InlineAvatar-DqnZaBNq.js +1 -0
- zenml/zen_server/dashboard/assets/Lock-CYYy18Mm.js +1 -0
- zenml/zen_server/dashboard/assets/MarkdownVisualization-ylXaAxev.js +14 -0
- zenml/zen_server/dashboard/assets/NestedCollapsible-aK5ojKoF.js +1 -0
- zenml/zen_server/dashboard/assets/NumberBox-Dtp3J6g5.js +1 -0
- zenml/zen_server/dashboard/assets/Partials-CqZp5NMX.js +1 -0
- zenml/zen_server/dashboard/assets/PasswordChecker-B0nadgh6.js +1 -0
- zenml/zen_server/dashboard/assets/ProBadge-B4tRUYve.js +1 -0
- zenml/zen_server/dashboard/assets/ProCta-CZuP29Qz.js +1 -0
- zenml/zen_server/dashboard/assets/ProviderIcon-Bd7GUQ1_.js +1 -0
- zenml/zen_server/dashboard/assets/ProviderRadio-mstdqzsS.js +1 -0
- zenml/zen_server/dashboard/assets/RunSelector-CsruSB4i.js +1 -0
- zenml/zen_server/dashboard/assets/RunsBody-DxxtWVYz.js +1 -0
- zenml/zen_server/dashboard/assets/SearchField-D6tPxyqw.js +1 -0
- zenml/zen_server/dashboard/assets/SecretTooltip-CLzJIYW_.js +1 -0
- zenml/zen_server/dashboard/assets/SetPassword-Yn50ooBC.js +1 -0
- zenml/zen_server/dashboard/assets/StackList-U537qoYd.js +1 -0
- zenml/zen_server/dashboard/assets/Tabs-CNv-eTYM.js +1 -0
- zenml/zen_server/dashboard/assets/Tick-jEIevzVf.js +1 -0
- zenml/zen_server/dashboard/assets/UpdatePasswordSchemas-C16GW-kX.js +1 -0
- zenml/zen_server/dashboard/assets/UsageReason-Bf2tzhv1.js +1 -0
- zenml/zen_server/dashboard/assets/WizardFooter-D6i-AP1K.js +1 -0
- zenml/zen_server/dashboard/assets/acp-DOsXjFc7.webp +0 -0
- zenml/zen_server/dashboard/assets/adam-e-y0WnB_.webp +0 -0
- zenml/zen_server/dashboard/assets/alex-DcCuDHPg.webp +0 -0
- zenml/zen_server/dashboard/assets/all-pipeline-runs-query-DUti43aF.js +1 -0
- zenml/zen_server/dashboard/assets/baris-C0ZrZ10g.webp +0 -0
- zenml/zen_server/dashboard/assets/check-DloQpStc.js +1 -0
- zenml/zen_server/dashboard/assets/check-circle-jNbX5-sR.js +1 -0
- zenml/zen_server/dashboard/assets/chevron-down-6JyMkfjR.js +1 -0
- zenml/zen_server/dashboard/assets/chevron-right-double-D7ojK9Co.js +1 -0
- zenml/zen_server/dashboard/assets/cloud-squares-DeRLMopf.svg +43 -0
- zenml/zen_server/dashboard/assets/code-browser-CUFUIHfp.js +1 -0
- zenml/zen_server/dashboard/assets/code-snippets-CqONne41.js +13 -0
- zenml/zen_server/dashboard/assets/components-Br2ezRib.js +1 -0
- zenml/zen_server/dashboard/assets/connectors-video-C9qY4syJ.svg +21 -0
- zenml/zen_server/dashboard/assets/copy-C8XQA2Ug.js +1 -0
- zenml/zen_server/dashboard/assets/create-stack-Ch2WPs9U.js +1 -0
- zenml/zen_server/dashboard/assets/dates-3pMLCNrD.js +1 -0
- zenml/zen_server/dashboard/assets/delete-run-Byf9hTjA.js +1 -0
- zenml/zen_server/dashboard/assets/docker-BdA9vrnW.js +1 -0
- zenml/zen_server/dashboard/assets/dots-horizontal-otGBOSDJ.js +1 -0
- zenml/zen_server/dashboard/assets/flyte-Cj-xy_8I.svg +10 -0
- zenml/zen_server/dashboard/assets/form-schemas-BZqKBPBF.js +1 -0
- zenml/zen_server/dashboard/assets/gcp-CFtm4BA7.js +1 -0
- zenml/zen_server/dashboard/assets/hamza-NKKOZz1I.webp +0 -0
- zenml/zen_server/dashboard/assets/help-Cc9bBIJH.js +1 -0
- zenml/zen_server/dashboard/assets/index-CE0aQlv8.js +55 -0
- zenml/zen_server/dashboard/assets/index-CtdYkjUi.js +1 -0
- zenml/zen_server/dashboard/assets/index-CyBKZcpO.js +1 -0
- zenml/zen_server/dashboard/assets/index-DXvT1_Um.css +1 -0
- zenml/zen_server/dashboard/assets/index-Uu49AX48.js +1 -0
- zenml/zen_server/dashboard/assets/index-v6gQjDEo.js +1 -0
- zenml/zen_server/dashboard/assets/index.esm-Dy6Z9Ung.js +1 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-400-normal-BLGc9T1a.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-400-normal-ZzOtrSSW.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-500-normal-D4Vwzodn.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-500-normal-DH2hs3aW.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-600-normal-BGBWG807.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-600-normal-BuzJQFbW.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-ext-400-normal-BPnxn4xp.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-ext-400-normal-Dc4VJyIJ.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-ext-500-normal-BShVwWPj.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-ext-500-normal-CUiC4oBV.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-ext-600-normal-Bt9VVOA-.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-cyrillic-ext-600-normal-CaqZN2hq.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-400-normal-BZzXV7-1.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-400-normal-DxZsaF_h.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-500-normal-CeQXL5ds.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-500-normal-d_eO-yCQ.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-600-normal-CwicyhtI.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-600-normal-Dhlb-90d.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-ext-400-normal-Bput3-QP.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-ext-400-normal-DCpCPQOf.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-ext-500-normal-B6guLgqG.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-ext-500-normal-M2hEX8vc.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-ext-600-normal-C9WLioJ8.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-greek-ext-600-normal-Cnui8OiR.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-400-normal-BOOGhInR.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-400-normal-gitzw0hO.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-500-normal-D2bGa7uu.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-500-normal-deR1Tlfd.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-600-normal-B5cFAncS.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-600-normal-D273HNI0.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-ext-400-normal-C1t-h-pH.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-ext-400-normal-hnt3BR84.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-ext-500-normal-CIS2RHJS.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-ext-500-normal-UMdmhHu2.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-ext-600-normal-BnYJhD27.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-latin-ext-600-normal-CAF0vJDd.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-vietnamese-400-normal-BUNmGMP1.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-vietnamese-500-normal-DQPw2Hwd.woff +0 -0
- zenml/zen_server/dashboard/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
- zenml/zen_server/dashboard/assets/inter-vietnamese-600-normal-Cm6aH8_k.woff +0 -0
- zenml/zen_server/dashboard/assets/key-icon-aH-QIa5R.js +1 -0
- zenml/zen_server/dashboard/assets/kubernetes-B2wmAJ1d.js +1 -0
- zenml/zen_server/dashboard/assets/layout-BtHBmE4w.js +1 -0
- zenml/zen_server/dashboard/assets/link-external-b9AXw_sW.js +1 -0
- zenml/zen_server/dashboard/assets/login-command-CkqxPtV3.js +1 -0
- zenml/zen_server/dashboard/assets/login-mutation-DNDVp_2H.js +1 -0
- zenml/zen_server/dashboard/assets/logs-WMSM52RF.js +1 -0
- zenml/zen_server/dashboard/assets/mcp-Cb1aMeoq.webp +0 -0
- zenml/zen_server/dashboard/assets/metaflow-weOkWNyT.svg +10 -0
- zenml/zen_server/dashboard/assets/not-found-Bmup4ctE.js +1 -0
- zenml/zen_server/dashboard/assets/package-C6uypY4h.js +1 -0
- zenml/zen_server/dashboard/assets/page--XLMzHrn.js +1 -0
- zenml/zen_server/dashboard/assets/page-ANYGfEUL.js +1 -0
- zenml/zen_server/dashboard/assets/page-B5Sr8pib.js +1 -0
- zenml/zen_server/dashboard/assets/page-BC27C_OI.js +2 -0
- zenml/zen_server/dashboard/assets/page-BNxYrN0q.js +1 -0
- zenml/zen_server/dashboard/assets/page-BYJfqgLN.js +1 -0
- zenml/zen_server/dashboard/assets/page-B_0XkV48.js +1 -0
- zenml/zen_server/dashboard/assets/page-BrmJp1Wt.js +1 -0
- zenml/zen_server/dashboard/assets/page-C2nU3Gxn.js +1 -0
- zenml/zen_server/dashboard/assets/page-C70wZtV2.js +1 -0
- zenml/zen_server/dashboard/assets/page-CHRn1fQm.js +1 -0
- zenml/zen_server/dashboard/assets/page-CWr96ZKN.js +1 -0
- zenml/zen_server/dashboard/assets/page-CXAbSyp9.js +1 -0
- zenml/zen_server/dashboard/assets/page-CaeI9ptC.js +1 -0
- zenml/zen_server/dashboard/assets/page-Cc8ZEuj4.js +1 -0
- zenml/zen_server/dashboard/assets/page-CltCNL0T.js +1 -0
- zenml/zen_server/dashboard/assets/page-CmlYj7Nl.js +1 -0
- zenml/zen_server/dashboard/assets/page-D6Ev5P8V.js +1 -0
- zenml/zen_server/dashboard/assets/page-D9Oh05fl.js +1 -0
- zenml/zen_server/dashboard/assets/page-DGlm1RVc.js +1 -0
- zenml/zen_server/dashboard/assets/page-DN4BVIOL.js +1 -0
- zenml/zen_server/dashboard/assets/page-Dif8CWyZ.js +1 -0
- zenml/zen_server/dashboard/assets/page-DlIi5ThM.js +1 -0
- zenml/zen_server/dashboard/assets/page-DoW7YxTu.js +1 -0
- zenml/zen_server/dashboard/assets/page-Dth9X1Ih.js +1 -0
- zenml/zen_server/dashboard/assets/page-DweqqCkF.js +1 -0
- zenml/zen_server/dashboard/assets/page-DyOJ_pq3.js +1 -0
- zenml/zen_server/dashboard/assets/page-Hn8q9iJZ.js +1 -0
- zenml/zen_server/dashboard/assets/page-IhckKFnD.js +6 -0
- zenml/zen_server/dashboard/assets/page-LyZ_l8vR.js +1 -0
- zenml/zen_server/dashboard/assets/page-PamGpk0j.js +1 -0
- zenml/zen_server/dashboard/assets/page-PxOWfKgF.js +2 -0
- zenml/zen_server/dashboard/assets/persist-DeXRG61d.js +1 -0
- zenml/zen_server/dashboard/assets/persist-vP0-Xl4f.js +1 -0
- zenml/zen_server/dashboard/assets/plus-tf1V2hTJ.js +1 -0
- zenml/zen_server/dashboard/assets/refresh-BjOeWlEq.js +1 -0
- zenml/zen_server/dashboard/assets/repos-video-D8kpu60k.svg +9 -0
- zenml/zen_server/dashboard/assets/rocket-DjT2cDvG.js +1 -0
- zenml/zen_server/dashboard/assets/service-DH_oUqQj.js +2 -0
- zenml/zen_server/dashboard/assets/settings_preview-0JLrRgHP.webp +0 -0
- zenml/zen_server/dashboard/assets/sharedSchema-Bw1_Wa7l.js +14 -0
- zenml/zen_server/dashboard/assets/stack-detail-query-B_0R_fd6.js +1 -0
- zenml/zen_server/dashboard/assets/stefan-B08Ftbba.webp +0 -0
- zenml/zen_server/dashboard/assets/templates-1S_8WeSK.webp +0 -0
- zenml/zen_server/dashboard/assets/tick-circle-BEX_Tp4v.js +1 -0
- zenml/zen_server/dashboard/assets/tour-cover-BYfeen6M.webp +0 -0
- zenml/zen_server/dashboard/assets/trash-arLUMWMS.js +1 -0
- zenml/zen_server/dashboard/assets/update-server-settings-mutation-D9qYhfaN.js +1 -0
- zenml/zen_server/dashboard/assets/upgrade-form-CwRHBuXB.webp +0 -0
- zenml/zen_server/dashboard/assets/url-Dh93fvh0.js +1 -0
- zenml/zen_server/dashboard/assets/zod-BwEbpOxH.js +1 -0
- zenml/zen_server/dashboard/index.html +19 -1
- zenml/zen_server/deploy/__init__.py +7 -16
- zenml/zen_server/deploy/base_provider.py +49 -78
- zenml/zen_server/deploy/{local → daemon}/__init__.py +3 -3
- zenml/zen_server/deploy/{local/local_provider.py → daemon/daemon_provider.py} +48 -66
- zenml/zen_server/deploy/{local/local_zen_server.py → daemon/daemon_zen_server.py} +78 -62
- zenml/zen_server/deploy/deployer.py +94 -175
- zenml/zen_server/deploy/deployment.py +23 -17
- zenml/zen_server/deploy/docker/docker_provider.py +15 -31
- zenml/zen_server/deploy/docker/docker_zen_server.py +30 -35
- zenml/zen_server/deploy/helm/Chart.yaml +1 -1
- zenml/zen_server/deploy/helm/README.md +3 -13
- zenml/zen_server/deploy/helm/templates/NOTES.txt +23 -7
- zenml/zen_server/deploy/helm/templates/_environment.tpl +175 -23
- zenml/zen_server/deploy/helm/templates/server-db-job.yaml +45 -18
- zenml/zen_server/deploy/helm/templates/server-db-pvc.yaml +25 -0
- zenml/zen_server/deploy/helm/templates/server-deployment.yaml +22 -6
- zenml/zen_server/deploy/helm/templates/server-secret.yaml +11 -10
- zenml/zen_server/deploy/helm/values.yaml +210 -28
- zenml/zen_server/exceptions.py +20 -1
- zenml/zen_server/feature_gate/__init__.py +13 -0
- zenml/zen_server/feature_gate/endpoint_utils.py +61 -0
- zenml/zen_server/feature_gate/feature_gate_interface.py +49 -0
- zenml/zen_server/feature_gate/zenml_cloud_feature_gate.py +125 -0
- zenml/zen_server/jwt.py +64 -32
- zenml/zen_server/rate_limit.py +200 -0
- zenml/zen_server/rbac/endpoint_utils.py +92 -9
- zenml/zen_server/rbac/models.py +21 -17
- zenml/zen_server/rbac/rbac_sql_zen_store.py +175 -0
- zenml/zen_server/rbac/utils.py +71 -30
- zenml/zen_server/rbac/zenml_cloud_rbac.py +13 -188
- zenml/zen_server/routers/actions_endpoints.py +324 -0
- zenml/zen_server/routers/artifact_version_endpoints.py +28 -2
- zenml/zen_server/routers/auth_endpoints.py +249 -131
- zenml/zen_server/routers/code_repositories_endpoints.py +1 -0
- zenml/zen_server/routers/devices_endpoints.py +56 -49
- zenml/zen_server/routers/event_source_endpoints.py +327 -0
- zenml/zen_server/routers/logs_endpoints.py +66 -0
- zenml/zen_server/routers/model_versions_endpoints.py +59 -0
- zenml/zen_server/routers/models_endpoints.py +7 -1
- zenml/zen_server/routers/pipeline_builds_endpoints.py +6 -1
- zenml/zen_server/routers/pipeline_deployments_endpoints.py +35 -0
- zenml/zen_server/routers/pipelines_endpoints.py +19 -32
- zenml/zen_server/routers/plugin_endpoints.py +107 -0
- zenml/zen_server/routers/run_templates_endpoints.py +212 -0
- zenml/zen_server/routers/runs_endpoints.py +91 -32
- zenml/zen_server/routers/schedule_endpoints.py +1 -0
- zenml/zen_server/routers/secrets_endpoints.py +4 -2
- zenml/zen_server/routers/server_endpoints.py +186 -4
- zenml/zen_server/routers/service_connectors_endpoints.py +56 -0
- zenml/zen_server/routers/service_endpoints.py +180 -0
- zenml/zen_server/routers/stack_components_endpoints.py +2 -1
- zenml/zen_server/routers/stack_deployment_endpoints.py +164 -0
- zenml/zen_server/routers/steps_endpoints.py +21 -12
- zenml/zen_server/routers/triggers_endpoints.py +336 -0
- zenml/zen_server/routers/users_endpoints.py +280 -45
- zenml/zen_server/routers/webhook_endpoints.py +127 -0
- zenml/zen_server/routers/workspaces_endpoints.py +220 -185
- zenml/zen_server/secure_headers.py +120 -0
- zenml/{new → zen_server/template_execution}/__init__.py +1 -1
- zenml/zen_server/template_execution/runner_entrypoint_configuration.py +42 -0
- zenml/zen_server/template_execution/utils.py +474 -0
- zenml/zen_server/template_execution/workload_manager_interface.py +92 -0
- zenml/zen_server/utils.py +374 -74
- zenml/zen_server/zen_server_api.py +299 -52
- zenml/zen_stores/base_zen_store.py +90 -58
- zenml/zen_stores/migrations/alembic.py +22 -9
- zenml/zen_stores/migrations/env.py +2 -2
- zenml/zen_stores/migrations/utils.py +731 -0
- zenml/zen_stores/migrations/versions/0.21.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.21.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.22.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.23.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.30.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.31.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.31.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.32.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.32.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.33.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.34.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.35.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.35.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.36.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.36.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.37.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.38.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.39.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.39.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.40.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.40.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.40.2_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.40.3_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.41.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.42.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.42.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.43.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.44.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.44.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.44.2_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.44.3_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.45.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.45.1_release_0_45_1.py +0 -1
- zenml/zen_stores/migrations/versions/0.45.2_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.45.3_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.45.4_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.45.5_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.45.6_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.46.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.46.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.47.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.50.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.51.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.52.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.53.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.53.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.54.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.54.1_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.55.0_release.py +0 -1
- zenml/zen_stores/migrations/versions/0.55.1_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.55.2_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.55.3_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.55.4_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.55.5_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.56.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.56.1_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.56.2_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.56.3_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.56.4_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.57.0.rc1_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.57.0.rc2_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.57.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.57.1_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.58.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.58.1_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.58.2_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.60.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.61.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.62.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.63.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.64.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.65.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.66.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.67.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.68.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.68.1_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.70.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.71.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/0.72.0_release.py +23 -0
- zenml/zen_stores/migrations/versions/026d4577b6a0_add_code_path.py +39 -0
- zenml/zen_stores/migrations/versions/03742aa7fdd7_add_secrets.py +1 -0
- zenml/zen_stores/migrations/versions/0701da9951a0_added_service_table.py +94 -0
- zenml/zen_stores/migrations/versions/0b06faa59c93_add_service_connectors.py +1 -0
- zenml/zen_stores/migrations/versions/0d707865f404_adding_labels_to_stacks.py +30 -0
- zenml/zen_stores/migrations/versions/0e4735b23577_increase_pipeline_spec_field_length.py +1 -0
- zenml/zen_stores/migrations/versions/1041bc644e0d_remove_secrets_manager.py +6 -3
- zenml/zen_stores/migrations/versions/10a907dad202_delete_mlmd_tables.py +2 -1
- zenml/zen_stores/migrations/versions/14d687c8fa1c_rename_model_config_to_model_version.py +1 -0
- zenml/zen_stores/migrations/versions/19f27d5b234e_add_build_and_deployment_tables.py +1 -0
- zenml/zen_stores/migrations/versions/1a9a9d2a836d_admin_users.py +56 -0
- zenml/zen_stores/migrations/versions/1ac1b9c04da1_make_secrets_values_optional.py +1 -0
- zenml/zen_stores/migrations/versions/1cb6477f72d6_move_artifact_save_type.py +99 -0
- zenml/zen_stores/migrations/versions/1d74e596abb8_add_run_once_start_time_to_schedule.py +36 -0
- zenml/zen_stores/migrations/versions/1d8f30c54477_migrate_to_new_.py +124 -0
- zenml/zen_stores/migrations/versions/248dfd320b68_update_size_of_flavor_config_schema.py +1 -0
- zenml/zen_stores/migrations/versions/25155145c545_separate_actions_and_triggers.py +228 -0
- zenml/zen_stores/migrations/versions/26351d482b9e_add_step_run_unique_constraint.py +37 -0
- zenml/zen_stores/migrations/versions/26b776ad583e_redesign_artifacts.py +9 -10
- zenml/zen_stores/migrations/versions/2d201872e23c_remove_db_dependency_loop.py +29 -0
- zenml/zen_stores/migrations/versions/37835ce041d2_optimizing_database.py +4 -3
- zenml/zen_stores/migrations/versions/389046140cad_data_versioning.py +1 -0
- zenml/zen_stores/migrations/versions/3944116bbd56_rename_project_to_workspace.py +1 -0
- zenml/zen_stores/migrations/versions/3b68abe58f44_add_model_watchtower_entities.py +1 -0
- zenml/zen_stores/migrations/versions/3c5a367730c2_add_environment_info_to_runs.py +1 -0
- zenml/zen_stores/migrations/versions/3dcc5d20e82f_add_last_user_activity.py +51 -0
- zenml/zen_stores/migrations/versions/43a86093b60e_add_labels_for_stack_components.py +1 -0
- zenml/zen_stores/migrations/versions/46506f72f0ed_add_server_settings.py +123 -0
- zenml/zen_stores/migrations/versions/479103df60b6_add_triggers.py +162 -0
- zenml/zen_stores/migrations/versions/4a3087070f4e_add_step_source_code.py +1 -0
- zenml/zen_stores/migrations/versions/4c41c0ca42db_add_code_repository_table.py +1 -0
- zenml/zen_stores/migrations/versions/4d688d8f7aff_rename_model_version_to_model.py +1 -0
- zenml/zen_stores/migrations/versions/4e1972485075_endpoint_artifact_deployment_artifact.py +1 -0
- zenml/zen_stores/migrations/versions/4f66af55fbb9_rename_model_config_model_to_model_.py +1 -0
- zenml/zen_stores/migrations/versions/5330ba58bf20_rename_tables_and_foreign_keys.py +8 -9
- zenml/zen_stores/migrations/versions/5994f9ad0489_introduce_role_permissions.py +4 -2
- zenml/zen_stores/migrations/versions/5cc3f41cf048_add_save_models_to_registry.py +1 -0
- zenml/zen_stores/migrations/versions/6119cd9b93c2_tags_table.py +1 -0
- zenml/zen_stores/migrations/versions/623a234c11f5_add_sdk_docs_url_to_flavors.py +1 -0
- zenml/zen_stores/migrations/versions/6917bce75069_add_pipeline_run_unique_constraint.py +5 -4
- zenml/zen_stores/migrations/versions/6a28c4fd0ef2_add_caching_info.py +1 -0
- zenml/zen_stores/migrations/versions/6f707b385dc1_fix_model_artifacts.py +1 -0
- zenml/zen_stores/migrations/versions/722392c91006_make_is_service_account_mandatory.py +1 -0
- zenml/zen_stores/migrations/versions/72675226b2de_unique_users.py +31 -0
- zenml/zen_stores/migrations/versions/72722dee4686_track_server_version.py +1 -0
- zenml/zen_stores/migrations/versions/7280c14811d6_use_text_type.py +1 -0
- zenml/zen_stores/migrations/versions/728c6369cfaa_add_name_column_to_input_artifact_pk.py +4 -2
- zenml/zen_stores/migrations/versions/729263e47b55_fix_external_input_artifacts.py +1 -0
- zenml/zen_stores/migrations/versions/743ec82b1b3c_update_size_of_build_images.py +3 -2
- zenml/zen_stores/migrations/versions/7500f434b71c_remove_shared_columns.py +4 -2
- zenml/zen_stores/migrations/versions/76a7b9451ccd_add_build_template_deployment_id.py +52 -0
- zenml/zen_stores/migrations/versions/7834208cc3f6_artifact_project_scoping.py +9 -7
- zenml/zen_stores/migrations/versions/7b651bf6822e_track_secrets_in_db.py +7 -7
- zenml/zen_stores/migrations/versions/7d1919bb1ef0_add_run_templates.py +100 -0
- zenml/zen_stores/migrations/versions/7e4a481d17f7_add_identity_table.py +3 -2
- zenml/zen_stores/migrations/versions/7f603e583dd7_fixed_migration.py +2 -1
- zenml/zen_stores/migrations/versions/86fa52918b54_remove_teams_and_roles.py +1 -0
- zenml/zen_stores/migrations/versions/8a64fbfecda0_add_num_outputs_to_run_step.py +1 -0
- zenml/zen_stores/migrations/versions/8ed03137cacc_polymorthic_run_metadata.py +1 -0
- zenml/zen_stores/migrations/versions/904464ea4041_add_pipeline_model_run_unique_constraints.py +192 -0
- zenml/zen_stores/migrations/versions/909550c7c4da_remove_user_hub_token.py +36 -0
- zenml/zen_stores/migrations/versions/93cbda80a732_add_service_accounts.py +1 -0
- zenml/zen_stores/migrations/versions/979eff8fc4b1_add_code_repo_description_and_logo_url.py +1 -0
- zenml/zen_stores/migrations/versions/9971237fa937_artifact_visualizations.py +1 -0
- zenml/zen_stores/migrations/versions/9d8020441014_increase_step_configuration_length.py +1 -0
- zenml/zen_stores/migrations/versions/a1237ba94fd8_add_model_version_producer_run_unique_.py +68 -0
- zenml/zen_stores/migrations/versions/a39c4184c8ce_remove_secrets_manager_flavors.py +3 -2
- zenml/zen_stores/migrations/versions/a91762e6be36_artifact_version_table.py +5 -4
- zenml/zen_stores/migrations/versions/ade72effebaf_added_logs_table.py +1 -0
- zenml/zen_stores/migrations/versions/alembic_start.py +2 -1
- zenml/zen_stores/migrations/versions/b4eccf34dfa3_add_hub_token_to_user_model.py +1 -0
- zenml/zen_stores/migrations/versions/b4fca5241eea_migrate_onboarding_state.py +167 -0
- zenml/zen_stores/migrations/versions/b557b2871693_update_step_run_input_types.py +33 -0
- zenml/zen_stores/migrations/versions/b59aa68fdb1f_simplify_pipelines.py +139 -0
- zenml/zen_stores/migrations/versions/b73bc71f1106_remove_component_spec_path.py +36 -0
- zenml/zen_stores/migrations/versions/bf2120261b5a_add_configured_model_version_id.py +74 -0
- zenml/zen_stores/migrations/versions/c1b18cec3a48_increase_length_on_flavor_config_schema.py +1 -0
- zenml/zen_stores/migrations/versions/c22561cbb3a9_add_artifact_unique_constraints.py +86 -0
- zenml/zen_stores/migrations/versions/cc269488e5a9_separate_run_metadata.py +135 -0
- zenml/zen_stores/migrations/versions/cc9894cb58aa_add_user_metadata.py +41 -0
- zenml/zen_stores/migrations/versions/ccd68b7825ae_add_status_to_pipeline_and_step_run.py +1 -0
- zenml/zen_stores/migrations/versions/d02b3d3464cf_add_orchestrator_run_id_column.py +1 -0
- zenml/zen_stores/migrations/versions/d26471b6fe8f_update_build_filtering.py +1 -0
- zenml/zen_stores/migrations/versions/d7b3acf9aa46_create_schedule_table.py +1 -0
- zenml/zen_stores/migrations/versions/e1d66d91a099_add_stack_and_component_spec_paths_to_.py +1 -0
- zenml/zen_stores/migrations/versions/e5225281b4d3_add_connector_skew_tolerance.py +1 -0
- zenml/zen_stores/migrations/versions/e65aa6708ff7_pipeline_versioning.py +1 -0
- zenml/zen_stores/migrations/versions/ec0d785ca296_create_run_metadata_table.py +1 -0
- zenml/zen_stores/migrations/versions/ec6307720f92_simplify_model_version_links.py +119 -0
- zenml/zen_stores/migrations/versions/f3b3964e3a0f_add_oauth_devices.py +1 -0
- zenml/zen_stores/migrations/versions/f49904a80aa7_increase_length_of_artifact_table_sources.py +1 -0
- zenml/zen_stores/migrations/versions/fbd7f18ced1e_increase_step_run_field_lengths.py +5 -4
- zenml/zen_stores/rest_zen_store.py +1326 -305
- zenml/zen_stores/schemas/__init__.py +22 -3
- zenml/zen_stores/schemas/action_schemas.py +192 -0
- zenml/zen_stores/schemas/api_key_schemas.py +23 -10
- zenml/zen_stores/schemas/artifact_schemas.py +112 -49
- zenml/zen_stores/schemas/artifact_visualization_schemas.py +17 -8
- zenml/zen_stores/schemas/base_schemas.py +27 -0
- zenml/zen_stores/schemas/code_repository_schemas.py +25 -10
- zenml/zen_stores/schemas/component_schemas.py +74 -11
- zenml/zen_stores/schemas/constants.py +16 -0
- zenml/zen_stores/schemas/device_schemas.py +29 -15
- zenml/zen_stores/schemas/event_source_schemas.py +188 -0
- zenml/zen_stores/schemas/flavor_schemas.py +19 -9
- zenml/zen_stores/schemas/logs_schemas.py +12 -6
- zenml/zen_stores/schemas/model_schemas.py +192 -139
- zenml/zen_stores/schemas/pipeline_build_schemas.py +16 -16
- zenml/zen_stores/schemas/pipeline_deployment_schemas.py +58 -17
- zenml/zen_stores/schemas/pipeline_run_schemas.py +170 -35
- zenml/zen_stores/schemas/pipeline_schemas.py +51 -33
- zenml/zen_stores/schemas/run_metadata_schemas.py +28 -78
- zenml/zen_stores/schemas/run_template_schemas.py +267 -0
- zenml/zen_stores/schemas/schedule_schema.py +15 -5
- zenml/zen_stores/schemas/secret_schemas.py +18 -10
- zenml/zen_stores/schemas/server_settings_schemas.py +129 -0
- zenml/zen_stores/schemas/service_connector_schemas.py +13 -6
- zenml/zen_stores/schemas/service_schemas.py +258 -0
- zenml/zen_stores/schemas/stack_schemas.py +23 -6
- zenml/zen_stores/schemas/step_run_schemas.py +132 -41
- zenml/zen_stores/schemas/tag_schemas.py +31 -50
- zenml/zen_stores/schemas/trigger_schemas.py +316 -0
- zenml/zen_stores/schemas/user_schemas.py +66 -23
- zenml/zen_stores/schemas/utils.py +112 -0
- zenml/zen_stores/schemas/workspace_schemas.py +36 -19
- zenml/zen_stores/secrets_stores/aws_secrets_store.py +41 -32
- zenml/zen_stores/secrets_stores/azure_secrets_store.py +20 -23
- zenml/zen_stores/secrets_stores/base_secrets_store.py +80 -12
- zenml/zen_stores/secrets_stores/gcp_secrets_store.py +42 -33
- zenml/zen_stores/secrets_stores/hashicorp_secrets_store.py +7 -11
- zenml/zen_stores/secrets_stores/secrets_store_interface.py +1 -0
- zenml/zen_stores/secrets_stores/service_connector_secrets_store.py +15 -8
- zenml/zen_stores/secrets_stores/sql_secrets_store.py +8 -9
- zenml/zen_stores/sql_zen_store.py +4062 -799
- zenml/zen_stores/template_utils.py +263 -0
- zenml/zen_stores/zen_store_interface.py +614 -44
- zenml_nightly-0.72.0.dev20250116.dist-info/METADATA +486 -0
- zenml_nightly-0.72.0.dev20250116.dist-info/RECORD +1294 -0
- {zenml_nightly-0.55.0.dev20240124.dist-info → zenml_nightly-0.72.0.dev20250116.dist-info}/WHEEL +1 -1
- CLA.md +0 -110
- CODE-OF-CONDUCT.md +0 -132
- CONTRIBUTING.md +0 -260
- README.md +0 -304
- RELEASE_NOTES.md +0 -3919
- ROADMAP.md +0 -5
- SECURITY.md +0 -15
- zenml/_hub/client.py +0 -285
- zenml/_hub/constants.py +0 -21
- zenml/_hub/utils.py +0 -80
- zenml/api.py +0 -61
- zenml/cli/hub.py +0 -1115
- zenml/cli/stack_recipes.py +0 -469
- zenml/integrations/gcp/google_cloud_function.py +0 -187
- zenml/integrations/gcp/google_cloud_scheduler.py +0 -83
- zenml/integrations/gcp/orchestrators/vertex_scheduler/main.py +0 -91
- zenml/integrations/gcp/orchestrators/vertex_scheduler/requirements.txt +0 -2
- zenml/integrations/kserve/__init__.py +0 -57
- zenml/integrations/kserve/custom_deployer/zenml_custom_model.py +0 -175
- zenml/integrations/kserve/flavors/kserve_model_deployer_flavor.py +0 -137
- zenml/integrations/kserve/model_deployers/kserve_model_deployer.py +0 -1003
- zenml/integrations/kserve/secret_schemas/secret_schemas.py +0 -65
- zenml/integrations/kserve/services/kserve_deployment.py +0 -596
- zenml/integrations/kserve/steps/__init__.py +0 -22
- zenml/integrations/kserve/steps/kserve_deployer.py +0 -472
- zenml/integrations/kserve/steps/kserve_step_utils.py +0 -293
- zenml/integrations/kubeflow/utils.py +0 -96
- zenml/lineage_graph/lineage_graph.py +0 -244
- zenml/lineage_graph/node/artifact_node.py +0 -52
- zenml/lineage_graph/node/step_node.py +0 -41
- zenml/models/v2/base/internal.py +0 -37
- zenml/models/v2/base/update.py +0 -40
- zenml/models/v2/misc/hub_plugin_models.py +0 -79
- zenml/new/pipelines/deserialization_utils.py +0 -291
- zenml/new/pipelines/model_utils.py +0 -72
- zenml/new/pipelines/pipeline_decorator.py +0 -109
- zenml/new/steps/step_decorator.py +0 -160
- zenml/pipelines/base_pipeline.py +0 -274
- zenml/post_execution/pipeline.py +0 -58
- zenml/post_execution/pipeline_run.py +0 -55
- zenml/services/service_registry.py +0 -214
- zenml/services/terraform/__init__.py +0 -14
- zenml/services/terraform/terraform_service.py +0 -441
- zenml/steps/step_environment.py +0 -108
- zenml/steps/step_output.py +0 -36
- zenml/utils/mlstacks_utils.py +0 -635
- zenml/utils/terraform_utils.py +0 -42
- zenml/zen_server/dashboard/_redirects +0 -1
- zenml/zen_server/dashboard/asset-manifest.json +0 -131
- zenml/zen_server/dashboard/manifest.json +0 -25
- zenml/zen_server/dashboard/precache-manifest.c139638dcc4d9d3425353266447a2fad.js +0 -462
- zenml/zen_server/dashboard/robots.txt +0 -2
- zenml/zen_server/dashboard/service-worker.js +0 -39
- zenml/zen_server/dashboard/static/css/2.5b37d44a.chunk.css +0 -16
- zenml/zen_server/dashboard/static/css/2.5b37d44a.chunk.css.map +0 -1
- zenml/zen_server/dashboard/static/css/main.77e46c35.chunk.css +0 -2
- zenml/zen_server/dashboard/static/css/main.77e46c35.chunk.css.map +0 -1
- zenml/zen_server/dashboard/static/js/2.bb4cef22.chunk.js +0 -3
- zenml/zen_server/dashboard/static/js/2.bb4cef22.chunk.js.LICENSE.txt +0 -95
- zenml/zen_server/dashboard/static/js/2.bb4cef22.chunk.js.map +0 -1
- zenml/zen_server/dashboard/static/js/main.270838b4.chunk.js +0 -2
- zenml/zen_server/dashboard/static/js/main.270838b4.chunk.js.map +0 -1
- zenml/zen_server/dashboard/static/js/runtime-main.bfca2edd.js +0 -2
- zenml/zen_server/dashboard/static/js/runtime-main.bfca2edd.js.map +0 -1
- zenml/zen_server/dashboard/static/media/AlertTriangle.28aee535.svg +0 -5
- zenml/zen_server/dashboard/static/media/ArrowSquareOut.abfb9bc7.svg +0 -5
- zenml/zen_server/dashboard/static/media/Back.86c23a22.svg +0 -4
- zenml/zen_server/dashboard/static/media/BookOpen.5cb101ff.svg +0 -4
- zenml/zen_server/dashboard/static/media/BoundingBox.1eb98717.svg +0 -10
- zenml/zen_server/dashboard/static/media/Burger.9b1c67d7.svg +0 -3
- zenml/zen_server/dashboard/static/media/Cached.2381fb8d.svg +0 -1
- zenml/zen_server/dashboard/static/media/Calendar.356e11c7.svg +0 -3
- zenml/zen_server/dashboard/static/media/ChartBarHorizontal.0247447b.svg +0 -6
- zenml/zen_server/dashboard/static/media/ChartLine.0d79e18d.svg +0 -4
- zenml/zen_server/dashboard/static/media/ChatDots.2e1c9211.svg +0 -6
- zenml/zen_server/dashboard/static/media/Check.dad6beb2.svg +0 -3
- zenml/zen_server/dashboard/static/media/CheckCircleFilled.c19566d0.svg +0 -3
- zenml/zen_server/dashboard/static/media/Checkbox.af50e31e.svg +0 -3
- zenml/zen_server/dashboard/static/media/ChevronDown.f860ce32.svg +0 -3
- zenml/zen_server/dashboard/static/media/ChevronDownLight.6642d756.svg +0 -3
- zenml/zen_server/dashboard/static/media/ChevronLeft.f6edfcdb.svg +0 -3
- zenml/zen_server/dashboard/static/media/CircleCheck.f98fd6ca.svg +0 -1
- zenml/zen_server/dashboard/static/media/Clock.ffc9de95.svg +0 -3
- zenml/zen_server/dashboard/static/media/Close.74e9efbc.svg +0 -5
- zenml/zen_server/dashboard/static/media/CloseWithBorder.6960930a.svg +0 -3
- zenml/zen_server/dashboard/static/media/CloseWithoutBorder.cd6f71df.svg +0 -3
- zenml/zen_server/dashboard/static/media/CloudArrowUp.0aecb235.svg +0 -6
- zenml/zen_server/dashboard/static/media/Code.ef0f33b5.svg +0 -3
- zenml/zen_server/dashboard/static/media/Config.0be63f8a.svg +0 -1
- zenml/zen_server/dashboard/static/media/Connector.9fd46ef1.svg +0 -10
- zenml/zen_server/dashboard/static/media/Copy.36e2112a.svg +0 -1
- zenml/zen_server/dashboard/static/media/Dashboard.d05787e0.svg +0 -3
- zenml/zen_server/dashboard/static/media/Data.b1c3b5f8.svg +0 -3
- zenml/zen_server/dashboard/static/media/Delete.3c361b28.svg +0 -8
- zenml/zen_server/dashboard/static/media/Docs.7541d478.svg +0 -7
- zenml/zen_server/dashboard/static/media/Download.fba04d87.svg +0 -5
- zenml/zen_server/dashboard/static/media/Edit.490eb294.svg +0 -6
- zenml/zen_server/dashboard/static/media/EmptyRightArrow.23749d01.svg +0 -3
- zenml/zen_server/dashboard/static/media/Example.6396cd37.svg +0 -5
- zenml/zen_server/dashboard/static/media/Extension.1394cd4a.svg +0 -3
- zenml/zen_server/dashboard/static/media/Eye.d9e4ee62.svg +0 -4
- zenml/zen_server/dashboard/static/media/Failed.0213c1a0.svg +0 -1
- zenml/zen_server/dashboard/static/media/FileText.1f15bacd.svg +0 -7
- zenml/zen_server/dashboard/static/media/Filter.ab6b9c0d.svg +0 -3
- zenml/zen_server/dashboard/static/media/Folders.12b29887.svg +0 -5
- zenml/zen_server/dashboard/static/media/FunnelFill.6df4c143.svg +0 -3
- zenml/zen_server/dashboard/static/media/GitCommit.7dd9c2aa.svg +0 -5
- zenml/zen_server/dashboard/static/media/GitHub_Logo.cefc2023.png +0 -0
- zenml/zen_server/dashboard/static/media/Graph.2c63a892.svg +0 -11
- zenml/zen_server/dashboard/static/media/History.08329240.svg +0 -3
- zenml/zen_server/dashboard/static/media/Home.0843b0d5.svg +0 -3
- zenml/zen_server/dashboard/static/media/ImageBuilder.ea762d9c.svg +0 -6
- zenml/zen_server/dashboard/static/media/InProgress.304a0edc.svg +0 -1
- zenml/zen_server/dashboard/static/media/Info.9fe10c5c.svg +0 -3
- zenml/zen_server/dashboard/static/media/KeyboardReturn.491afbe3.svg +0 -3
- zenml/zen_server/dashboard/static/media/Link.72bbb55d.svg +0 -4
- zenml/zen_server/dashboard/static/media/Lock.30f5e1fe.svg +0 -5
- zenml/zen_server/dashboard/static/media/Lock2.a769ea52.svg +0 -3
- zenml/zen_server/dashboard/static/media/LockKey.92f21621.svg +0 -6
- zenml/zen_server/dashboard/static/media/Logs.8bf4d005.svg +0 -5
- zenml/zen_server/dashboard/static/media/MinusCircle.4188f418.svg +0 -4
- zenml/zen_server/dashboard/static/media/ModelRegistry.f0de050a.svg +0 -6
- zenml/zen_server/dashboard/static/media/MultiUser.a2ba7c67.svg +0 -10
- zenml/zen_server/dashboard/static/media/PaginationFirst.92628634.svg +0 -4
- zenml/zen_server/dashboard/static/media/PaginationLast.00d3c732.svg +0 -4
- zenml/zen_server/dashboard/static/media/PaginationNext.86158845.svg +0 -3
- zenml/zen_server/dashboard/static/media/PaginationPrev.60c18a88.svg +0 -3
- zenml/zen_server/dashboard/static/media/Pen.f2d831d4.svg +0 -6
- zenml/zen_server/dashboard/static/media/PhotoCamera.179d6d4c.svg +0 -3
- zenml/zen_server/dashboard/static/media/Pipeline.30d298b0.svg +0 -7
- zenml/zen_server/dashboard/static/media/Plus.5aa1c16b.svg +0 -3
- zenml/zen_server/dashboard/static/media/PlusCircle.92d860dd.svg +0 -5
- zenml/zen_server/dashboard/static/media/Repositories.71a36b8c.svg +0 -3
- zenml/zen_server/dashboard/static/media/RightArrow.f30d3871.svg +0 -29
- zenml/zen_server/dashboard/static/media/Rocket.63bf7b9d.svg +0 -3
- zenml/zen_server/dashboard/static/media/RocketLaunch.1bff2b59.svg +0 -6
- zenml/zen_server/dashboard/static/media/Rubik-Medium.c87313aa.ttf +0 -0
- zenml/zen_server/dashboard/static/media/Rubik-Regular.b3d0902b.ttf +0 -0
- zenml/zen_server/dashboard/static/media/Run.daec4fb2.svg +0 -6
- zenml/zen_server/dashboard/static/media/Search.d1afcce5.svg +0 -4
- zenml/zen_server/dashboard/static/media/Settings.59ca73ae.svg +0 -4
- zenml/zen_server/dashboard/static/media/Share2.46c3ff66.svg +0 -3
- zenml/zen_server/dashboard/static/media/SignOut.6aa718c5.svg +0 -3
- zenml/zen_server/dashboard/static/media/SimplePlus.5cf7ec20.svg +0 -3
- zenml/zen_server/dashboard/static/media/SingleUser.bef3a095.svg +0 -4
- zenml/zen_server/dashboard/static/media/SourceCodePro-Regular.b484b32f.ttf +0 -0
- zenml/zen_server/dashboard/static/media/Stack.19b604ac.svg +0 -5
- zenml/zen_server/dashboard/static/media/StackComponent.b1ba90b5.svg +0 -4
- zenml/zen_server/dashboard/static/media/Star.f0c25022.svg +0 -9
- zenml/zen_server/dashboard/static/media/StarOutline.94ca8cd9.svg +0 -3
- zenml/zen_server/dashboard/static/media/Storefront.4b4796fe.svg +0 -3
- zenml/zen_server/dashboard/static/media/Stream.543e3039.svg +0 -3
- zenml/zen_server/dashboard/static/media/SupportAgent.510ddf1f.svg +0 -8
- zenml/zen_server/dashboard/static/media/Table.77033750.svg +0 -6
- zenml/zen_server/dashboard/static/media/Tool.d5785486.svg +0 -3
- zenml/zen_server/dashboard/static/media/UserPlus.741a99d7.svg +0 -6
- zenml/zen_server/dashboard/static/media/Verified.0625b2a0.svg +0 -3
- zenml/zen_server/dashboard/static/media/addNew.4fb6c939.svg +0 -8
- zenml/zen_server/dashboard/static/media/arrowClose.cbd53f3f.svg +0 -3
- zenml/zen_server/dashboard/static/media/arrowOpen.6ceef0af.svg +0 -3
- zenml/zen_server/dashboard/static/media/check_small.30bc0138.svg +0 -3
- zenml/zen_server/dashboard/static/media/circleArrowSideClose.98d6013e.svg +0 -18
- zenml/zen_server/dashboard/static/media/circleArrowSideOpen.63653df6.svg +0 -18
- zenml/zen_server/dashboard/static/media/image.104fd14b.png +0 -0
- zenml/zen_server/dashboard/static/media/imageAddIcon.e83004a9.svg +0 -7
- zenml/zen_server/dashboard/static/media/logo.93333e5c.svg +0 -1
- zenml/zen_server/dashboard/static/media/logo_small.4204397d.svg +0 -3
- zenml/zen_server/dashboard/static/media/logo_white.d4b4414e.svg +0 -20
- zenml/zen_server/dashboard/static/media/notConnected.5e2c8ea7.svg +0 -8
- zenml/zen_server/dashboard/static/media/plugin-fallback.72c294e6.svg +0 -6
- zenml/zen_server/dashboard/static/media/share.bcd998b0.svg +0 -5
- zenml/zen_server/dashboard/static/media/stars.08a9b19a.svg +0 -8
- zenml/zen_server/deploy/terraform/__init__.py +0 -41
- zenml/zen_server/deploy/terraform/providers/__init__.py +0 -14
- zenml/zen_server/deploy/terraform/providers/aws_provider.py +0 -61
- zenml/zen_server/deploy/terraform/providers/azure_provider.py +0 -59
- zenml/zen_server/deploy/terraform/providers/gcp_provider.py +0 -59
- zenml/zen_server/deploy/terraform/providers/terraform_provider.py +0 -332
- zenml/zen_server/deploy/terraform/recipes/aws/.gitignore +0 -8
- zenml/zen_server/deploy/terraform/recipes/aws/helm.tf +0 -20
- zenml/zen_server/deploy/terraform/recipes/aws/ingress.tf +0 -30
- zenml/zen_server/deploy/terraform/recipes/aws/outputs.tf +0 -14
- zenml/zen_server/deploy/terraform/recipes/aws/printf.cmd +0 -2
- zenml/zen_server/deploy/terraform/recipes/aws/sql.tf +0 -62
- zenml/zen_server/deploy/terraform/recipes/aws/terraform.tf +0 -44
- zenml/zen_server/deploy/terraform/recipes/aws/variables.tf +0 -179
- zenml/zen_server/deploy/terraform/recipes/aws/vpc.tf +0 -47
- zenml/zen_server/deploy/terraform/recipes/aws/zen_server.tf +0 -111
- zenml/zen_server/deploy/terraform/recipes/azure/.gitignore +0 -8
- zenml/zen_server/deploy/terraform/recipes/azure/helm.tf +0 -20
- zenml/zen_server/deploy/terraform/recipes/azure/ingress.tf +0 -30
- zenml/zen_server/deploy/terraform/recipes/azure/key_vault.tf +0 -73
- zenml/zen_server/deploy/terraform/recipes/azure/outputs.tf +0 -14
- zenml/zen_server/deploy/terraform/recipes/azure/printf.cmd +0 -2
- zenml/zen_server/deploy/terraform/recipes/azure/rg.tf +0 -36
- zenml/zen_server/deploy/terraform/recipes/azure/sql.tf +0 -65
- zenml/zen_server/deploy/terraform/recipes/azure/terraform.tf +0 -52
- zenml/zen_server/deploy/terraform/recipes/azure/variables.tf +0 -188
- zenml/zen_server/deploy/terraform/recipes/azure/zen_server.tf +0 -111
- zenml/zen_server/deploy/terraform/recipes/gcp/.gitignore +0 -8
- zenml/zen_server/deploy/terraform/recipes/gcp/helm.tf +0 -20
- zenml/zen_server/deploy/terraform/recipes/gcp/ingress.tf +0 -30
- zenml/zen_server/deploy/terraform/recipes/gcp/outputs.tf +0 -14
- zenml/zen_server/deploy/terraform/recipes/gcp/printf.cmd +0 -2
- zenml/zen_server/deploy/terraform/recipes/gcp/sql.tf +0 -64
- zenml/zen_server/deploy/terraform/recipes/gcp/terraform.tf +0 -44
- zenml/zen_server/deploy/terraform/recipes/gcp/variables.tf +0 -183
- zenml/zen_server/deploy/terraform/recipes/gcp/zen_server.tf +0 -122
- zenml/zen_server/deploy/terraform/terraform_zen_server.py +0 -255
- zenml/zen_server/routers/run_metadata_endpoints.py +0 -97
- zenml_nightly-0.55.0.dev20240124.dist-info/METADATA +0 -438
- zenml_nightly-0.55.0.dev20240124.dist-info/RECORD +0 -1072
- {zenml_nightly-0.55.0.dev20240124.dist-info → zenml_nightly-0.72.0.dev20250116.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.55.0.dev20240124.dist-info → zenml_nightly-0.72.0.dev20250116.dist-info}/entry_points.txt +0 -0
zenml/client.py
CHANGED
@@ -13,11 +13,12 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Client implementation."""
|
15
15
|
|
16
|
+
import functools
|
16
17
|
import json
|
17
18
|
import os
|
18
19
|
from abc import ABCMeta
|
20
|
+
from collections import Counter
|
19
21
|
from datetime import datetime
|
20
|
-
from functools import partial
|
21
22
|
from pathlib import Path
|
22
23
|
from typing import (
|
23
24
|
TYPE_CHECKING,
|
@@ -35,9 +36,14 @@ from typing import (
|
|
35
36
|
)
|
36
37
|
from uuid import UUID, uuid4
|
37
38
|
|
38
|
-
from pydantic import SecretStr
|
39
|
+
from pydantic import ConfigDict, SecretStr
|
39
40
|
|
41
|
+
from zenml.client_lazy_loader import (
|
42
|
+
client_lazy_loader,
|
43
|
+
evaluate_all_lazy_load_args_in_client_methods,
|
44
|
+
)
|
40
45
|
from zenml.config.global_config import GlobalConfiguration
|
46
|
+
from zenml.config.pipeline_run_configuration import PipelineRunConfiguration
|
41
47
|
from zenml.config.source import Source
|
42
48
|
from zenml.constants import (
|
43
49
|
ENV_ZENML_ACTIVE_STACK_ID,
|
@@ -54,9 +60,10 @@ from zenml.constants import (
|
|
54
60
|
from zenml.enums import (
|
55
61
|
ArtifactType,
|
56
62
|
LogicalOperators,
|
57
|
-
MetadataResourceTypes,
|
58
63
|
ModelStages,
|
59
64
|
OAuthDeviceStatus,
|
65
|
+
PluginSubType,
|
66
|
+
PluginType,
|
60
67
|
SecretScope,
|
61
68
|
SorterOps,
|
62
69
|
StackComponentType,
|
@@ -73,6 +80,10 @@ from zenml.exceptions import (
|
|
73
80
|
from zenml.io import fileio
|
74
81
|
from zenml.logger import get_logger
|
75
82
|
from zenml.models import (
|
83
|
+
ActionFilter,
|
84
|
+
ActionRequest,
|
85
|
+
ActionResponse,
|
86
|
+
ActionUpdate,
|
76
87
|
APIKeyFilter,
|
77
88
|
APIKeyRequest,
|
78
89
|
APIKeyResponse,
|
@@ -84,7 +95,7 @@ from zenml.models import (
|
|
84
95
|
ArtifactVersionFilter,
|
85
96
|
ArtifactVersionResponse,
|
86
97
|
ArtifactVersionUpdate,
|
87
|
-
|
98
|
+
BaseIdentifiedResponse,
|
88
99
|
CodeRepositoryFilter,
|
89
100
|
CodeRepositoryRequest,
|
90
101
|
CodeRepositoryResponse,
|
@@ -93,8 +104,11 @@ from zenml.models import (
|
|
93
104
|
ComponentRequest,
|
94
105
|
ComponentResponse,
|
95
106
|
ComponentUpdate,
|
107
|
+
EventSourceFilter,
|
108
|
+
EventSourceRequest,
|
109
|
+
EventSourceResponse,
|
110
|
+
EventSourceUpdate,
|
96
111
|
FlavorFilter,
|
97
|
-
FlavorRequest,
|
98
112
|
FlavorResponse,
|
99
113
|
ModelFilter,
|
100
114
|
ModelRequest,
|
@@ -120,15 +134,20 @@ from zenml.models import (
|
|
120
134
|
PipelineResponse,
|
121
135
|
PipelineRunFilter,
|
122
136
|
PipelineRunResponse,
|
123
|
-
RunMetadataFilter,
|
124
137
|
RunMetadataRequest,
|
125
|
-
|
138
|
+
RunMetadataResource,
|
139
|
+
RunTemplateFilter,
|
140
|
+
RunTemplateRequest,
|
141
|
+
RunTemplateResponse,
|
142
|
+
RunTemplateUpdate,
|
126
143
|
ScheduleFilter,
|
127
144
|
ScheduleResponse,
|
128
145
|
SecretFilter,
|
129
146
|
SecretRequest,
|
130
147
|
SecretResponse,
|
131
148
|
SecretUpdate,
|
149
|
+
ServerSettingsResponse,
|
150
|
+
ServerSettingsUpdate,
|
132
151
|
ServiceAccountFilter,
|
133
152
|
ServiceAccountRequest,
|
134
153
|
ServiceAccountResponse,
|
@@ -139,6 +158,10 @@ from zenml.models import (
|
|
139
158
|
ServiceConnectorResponse,
|
140
159
|
ServiceConnectorTypeModel,
|
141
160
|
ServiceConnectorUpdate,
|
161
|
+
ServiceFilter,
|
162
|
+
ServiceRequest,
|
163
|
+
ServiceResponse,
|
164
|
+
ServiceUpdate,
|
142
165
|
StackFilter,
|
143
166
|
StackRequest,
|
144
167
|
StackResponse,
|
@@ -149,6 +172,12 @@ from zenml.models import (
|
|
149
172
|
TagRequest,
|
150
173
|
TagResponse,
|
151
174
|
TagUpdate,
|
175
|
+
TriggerExecutionFilter,
|
176
|
+
TriggerExecutionResponse,
|
177
|
+
TriggerFilter,
|
178
|
+
TriggerRequest,
|
179
|
+
TriggerResponse,
|
180
|
+
TriggerUpdate,
|
152
181
|
UserFilter,
|
153
182
|
UserRequest,
|
154
183
|
UserResponse,
|
@@ -158,7 +187,12 @@ from zenml.models import (
|
|
158
187
|
WorkspaceResponse,
|
159
188
|
WorkspaceUpdate,
|
160
189
|
)
|
190
|
+
from zenml.models.v2.core.step_run import StepRunUpdate
|
191
|
+
from zenml.services.service import ServiceConfig
|
192
|
+
from zenml.services.service_status import ServiceState
|
193
|
+
from zenml.services.service_type import ServiceType
|
161
194
|
from zenml.utils import io_utils, source_utils
|
195
|
+
from zenml.utils.dict_utils import dict_to_bytes
|
162
196
|
from zenml.utils.filesync_model import FileSyncModel
|
163
197
|
from zenml.utils.pagination_utils import depaginate
|
164
198
|
from zenml.utils.uuid_utils import is_valid_uuid
|
@@ -171,7 +205,8 @@ if TYPE_CHECKING:
|
|
171
205
|
|
172
206
|
logger = get_logger(__name__)
|
173
207
|
|
174
|
-
AnyResponse = TypeVar("AnyResponse", bound=
|
208
|
+
AnyResponse = TypeVar("AnyResponse", bound=BaseIdentifiedResponse) # type: ignore[type-arg]
|
209
|
+
F = TypeVar("F", bound=Callable[..., Any])
|
175
210
|
|
176
211
|
|
177
212
|
class ClientConfiguration(FileSyncModel):
|
@@ -219,18 +254,14 @@ class ClientConfiguration(FileSyncModel):
|
|
219
254
|
self.active_stack_id = stack.id
|
220
255
|
self._active_stack = stack
|
221
256
|
|
222
|
-
|
223
|
-
"""Pydantic configuration class."""
|
224
|
-
|
257
|
+
model_config = ConfigDict(
|
225
258
|
# Validate attributes when assigning them. We need to set this in order
|
226
259
|
# to have a mix of mutable and immutable attributes
|
227
|
-
validate_assignment
|
260
|
+
validate_assignment=True,
|
228
261
|
# Allow extra attributes from configs of previous ZenML versions to
|
229
262
|
# permit downgrading
|
230
|
-
extra
|
231
|
-
|
232
|
-
# are mutable and not included in serialization
|
233
|
-
underscore_attrs_are_private = True
|
263
|
+
extra="allow",
|
264
|
+
)
|
234
265
|
|
235
266
|
|
236
267
|
class ClientMetaClass(ABCMeta):
|
@@ -281,6 +312,30 @@ class ClientMetaClass(ABCMeta):
|
|
281
312
|
return cls._global_client
|
282
313
|
|
283
314
|
|
315
|
+
def _fail_for_sql_zen_store(method: F) -> F:
|
316
|
+
"""Decorator for methods that are not allowed with a SQLZenStore.
|
317
|
+
|
318
|
+
Args:
|
319
|
+
method: The method to decorate.
|
320
|
+
|
321
|
+
Returns:
|
322
|
+
The decorated method.
|
323
|
+
"""
|
324
|
+
|
325
|
+
@functools.wraps(method)
|
326
|
+
def wrapper(self: "Client", *args: Any, **kwargs: Any) -> Any:
|
327
|
+
# No isinstance check to avoid importing ZenStore implementations
|
328
|
+
if self.zen_store.__class__.__name__ == "SqlZenStore":
|
329
|
+
raise TypeError(
|
330
|
+
"This method is not allowed when not connected "
|
331
|
+
"to a ZenML Server through the API interface."
|
332
|
+
)
|
333
|
+
return method(self, *args, **kwargs)
|
334
|
+
|
335
|
+
return cast(F, wrapper)
|
336
|
+
|
337
|
+
|
338
|
+
@evaluate_all_lazy_load_args_in_client_methods
|
284
339
|
class Client(metaclass=ClientMetaClass):
|
285
340
|
"""ZenML client class.
|
286
341
|
|
@@ -289,6 +344,8 @@ class Client(metaclass=ClientMetaClass):
|
|
289
344
|
"""
|
290
345
|
|
291
346
|
_active_user: Optional["UserResponse"] = None
|
347
|
+
_active_workspace: Optional["WorkspaceResponse"] = None
|
348
|
+
_active_stack: Optional["StackResponse"] = None
|
292
349
|
|
293
350
|
def __init__(
|
294
351
|
self,
|
@@ -643,12 +700,62 @@ class Client(metaclass=ClientMetaClass):
|
|
643
700
|
GlobalConfiguration().set_active_workspace(workspace)
|
644
701
|
return workspace
|
645
702
|
|
703
|
+
# ----------------------------- Server Settings ----------------------------
|
704
|
+
|
705
|
+
def get_settings(self, hydrate: bool = True) -> ServerSettingsResponse:
|
706
|
+
"""Get the server settings.
|
707
|
+
|
708
|
+
Args:
|
709
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
710
|
+
by including metadata fields in the response.
|
711
|
+
|
712
|
+
Returns:
|
713
|
+
The server settings.
|
714
|
+
"""
|
715
|
+
return self.zen_store.get_server_settings(hydrate=hydrate)
|
716
|
+
|
717
|
+
def update_server_settings(
|
718
|
+
self,
|
719
|
+
updated_name: Optional[str] = None,
|
720
|
+
updated_logo_url: Optional[str] = None,
|
721
|
+
updated_enable_analytics: Optional[bool] = None,
|
722
|
+
updated_enable_announcements: Optional[bool] = None,
|
723
|
+
updated_enable_updates: Optional[bool] = None,
|
724
|
+
updated_onboarding_state: Optional[Dict[str, Any]] = None,
|
725
|
+
) -> ServerSettingsResponse:
|
726
|
+
"""Update the server settings.
|
727
|
+
|
728
|
+
Args:
|
729
|
+
updated_name: Updated name for the server.
|
730
|
+
updated_logo_url: Updated logo URL for the server.
|
731
|
+
updated_enable_analytics: Updated value whether to enable
|
732
|
+
analytics for the server.
|
733
|
+
updated_enable_announcements: Updated value whether to display
|
734
|
+
announcements about ZenML.
|
735
|
+
updated_enable_updates: Updated value whether to display updates
|
736
|
+
about ZenML.
|
737
|
+
updated_onboarding_state: Updated onboarding state for the server.
|
738
|
+
|
739
|
+
Returns:
|
740
|
+
The updated server settings.
|
741
|
+
"""
|
742
|
+
update_model = ServerSettingsUpdate(
|
743
|
+
server_name=updated_name,
|
744
|
+
logo_url=updated_logo_url,
|
745
|
+
enable_analytics=updated_enable_analytics,
|
746
|
+
display_announcements=updated_enable_announcements,
|
747
|
+
display_updates=updated_enable_updates,
|
748
|
+
onboarding_state=updated_onboarding_state,
|
749
|
+
)
|
750
|
+
return self.zen_store.update_server_settings(update_model)
|
751
|
+
|
646
752
|
# ---------------------------------- Users ---------------------------------
|
647
753
|
|
648
754
|
def create_user(
|
649
755
|
self,
|
650
756
|
name: str,
|
651
757
|
password: Optional[str] = None,
|
758
|
+
is_admin: bool = False,
|
652
759
|
) -> UserResponse:
|
653
760
|
"""Create a new user.
|
654
761
|
|
@@ -656,11 +763,14 @@ class Client(metaclass=ClientMetaClass):
|
|
656
763
|
name: The name of the user.
|
657
764
|
password: The password of the user. If not provided, the user will
|
658
765
|
be created with empty password.
|
766
|
+
is_admin: Whether the user should be an admin.
|
659
767
|
|
660
768
|
Returns:
|
661
769
|
The model of the created user.
|
662
770
|
"""
|
663
|
-
user = UserRequest(
|
771
|
+
user = UserRequest(
|
772
|
+
name=name, password=password or None, is_admin=is_admin
|
773
|
+
)
|
664
774
|
user.active = (
|
665
775
|
password != "" if self.zen_store.type != StoreType.REST else True
|
666
776
|
)
|
@@ -758,7 +868,11 @@ class Client(metaclass=ClientMetaClass):
|
|
758
868
|
updated_full_name: Optional[str] = None,
|
759
869
|
updated_email: Optional[str] = None,
|
760
870
|
updated_email_opt_in: Optional[bool] = None,
|
761
|
-
|
871
|
+
updated_password: Optional[str] = None,
|
872
|
+
old_password: Optional[str] = None,
|
873
|
+
updated_is_admin: Optional[bool] = None,
|
874
|
+
updated_metadata: Optional[Dict[str, Any]] = None,
|
875
|
+
active: Optional[bool] = None,
|
762
876
|
) -> UserResponse:
|
763
877
|
"""Update a user.
|
764
878
|
|
@@ -768,10 +882,19 @@ class Client(metaclass=ClientMetaClass):
|
|
768
882
|
updated_full_name: The new full name of the user.
|
769
883
|
updated_email: The new email of the user.
|
770
884
|
updated_email_opt_in: The new email opt-in status of the user.
|
771
|
-
|
885
|
+
updated_password: The new password of the user.
|
886
|
+
old_password: The old password of the user. Required for password
|
887
|
+
update.
|
888
|
+
updated_is_admin: Whether the user should be an admin.
|
889
|
+
updated_metadata: The new metadata for the user.
|
890
|
+
active: Use to activate or deactivate the user.
|
772
891
|
|
773
892
|
Returns:
|
774
893
|
The updated user.
|
894
|
+
|
895
|
+
Raises:
|
896
|
+
ValidationError: If the old password is not provided when updating
|
897
|
+
the password.
|
775
898
|
"""
|
776
899
|
user = self.get_user(
|
777
900
|
name_id_or_prefix=name_id_or_prefix, allow_name_prefix_match=False
|
@@ -786,13 +909,41 @@ class Client(metaclass=ClientMetaClass):
|
|
786
909
|
)
|
787
910
|
if updated_email_opt_in is not None:
|
788
911
|
user_update.email_opted_in = updated_email_opt_in
|
789
|
-
if
|
790
|
-
user_update.
|
912
|
+
if updated_password is not None:
|
913
|
+
user_update.password = updated_password
|
914
|
+
if old_password is None:
|
915
|
+
raise ValidationError(
|
916
|
+
"Old password is required to update the password."
|
917
|
+
)
|
918
|
+
user_update.old_password = old_password
|
919
|
+
if updated_is_admin is not None:
|
920
|
+
user_update.is_admin = updated_is_admin
|
921
|
+
if active is not None:
|
922
|
+
user_update.active = active
|
923
|
+
|
924
|
+
if updated_metadata is not None:
|
925
|
+
user_update.user_metadata = updated_metadata
|
791
926
|
|
792
927
|
return self.zen_store.update_user(
|
793
928
|
user_id=user.id, user_update=user_update
|
794
929
|
)
|
795
930
|
|
931
|
+
@_fail_for_sql_zen_store
|
932
|
+
def deactivate_user(self, name_id_or_prefix: str) -> "UserResponse":
|
933
|
+
"""Deactivate a user and generate an activation token.
|
934
|
+
|
935
|
+
Args:
|
936
|
+
name_id_or_prefix: The name or ID of the user to reset.
|
937
|
+
|
938
|
+
Returns:
|
939
|
+
The deactivated user.
|
940
|
+
"""
|
941
|
+
from zenml.zen_stores.rest_zen_store import RestZenStore
|
942
|
+
|
943
|
+
user = self.get_user(name_id_or_prefix, allow_name_prefix_match=False)
|
944
|
+
assert isinstance(self.zen_store, RestZenStore)
|
945
|
+
return self.zen_store.deactivate_user(user_name_or_id=user.name)
|
946
|
+
|
796
947
|
def delete_user(self, name_id_or_prefix: str) -> None:
|
797
948
|
"""Delete a user.
|
798
949
|
|
@@ -962,9 +1113,13 @@ class Client(metaclass=ClientMetaClass):
|
|
962
1113
|
Raises:
|
963
1114
|
RuntimeError: If the active workspace is not set.
|
964
1115
|
"""
|
965
|
-
if
|
966
|
-
|
967
|
-
|
1116
|
+
if workspace_id := os.environ.get(ENV_ZENML_ACTIVE_WORKSPACE_ID):
|
1117
|
+
if not self._active_workspace or self._active_workspace.id != UUID(
|
1118
|
+
workspace_id
|
1119
|
+
):
|
1120
|
+
self._active_workspace = self.get_workspace(workspace_id)
|
1121
|
+
|
1122
|
+
return self._active_workspace
|
968
1123
|
|
969
1124
|
from zenml.constants import DEFAULT_WORKSPACE_NAME
|
970
1125
|
|
@@ -1001,6 +1156,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1001
1156
|
name: str,
|
1002
1157
|
components: Mapping[StackComponentType, Union[str, UUID]],
|
1003
1158
|
stack_spec_file: Optional[str] = None,
|
1159
|
+
labels: Optional[Dict[str, Any]] = None,
|
1004
1160
|
) -> StackResponse:
|
1005
1161
|
"""Registers a stack and its components.
|
1006
1162
|
|
@@ -1008,6 +1164,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1008
1164
|
name: The name of the stack to register.
|
1009
1165
|
components: dictionary which maps component types to component names
|
1010
1166
|
stack_spec_file: path to the stack spec file
|
1167
|
+
labels: The labels of the stack.
|
1011
1168
|
|
1012
1169
|
Returns:
|
1013
1170
|
The model of the registered stack.
|
@@ -1032,6 +1189,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1032
1189
|
stack_spec_path=stack_spec_file,
|
1033
1190
|
workspace=self.active_workspace.id,
|
1034
1191
|
user=self.active_user.id,
|
1192
|
+
labels=labels,
|
1035
1193
|
)
|
1036
1194
|
|
1037
1195
|
self._validate_stack_configuration(stack=stack)
|
@@ -1075,13 +1233,15 @@ class Client(metaclass=ClientMetaClass):
|
|
1075
1233
|
size: int = PAGE_SIZE_DEFAULT,
|
1076
1234
|
logical_operator: LogicalOperators = LogicalOperators.AND,
|
1077
1235
|
id: Optional[Union[UUID, str]] = None,
|
1078
|
-
created: Optional[datetime] = None,
|
1079
|
-
updated: Optional[datetime] = None,
|
1236
|
+
created: Optional[Union[datetime, str]] = None,
|
1237
|
+
updated: Optional[Union[datetime, str]] = None,
|
1080
1238
|
name: Optional[str] = None,
|
1081
1239
|
description: Optional[str] = None,
|
1082
1240
|
workspace_id: Optional[Union[str, UUID]] = None,
|
1083
1241
|
user_id: Optional[Union[str, UUID]] = None,
|
1084
1242
|
component_id: Optional[Union[str, UUID]] = None,
|
1243
|
+
user: Optional[Union[UUID, str]] = None,
|
1244
|
+
component: Optional[Union[UUID, str]] = None,
|
1085
1245
|
hydrate: bool = False,
|
1086
1246
|
) -> Page[StackResponse]:
|
1087
1247
|
"""Lists all stacks.
|
@@ -1098,6 +1258,8 @@ class Client(metaclass=ClientMetaClass):
|
|
1098
1258
|
workspace_id: The id of the workspace to filter by.
|
1099
1259
|
user_id: The id of the user to filter by.
|
1100
1260
|
component_id: The id of the component to filter by.
|
1261
|
+
user: The name/ID of the user to filter by.
|
1262
|
+
component: The name/ID of the component to filter by.
|
1101
1263
|
name: The name of the stack to filter by.
|
1102
1264
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
1103
1265
|
by including metadata fields in the response.
|
@@ -1113,6 +1275,8 @@ class Client(metaclass=ClientMetaClass):
|
|
1113
1275
|
workspace_id=workspace_id,
|
1114
1276
|
user_id=user_id,
|
1115
1277
|
component_id=component_id,
|
1278
|
+
user=user,
|
1279
|
+
component=component,
|
1116
1280
|
name=name,
|
1117
1281
|
description=description,
|
1118
1282
|
id=id,
|
@@ -1127,6 +1291,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1127
1291
|
name_id_or_prefix: Optional[Union[UUID, str]] = None,
|
1128
1292
|
name: Optional[str] = None,
|
1129
1293
|
stack_spec_file: Optional[str] = None,
|
1294
|
+
labels: Optional[Dict[str, Any]] = None,
|
1130
1295
|
description: Optional[str] = None,
|
1131
1296
|
component_updates: Optional[
|
1132
1297
|
Dict[StackComponentType, List[Union[UUID, str]]]
|
@@ -1137,7 +1302,8 @@ class Client(metaclass=ClientMetaClass):
|
|
1137
1302
|
Args:
|
1138
1303
|
name_id_or_prefix: The name, id or prefix of the stack to update.
|
1139
1304
|
name: the new name of the stack.
|
1140
|
-
stack_spec_file: path to the stack spec file
|
1305
|
+
stack_spec_file: path to the stack spec file.
|
1306
|
+
labels: The new labels of the stack component.
|
1141
1307
|
description: the new description of the stack.
|
1142
1308
|
component_updates: dictionary which maps stack component types to
|
1143
1309
|
lists of new stack component names or ids.
|
@@ -1154,7 +1320,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1154
1320
|
)
|
1155
1321
|
|
1156
1322
|
# Create the update model
|
1157
|
-
update_model = StackUpdate(
|
1323
|
+
update_model = StackUpdate(
|
1158
1324
|
workspace=self.active_workspace.id,
|
1159
1325
|
user=self.active_user.id,
|
1160
1326
|
stack_spec_path=stack_spec_file,
|
@@ -1191,6 +1357,15 @@ class Client(metaclass=ClientMetaClass):
|
|
1191
1357
|
for c_type, c_list in components_dict.items()
|
1192
1358
|
}
|
1193
1359
|
|
1360
|
+
if labels is not None:
|
1361
|
+
existing_labels = stack.labels or {}
|
1362
|
+
existing_labels.update(labels)
|
1363
|
+
|
1364
|
+
existing_labels = {
|
1365
|
+
k: v for k, v in existing_labels.items() if v is not None
|
1366
|
+
}
|
1367
|
+
update_model.labels = existing_labels
|
1368
|
+
|
1194
1369
|
updated_stack = self.zen_store.update_stack(
|
1195
1370
|
stack_id=stack.id,
|
1196
1371
|
stack_update=update_model,
|
@@ -1294,8 +1469,13 @@ class Client(metaclass=ClientMetaClass):
|
|
1294
1469
|
Raises:
|
1295
1470
|
RuntimeError: If the active stack is not set.
|
1296
1471
|
"""
|
1297
|
-
if
|
1298
|
-
|
1472
|
+
if env_stack_id := os.environ.get(ENV_ZENML_ACTIVE_STACK_ID):
|
1473
|
+
if not self._active_stack or self._active_stack.id != UUID(
|
1474
|
+
env_stack_id
|
1475
|
+
):
|
1476
|
+
self._active_stack = self.get_stack(env_stack_id)
|
1477
|
+
|
1478
|
+
return self._active_stack
|
1299
1479
|
|
1300
1480
|
stack_id: Optional[UUID] = None
|
1301
1481
|
|
@@ -1357,25 +1537,25 @@ class Client(metaclass=ClientMetaClass):
|
|
1357
1537
|
stack: The stack to validate.
|
1358
1538
|
|
1359
1539
|
Raises:
|
1360
|
-
KeyError: If the stack references missing components.
|
1361
1540
|
ValidationError: If the stack configuration is invalid.
|
1362
1541
|
"""
|
1363
1542
|
local_components: List[str] = []
|
1364
1543
|
remote_components: List[str] = []
|
1365
1544
|
assert stack.components is not None
|
1366
|
-
for component_type,
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1545
|
+
for component_type, components in stack.components.items():
|
1546
|
+
component_flavor: Union[FlavorResponse, str]
|
1547
|
+
|
1548
|
+
for component in components:
|
1549
|
+
if isinstance(component, UUID):
|
1550
|
+
component_response = self.get_stack_component(
|
1551
|
+
name_id_or_prefix=component,
|
1371
1552
|
component_type=component_type,
|
1372
1553
|
)
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
) from e
|
1554
|
+
component_config = component_response.configuration
|
1555
|
+
component_flavor = component_response.flavor
|
1556
|
+
else:
|
1557
|
+
component_config = component.configuration
|
1558
|
+
component_flavor = component.flavor
|
1379
1559
|
|
1380
1560
|
# Create and validate the configuration
|
1381
1561
|
from zenml.stack.utils import (
|
@@ -1384,9 +1564,9 @@ class Client(metaclass=ClientMetaClass):
|
|
1384
1564
|
)
|
1385
1565
|
|
1386
1566
|
configuration = validate_stack_component_config(
|
1387
|
-
configuration_dict=
|
1388
|
-
|
1389
|
-
component_type=
|
1567
|
+
configuration_dict=component_config,
|
1568
|
+
flavor=component_flavor,
|
1569
|
+
component_type=component_type,
|
1390
1570
|
# Always enforce validation of custom flavors
|
1391
1571
|
validate_custom_flavors=True,
|
1392
1572
|
)
|
@@ -1394,13 +1574,18 @@ class Client(metaclass=ClientMetaClass):
|
|
1394
1574
|
# `validate_custom_flavors=True` above
|
1395
1575
|
assert configuration is not None
|
1396
1576
|
warn_if_config_server_mismatch(configuration)
|
1577
|
+
flavor_name = (
|
1578
|
+
component_flavor.name
|
1579
|
+
if isinstance(component_flavor, FlavorResponse)
|
1580
|
+
else component_flavor
|
1581
|
+
)
|
1397
1582
|
if configuration.is_local:
|
1398
1583
|
local_components.append(
|
1399
|
-
f"{
|
1584
|
+
f"{component_type.value}: {flavor_name}"
|
1400
1585
|
)
|
1401
1586
|
elif configuration.is_remote:
|
1402
1587
|
remote_components.append(
|
1403
|
-
f"{
|
1588
|
+
f"{component_type.value}: {flavor_name}"
|
1404
1589
|
)
|
1405
1590
|
|
1406
1591
|
if local_components and remote_components:
|
@@ -1424,6 +1609,230 @@ class Client(metaclass=ClientMetaClass):
|
|
1424
1609
|
"an Orchestrator."
|
1425
1610
|
)
|
1426
1611
|
|
1612
|
+
# ----------------------------- Services -----------------------------------
|
1613
|
+
|
1614
|
+
def create_service(
|
1615
|
+
self,
|
1616
|
+
config: ServiceConfig,
|
1617
|
+
service_type: ServiceType,
|
1618
|
+
model_version_id: Optional[UUID] = None,
|
1619
|
+
) -> ServiceResponse:
|
1620
|
+
"""Registers a service.
|
1621
|
+
|
1622
|
+
Args:
|
1623
|
+
config: The configuration of the service.
|
1624
|
+
service_type: The type of the service.
|
1625
|
+
model_version_id: The ID of the model version to associate with the
|
1626
|
+
service.
|
1627
|
+
|
1628
|
+
Returns:
|
1629
|
+
The registered service.
|
1630
|
+
"""
|
1631
|
+
service_request = ServiceRequest(
|
1632
|
+
name=config.service_name,
|
1633
|
+
service_type=service_type,
|
1634
|
+
config=config.model_dump(),
|
1635
|
+
workspace=self.active_workspace.id,
|
1636
|
+
user=self.active_user.id,
|
1637
|
+
model_version_id=model_version_id,
|
1638
|
+
)
|
1639
|
+
# Register the service
|
1640
|
+
return self.zen_store.create_service(service_request)
|
1641
|
+
|
1642
|
+
def get_service(
|
1643
|
+
self,
|
1644
|
+
name_id_or_prefix: Union[str, UUID],
|
1645
|
+
allow_name_prefix_match: bool = True,
|
1646
|
+
hydrate: bool = True,
|
1647
|
+
type: Optional[str] = None,
|
1648
|
+
) -> ServiceResponse:
|
1649
|
+
"""Gets a service.
|
1650
|
+
|
1651
|
+
Args:
|
1652
|
+
name_id_or_prefix: The name or ID of the service.
|
1653
|
+
allow_name_prefix_match: If True, allow matching by name prefix.
|
1654
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
1655
|
+
by including metadata fields in the response.
|
1656
|
+
type: The type of the service.
|
1657
|
+
|
1658
|
+
Returns:
|
1659
|
+
The Service
|
1660
|
+
"""
|
1661
|
+
|
1662
|
+
def type_scoped_list_method(
|
1663
|
+
hydrate: bool = True,
|
1664
|
+
**kwargs: Any,
|
1665
|
+
) -> Page[ServiceResponse]:
|
1666
|
+
"""Call `zen_store.list_services` with type scoping.
|
1667
|
+
|
1668
|
+
Args:
|
1669
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
1670
|
+
by including metadata fields in the response.
|
1671
|
+
**kwargs: Keyword arguments to pass to `ServiceFilterModel`.
|
1672
|
+
|
1673
|
+
Returns:
|
1674
|
+
The type-scoped list of services.
|
1675
|
+
"""
|
1676
|
+
service_filter_model = ServiceFilter(**kwargs)
|
1677
|
+
if type:
|
1678
|
+
service_filter_model.set_type(type=type)
|
1679
|
+
service_filter_model.set_scope_workspace(self.active_workspace.id)
|
1680
|
+
return self.zen_store.list_services(
|
1681
|
+
filter_model=service_filter_model,
|
1682
|
+
hydrate=hydrate,
|
1683
|
+
)
|
1684
|
+
|
1685
|
+
return self._get_entity_by_id_or_name_or_prefix(
|
1686
|
+
get_method=self.zen_store.get_service,
|
1687
|
+
list_method=type_scoped_list_method,
|
1688
|
+
name_id_or_prefix=name_id_or_prefix,
|
1689
|
+
allow_name_prefix_match=allow_name_prefix_match,
|
1690
|
+
hydrate=hydrate,
|
1691
|
+
)
|
1692
|
+
|
1693
|
+
def list_services(
|
1694
|
+
self,
|
1695
|
+
sort_by: str = "created",
|
1696
|
+
page: int = PAGINATION_STARTING_PAGE,
|
1697
|
+
size: int = PAGE_SIZE_DEFAULT,
|
1698
|
+
logical_operator: LogicalOperators = LogicalOperators.AND,
|
1699
|
+
id: Optional[Union[UUID, str]] = None,
|
1700
|
+
created: Optional[datetime] = None,
|
1701
|
+
updated: Optional[datetime] = None,
|
1702
|
+
type: Optional[str] = None,
|
1703
|
+
flavor: Optional[str] = None,
|
1704
|
+
user: Optional[Union[UUID, str]] = None,
|
1705
|
+
workspace_id: Optional[Union[str, UUID]] = None,
|
1706
|
+
user_id: Optional[Union[str, UUID]] = None,
|
1707
|
+
hydrate: bool = False,
|
1708
|
+
running: Optional[bool] = None,
|
1709
|
+
service_name: Optional[str] = None,
|
1710
|
+
pipeline_name: Optional[str] = None,
|
1711
|
+
pipeline_run_id: Optional[str] = None,
|
1712
|
+
pipeline_step_name: Optional[str] = None,
|
1713
|
+
model_version_id: Optional[Union[str, UUID]] = None,
|
1714
|
+
config: Optional[Dict[str, Any]] = None,
|
1715
|
+
) -> Page[ServiceResponse]:
|
1716
|
+
"""List all services.
|
1717
|
+
|
1718
|
+
Args:
|
1719
|
+
sort_by: The column to sort by
|
1720
|
+
page: The page of items
|
1721
|
+
size: The maximum size of all pages
|
1722
|
+
logical_operator: Which logical operator to use [and, or]
|
1723
|
+
id: Use the id of services to filter by.
|
1724
|
+
created: Use to filter by time of creation
|
1725
|
+
updated: Use the last updated date for filtering
|
1726
|
+
type: Use the service type for filtering
|
1727
|
+
flavor: Use the service flavor for filtering
|
1728
|
+
workspace_id: The id of the workspace to filter by.
|
1729
|
+
user_id: The id of the user to filter by.
|
1730
|
+
user: Filter by user name/ID.
|
1731
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
1732
|
+
by including metadata fields in the response.
|
1733
|
+
running: Use the running status for filtering
|
1734
|
+
pipeline_name: Use the pipeline name for filtering
|
1735
|
+
service_name: Use the service name or model name
|
1736
|
+
for filtering
|
1737
|
+
pipeline_step_name: Use the pipeline step name for filtering
|
1738
|
+
model_version_id: Use the model version id for filtering
|
1739
|
+
config: Use the config for filtering
|
1740
|
+
pipeline_run_id: Use the pipeline run id for filtering
|
1741
|
+
|
1742
|
+
Returns:
|
1743
|
+
The Service response page.
|
1744
|
+
"""
|
1745
|
+
service_filter_model = ServiceFilter(
|
1746
|
+
sort_by=sort_by,
|
1747
|
+
page=page,
|
1748
|
+
size=size,
|
1749
|
+
logical_operator=logical_operator,
|
1750
|
+
id=id,
|
1751
|
+
created=created,
|
1752
|
+
updated=updated,
|
1753
|
+
type=type,
|
1754
|
+
flavor=flavor,
|
1755
|
+
workspace_id=workspace_id,
|
1756
|
+
user_id=user_id,
|
1757
|
+
user=user,
|
1758
|
+
running=running,
|
1759
|
+
name=service_name,
|
1760
|
+
pipeline_name=pipeline_name,
|
1761
|
+
pipeline_step_name=pipeline_step_name,
|
1762
|
+
model_version_id=model_version_id,
|
1763
|
+
pipeline_run_id=pipeline_run_id,
|
1764
|
+
config=dict_to_bytes(config) if config else None,
|
1765
|
+
)
|
1766
|
+
service_filter_model.set_scope_workspace(self.active_workspace.id)
|
1767
|
+
return self.zen_store.list_services(
|
1768
|
+
filter_model=service_filter_model, hydrate=hydrate
|
1769
|
+
)
|
1770
|
+
|
1771
|
+
def update_service(
|
1772
|
+
self,
|
1773
|
+
id: UUID,
|
1774
|
+
name: Optional[str] = None,
|
1775
|
+
service_source: Optional[str] = None,
|
1776
|
+
admin_state: Optional[ServiceState] = None,
|
1777
|
+
status: Optional[Dict[str, Any]] = None,
|
1778
|
+
endpoint: Optional[Dict[str, Any]] = None,
|
1779
|
+
labels: Optional[Dict[str, str]] = None,
|
1780
|
+
prediction_url: Optional[str] = None,
|
1781
|
+
health_check_url: Optional[str] = None,
|
1782
|
+
model_version_id: Optional[UUID] = None,
|
1783
|
+
) -> ServiceResponse:
|
1784
|
+
"""Update a service.
|
1785
|
+
|
1786
|
+
Args:
|
1787
|
+
id: The ID of the service to update.
|
1788
|
+
name: The new name of the service.
|
1789
|
+
admin_state: The new admin state of the service.
|
1790
|
+
status: The new status of the service.
|
1791
|
+
endpoint: The new endpoint of the service.
|
1792
|
+
service_source: The new service source of the service.
|
1793
|
+
labels: The new labels of the service.
|
1794
|
+
prediction_url: The new prediction url of the service.
|
1795
|
+
health_check_url: The new health check url of the service.
|
1796
|
+
model_version_id: The new model version id of the service.
|
1797
|
+
|
1798
|
+
Returns:
|
1799
|
+
The updated service.
|
1800
|
+
"""
|
1801
|
+
service_update = ServiceUpdate()
|
1802
|
+
if name:
|
1803
|
+
service_update.name = name
|
1804
|
+
if service_source:
|
1805
|
+
service_update.service_source = service_source
|
1806
|
+
if admin_state:
|
1807
|
+
service_update.admin_state = admin_state
|
1808
|
+
if status:
|
1809
|
+
service_update.status = status
|
1810
|
+
if endpoint:
|
1811
|
+
service_update.endpoint = endpoint
|
1812
|
+
if labels:
|
1813
|
+
service_update.labels = labels
|
1814
|
+
if prediction_url:
|
1815
|
+
service_update.prediction_url = prediction_url
|
1816
|
+
if health_check_url:
|
1817
|
+
service_update.health_check_url = health_check_url
|
1818
|
+
if model_version_id:
|
1819
|
+
service_update.model_version_id = model_version_id
|
1820
|
+
return self.zen_store.update_service(
|
1821
|
+
service_id=id, update=service_update
|
1822
|
+
)
|
1823
|
+
|
1824
|
+
def delete_service(self, name_id_or_prefix: UUID) -> None:
|
1825
|
+
"""Delete a service.
|
1826
|
+
|
1827
|
+
Args:
|
1828
|
+
name_id_or_prefix: The name or ID of the service to delete.
|
1829
|
+
"""
|
1830
|
+
service = self.get_service(
|
1831
|
+
name_id_or_prefix,
|
1832
|
+
allow_name_prefix_match=False,
|
1833
|
+
)
|
1834
|
+
self.zen_store.delete_service(service_id=service.id)
|
1835
|
+
|
1427
1836
|
# -------------------------------- Components ------------------------------
|
1428
1837
|
|
1429
1838
|
def get_stack_component(
|
@@ -1516,6 +1925,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1516
1925
|
user_id: Optional[Union[str, UUID]] = None,
|
1517
1926
|
connector_id: Optional[Union[str, UUID]] = None,
|
1518
1927
|
stack_id: Optional[Union[str, UUID]] = None,
|
1928
|
+
user: Optional[Union[UUID, str]] = None,
|
1519
1929
|
hydrate: bool = False,
|
1520
1930
|
) -> Page[ComponentResponse]:
|
1521
1931
|
"""Lists all registered stack components.
|
@@ -1535,6 +1945,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1535
1945
|
connector_id: The id of the connector to filter by.
|
1536
1946
|
stack_id: The id of the stack to filter by.
|
1537
1947
|
name: The name of the component to filter by.
|
1948
|
+
user: The ID of name of the user to filter by.
|
1538
1949
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
1539
1950
|
by including metadata fields in the response.
|
1540
1951
|
|
@@ -1556,6 +1967,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1556
1967
|
id=id,
|
1557
1968
|
created=created,
|
1558
1969
|
updated=updated,
|
1970
|
+
user=user,
|
1559
1971
|
)
|
1560
1972
|
component_filter_model.set_scope_workspace(self.active_workspace.id)
|
1561
1973
|
|
@@ -1569,7 +1981,6 @@ class Client(metaclass=ClientMetaClass):
|
|
1569
1981
|
flavor: str,
|
1570
1982
|
component_type: StackComponentType,
|
1571
1983
|
configuration: Dict[str, str],
|
1572
|
-
component_spec_path: Optional[str] = None,
|
1573
1984
|
labels: Optional[Dict[str, Any]] = None,
|
1574
1985
|
) -> "ComponentResponse":
|
1575
1986
|
"""Registers a stack component.
|
@@ -1577,7 +1988,6 @@ class Client(metaclass=ClientMetaClass):
|
|
1577
1988
|
Args:
|
1578
1989
|
name: The name of the stack component.
|
1579
1990
|
flavor: The flavor of the stack component.
|
1580
|
-
component_spec_path: The path to the stack spec file.
|
1581
1991
|
component_type: The type of the stack component.
|
1582
1992
|
configuration: The configuration of the stack component.
|
1583
1993
|
labels: The labels of the stack component.
|
@@ -1592,7 +2002,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1592
2002
|
|
1593
2003
|
validated_config = validate_stack_component_config(
|
1594
2004
|
configuration_dict=configuration,
|
1595
|
-
|
2005
|
+
flavor=flavor,
|
1596
2006
|
component_type=component_type,
|
1597
2007
|
# Always enforce validation of custom flavors
|
1598
2008
|
validate_custom_flavors=True,
|
@@ -1606,7 +2016,6 @@ class Client(metaclass=ClientMetaClass):
|
|
1606
2016
|
name=name,
|
1607
2017
|
type=component_type,
|
1608
2018
|
flavor=flavor,
|
1609
|
-
component_spec_path=component_spec_path,
|
1610
2019
|
configuration=configuration,
|
1611
2020
|
user=self.active_user.id,
|
1612
2021
|
workspace=self.active_workspace.id,
|
@@ -1623,7 +2032,6 @@ class Client(metaclass=ClientMetaClass):
|
|
1623
2032
|
name_id_or_prefix: Optional[Union[UUID, str]],
|
1624
2033
|
component_type: StackComponentType,
|
1625
2034
|
name: Optional[str] = None,
|
1626
|
-
component_spec_path: Optional[str] = None,
|
1627
2035
|
configuration: Optional[Dict[str, Any]] = None,
|
1628
2036
|
labels: Optional[Dict[str, Any]] = None,
|
1629
2037
|
disconnect: Optional[bool] = None,
|
@@ -1637,7 +2045,6 @@ class Client(metaclass=ClientMetaClass):
|
|
1637
2045
|
update.
|
1638
2046
|
component_type: The type of the stack component to update.
|
1639
2047
|
name: The new name of the stack component.
|
1640
|
-
component_spec_path: The new path to the stack spec file.
|
1641
2048
|
configuration: The new configuration of the stack component.
|
1642
2049
|
labels: The new labels of the stack component.
|
1643
2050
|
disconnect: Whether to disconnect the stack component from its
|
@@ -1659,10 +2066,9 @@ class Client(metaclass=ClientMetaClass):
|
|
1659
2066
|
allow_name_prefix_match=False,
|
1660
2067
|
)
|
1661
2068
|
|
1662
|
-
update_model = ComponentUpdate(
|
2069
|
+
update_model = ComponentUpdate(
|
1663
2070
|
workspace=self.active_workspace.id,
|
1664
2071
|
user=self.active_user.id,
|
1665
|
-
component_spec_path=component_spec_path,
|
1666
2072
|
)
|
1667
2073
|
|
1668
2074
|
if name is not None:
|
@@ -1693,7 +2099,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1693
2099
|
|
1694
2100
|
validated_config = validate_stack_component_config(
|
1695
2101
|
configuration_dict=existing_configuration,
|
1696
|
-
|
2102
|
+
flavor=component.flavor,
|
1697
2103
|
component_type=component.type,
|
1698
2104
|
# Always enforce validation of custom flavors
|
1699
2105
|
validate_custom_flavors=True,
|
@@ -1794,17 +2200,8 @@ class Client(metaclass=ClientMetaClass):
|
|
1794
2200
|
"configuration class' docstring."
|
1795
2201
|
)
|
1796
2202
|
|
1797
|
-
|
1798
|
-
|
1799
|
-
type=flavor.type,
|
1800
|
-
name=flavor.name,
|
1801
|
-
config_schema=flavor.config_schema,
|
1802
|
-
integration="custom",
|
1803
|
-
user=self.active_user.id,
|
1804
|
-
workspace=self.active_workspace.id,
|
1805
|
-
)
|
1806
|
-
|
1807
|
-
return self.zen_store.create_flavor(flavor=create_flavor_request)
|
2203
|
+
flavor_request = flavor.to_model(integration="custom", is_custom=True)
|
2204
|
+
return self.zen_store.create_flavor(flavor=flavor_request)
|
1808
2205
|
|
1809
2206
|
def get_flavor(
|
1810
2207
|
self,
|
@@ -1845,6 +2242,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1845
2242
|
type: Optional[str] = None,
|
1846
2243
|
integration: Optional[str] = None,
|
1847
2244
|
user_id: Optional[Union[str, UUID]] = None,
|
2245
|
+
user: Optional[Union[UUID, str]] = None,
|
1848
2246
|
hydrate: bool = False,
|
1849
2247
|
) -> Page[FlavorResponse]:
|
1850
2248
|
"""Fetches all the flavor models.
|
@@ -1858,6 +2256,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1858
2256
|
created: Use to flavors by time of creation
|
1859
2257
|
updated: Use the last updated date for filtering
|
1860
2258
|
user_id: The id of the user to filter by.
|
2259
|
+
user: Filter by user name/ID.
|
1861
2260
|
name: The name of the flavor to filter by.
|
1862
2261
|
type: The type of the flavor to filter by.
|
1863
2262
|
integration: The integration of the flavor to filter by.
|
@@ -1873,6 +2272,7 @@ class Client(metaclass=ClientMetaClass):
|
|
1873
2272
|
sort_by=sort_by,
|
1874
2273
|
logical_operator=logical_operator,
|
1875
2274
|
user_id=user_id,
|
2275
|
+
user=user,
|
1876
2276
|
name=name,
|
1877
2277
|
type=type,
|
1878
2278
|
integration=integration,
|
@@ -1964,11 +2364,11 @@ class Client(metaclass=ClientMetaClass):
|
|
1964
2364
|
created: Optional[Union[datetime, str]] = None,
|
1965
2365
|
updated: Optional[Union[datetime, str]] = None,
|
1966
2366
|
name: Optional[str] = None,
|
1967
|
-
|
1968
|
-
version_hash: Optional[str] = None,
|
1969
|
-
docstring: Optional[str] = None,
|
2367
|
+
latest_run_status: Optional[str] = None,
|
1970
2368
|
workspace_id: Optional[Union[str, UUID]] = None,
|
1971
2369
|
user_id: Optional[Union[str, UUID]] = None,
|
2370
|
+
user: Optional[Union[UUID, str]] = None,
|
2371
|
+
tag: Optional[str] = None,
|
1972
2372
|
hydrate: bool = False,
|
1973
2373
|
) -> Page[PipelineResponse]:
|
1974
2374
|
"""List all pipelines.
|
@@ -1982,11 +2382,12 @@ class Client(metaclass=ClientMetaClass):
|
|
1982
2382
|
created: Use to filter by time of creation
|
1983
2383
|
updated: Use the last updated date for filtering
|
1984
2384
|
name: The name of the pipeline to filter by.
|
1985
|
-
|
1986
|
-
|
1987
|
-
docstring: The docstring of the pipeline to filter by.
|
2385
|
+
latest_run_status: Filter by the status of the latest run of a
|
2386
|
+
pipeline.
|
1988
2387
|
workspace_id: The id of the workspace to filter by.
|
1989
2388
|
user_id: The id of the user to filter by.
|
2389
|
+
user: The name/ID of the user to filter by.
|
2390
|
+
tag: Tag to filter by.
|
1990
2391
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
1991
2392
|
by including metadata fields in the response.
|
1992
2393
|
|
@@ -2002,11 +2403,11 @@ class Client(metaclass=ClientMetaClass):
|
|
2002
2403
|
created=created,
|
2003
2404
|
updated=updated,
|
2004
2405
|
name=name,
|
2005
|
-
|
2006
|
-
version_hash=version_hash,
|
2007
|
-
docstring=docstring,
|
2406
|
+
latest_run_status=latest_run_status,
|
2008
2407
|
workspace_id=workspace_id,
|
2009
2408
|
user_id=user_id,
|
2409
|
+
user=user,
|
2410
|
+
tag=tag,
|
2010
2411
|
)
|
2011
2412
|
pipeline_filter_model.set_scope_workspace(self.active_workspace.id)
|
2012
2413
|
return self.zen_store.list_pipelines(
|
@@ -2017,46 +2418,176 @@ class Client(metaclass=ClientMetaClass):
|
|
2017
2418
|
def get_pipeline(
|
2018
2419
|
self,
|
2019
2420
|
name_id_or_prefix: Union[str, UUID],
|
2020
|
-
version: Optional[str] = None,
|
2021
2421
|
hydrate: bool = True,
|
2022
2422
|
) -> PipelineResponse:
|
2023
2423
|
"""Get a pipeline by name, id or prefix.
|
2024
2424
|
|
2025
2425
|
Args:
|
2026
2426
|
name_id_or_prefix: The name, ID or ID prefix of the pipeline.
|
2027
|
-
version: The pipeline version. If not specified, the latest
|
2028
|
-
version is returned.
|
2029
2427
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2030
2428
|
by including metadata fields in the response.
|
2031
2429
|
|
2032
2430
|
Returns:
|
2033
2431
|
The pipeline.
|
2034
2432
|
"""
|
2035
|
-
return self.
|
2433
|
+
return self._get_entity_by_id_or_name_or_prefix(
|
2036
2434
|
get_method=self.zen_store.get_pipeline,
|
2037
2435
|
list_method=self.list_pipelines,
|
2038
2436
|
name_id_or_prefix=name_id_or_prefix,
|
2039
|
-
version=version,
|
2040
2437
|
hydrate=hydrate,
|
2041
2438
|
)
|
2042
2439
|
|
2043
2440
|
def delete_pipeline(
|
2044
2441
|
self,
|
2045
2442
|
name_id_or_prefix: Union[str, UUID],
|
2046
|
-
version: Optional[str] = None,
|
2047
2443
|
) -> None:
|
2048
2444
|
"""Delete a pipeline.
|
2049
2445
|
|
2050
2446
|
Args:
|
2051
2447
|
name_id_or_prefix: The name, ID or ID prefix of the pipeline.
|
2052
|
-
version: The pipeline version. If left empty, will delete
|
2053
|
-
the latest version.
|
2054
2448
|
"""
|
2055
|
-
pipeline = self.get_pipeline(
|
2056
|
-
name_id_or_prefix=name_id_or_prefix, version=version
|
2057
|
-
)
|
2449
|
+
pipeline = self.get_pipeline(name_id_or_prefix=name_id_or_prefix)
|
2058
2450
|
self.zen_store.delete_pipeline(pipeline_id=pipeline.id)
|
2059
2451
|
|
2452
|
+
@_fail_for_sql_zen_store
|
2453
|
+
def trigger_pipeline(
|
2454
|
+
self,
|
2455
|
+
pipeline_name_or_id: Union[str, UUID, None] = None,
|
2456
|
+
run_configuration: Optional[PipelineRunConfiguration] = None,
|
2457
|
+
config_path: Optional[str] = None,
|
2458
|
+
template_id: Optional[UUID] = None,
|
2459
|
+
stack_name_or_id: Union[str, UUID, None] = None,
|
2460
|
+
synchronous: bool = False,
|
2461
|
+
) -> PipelineRunResponse:
|
2462
|
+
"""Trigger a pipeline from the server.
|
2463
|
+
|
2464
|
+
Usage examples:
|
2465
|
+
* Run the latest runnable template for a pipeline:
|
2466
|
+
```python
|
2467
|
+
Client().trigger_pipeline(pipeline_name_or_id=<NAME>)
|
2468
|
+
```
|
2469
|
+
* Run the latest runnable template for a pipeline on a specific stack:
|
2470
|
+
```python
|
2471
|
+
Client().trigger_pipeline(
|
2472
|
+
pipeline_name_or_id=<NAME>,
|
2473
|
+
stack_name_or_id=<STACK_NAME_OR_ID>
|
2474
|
+
)
|
2475
|
+
```
|
2476
|
+
* Run a specific template:
|
2477
|
+
```python
|
2478
|
+
Client().trigger_pipeline(template_id=<ID>)
|
2479
|
+
```
|
2480
|
+
|
2481
|
+
Args:
|
2482
|
+
pipeline_name_or_id: Name or ID of the pipeline. If this is
|
2483
|
+
specified, the latest runnable template for this pipeline will
|
2484
|
+
be used for the run (Runnable here means that the build
|
2485
|
+
associated with the template is for a remote stack without any
|
2486
|
+
custom flavor stack components). If not given, a template ID
|
2487
|
+
that should be run needs to be specified.
|
2488
|
+
run_configuration: Configuration for the run. Either this or a
|
2489
|
+
path to a config file can be specified.
|
2490
|
+
config_path: Path to a YAML configuration file. This file will be
|
2491
|
+
parsed as a `PipelineRunConfiguration` object. Either this or
|
2492
|
+
the configuration in code can be specified.
|
2493
|
+
template_id: ID of the template to run. Either this or a pipeline
|
2494
|
+
can be specified.
|
2495
|
+
stack_name_or_id: Name or ID of the stack on which to run the
|
2496
|
+
pipeline. If not specified, this method will try to find a
|
2497
|
+
runnable template on any stack.
|
2498
|
+
synchronous: If `True`, this method will wait until the triggered
|
2499
|
+
run is finished.
|
2500
|
+
|
2501
|
+
Raises:
|
2502
|
+
RuntimeError: If triggering the pipeline failed.
|
2503
|
+
|
2504
|
+
Returns:
|
2505
|
+
Model of the pipeline run.
|
2506
|
+
"""
|
2507
|
+
from zenml.pipelines.run_utils import (
|
2508
|
+
validate_run_config_is_runnable_from_server,
|
2509
|
+
validate_stack_is_runnable_from_server,
|
2510
|
+
wait_for_pipeline_run_to_finish,
|
2511
|
+
)
|
2512
|
+
|
2513
|
+
if Counter([template_id, pipeline_name_or_id])[None] != 1:
|
2514
|
+
raise RuntimeError(
|
2515
|
+
"You need to specify exactly one of pipeline or template "
|
2516
|
+
"to trigger."
|
2517
|
+
)
|
2518
|
+
|
2519
|
+
if run_configuration and config_path:
|
2520
|
+
raise RuntimeError(
|
2521
|
+
"Only config path or runtime configuration can be specified."
|
2522
|
+
)
|
2523
|
+
|
2524
|
+
if config_path:
|
2525
|
+
run_configuration = PipelineRunConfiguration.from_yaml(config_path)
|
2526
|
+
|
2527
|
+
if run_configuration:
|
2528
|
+
validate_run_config_is_runnable_from_server(run_configuration)
|
2529
|
+
|
2530
|
+
if template_id:
|
2531
|
+
if stack_name_or_id:
|
2532
|
+
logger.warning(
|
2533
|
+
"Template ID and stack specified, ignoring the stack and "
|
2534
|
+
"using stack associated with the template instead."
|
2535
|
+
)
|
2536
|
+
|
2537
|
+
run = self.zen_store.run_template(
|
2538
|
+
template_id=template_id,
|
2539
|
+
run_configuration=run_configuration,
|
2540
|
+
)
|
2541
|
+
else:
|
2542
|
+
assert pipeline_name_or_id
|
2543
|
+
pipeline = self.get_pipeline(name_id_or_prefix=pipeline_name_or_id)
|
2544
|
+
|
2545
|
+
stack = None
|
2546
|
+
if stack_name_or_id:
|
2547
|
+
stack = self.get_stack(
|
2548
|
+
stack_name_or_id, allow_name_prefix_match=False
|
2549
|
+
)
|
2550
|
+
validate_stack_is_runnable_from_server(
|
2551
|
+
zen_store=self.zen_store, stack=stack
|
2552
|
+
)
|
2553
|
+
|
2554
|
+
templates = depaginate(
|
2555
|
+
self.list_run_templates,
|
2556
|
+
pipeline_id=pipeline.id,
|
2557
|
+
stack_id=stack.id if stack else None,
|
2558
|
+
)
|
2559
|
+
|
2560
|
+
for template in templates:
|
2561
|
+
if not template.build:
|
2562
|
+
continue
|
2563
|
+
|
2564
|
+
stack = template.build.stack
|
2565
|
+
if not stack:
|
2566
|
+
continue
|
2567
|
+
|
2568
|
+
try:
|
2569
|
+
validate_stack_is_runnable_from_server(
|
2570
|
+
zen_store=self.zen_store, stack=stack
|
2571
|
+
)
|
2572
|
+
except ValueError:
|
2573
|
+
continue
|
2574
|
+
|
2575
|
+
run = self.zen_store.run_template(
|
2576
|
+
template_id=template.id,
|
2577
|
+
run_configuration=run_configuration,
|
2578
|
+
)
|
2579
|
+
break
|
2580
|
+
else:
|
2581
|
+
raise RuntimeError(
|
2582
|
+
"Unable to find a runnable template for the given stack "
|
2583
|
+
"and pipeline."
|
2584
|
+
)
|
2585
|
+
|
2586
|
+
if synchronous:
|
2587
|
+
run = wait_for_pipeline_run_to_finish(run_id=run.id)
|
2588
|
+
|
2589
|
+
return run
|
2590
|
+
|
2060
2591
|
# -------------------------------- Builds ----------------------------------
|
2061
2592
|
|
2062
2593
|
def get_build(
|
@@ -2126,13 +2657,16 @@ class Client(metaclass=ClientMetaClass):
|
|
2126
2657
|
updated: Optional[Union[datetime, str]] = None,
|
2127
2658
|
workspace_id: Optional[Union[str, UUID]] = None,
|
2128
2659
|
user_id: Optional[Union[str, UUID]] = None,
|
2660
|
+
user: Optional[Union[UUID, str]] = None,
|
2129
2661
|
pipeline_id: Optional[Union[str, UUID]] = None,
|
2130
2662
|
stack_id: Optional[Union[str, UUID]] = None,
|
2663
|
+
container_registry_id: Optional[Union[UUID, str]] = None,
|
2131
2664
|
is_local: Optional[bool] = None,
|
2132
2665
|
contains_code: Optional[bool] = None,
|
2133
2666
|
zenml_version: Optional[str] = None,
|
2134
2667
|
python_version: Optional[str] = None,
|
2135
2668
|
checksum: Optional[str] = None,
|
2669
|
+
stack_checksum: Optional[str] = None,
|
2136
2670
|
hydrate: bool = False,
|
2137
2671
|
) -> Page[PipelineBuildResponse]:
|
2138
2672
|
"""List all builds.
|
@@ -2147,13 +2681,17 @@ class Client(metaclass=ClientMetaClass):
|
|
2147
2681
|
updated: Use the last updated date for filtering
|
2148
2682
|
workspace_id: The id of the workspace to filter by.
|
2149
2683
|
user_id: The id of the user to filter by.
|
2684
|
+
user: Filter by user name/ID.
|
2150
2685
|
pipeline_id: The id of the pipeline to filter by.
|
2151
2686
|
stack_id: The id of the stack to filter by.
|
2687
|
+
container_registry_id: The id of the container registry to
|
2688
|
+
filter by.
|
2152
2689
|
is_local: Use to filter local builds.
|
2153
2690
|
contains_code: Use to filter builds that contain code.
|
2154
2691
|
zenml_version: The version of ZenML to filter by.
|
2155
2692
|
python_version: The Python version to filter by.
|
2156
2693
|
checksum: The build checksum to filter by.
|
2694
|
+
stack_checksum: The stack checksum to filter by.
|
2157
2695
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2158
2696
|
by including metadata fields in the response.
|
2159
2697
|
|
@@ -2170,13 +2708,16 @@ class Client(metaclass=ClientMetaClass):
|
|
2170
2708
|
updated=updated,
|
2171
2709
|
workspace_id=workspace_id,
|
2172
2710
|
user_id=user_id,
|
2711
|
+
user=user,
|
2173
2712
|
pipeline_id=pipeline_id,
|
2174
2713
|
stack_id=stack_id,
|
2714
|
+
container_registry_id=container_registry_id,
|
2175
2715
|
is_local=is_local,
|
2176
2716
|
contains_code=contains_code,
|
2177
2717
|
zenml_version=zenml_version,
|
2178
2718
|
python_version=python_version,
|
2179
2719
|
checksum=checksum,
|
2720
|
+
stack_checksum=stack_checksum,
|
2180
2721
|
)
|
2181
2722
|
build_filter_model.set_scope_workspace(self.active_workspace.id)
|
2182
2723
|
return self.zen_store.list_builds(
|
@@ -2193,36 +2734,615 @@ class Client(metaclass=ClientMetaClass):
|
|
2193
2734
|
build = self.get_build(id_or_prefix=id_or_prefix)
|
2194
2735
|
self.zen_store.delete_build(build_id=build.id)
|
2195
2736
|
|
2196
|
-
#
|
2737
|
+
# --------------------------------- Event Sources -------------------------
|
2197
2738
|
|
2198
|
-
|
2739
|
+
@_fail_for_sql_zen_store
|
2740
|
+
def create_event_source(
|
2199
2741
|
self,
|
2200
|
-
|
2201
|
-
|
2202
|
-
|
2203
|
-
|
2742
|
+
name: str,
|
2743
|
+
configuration: Dict[str, Any],
|
2744
|
+
flavor: str,
|
2745
|
+
event_source_subtype: PluginSubType,
|
2746
|
+
description: str = "",
|
2747
|
+
) -> EventSourceResponse:
|
2748
|
+
"""Registers an event source.
|
2204
2749
|
|
2205
2750
|
Args:
|
2206
|
-
|
2207
|
-
|
2208
|
-
|
2751
|
+
name: The name of the event source to create.
|
2752
|
+
configuration: Configuration for this event source.
|
2753
|
+
flavor: The flavor of event source.
|
2754
|
+
event_source_subtype: The event source subtype.
|
2755
|
+
description: The description of the event source.
|
2209
2756
|
|
2210
2757
|
Returns:
|
2211
|
-
The
|
2212
|
-
|
2213
|
-
Raises:
|
2214
|
-
KeyError: If no deployment was found for the given id or prefix.
|
2215
|
-
ZenKeyError: If multiple deployments were found that match the given
|
2216
|
-
id or prefix.
|
2758
|
+
The model of the registered event source.
|
2217
2759
|
"""
|
2218
|
-
|
2760
|
+
event_source = EventSourceRequest(
|
2761
|
+
name=name,
|
2762
|
+
configuration=configuration,
|
2763
|
+
description=description,
|
2764
|
+
flavor=flavor,
|
2765
|
+
plugin_type=PluginType.EVENT_SOURCE,
|
2766
|
+
plugin_subtype=event_source_subtype,
|
2767
|
+
user=self.active_user.id,
|
2768
|
+
workspace=self.active_workspace.id,
|
2769
|
+
)
|
2770
|
+
|
2771
|
+
return self.zen_store.create_event_source(event_source=event_source)
|
2772
|
+
|
2773
|
+
@_fail_for_sql_zen_store
|
2774
|
+
def get_event_source(
|
2775
|
+
self,
|
2776
|
+
name_id_or_prefix: Union[UUID, str],
|
2777
|
+
allow_name_prefix_match: bool = True,
|
2778
|
+
hydrate: bool = True,
|
2779
|
+
) -> EventSourceResponse:
|
2780
|
+
"""Get an event source by name, ID or prefix.
|
2781
|
+
|
2782
|
+
Args:
|
2783
|
+
name_id_or_prefix: The name, ID or prefix of the stack.
|
2784
|
+
allow_name_prefix_match: If True, allow matching by name prefix.
|
2785
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
2786
|
+
by including metadata fields in the response.
|
2787
|
+
|
2788
|
+
Returns:
|
2789
|
+
The event_source.
|
2790
|
+
"""
|
2791
|
+
return self._get_entity_by_id_or_name_or_prefix(
|
2792
|
+
get_method=self.zen_store.get_event_source,
|
2793
|
+
list_method=self.list_event_sources,
|
2794
|
+
name_id_or_prefix=name_id_or_prefix,
|
2795
|
+
allow_name_prefix_match=allow_name_prefix_match,
|
2796
|
+
hydrate=hydrate,
|
2797
|
+
)
|
2798
|
+
|
2799
|
+
def list_event_sources(
|
2800
|
+
self,
|
2801
|
+
sort_by: str = "created",
|
2802
|
+
page: int = PAGINATION_STARTING_PAGE,
|
2803
|
+
size: int = PAGE_SIZE_DEFAULT,
|
2804
|
+
logical_operator: LogicalOperators = LogicalOperators.AND,
|
2805
|
+
id: Optional[Union[UUID, str]] = None,
|
2806
|
+
created: Optional[datetime] = None,
|
2807
|
+
updated: Optional[datetime] = None,
|
2808
|
+
name: Optional[str] = None,
|
2809
|
+
flavor: Optional[str] = None,
|
2810
|
+
event_source_type: Optional[str] = None,
|
2811
|
+
workspace_id: Optional[Union[str, UUID]] = None,
|
2812
|
+
user_id: Optional[Union[str, UUID]] = None,
|
2813
|
+
user: Optional[Union[UUID, str]] = None,
|
2814
|
+
hydrate: bool = False,
|
2815
|
+
) -> Page[EventSourceResponse]:
|
2816
|
+
"""Lists all event_sources.
|
2817
|
+
|
2818
|
+
Args:
|
2819
|
+
sort_by: The column to sort by
|
2820
|
+
page: The page of items
|
2821
|
+
size: The maximum size of all pages
|
2822
|
+
logical_operator: Which logical operator to use [and, or]
|
2823
|
+
id: Use the id of event_sources to filter by.
|
2824
|
+
created: Use to filter by time of creation
|
2825
|
+
updated: Use the last updated date for filtering
|
2826
|
+
workspace_id: The id of the workspace to filter by.
|
2827
|
+
user_id: The id of the user to filter by.
|
2828
|
+
user: Filter by user name/ID.
|
2829
|
+
name: The name of the event_source to filter by.
|
2830
|
+
flavor: The flavor of the event_source to filter by.
|
2831
|
+
event_source_type: The subtype of the event_source to filter by.
|
2832
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
2833
|
+
by including metadata fields in the response.
|
2834
|
+
|
2835
|
+
Returns:
|
2836
|
+
A page of event_sources.
|
2837
|
+
"""
|
2838
|
+
event_source_filter_model = EventSourceFilter(
|
2839
|
+
page=page,
|
2840
|
+
size=size,
|
2841
|
+
sort_by=sort_by,
|
2842
|
+
logical_operator=logical_operator,
|
2843
|
+
workspace_id=workspace_id,
|
2844
|
+
user_id=user_id,
|
2845
|
+
user=user,
|
2846
|
+
name=name,
|
2847
|
+
flavor=flavor,
|
2848
|
+
plugin_subtype=event_source_type,
|
2849
|
+
id=id,
|
2850
|
+
created=created,
|
2851
|
+
updated=updated,
|
2852
|
+
)
|
2853
|
+
event_source_filter_model.set_scope_workspace(self.active_workspace.id)
|
2854
|
+
return self.zen_store.list_event_sources(
|
2855
|
+
event_source_filter_model, hydrate=hydrate
|
2856
|
+
)
|
2857
|
+
|
2858
|
+
@_fail_for_sql_zen_store
|
2859
|
+
def update_event_source(
|
2860
|
+
self,
|
2861
|
+
name_id_or_prefix: Union[UUID, str],
|
2862
|
+
name: Optional[str] = None,
|
2863
|
+
description: Optional[str] = None,
|
2864
|
+
configuration: Optional[Dict[str, Any]] = None,
|
2865
|
+
rotate_secret: Optional[bool] = None,
|
2866
|
+
is_active: Optional[bool] = None,
|
2867
|
+
) -> EventSourceResponse:
|
2868
|
+
"""Updates a event_source.
|
2869
|
+
|
2870
|
+
Args:
|
2871
|
+
name_id_or_prefix: The name, id or prefix of the event_source to update.
|
2872
|
+
name: the new name of the event_source.
|
2873
|
+
description: the new description of the event_source.
|
2874
|
+
configuration: The event source configuration.
|
2875
|
+
rotate_secret: Allows rotating of secret, if true, the response will
|
2876
|
+
contain the new secret value
|
2877
|
+
is_active: Optional[bool] = Allows for activation/deactivating the
|
2878
|
+
event source
|
2879
|
+
|
2880
|
+
Returns:
|
2881
|
+
The model of the updated event_source.
|
2882
|
+
|
2883
|
+
Raises:
|
2884
|
+
EntityExistsError: If the event_source name is already taken.
|
2885
|
+
"""
|
2886
|
+
# First, get the eve
|
2887
|
+
event_source = self.get_event_source(
|
2888
|
+
name_id_or_prefix=name_id_or_prefix, allow_name_prefix_match=False
|
2889
|
+
)
|
2890
|
+
|
2891
|
+
# Create the update model
|
2892
|
+
update_model = EventSourceUpdate(
|
2893
|
+
name=name,
|
2894
|
+
description=description,
|
2895
|
+
configuration=configuration,
|
2896
|
+
rotate_secret=rotate_secret,
|
2897
|
+
is_active=is_active,
|
2898
|
+
)
|
2899
|
+
|
2900
|
+
if name:
|
2901
|
+
if self.list_event_sources(name=name):
|
2902
|
+
raise EntityExistsError(
|
2903
|
+
"There are already existing event_sources with the name "
|
2904
|
+
f"'{name}'."
|
2905
|
+
)
|
2906
|
+
|
2907
|
+
updated_event_source = self.zen_store.update_event_source(
|
2908
|
+
event_source_id=event_source.id,
|
2909
|
+
event_source_update=update_model,
|
2910
|
+
)
|
2911
|
+
return updated_event_source
|
2912
|
+
|
2913
|
+
@_fail_for_sql_zen_store
|
2914
|
+
def delete_event_source(self, name_id_or_prefix: Union[str, UUID]) -> None:
|
2915
|
+
"""Deletes an event_source.
|
2916
|
+
|
2917
|
+
Args:
|
2918
|
+
name_id_or_prefix: The name, id or prefix id of the event_source
|
2919
|
+
to deregister.
|
2920
|
+
"""
|
2921
|
+
event_source = self.get_event_source(
|
2922
|
+
name_id_or_prefix=name_id_or_prefix, allow_name_prefix_match=False
|
2923
|
+
)
|
2924
|
+
|
2925
|
+
self.zen_store.delete_event_source(event_source_id=event_source.id)
|
2926
|
+
logger.info("Deleted event_source with name '%s'.", event_source.name)
|
2927
|
+
|
2928
|
+
# --------------------------------- Actions -------------------------
|
2929
|
+
|
2930
|
+
@_fail_for_sql_zen_store
|
2931
|
+
def create_action(
|
2932
|
+
self,
|
2933
|
+
name: str,
|
2934
|
+
flavor: str,
|
2935
|
+
action_type: PluginSubType,
|
2936
|
+
configuration: Dict[str, Any],
|
2937
|
+
service_account_id: UUID,
|
2938
|
+
auth_window: Optional[int] = None,
|
2939
|
+
description: str = "",
|
2940
|
+
) -> ActionResponse:
|
2941
|
+
"""Create an action.
|
2942
|
+
|
2943
|
+
Args:
|
2944
|
+
name: The name of the action.
|
2945
|
+
flavor: The flavor of the action,
|
2946
|
+
action_type: The action subtype.
|
2947
|
+
configuration: The action configuration.
|
2948
|
+
service_account_id: The service account that is used to execute the
|
2949
|
+
action.
|
2950
|
+
auth_window: The time window in minutes for which the service
|
2951
|
+
account is authorized to execute the action. Set this to 0 to
|
2952
|
+
authorize the service account indefinitely (not recommended).
|
2953
|
+
description: The description of the action.
|
2954
|
+
|
2955
|
+
Returns:
|
2956
|
+
The created action
|
2957
|
+
"""
|
2958
|
+
action = ActionRequest(
|
2959
|
+
name=name,
|
2960
|
+
description=description,
|
2961
|
+
flavor=flavor,
|
2962
|
+
plugin_subtype=action_type,
|
2963
|
+
configuration=configuration,
|
2964
|
+
service_account_id=service_account_id,
|
2965
|
+
auth_window=auth_window,
|
2966
|
+
user=self.active_user.id,
|
2967
|
+
workspace=self.active_workspace.id,
|
2968
|
+
)
|
2969
|
+
|
2970
|
+
return self.zen_store.create_action(action=action)
|
2971
|
+
|
2972
|
+
@_fail_for_sql_zen_store
|
2973
|
+
def get_action(
|
2974
|
+
self,
|
2975
|
+
name_id_or_prefix: Union[UUID, str],
|
2976
|
+
allow_name_prefix_match: bool = True,
|
2977
|
+
hydrate: bool = True,
|
2978
|
+
) -> ActionResponse:
|
2979
|
+
"""Get an action by name, ID or prefix.
|
2980
|
+
|
2981
|
+
Args:
|
2982
|
+
name_id_or_prefix: The name, ID or prefix of the action.
|
2983
|
+
allow_name_prefix_match: If True, allow matching by name prefix.
|
2984
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
2985
|
+
by including metadata fields in the response.
|
2986
|
+
|
2987
|
+
Returns:
|
2988
|
+
The action.
|
2989
|
+
"""
|
2990
|
+
return self._get_entity_by_id_or_name_or_prefix(
|
2991
|
+
get_method=self.zen_store.get_action,
|
2992
|
+
list_method=self.list_actions,
|
2993
|
+
name_id_or_prefix=name_id_or_prefix,
|
2994
|
+
allow_name_prefix_match=allow_name_prefix_match,
|
2995
|
+
hydrate=hydrate,
|
2996
|
+
)
|
2997
|
+
|
2998
|
+
@_fail_for_sql_zen_store
|
2999
|
+
def list_actions(
|
3000
|
+
self,
|
3001
|
+
sort_by: str = "created",
|
3002
|
+
page: int = PAGINATION_STARTING_PAGE,
|
3003
|
+
size: int = PAGE_SIZE_DEFAULT,
|
3004
|
+
logical_operator: LogicalOperators = LogicalOperators.AND,
|
3005
|
+
id: Optional[Union[UUID, str]] = None,
|
3006
|
+
created: Optional[datetime] = None,
|
3007
|
+
updated: Optional[datetime] = None,
|
3008
|
+
name: Optional[str] = None,
|
3009
|
+
flavor: Optional[str] = None,
|
3010
|
+
action_type: Optional[str] = None,
|
3011
|
+
workspace_id: Optional[Union[str, UUID]] = None,
|
3012
|
+
user_id: Optional[Union[str, UUID]] = None,
|
3013
|
+
user: Optional[Union[UUID, str]] = None,
|
3014
|
+
hydrate: bool = False,
|
3015
|
+
) -> Page[ActionResponse]:
|
3016
|
+
"""List actions.
|
3017
|
+
|
3018
|
+
Args:
|
3019
|
+
sort_by: The column to sort by
|
3020
|
+
page: The page of items
|
3021
|
+
size: The maximum size of all pages
|
3022
|
+
logical_operator: Which logical operator to use [and, or]
|
3023
|
+
id: Use the id of the action to filter by.
|
3024
|
+
created: Use to filter by time of creation
|
3025
|
+
updated: Use the last updated date for filtering
|
3026
|
+
workspace_id: The id of the workspace to filter by.
|
3027
|
+
user_id: The id of the user to filter by.
|
3028
|
+
user: Filter by user name/ID.
|
3029
|
+
name: The name of the action to filter by.
|
3030
|
+
flavor: The flavor of the action to filter by.
|
3031
|
+
action_type: The type of the action to filter by.
|
3032
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
3033
|
+
by including metadata fields in the response.
|
3034
|
+
|
3035
|
+
Returns:
|
3036
|
+
A page of actions.
|
3037
|
+
"""
|
3038
|
+
filter_model = ActionFilter(
|
3039
|
+
page=page,
|
3040
|
+
size=size,
|
3041
|
+
sort_by=sort_by,
|
3042
|
+
logical_operator=logical_operator,
|
3043
|
+
workspace_id=workspace_id,
|
3044
|
+
user_id=user_id,
|
3045
|
+
user=user,
|
3046
|
+
name=name,
|
3047
|
+
id=id,
|
3048
|
+
flavor=flavor,
|
3049
|
+
plugin_subtype=action_type,
|
3050
|
+
created=created,
|
3051
|
+
updated=updated,
|
3052
|
+
)
|
3053
|
+
filter_model.set_scope_workspace(self.active_workspace.id)
|
3054
|
+
return self.zen_store.list_actions(filter_model, hydrate=hydrate)
|
3055
|
+
|
3056
|
+
@_fail_for_sql_zen_store
|
3057
|
+
def update_action(
|
3058
|
+
self,
|
3059
|
+
name_id_or_prefix: Union[UUID, str],
|
3060
|
+
name: Optional[str] = None,
|
3061
|
+
description: Optional[str] = None,
|
3062
|
+
configuration: Optional[Dict[str, Any]] = None,
|
3063
|
+
service_account_id: Optional[UUID] = None,
|
3064
|
+
auth_window: Optional[int] = None,
|
3065
|
+
) -> ActionResponse:
|
3066
|
+
"""Update an action.
|
3067
|
+
|
3068
|
+
Args:
|
3069
|
+
name_id_or_prefix: The name, id or prefix of the action to update.
|
3070
|
+
name: The new name of the action.
|
3071
|
+
description: The new description of the action.
|
3072
|
+
configuration: The new configuration of the action.
|
3073
|
+
service_account_id: The new service account that is used to execute
|
3074
|
+
the action.
|
3075
|
+
auth_window: The new time window in minutes for which the service
|
3076
|
+
account is authorized to execute the action. Set this to 0 to
|
3077
|
+
authorize the service account indefinitely (not recommended).
|
3078
|
+
|
3079
|
+
Returns:
|
3080
|
+
The updated action.
|
3081
|
+
"""
|
3082
|
+
action = self.get_action(
|
3083
|
+
name_id_or_prefix=name_id_or_prefix, allow_name_prefix_match=False
|
3084
|
+
)
|
3085
|
+
|
3086
|
+
update_model = ActionUpdate(
|
3087
|
+
name=name,
|
3088
|
+
description=description,
|
3089
|
+
configuration=configuration,
|
3090
|
+
service_account_id=service_account_id,
|
3091
|
+
auth_window=auth_window,
|
3092
|
+
)
|
3093
|
+
|
3094
|
+
return self.zen_store.update_action(
|
3095
|
+
action_id=action.id,
|
3096
|
+
action_update=update_model,
|
3097
|
+
)
|
3098
|
+
|
3099
|
+
@_fail_for_sql_zen_store
|
3100
|
+
def delete_action(self, name_id_or_prefix: Union[str, UUID]) -> None:
|
3101
|
+
"""Delete an action.
|
3102
|
+
|
3103
|
+
Args:
|
3104
|
+
name_id_or_prefix: The name, id or prefix id of the action
|
3105
|
+
to delete.
|
3106
|
+
"""
|
3107
|
+
action = self.get_action(
|
3108
|
+
name_id_or_prefix=name_id_or_prefix, allow_name_prefix_match=False
|
3109
|
+
)
|
3110
|
+
|
3111
|
+
self.zen_store.delete_action(action_id=action.id)
|
3112
|
+
logger.info("Deleted action with name '%s'.", action.name)
|
3113
|
+
|
3114
|
+
# --------------------------------- Triggers -------------------------
|
3115
|
+
|
3116
|
+
@_fail_for_sql_zen_store
|
3117
|
+
def create_trigger(
|
3118
|
+
self,
|
3119
|
+
name: str,
|
3120
|
+
event_source_id: UUID,
|
3121
|
+
event_filter: Dict[str, Any],
|
3122
|
+
action_id: UUID,
|
3123
|
+
description: str = "",
|
3124
|
+
) -> TriggerResponse:
|
3125
|
+
"""Registers a trigger.
|
3126
|
+
|
3127
|
+
Args:
|
3128
|
+
name: The name of the trigger to create.
|
3129
|
+
event_source_id: The id of the event source id
|
3130
|
+
event_filter: The event filter
|
3131
|
+
action_id: The ID of the action that should be triggered.
|
3132
|
+
description: The description of the trigger
|
3133
|
+
|
3134
|
+
Returns:
|
3135
|
+
The created trigger.
|
3136
|
+
"""
|
3137
|
+
trigger = TriggerRequest(
|
3138
|
+
name=name,
|
3139
|
+
description=description,
|
3140
|
+
event_source_id=event_source_id,
|
3141
|
+
event_filter=event_filter,
|
3142
|
+
action_id=action_id,
|
3143
|
+
user=self.active_user.id,
|
3144
|
+
workspace=self.active_workspace.id,
|
3145
|
+
)
|
3146
|
+
|
3147
|
+
return self.zen_store.create_trigger(trigger=trigger)
|
3148
|
+
|
3149
|
+
@_fail_for_sql_zen_store
|
3150
|
+
def get_trigger(
|
3151
|
+
self,
|
3152
|
+
name_id_or_prefix: Union[UUID, str],
|
3153
|
+
allow_name_prefix_match: bool = True,
|
3154
|
+
hydrate: bool = True,
|
3155
|
+
) -> TriggerResponse:
|
3156
|
+
"""Get a trigger by name, ID or prefix.
|
3157
|
+
|
3158
|
+
Args:
|
3159
|
+
name_id_or_prefix: The name, ID or prefix of the trigger.
|
3160
|
+
allow_name_prefix_match: If True, allow matching by name prefix.
|
3161
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
3162
|
+
by including metadata fields in the response.
|
3163
|
+
|
3164
|
+
Returns:
|
3165
|
+
The trigger.
|
3166
|
+
"""
|
3167
|
+
return self._get_entity_by_id_or_name_or_prefix(
|
3168
|
+
get_method=self.zen_store.get_trigger,
|
3169
|
+
list_method=self.list_triggers,
|
3170
|
+
name_id_or_prefix=name_id_or_prefix,
|
3171
|
+
allow_name_prefix_match=allow_name_prefix_match,
|
3172
|
+
hydrate=hydrate,
|
3173
|
+
)
|
3174
|
+
|
3175
|
+
@_fail_for_sql_zen_store
|
3176
|
+
def list_triggers(
|
3177
|
+
self,
|
3178
|
+
sort_by: str = "created",
|
3179
|
+
page: int = PAGINATION_STARTING_PAGE,
|
3180
|
+
size: int = PAGE_SIZE_DEFAULT,
|
3181
|
+
logical_operator: LogicalOperators = LogicalOperators.AND,
|
3182
|
+
id: Optional[Union[UUID, str]] = None,
|
3183
|
+
created: Optional[datetime] = None,
|
3184
|
+
updated: Optional[datetime] = None,
|
3185
|
+
name: Optional[str] = None,
|
3186
|
+
event_source_id: Optional[UUID] = None,
|
3187
|
+
action_id: Optional[UUID] = None,
|
3188
|
+
event_source_flavor: Optional[str] = None,
|
3189
|
+
event_source_subtype: Optional[str] = None,
|
3190
|
+
action_flavor: Optional[str] = None,
|
3191
|
+
action_subtype: Optional[str] = None,
|
3192
|
+
workspace_id: Optional[Union[str, UUID]] = None,
|
3193
|
+
user_id: Optional[Union[str, UUID]] = None,
|
3194
|
+
user: Optional[Union[UUID, str]] = None,
|
3195
|
+
hydrate: bool = False,
|
3196
|
+
) -> Page[TriggerResponse]:
|
3197
|
+
"""Lists all triggers.
|
3198
|
+
|
3199
|
+
Args:
|
3200
|
+
sort_by: The column to sort by
|
3201
|
+
page: The page of items
|
3202
|
+
size: The maximum size of all pages
|
3203
|
+
logical_operator: Which logical operator to use [and, or]
|
3204
|
+
id: Use the id of triggers to filter by.
|
3205
|
+
created: Use to filter by time of creation
|
3206
|
+
updated: Use the last updated date for filtering
|
3207
|
+
workspace_id: The id of the workspace to filter by.
|
3208
|
+
user_id: The id of the user to filter by.
|
3209
|
+
user: Filter by user name/ID.
|
3210
|
+
name: The name of the trigger to filter by.
|
3211
|
+
event_source_id: The event source associated with the trigger.
|
3212
|
+
action_id: The action associated with the trigger.
|
3213
|
+
event_source_flavor: Flavor of the event source associated with the
|
3214
|
+
trigger.
|
3215
|
+
event_source_subtype: Type of the event source associated with the
|
3216
|
+
trigger.
|
3217
|
+
action_flavor: Flavor of the action associated with the trigger.
|
3218
|
+
action_subtype: Type of the action associated with the trigger.
|
3219
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
3220
|
+
by including metadata fields in the response.
|
3221
|
+
|
3222
|
+
Returns:
|
3223
|
+
A page of triggers.
|
3224
|
+
"""
|
3225
|
+
trigger_filter_model = TriggerFilter(
|
3226
|
+
page=page,
|
3227
|
+
size=size,
|
3228
|
+
sort_by=sort_by,
|
3229
|
+
logical_operator=logical_operator,
|
3230
|
+
workspace_id=workspace_id,
|
3231
|
+
user_id=user_id,
|
3232
|
+
user=user,
|
3233
|
+
name=name,
|
3234
|
+
event_source_id=event_source_id,
|
3235
|
+
action_id=action_id,
|
3236
|
+
event_source_flavor=event_source_flavor,
|
3237
|
+
event_source_subtype=event_source_subtype,
|
3238
|
+
action_flavor=action_flavor,
|
3239
|
+
action_subtype=action_subtype,
|
3240
|
+
id=id,
|
3241
|
+
created=created,
|
3242
|
+
updated=updated,
|
3243
|
+
)
|
3244
|
+
trigger_filter_model.set_scope_workspace(self.active_workspace.id)
|
3245
|
+
return self.zen_store.list_triggers(
|
3246
|
+
trigger_filter_model, hydrate=hydrate
|
3247
|
+
)
|
3248
|
+
|
3249
|
+
@_fail_for_sql_zen_store
|
3250
|
+
def update_trigger(
|
3251
|
+
self,
|
3252
|
+
name_id_or_prefix: Union[UUID, str],
|
3253
|
+
name: Optional[str] = None,
|
3254
|
+
description: Optional[str] = None,
|
3255
|
+
event_filter: Optional[Dict[str, Any]] = None,
|
3256
|
+
is_active: Optional[bool] = None,
|
3257
|
+
) -> TriggerResponse:
|
3258
|
+
"""Updates a trigger.
|
3259
|
+
|
3260
|
+
Args:
|
3261
|
+
name_id_or_prefix: The name, id or prefix of the trigger to update.
|
3262
|
+
name: the new name of the trigger.
|
3263
|
+
description: the new description of the trigger.
|
3264
|
+
event_filter: The event filter configuration.
|
3265
|
+
is_active: Whether the trigger is active or not.
|
3266
|
+
|
3267
|
+
Returns:
|
3268
|
+
The model of the updated trigger.
|
3269
|
+
|
3270
|
+
Raises:
|
3271
|
+
EntityExistsError: If the trigger name is already taken.
|
3272
|
+
"""
|
3273
|
+
# First, get the eve
|
3274
|
+
trigger = self.get_trigger(
|
3275
|
+
name_id_or_prefix=name_id_or_prefix, allow_name_prefix_match=False
|
3276
|
+
)
|
3277
|
+
|
3278
|
+
# Create the update model
|
3279
|
+
update_model = TriggerUpdate(
|
3280
|
+
name=name,
|
3281
|
+
description=description,
|
3282
|
+
event_filter=event_filter,
|
3283
|
+
is_active=is_active,
|
3284
|
+
)
|
3285
|
+
|
3286
|
+
if name:
|
3287
|
+
if self.list_triggers(name=name):
|
3288
|
+
raise EntityExistsError(
|
3289
|
+
"There are already is an existing trigger with the name "
|
3290
|
+
f"'{name}'."
|
3291
|
+
)
|
3292
|
+
|
3293
|
+
updated_trigger = self.zen_store.update_trigger(
|
3294
|
+
trigger_id=trigger.id,
|
3295
|
+
trigger_update=update_model,
|
3296
|
+
)
|
3297
|
+
return updated_trigger
|
3298
|
+
|
3299
|
+
@_fail_for_sql_zen_store
|
3300
|
+
def delete_trigger(self, name_id_or_prefix: Union[str, UUID]) -> None:
|
3301
|
+
"""Deletes an trigger.
|
3302
|
+
|
3303
|
+
Args:
|
3304
|
+
name_id_or_prefix: The name, id or prefix id of the trigger
|
3305
|
+
to deregister.
|
3306
|
+
"""
|
3307
|
+
trigger = self.get_trigger(
|
3308
|
+
name_id_or_prefix=name_id_or_prefix, allow_name_prefix_match=False
|
3309
|
+
)
|
3310
|
+
|
3311
|
+
self.zen_store.delete_trigger(trigger_id=trigger.id)
|
3312
|
+
logger.info("Deleted trigger with name '%s'.", trigger.name)
|
3313
|
+
|
3314
|
+
# ------------------------------ Deployments -------------------------------
|
3315
|
+
|
3316
|
+
def get_deployment(
|
3317
|
+
self,
|
3318
|
+
id_or_prefix: Union[str, UUID],
|
3319
|
+
hydrate: bool = True,
|
3320
|
+
) -> PipelineDeploymentResponse:
|
3321
|
+
"""Get a deployment by id or prefix.
|
3322
|
+
|
3323
|
+
Args:
|
3324
|
+
id_or_prefix: The id or id prefix of the deployment.
|
3325
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
3326
|
+
by including metadata fields in the response.
|
3327
|
+
|
3328
|
+
Returns:
|
3329
|
+
The deployment.
|
3330
|
+
|
3331
|
+
Raises:
|
3332
|
+
KeyError: If no deployment was found for the given id or prefix.
|
3333
|
+
ZenKeyError: If multiple deployments were found that match the given
|
3334
|
+
id or prefix.
|
3335
|
+
"""
|
3336
|
+
from zenml.utils.uuid_utils import is_valid_uuid
|
2219
3337
|
|
2220
3338
|
# First interpret as full UUID
|
2221
3339
|
if is_valid_uuid(id_or_prefix):
|
2222
|
-
|
2223
|
-
UUID(id_or_prefix)
|
2224
|
-
|
3340
|
+
id_ = (
|
3341
|
+
UUID(id_or_prefix)
|
3342
|
+
if isinstance(id_or_prefix, str)
|
3343
|
+
else id_or_prefix
|
2225
3344
|
)
|
3345
|
+
return self.zen_store.get_deployment(id_, hydrate=hydrate)
|
2226
3346
|
|
2227
3347
|
entity = self.list_deployments(
|
2228
3348
|
id=f"startswith:{id_or_prefix}",
|
@@ -2240,80 +3360,277 @@ class Client(metaclass=ClientMetaClass):
|
|
2240
3360
|
f"prefix that matches the provided string '{id_or_prefix}'."
|
2241
3361
|
)
|
2242
3362
|
|
2243
|
-
raise ZenKeyError(
|
2244
|
-
f"{entity.total} deployments have been found that have "
|
2245
|
-
f"an ID that matches the provided "
|
2246
|
-
f"string '{id_or_prefix}':\n"
|
2247
|
-
f"{[entity.items]}.\n"
|
2248
|
-
f"Please use the id to uniquely identify "
|
2249
|
-
f"only one of the deployments."
|
3363
|
+
raise ZenKeyError(
|
3364
|
+
f"{entity.total} deployments have been found that have "
|
3365
|
+
f"an ID that matches the provided "
|
3366
|
+
f"string '{id_or_prefix}':\n"
|
3367
|
+
f"{[entity.items]}.\n"
|
3368
|
+
f"Please use the id to uniquely identify "
|
3369
|
+
f"only one of the deployments."
|
3370
|
+
)
|
3371
|
+
|
3372
|
+
def list_deployments(
|
3373
|
+
self,
|
3374
|
+
sort_by: str = "created",
|
3375
|
+
page: int = PAGINATION_STARTING_PAGE,
|
3376
|
+
size: int = PAGE_SIZE_DEFAULT,
|
3377
|
+
logical_operator: LogicalOperators = LogicalOperators.AND,
|
3378
|
+
id: Optional[Union[UUID, str]] = None,
|
3379
|
+
created: Optional[Union[datetime, str]] = None,
|
3380
|
+
updated: Optional[Union[datetime, str]] = None,
|
3381
|
+
workspace_id: Optional[Union[str, UUID]] = None,
|
3382
|
+
user_id: Optional[Union[str, UUID]] = None,
|
3383
|
+
user: Optional[Union[UUID, str]] = None,
|
3384
|
+
pipeline_id: Optional[Union[str, UUID]] = None,
|
3385
|
+
stack_id: Optional[Union[str, UUID]] = None,
|
3386
|
+
build_id: Optional[Union[str, UUID]] = None,
|
3387
|
+
template_id: Optional[Union[str, UUID]] = None,
|
3388
|
+
hydrate: bool = False,
|
3389
|
+
) -> Page[PipelineDeploymentResponse]:
|
3390
|
+
"""List all deployments.
|
3391
|
+
|
3392
|
+
Args:
|
3393
|
+
sort_by: The column to sort by
|
3394
|
+
page: The page of items
|
3395
|
+
size: The maximum size of all pages
|
3396
|
+
logical_operator: Which logical operator to use [and, or]
|
3397
|
+
id: Use the id of build to filter by.
|
3398
|
+
created: Use to filter by time of creation
|
3399
|
+
updated: Use the last updated date for filtering
|
3400
|
+
workspace_id: The id of the workspace to filter by.
|
3401
|
+
user_id: The id of the user to filter by.
|
3402
|
+
user: Filter by user name/ID.
|
3403
|
+
pipeline_id: The id of the pipeline to filter by.
|
3404
|
+
stack_id: The id of the stack to filter by.
|
3405
|
+
build_id: The id of the build to filter by.
|
3406
|
+
template_id: The ID of the template to filter by.
|
3407
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
3408
|
+
by including metadata fields in the response.
|
3409
|
+
|
3410
|
+
Returns:
|
3411
|
+
A page with deployments fitting the filter description
|
3412
|
+
"""
|
3413
|
+
deployment_filter_model = PipelineDeploymentFilter(
|
3414
|
+
sort_by=sort_by,
|
3415
|
+
page=page,
|
3416
|
+
size=size,
|
3417
|
+
logical_operator=logical_operator,
|
3418
|
+
id=id,
|
3419
|
+
created=created,
|
3420
|
+
updated=updated,
|
3421
|
+
workspace_id=workspace_id,
|
3422
|
+
user_id=user_id,
|
3423
|
+
user=user,
|
3424
|
+
pipeline_id=pipeline_id,
|
3425
|
+
stack_id=stack_id,
|
3426
|
+
build_id=build_id,
|
3427
|
+
template_id=template_id,
|
3428
|
+
)
|
3429
|
+
deployment_filter_model.set_scope_workspace(self.active_workspace.id)
|
3430
|
+
return self.zen_store.list_deployments(
|
3431
|
+
deployment_filter_model=deployment_filter_model,
|
3432
|
+
hydrate=hydrate,
|
3433
|
+
)
|
3434
|
+
|
3435
|
+
def delete_deployment(self, id_or_prefix: str) -> None:
|
3436
|
+
"""Delete a deployment.
|
3437
|
+
|
3438
|
+
Args:
|
3439
|
+
id_or_prefix: The id or id prefix of the deployment.
|
3440
|
+
"""
|
3441
|
+
deployment = self.get_deployment(
|
3442
|
+
id_or_prefix=id_or_prefix, hydrate=False
|
3443
|
+
)
|
3444
|
+
self.zen_store.delete_deployment(deployment_id=deployment.id)
|
3445
|
+
|
3446
|
+
# ------------------------------ Run templates -----------------------------
|
3447
|
+
|
3448
|
+
def create_run_template(
|
3449
|
+
self,
|
3450
|
+
name: str,
|
3451
|
+
deployment_id: UUID,
|
3452
|
+
description: Optional[str] = None,
|
3453
|
+
tags: Optional[List[str]] = None,
|
3454
|
+
) -> RunTemplateResponse:
|
3455
|
+
"""Create a run template.
|
3456
|
+
|
3457
|
+
Args:
|
3458
|
+
name: The name of the run template.
|
3459
|
+
deployment_id: ID of the deployment which this template should be
|
3460
|
+
based off of.
|
3461
|
+
description: The description of the run template.
|
3462
|
+
tags: Tags associated with the run template.
|
3463
|
+
|
3464
|
+
Returns:
|
3465
|
+
The created run template.
|
3466
|
+
"""
|
3467
|
+
return self.zen_store.create_run_template(
|
3468
|
+
template=RunTemplateRequest(
|
3469
|
+
name=name,
|
3470
|
+
description=description,
|
3471
|
+
source_deployment_id=deployment_id,
|
3472
|
+
tags=tags,
|
3473
|
+
user=self.active_user.id,
|
3474
|
+
workspace=self.active_workspace.id,
|
3475
|
+
)
|
3476
|
+
)
|
3477
|
+
|
3478
|
+
def get_run_template(
|
3479
|
+
self,
|
3480
|
+
name_id_or_prefix: Union[str, UUID],
|
3481
|
+
hydrate: bool = True,
|
3482
|
+
) -> RunTemplateResponse:
|
3483
|
+
"""Get a run template.
|
3484
|
+
|
3485
|
+
Args:
|
3486
|
+
name_id_or_prefix: Name/ID/ID prefix of the template to get.
|
3487
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
3488
|
+
by including metadata fields in the response.
|
3489
|
+
|
3490
|
+
Returns:
|
3491
|
+
The run template.
|
3492
|
+
"""
|
3493
|
+
return self._get_entity_by_id_or_name_or_prefix(
|
3494
|
+
get_method=self.zen_store.get_run_template,
|
3495
|
+
list_method=self.list_run_templates,
|
3496
|
+
name_id_or_prefix=name_id_or_prefix,
|
3497
|
+
allow_name_prefix_match=False,
|
3498
|
+
hydrate=hydrate,
|
2250
3499
|
)
|
2251
3500
|
|
2252
|
-
def
|
3501
|
+
def list_run_templates(
|
2253
3502
|
self,
|
2254
3503
|
sort_by: str = "created",
|
2255
3504
|
page: int = PAGINATION_STARTING_PAGE,
|
2256
3505
|
size: int = PAGE_SIZE_DEFAULT,
|
2257
3506
|
logical_operator: LogicalOperators = LogicalOperators.AND,
|
2258
|
-
id: Optional[Union[UUID, str]] = None,
|
2259
3507
|
created: Optional[Union[datetime, str]] = None,
|
2260
3508
|
updated: Optional[Union[datetime, str]] = None,
|
3509
|
+
id: Optional[Union[UUID, str]] = None,
|
3510
|
+
name: Optional[str] = None,
|
3511
|
+
tag: Optional[str] = None,
|
2261
3512
|
workspace_id: Optional[Union[str, UUID]] = None,
|
2262
3513
|
user_id: Optional[Union[str, UUID]] = None,
|
2263
3514
|
pipeline_id: Optional[Union[str, UUID]] = None,
|
2264
|
-
stack_id: Optional[Union[str, UUID]] = None,
|
2265
3515
|
build_id: Optional[Union[str, UUID]] = None,
|
3516
|
+
stack_id: Optional[Union[str, UUID]] = None,
|
3517
|
+
code_repository_id: Optional[Union[str, UUID]] = None,
|
3518
|
+
user: Optional[Union[UUID, str]] = None,
|
3519
|
+
pipeline: Optional[Union[UUID, str]] = None,
|
3520
|
+
stack: Optional[Union[UUID, str]] = None,
|
2266
3521
|
hydrate: bool = False,
|
2267
|
-
) -> Page[
|
2268
|
-
"""
|
3522
|
+
) -> Page[RunTemplateResponse]:
|
3523
|
+
"""Get a page of run templates.
|
2269
3524
|
|
2270
3525
|
Args:
|
2271
|
-
sort_by: The column to sort by
|
2272
|
-
page: The page of items
|
2273
|
-
size: The maximum size of all pages
|
2274
|
-
logical_operator: Which logical operator to use [and, or]
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
3526
|
+
sort_by: The column to sort by.
|
3527
|
+
page: The page of items.
|
3528
|
+
size: The maximum size of all pages.
|
3529
|
+
logical_operator: Which logical operator to use [and, or].
|
3530
|
+
created: Filter by the creation date.
|
3531
|
+
updated: Filter by the last updated date.
|
3532
|
+
id: Filter by run template ID.
|
3533
|
+
name: Filter by run template name.
|
3534
|
+
tag: Filter by run template tags.
|
3535
|
+
workspace_id: Filter by workspace ID.
|
3536
|
+
user_id: Filter by user ID.
|
3537
|
+
pipeline_id: Filter by pipeline ID.
|
3538
|
+
build_id: Filter by build ID.
|
3539
|
+
stack_id: Filter by stack ID.
|
3540
|
+
code_repository_id: Filter by code repository ID.
|
3541
|
+
user: Filter by user name/ID.
|
3542
|
+
pipeline: Filter by pipeline name/ID.
|
3543
|
+
stack: Filter by stack name/ID.
|
2283
3544
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2284
3545
|
by including metadata fields in the response.
|
2285
3546
|
|
2286
3547
|
Returns:
|
2287
|
-
A page
|
3548
|
+
A page of run templates.
|
2288
3549
|
"""
|
2289
|
-
|
3550
|
+
filter = RunTemplateFilter(
|
2290
3551
|
sort_by=sort_by,
|
2291
3552
|
page=page,
|
2292
3553
|
size=size,
|
2293
3554
|
logical_operator=logical_operator,
|
2294
|
-
id=id,
|
2295
3555
|
created=created,
|
2296
3556
|
updated=updated,
|
3557
|
+
id=id,
|
3558
|
+
name=name,
|
3559
|
+
tag=tag,
|
2297
3560
|
workspace_id=workspace_id,
|
2298
3561
|
user_id=user_id,
|
2299
3562
|
pipeline_id=pipeline_id,
|
2300
|
-
stack_id=stack_id,
|
2301
3563
|
build_id=build_id,
|
3564
|
+
stack_id=stack_id,
|
3565
|
+
code_repository_id=code_repository_id,
|
3566
|
+
user=user,
|
3567
|
+
pipeline=pipeline,
|
3568
|
+
stack=stack,
|
2302
3569
|
)
|
2303
|
-
|
2304
|
-
return self.zen_store.
|
2305
|
-
|
2306
|
-
hydrate=hydrate,
|
3570
|
+
|
3571
|
+
return self.zen_store.list_run_templates(
|
3572
|
+
template_filter_model=filter, hydrate=hydrate
|
2307
3573
|
)
|
2308
3574
|
|
2309
|
-
def
|
2310
|
-
|
3575
|
+
def update_run_template(
|
3576
|
+
self,
|
3577
|
+
name_id_or_prefix: Union[str, UUID],
|
3578
|
+
name: Optional[str] = None,
|
3579
|
+
description: Optional[str] = None,
|
3580
|
+
add_tags: Optional[List[str]] = None,
|
3581
|
+
remove_tags: Optional[List[str]] = None,
|
3582
|
+
) -> RunTemplateResponse:
|
3583
|
+
"""Update a run template.
|
2311
3584
|
|
2312
3585
|
Args:
|
2313
|
-
|
3586
|
+
name_id_or_prefix: Name/ID/ID prefix of the template to update.
|
3587
|
+
name: The new name of the run template.
|
3588
|
+
description: The new description of the run template.
|
3589
|
+
add_tags: Tags to add to the run template.
|
3590
|
+
remove_tags: Tags to remove from the run template.
|
3591
|
+
|
3592
|
+
Returns:
|
3593
|
+
The updated run template.
|
2314
3594
|
"""
|
2315
|
-
|
2316
|
-
|
3595
|
+
if is_valid_uuid(name_id_or_prefix):
|
3596
|
+
template_id = (
|
3597
|
+
UUID(name_id_or_prefix)
|
3598
|
+
if isinstance(name_id_or_prefix, str)
|
3599
|
+
else name_id_or_prefix
|
3600
|
+
)
|
3601
|
+
else:
|
3602
|
+
template_id = self.get_run_template(
|
3603
|
+
name_id_or_prefix, hydrate=False
|
3604
|
+
).id
|
3605
|
+
|
3606
|
+
return self.zen_store.update_run_template(
|
3607
|
+
template_id=template_id,
|
3608
|
+
template_update=RunTemplateUpdate(
|
3609
|
+
name=name,
|
3610
|
+
description=description,
|
3611
|
+
add_tags=add_tags,
|
3612
|
+
remove_tags=remove_tags,
|
3613
|
+
),
|
3614
|
+
)
|
3615
|
+
|
3616
|
+
def delete_run_template(self, name_id_or_prefix: Union[str, UUID]) -> None:
|
3617
|
+
"""Delete a run template.
|
3618
|
+
|
3619
|
+
Args:
|
3620
|
+
name_id_or_prefix: Name/ID/ID prefix of the template to delete.
|
3621
|
+
"""
|
3622
|
+
if is_valid_uuid(name_id_or_prefix):
|
3623
|
+
template_id = (
|
3624
|
+
UUID(name_id_or_prefix)
|
3625
|
+
if isinstance(name_id_or_prefix, str)
|
3626
|
+
else name_id_or_prefix
|
3627
|
+
)
|
3628
|
+
else:
|
3629
|
+
template_id = self.get_run_template(
|
3630
|
+
name_id_or_prefix, hydrate=False
|
3631
|
+
).id
|
3632
|
+
|
3633
|
+
self.zen_store.delete_run_template(template_id=template_id)
|
2317
3634
|
|
2318
3635
|
# ------------------------------- Schedules --------------------------------
|
2319
3636
|
|
@@ -2354,6 +3671,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2354
3671
|
name: Optional[str] = None,
|
2355
3672
|
workspace_id: Optional[Union[str, UUID]] = None,
|
2356
3673
|
user_id: Optional[Union[str, UUID]] = None,
|
3674
|
+
user: Optional[Union[UUID, str]] = None,
|
2357
3675
|
pipeline_id: Optional[Union[str, UUID]] = None,
|
2358
3676
|
orchestrator_id: Optional[Union[str, UUID]] = None,
|
2359
3677
|
active: Optional[Union[str, bool]] = None,
|
@@ -2363,6 +3681,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2363
3681
|
interval_second: Optional[int] = None,
|
2364
3682
|
catchup: Optional[Union[str, bool]] = None,
|
2365
3683
|
hydrate: bool = False,
|
3684
|
+
run_once_start_time: Optional[Union[datetime, str]] = None,
|
2366
3685
|
) -> Page[ScheduleResponse]:
|
2367
3686
|
"""List schedules.
|
2368
3687
|
|
@@ -2377,6 +3696,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2377
3696
|
name: The name of the stack to filter by.
|
2378
3697
|
workspace_id: The id of the workspace to filter by.
|
2379
3698
|
user_id: The id of the user to filter by.
|
3699
|
+
user: Filter by user name/ID.
|
2380
3700
|
pipeline_id: The id of the pipeline to filter by.
|
2381
3701
|
orchestrator_id: The id of the orchestrator to filter by.
|
2382
3702
|
active: Use to filter by active status.
|
@@ -2387,6 +3707,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2387
3707
|
catchup: Use to filter by catchup.
|
2388
3708
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2389
3709
|
by including metadata fields in the response.
|
3710
|
+
run_once_start_time: Use to filter by run once start time.
|
2390
3711
|
|
2391
3712
|
Returns:
|
2392
3713
|
A list of schedules.
|
@@ -2402,6 +3723,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2402
3723
|
name=name,
|
2403
3724
|
workspace_id=workspace_id,
|
2404
3725
|
user_id=user_id,
|
3726
|
+
user=user,
|
2405
3727
|
pipeline_id=pipeline_id,
|
2406
3728
|
orchestrator_id=orchestrator_id,
|
2407
3729
|
active=active,
|
@@ -2410,6 +3732,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2410
3732
|
end_time=end_time,
|
2411
3733
|
interval_second=interval_second,
|
2412
3734
|
catchup=catchup,
|
3735
|
+
run_once_start_time=run_once_start_time,
|
2413
3736
|
)
|
2414
3737
|
schedule_filter_model.set_scope_workspace(self.active_workspace.id)
|
2415
3738
|
return self.zen_store.list_schedules(
|
@@ -2473,18 +3796,30 @@ class Client(metaclass=ClientMetaClass):
|
|
2473
3796
|
name: Optional[str] = None,
|
2474
3797
|
workspace_id: Optional[Union[str, UUID]] = None,
|
2475
3798
|
pipeline_id: Optional[Union[str, UUID]] = None,
|
3799
|
+
pipeline_name: Optional[str] = None,
|
2476
3800
|
user_id: Optional[Union[str, UUID]] = None,
|
2477
3801
|
stack_id: Optional[Union[str, UUID]] = None,
|
2478
3802
|
schedule_id: Optional[Union[str, UUID]] = None,
|
2479
3803
|
build_id: Optional[Union[str, UUID]] = None,
|
2480
3804
|
deployment_id: Optional[Union[str, UUID]] = None,
|
2481
3805
|
code_repository_id: Optional[Union[str, UUID]] = None,
|
3806
|
+
template_id: Optional[Union[str, UUID]] = None,
|
3807
|
+
model_version_id: Optional[Union[str, UUID]] = None,
|
2482
3808
|
orchestrator_run_id: Optional[str] = None,
|
2483
3809
|
status: Optional[str] = None,
|
2484
3810
|
start_time: Optional[Union[datetime, str]] = None,
|
2485
3811
|
end_time: Optional[Union[datetime, str]] = None,
|
2486
3812
|
num_steps: Optional[Union[int, str]] = None,
|
2487
3813
|
unlisted: Optional[bool] = None,
|
3814
|
+
templatable: Optional[bool] = None,
|
3815
|
+
tag: Optional[str] = None,
|
3816
|
+
user: Optional[Union[UUID, str]] = None,
|
3817
|
+
run_metadata: Optional[Dict[str, str]] = None,
|
3818
|
+
pipeline: Optional[Union[UUID, str]] = None,
|
3819
|
+
code_repository: Optional[Union[UUID, str]] = None,
|
3820
|
+
model: Optional[Union[UUID, str]] = None,
|
3821
|
+
stack: Optional[Union[UUID, str]] = None,
|
3822
|
+
stack_component: Optional[Union[UUID, str]] = None,
|
2488
3823
|
hydrate: bool = False,
|
2489
3824
|
) -> Page[PipelineRunResponse]:
|
2490
3825
|
"""List all pipeline runs.
|
@@ -2499,12 +3834,16 @@ class Client(metaclass=ClientMetaClass):
|
|
2499
3834
|
updated: Use the last updated date for filtering
|
2500
3835
|
workspace_id: The id of the workspace to filter by.
|
2501
3836
|
pipeline_id: The id of the pipeline to filter by.
|
3837
|
+
pipeline_name: DEPRECATED. Use `pipeline` instead to filter by
|
3838
|
+
pipeline name.
|
2502
3839
|
user_id: The id of the user to filter by.
|
2503
3840
|
stack_id: The id of the stack to filter by.
|
2504
3841
|
schedule_id: The id of the schedule to filter by.
|
2505
3842
|
build_id: The id of the build to filter by.
|
2506
3843
|
deployment_id: The id of the deployment to filter by.
|
2507
3844
|
code_repository_id: The id of the code repository to filter by.
|
3845
|
+
template_id: The ID of the template to filter by.
|
3846
|
+
model_version_id: The ID of the model version to filter by.
|
2508
3847
|
orchestrator_run_id: The run id of the orchestrator to filter by.
|
2509
3848
|
name: The name of the run to filter by.
|
2510
3849
|
status: The status of the pipeline run
|
@@ -2512,6 +3851,15 @@ class Client(metaclass=ClientMetaClass):
|
|
2512
3851
|
end_time: The end_time for the pipeline run
|
2513
3852
|
num_steps: The number of steps for the pipeline run
|
2514
3853
|
unlisted: If the runs should be unlisted or not.
|
3854
|
+
templatable: If the runs should be templatable or not.
|
3855
|
+
tag: Tag to filter by.
|
3856
|
+
user: The name/ID of the user to filter by.
|
3857
|
+
run_metadata: The run_metadata of the run to filter by.
|
3858
|
+
pipeline: The name/ID of the pipeline to filter by.
|
3859
|
+
code_repository: Filter by code repository name/ID.
|
3860
|
+
model: Filter by model name/ID.
|
3861
|
+
stack: Filter by stack name/ID.
|
3862
|
+
stack_component: Filter by stack component name/ID.
|
2515
3863
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2516
3864
|
by including metadata fields in the response.
|
2517
3865
|
|
@@ -2529,10 +3877,13 @@ class Client(metaclass=ClientMetaClass):
|
|
2529
3877
|
name=name,
|
2530
3878
|
workspace_id=workspace_id,
|
2531
3879
|
pipeline_id=pipeline_id,
|
3880
|
+
pipeline_name=pipeline_name,
|
2532
3881
|
schedule_id=schedule_id,
|
2533
3882
|
build_id=build_id,
|
2534
3883
|
deployment_id=deployment_id,
|
2535
3884
|
code_repository_id=code_repository_id,
|
3885
|
+
template_id=template_id,
|
3886
|
+
model_version_id=model_version_id,
|
2536
3887
|
orchestrator_run_id=orchestrator_run_id,
|
2537
3888
|
user_id=user_id,
|
2538
3889
|
stack_id=stack_id,
|
@@ -2540,7 +3891,16 @@ class Client(metaclass=ClientMetaClass):
|
|
2540
3891
|
start_time=start_time,
|
2541
3892
|
end_time=end_time,
|
2542
3893
|
num_steps=num_steps,
|
3894
|
+
tag=tag,
|
2543
3895
|
unlisted=unlisted,
|
3896
|
+
user=user,
|
3897
|
+
run_metadata=run_metadata,
|
3898
|
+
pipeline=pipeline,
|
3899
|
+
code_repository=code_repository,
|
3900
|
+
stack=stack,
|
3901
|
+
model=model,
|
3902
|
+
stack_component=stack_component,
|
3903
|
+
templatable=templatable,
|
2544
3904
|
)
|
2545
3905
|
runs_filter_model.set_scope_workspace(self.active_workspace.id)
|
2546
3906
|
return self.zen_store.list_runs(
|
@@ -2548,21 +3908,6 @@ class Client(metaclass=ClientMetaClass):
|
|
2548
3908
|
hydrate=hydrate,
|
2549
3909
|
)
|
2550
3910
|
|
2551
|
-
def list_runs(self, **kwargs: Any) -> Page[PipelineRunResponse]:
|
2552
|
-
"""(Deprecated) List all pipeline runs.
|
2553
|
-
|
2554
|
-
Args:
|
2555
|
-
**kwargs: The filter arguments passed to `list_pipeline_runs`.
|
2556
|
-
|
2557
|
-
Returns:
|
2558
|
-
A page with Pipeline Runs fitting the filter description
|
2559
|
-
"""
|
2560
|
-
logger.warning(
|
2561
|
-
"`Client.list_runs()` is deprecated and will be removed in a "
|
2562
|
-
"future release. Please use `Client.list_pipeline_runs()` instead."
|
2563
|
-
)
|
2564
|
-
return self.list_pipeline_runs(**kwargs)
|
2565
|
-
|
2566
3911
|
def delete_pipeline_run(
|
2567
3912
|
self,
|
2568
3913
|
name_id_or_prefix: Union[str, UUID],
|
@@ -2609,17 +3954,19 @@ class Client(metaclass=ClientMetaClass):
|
|
2609
3954
|
created: Optional[Union[datetime, str]] = None,
|
2610
3955
|
updated: Optional[Union[datetime, str]] = None,
|
2611
3956
|
name: Optional[str] = None,
|
2612
|
-
entrypoint_name: Optional[str] = None,
|
2613
|
-
code_hash: Optional[str] = None,
|
2614
3957
|
cache_key: Optional[str] = None,
|
3958
|
+
code_hash: Optional[str] = None,
|
2615
3959
|
status: Optional[str] = None,
|
2616
3960
|
start_time: Optional[Union[datetime, str]] = None,
|
2617
3961
|
end_time: Optional[Union[datetime, str]] = None,
|
2618
3962
|
pipeline_run_id: Optional[Union[str, UUID]] = None,
|
3963
|
+
deployment_id: Optional[Union[str, UUID]] = None,
|
2619
3964
|
original_step_run_id: Optional[Union[str, UUID]] = None,
|
2620
3965
|
workspace_id: Optional[Union[str, UUID]] = None,
|
2621
3966
|
user_id: Optional[Union[str, UUID]] = None,
|
2622
|
-
|
3967
|
+
user: Optional[Union[UUID, str]] = None,
|
3968
|
+
model_version_id: Optional[Union[str, UUID]] = None,
|
3969
|
+
model: Optional[Union[UUID, str]] = None,
|
2623
3970
|
hydrate: bool = False,
|
2624
3971
|
) -> Page[StepRunResponse]:
|
2625
3972
|
"""List all pipelines.
|
@@ -2636,14 +3983,16 @@ class Client(metaclass=ClientMetaClass):
|
|
2636
3983
|
end_time: Use to filter by the time when the step finished running
|
2637
3984
|
workspace_id: The id of the workspace to filter by.
|
2638
3985
|
user_id: The id of the user to filter by.
|
2639
|
-
|
2640
|
-
|
2641
|
-
|
2642
|
-
|
2643
|
-
|
2644
|
-
|
3986
|
+
user: Filter by user name/ID.
|
3987
|
+
pipeline_run_id: The id of the pipeline run to filter by.
|
3988
|
+
deployment_id: The id of the deployment to filter by.
|
3989
|
+
original_step_run_id: The id of the original step run to filter by.
|
3990
|
+
model_version_id: The ID of the model version to filter by.
|
3991
|
+
model: Filter by model name/ID.
|
3992
|
+
name: The name of the step run to filter by.
|
3993
|
+
cache_key: The cache key of the step run to filter by.
|
3994
|
+
code_hash: The code hash of the step run to filter by.
|
2645
3995
|
status: The name of the run to filter by.
|
2646
|
-
num_outputs: The number of outputs for the step run
|
2647
3996
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2648
3997
|
by including metadata fields in the response.
|
2649
3998
|
|
@@ -2656,10 +4005,10 @@ class Client(metaclass=ClientMetaClass):
|
|
2656
4005
|
size=size,
|
2657
4006
|
logical_operator=logical_operator,
|
2658
4007
|
id=id,
|
2659
|
-
entrypoint_name=entrypoint_name,
|
2660
|
-
code_hash=code_hash,
|
2661
4008
|
cache_key=cache_key,
|
4009
|
+
code_hash=code_hash,
|
2662
4010
|
pipeline_run_id=pipeline_run_id,
|
4011
|
+
deployment_id=deployment_id,
|
2663
4012
|
original_step_run_id=original_step_run_id,
|
2664
4013
|
status=status,
|
2665
4014
|
created=created,
|
@@ -2669,7 +4018,9 @@ class Client(metaclass=ClientMetaClass):
|
|
2669
4018
|
name=name,
|
2670
4019
|
workspace_id=workspace_id,
|
2671
4020
|
user_id=user_id,
|
2672
|
-
|
4021
|
+
user=user,
|
4022
|
+
model_version_id=model_version_id,
|
4023
|
+
model=model,
|
2673
4024
|
)
|
2674
4025
|
step_run_filter_model.set_scope_workspace(self.active_workspace.id)
|
2675
4026
|
return self.zen_store.list_run_steps(
|
@@ -2757,6 +4108,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2757
4108
|
new_name: Optional[str] = None,
|
2758
4109
|
add_tags: Optional[List[str]] = None,
|
2759
4110
|
remove_tags: Optional[List[str]] = None,
|
4111
|
+
has_custom_name: Optional[bool] = None,
|
2760
4112
|
) -> ArtifactResponse:
|
2761
4113
|
"""Update an artifact.
|
2762
4114
|
|
@@ -2765,6 +4117,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2765
4117
|
new_name: The new name of the artifact.
|
2766
4118
|
add_tags: Tags to add to the artifact.
|
2767
4119
|
remove_tags: Tags to remove from the artifact.
|
4120
|
+
has_custom_name: Whether the artifact has a custom name.
|
2768
4121
|
|
2769
4122
|
Returns:
|
2770
4123
|
The updated artifact.
|
@@ -2774,6 +4127,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2774
4127
|
name=new_name,
|
2775
4128
|
add_tags=add_tags,
|
2776
4129
|
remove_tags=remove_tags,
|
4130
|
+
has_custom_name=has_custom_name,
|
2777
4131
|
)
|
2778
4132
|
return self.zen_store.update_artifact(
|
2779
4133
|
artifact_id=artifact.id, artifact_update=artifact_update
|
@@ -2805,7 +4159,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2805
4159
|
"""
|
2806
4160
|
if delete_from_artifact_store:
|
2807
4161
|
unused_artifact_versions = depaginate(
|
2808
|
-
|
4162
|
+
self.list_artifact_versions, only_unused=True
|
2809
4163
|
)
|
2810
4164
|
for unused_artifact_version in unused_artifact_versions:
|
2811
4165
|
self._delete_artifact_from_artifact_store(
|
@@ -2837,13 +4191,35 @@ class Client(metaclass=ClientMetaClass):
|
|
2837
4191
|
Returns:
|
2838
4192
|
The artifact version.
|
2839
4193
|
"""
|
2840
|
-
|
4194
|
+
from zenml import get_step_context
|
4195
|
+
|
4196
|
+
if cll := client_lazy_loader(
|
4197
|
+
method_name="get_artifact_version",
|
4198
|
+
name_id_or_prefix=name_id_or_prefix,
|
4199
|
+
version=version,
|
4200
|
+
hydrate=hydrate,
|
4201
|
+
):
|
4202
|
+
return cll # type: ignore[return-value]
|
4203
|
+
|
4204
|
+
artifact = self._get_entity_version_by_id_or_name_or_prefix(
|
2841
4205
|
get_method=self.zen_store.get_artifact_version,
|
2842
4206
|
list_method=self.list_artifact_versions,
|
2843
4207
|
name_id_or_prefix=name_id_or_prefix,
|
2844
4208
|
version=version,
|
2845
4209
|
hydrate=hydrate,
|
2846
4210
|
)
|
4211
|
+
try:
|
4212
|
+
step_run = get_step_context().step_run
|
4213
|
+
client = Client()
|
4214
|
+
client.zen_store.update_run_step(
|
4215
|
+
step_run_id=step_run.id,
|
4216
|
+
step_run_update=StepRunUpdate(
|
4217
|
+
loaded_artifact_versions={artifact.name: artifact.id}
|
4218
|
+
),
|
4219
|
+
)
|
4220
|
+
except RuntimeError:
|
4221
|
+
pass # Cannot link to step run if called outside a step
|
4222
|
+
return artifact
|
2847
4223
|
|
2848
4224
|
def list_artifact_versions(
|
2849
4225
|
self,
|
@@ -2865,10 +4241,15 @@ class Client(metaclass=ClientMetaClass):
|
|
2865
4241
|
materializer: Optional[str] = None,
|
2866
4242
|
workspace_id: Optional[Union[str, UUID]] = None,
|
2867
4243
|
user_id: Optional[Union[str, UUID]] = None,
|
4244
|
+
model_version_id: Optional[Union[str, UUID]] = None,
|
2868
4245
|
only_unused: Optional[bool] = False,
|
2869
4246
|
has_custom_name: Optional[bool] = None,
|
2870
|
-
|
4247
|
+
user: Optional[Union[UUID, str]] = None,
|
4248
|
+
model: Optional[Union[UUID, str]] = None,
|
4249
|
+
pipeline_run: Optional[Union[UUID, str]] = None,
|
4250
|
+
run_metadata: Optional[Dict[str, str]] = None,
|
2871
4251
|
tag: Optional[str] = None,
|
4252
|
+
hydrate: bool = False,
|
2872
4253
|
) -> Page[ArtifactVersionResponse]:
|
2873
4254
|
"""Get a list of artifact versions.
|
2874
4255
|
|
@@ -2890,13 +4271,18 @@ class Client(metaclass=ClientMetaClass):
|
|
2890
4271
|
uri: The uri of the artifact to filter by.
|
2891
4272
|
materializer: The materializer of the artifact to filter by.
|
2892
4273
|
workspace_id: The id of the workspace to filter by.
|
2893
|
-
user_id: The
|
4274
|
+
user_id: The id of the user to filter by.
|
4275
|
+
model_version_id: Filter by model version ID.
|
2894
4276
|
only_unused: Only return artifact versions that are not used in
|
2895
4277
|
any pipeline runs.
|
2896
4278
|
has_custom_name: Filter artifacts with/without custom names.
|
4279
|
+
tag: A tag to filter by.
|
4280
|
+
user: Filter by user name or ID.
|
4281
|
+
model: Filter by model name or ID.
|
4282
|
+
pipeline_run: Filter by pipeline run name or ID.
|
4283
|
+
run_metadata: Filter by run metadata.
|
2897
4284
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2898
4285
|
by including metadata fields in the response.
|
2899
|
-
tag: A tag to filter by.
|
2900
4286
|
|
2901
4287
|
Returns:
|
2902
4288
|
A list of artifact versions.
|
@@ -2920,9 +4306,13 @@ class Client(metaclass=ClientMetaClass):
|
|
2920
4306
|
materializer=materializer,
|
2921
4307
|
workspace_id=workspace_id,
|
2922
4308
|
user_id=user_id,
|
4309
|
+
model_version_id=model_version_id,
|
2923
4310
|
only_unused=only_unused,
|
2924
4311
|
has_custom_name=has_custom_name,
|
2925
4312
|
tag=tag,
|
4313
|
+
user=user,
|
4314
|
+
model=model,
|
4315
|
+
pipeline_run=pipeline_run,
|
2926
4316
|
)
|
2927
4317
|
artifact_version_filter_model.set_scope_workspace(
|
2928
4318
|
self.active_workspace.id
|
@@ -3007,7 +4397,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3007
4397
|
ValueError: If the artifact version is still used in any runs.
|
3008
4398
|
"""
|
3009
4399
|
if artifact_version not in depaginate(
|
3010
|
-
|
4400
|
+
self.list_artifact_versions, only_unused=True
|
3011
4401
|
):
|
3012
4402
|
raise ValueError(
|
3013
4403
|
"The metadata of artifact versions that are used in runs "
|
@@ -3069,23 +4459,20 @@ class Client(metaclass=ClientMetaClass):
|
|
3069
4459
|
def create_run_metadata(
|
3070
4460
|
self,
|
3071
4461
|
metadata: Dict[str, "MetadataType"],
|
3072
|
-
|
3073
|
-
resource_type: MetadataResourceTypes,
|
4462
|
+
resources: List[RunMetadataResource],
|
3074
4463
|
stack_component_id: Optional[UUID] = None,
|
3075
|
-
|
4464
|
+
publisher_step_id: Optional[UUID] = None,
|
4465
|
+
) -> None:
|
3076
4466
|
"""Create run metadata.
|
3077
4467
|
|
3078
4468
|
Args:
|
3079
4469
|
metadata: The metadata to create as a dictionary of key-value pairs.
|
3080
|
-
|
3081
|
-
metadata was produced.
|
3082
|
-
resource_type: The type of the resource for which the
|
4470
|
+
resources: The list of IDs and types of the resources for that the
|
3083
4471
|
metadata was produced.
|
3084
4472
|
stack_component_id: The ID of the stack component that produced
|
3085
4473
|
the metadata.
|
3086
|
-
|
3087
|
-
|
3088
|
-
The created metadata, as string to model dictionary.
|
4474
|
+
publisher_step_id: The ID of the step execution that publishes
|
4475
|
+
this metadata automatically.
|
3089
4476
|
"""
|
3090
4477
|
from zenml.metadata.metadata_types import get_metadata_type
|
3091
4478
|
|
@@ -3114,80 +4501,13 @@ class Client(metaclass=ClientMetaClass):
|
|
3114
4501
|
run_metadata = RunMetadataRequest(
|
3115
4502
|
workspace=self.active_workspace.id,
|
3116
4503
|
user=self.active_user.id,
|
3117
|
-
|
3118
|
-
resource_type=resource_type,
|
4504
|
+
resources=resources,
|
3119
4505
|
stack_component_id=stack_component_id,
|
4506
|
+
publisher_step_id=publisher_step_id,
|
3120
4507
|
values=values,
|
3121
4508
|
types=types,
|
3122
4509
|
)
|
3123
|
-
|
3124
|
-
|
3125
|
-
def list_run_metadata(
|
3126
|
-
self,
|
3127
|
-
sort_by: str = "created",
|
3128
|
-
page: int = PAGINATION_STARTING_PAGE,
|
3129
|
-
size: int = PAGE_SIZE_DEFAULT,
|
3130
|
-
logical_operator: LogicalOperators = LogicalOperators.AND,
|
3131
|
-
id: Optional[Union[UUID, str]] = None,
|
3132
|
-
created: Optional[Union[datetime, str]] = None,
|
3133
|
-
updated: Optional[Union[datetime, str]] = None,
|
3134
|
-
workspace_id: Optional[UUID] = None,
|
3135
|
-
user_id: Optional[UUID] = None,
|
3136
|
-
resource_id: Optional[UUID] = None,
|
3137
|
-
resource_type: Optional[MetadataResourceTypes] = None,
|
3138
|
-
stack_component_id: Optional[UUID] = None,
|
3139
|
-
key: Optional[str] = None,
|
3140
|
-
value: Optional["MetadataType"] = None,
|
3141
|
-
type: Optional[str] = None,
|
3142
|
-
hydrate: bool = False,
|
3143
|
-
) -> Page[RunMetadataResponse]:
|
3144
|
-
"""List run metadata.
|
3145
|
-
|
3146
|
-
Args:
|
3147
|
-
sort_by: The field to sort the results by.
|
3148
|
-
page: The page number to return.
|
3149
|
-
size: The number of results to return per page.
|
3150
|
-
logical_operator: The logical operator to use for filtering.
|
3151
|
-
id: The ID of the metadata.
|
3152
|
-
created: The creation time of the metadata.
|
3153
|
-
updated: The last update time of the metadata.
|
3154
|
-
workspace_id: The ID of the workspace the metadata belongs to.
|
3155
|
-
user_id: The ID of the user that created the metadata.
|
3156
|
-
resource_id: The ID of the resource the metadata belongs to.
|
3157
|
-
resource_type: The type of the resource the metadata belongs to.
|
3158
|
-
stack_component_id: The ID of the stack component that produced
|
3159
|
-
the metadata.
|
3160
|
-
key: The key of the metadata.
|
3161
|
-
value: The value of the metadata.
|
3162
|
-
type: The type of the metadata.
|
3163
|
-
hydrate: Flag deciding whether to hydrate the output model(s)
|
3164
|
-
by including metadata fields in the response.
|
3165
|
-
|
3166
|
-
Returns:
|
3167
|
-
The run metadata.
|
3168
|
-
"""
|
3169
|
-
metadata_filter_model = RunMetadataFilter(
|
3170
|
-
sort_by=sort_by,
|
3171
|
-
page=page,
|
3172
|
-
size=size,
|
3173
|
-
logical_operator=logical_operator,
|
3174
|
-
id=id,
|
3175
|
-
created=created,
|
3176
|
-
updated=updated,
|
3177
|
-
workspace_id=workspace_id,
|
3178
|
-
user_id=user_id,
|
3179
|
-
resource_id=resource_id,
|
3180
|
-
resource_type=resource_type,
|
3181
|
-
stack_component_id=stack_component_id,
|
3182
|
-
key=key,
|
3183
|
-
value=value,
|
3184
|
-
type=type,
|
3185
|
-
)
|
3186
|
-
metadata_filter_model.set_scope_workspace(self.active_workspace.id)
|
3187
|
-
return self.zen_store.list_run_metadata(
|
3188
|
-
metadata_filter_model,
|
3189
|
-
hydrate=hydrate,
|
3190
|
-
)
|
4510
|
+
self.zen_store.create_run_metadata(run_metadata)
|
3191
4511
|
|
3192
4512
|
# -------------------------------- Secrets ---------------------------------
|
3193
4513
|
|
@@ -3349,10 +4669,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3349
4669
|
hydrate=hydrate,
|
3350
4670
|
)
|
3351
4671
|
|
3352
|
-
msg =
|
3353
|
-
f"No secret found with name, ID or prefix "
|
3354
|
-
f"'{name_id_or_prefix}'"
|
3355
|
-
)
|
4672
|
+
msg = f"No secret found with name, ID or prefix '{name_id_or_prefix}'"
|
3356
4673
|
if scope is not None:
|
3357
4674
|
msg += f" in scope '{scope}'"
|
3358
4675
|
|
@@ -3371,6 +4688,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3371
4688
|
scope: Optional[SecretScope] = None,
|
3372
4689
|
workspace_id: Optional[Union[str, UUID]] = None,
|
3373
4690
|
user_id: Optional[Union[str, UUID]] = None,
|
4691
|
+
user: Optional[Union[UUID, str]] = None,
|
3374
4692
|
hydrate: bool = False,
|
3375
4693
|
) -> Page[SecretResponse]:
|
3376
4694
|
"""Fetches all the secret models.
|
@@ -3390,6 +4708,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3390
4708
|
scope: The scope of the secret to filter by.
|
3391
4709
|
workspace_id: The id of the workspace to filter by.
|
3392
4710
|
user_id: The id of the user to filter by.
|
4711
|
+
user: Filter by user name/ID.
|
3393
4712
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
3394
4713
|
by including metadata fields in the response.
|
3395
4714
|
|
@@ -3406,6 +4725,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3406
4725
|
sort_by=sort_by,
|
3407
4726
|
logical_operator=logical_operator,
|
3408
4727
|
user_id=user_id,
|
4728
|
+
user=user,
|
3409
4729
|
workspace_id=workspace_id,
|
3410
4730
|
name=name,
|
3411
4731
|
scope=scope,
|
@@ -3462,7 +4782,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3462
4782
|
hydrate=True,
|
3463
4783
|
)
|
3464
4784
|
|
3465
|
-
secret_update = SecretUpdate(name=new_name or secret.name)
|
4785
|
+
secret_update = SecretUpdate(name=new_name or secret.name)
|
3466
4786
|
|
3467
4787
|
if new_scope:
|
3468
4788
|
secret_update.scope = new_scope
|
@@ -3657,10 +4977,10 @@ class Client(metaclass=ClientMetaClass):
|
|
3657
4977
|
"""
|
3658
4978
|
from zenml.code_repositories import BaseCodeRepository
|
3659
4979
|
|
3660
|
-
code_repo_class: Type[
|
3661
|
-
|
3662
|
-
|
3663
|
-
|
4980
|
+
code_repo_class: Type[BaseCodeRepository] = (
|
4981
|
+
source_utils.load_and_validate_class(
|
4982
|
+
source=source, expected_class=BaseCodeRepository
|
4983
|
+
)
|
3664
4984
|
)
|
3665
4985
|
try:
|
3666
4986
|
# Validate the repo config
|
@@ -3720,6 +5040,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3720
5040
|
name: Optional[str] = None,
|
3721
5041
|
workspace_id: Optional[Union[str, UUID]] = None,
|
3722
5042
|
user_id: Optional[Union[str, UUID]] = None,
|
5043
|
+
user: Optional[Union[UUID, str]] = None,
|
3723
5044
|
hydrate: bool = False,
|
3724
5045
|
) -> Page[CodeRepositoryResponse]:
|
3725
5046
|
"""List all code repositories.
|
@@ -3735,6 +5056,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3735
5056
|
name: The name of the code repository to filter by.
|
3736
5057
|
workspace_id: The id of the workspace to filter by.
|
3737
5058
|
user_id: The id of the user to filter by.
|
5059
|
+
user: Filter by user name/ID.
|
3738
5060
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
3739
5061
|
by including metadata fields in the response.
|
3740
5062
|
|
@@ -3752,6 +5074,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3752
5074
|
name=name,
|
3753
5075
|
workspace_id=workspace_id,
|
3754
5076
|
user_id=user_id,
|
5077
|
+
user=user,
|
3755
5078
|
)
|
3756
5079
|
filter_model.set_scope_workspace(self.active_workspace.id)
|
3757
5080
|
return self.zen_store.list_code_repositories(
|
@@ -3781,7 +5104,7 @@ class Client(metaclass=ClientMetaClass):
|
|
3781
5104
|
repo = self.get_code_repository(
|
3782
5105
|
name_id_or_prefix=name_id_or_prefix, allow_name_prefix_match=False
|
3783
5106
|
)
|
3784
|
-
update = CodeRepositoryUpdate(
|
5107
|
+
update = CodeRepositoryUpdate(
|
3785
5108
|
name=name, description=description, logo_url=logo_url
|
3786
5109
|
)
|
3787
5110
|
return self.zen_store.update_code_repository(
|
@@ -4112,6 +5435,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4112
5435
|
resource_id: Optional[str] = None,
|
4113
5436
|
workspace_id: Optional[Union[str, UUID]] = None,
|
4114
5437
|
user_id: Optional[Union[str, UUID]] = None,
|
5438
|
+
user: Optional[Union[UUID, str]] = None,
|
4115
5439
|
labels: Optional[Dict[str, Optional[str]]] = None,
|
4116
5440
|
secret_id: Optional[Union[str, UUID]] = None,
|
4117
5441
|
hydrate: bool = False,
|
@@ -4134,6 +5458,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4134
5458
|
they can give access to.
|
4135
5459
|
workspace_id: The id of the workspace to filter by.
|
4136
5460
|
user_id: The id of the user to filter by.
|
5461
|
+
user: Filter by user name/ID.
|
4137
5462
|
name: The name of the service connector to filter by.
|
4138
5463
|
labels: The labels of the service connector to filter by.
|
4139
5464
|
secret_id: Filter by the id of the secret that is referenced by the
|
@@ -4151,6 +5476,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4151
5476
|
logical_operator=logical_operator,
|
4152
5477
|
workspace_id=workspace_id or self.active_workspace.id,
|
4153
5478
|
user_id=user_id,
|
5479
|
+
user=user,
|
4154
5480
|
name=name,
|
4155
5481
|
connector_type=connector_type,
|
4156
5482
|
auth_method=auth_method,
|
@@ -4177,6 +5503,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4177
5503
|
configuration: Optional[Dict[str, str]] = None,
|
4178
5504
|
resource_id: Optional[str] = None,
|
4179
5505
|
description: Optional[str] = None,
|
5506
|
+
expires_at: Optional[datetime] = None,
|
4180
5507
|
expires_skew_tolerance: Optional[int] = None,
|
4181
5508
|
expiration_seconds: Optional[int] = None,
|
4182
5509
|
labels: Optional[Dict[str, Optional[str]]] = None,
|
@@ -4220,6 +5547,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4220
5547
|
If set to the empty string, the existing resource ID will be
|
4221
5548
|
removed.
|
4222
5549
|
description: The description of the service connector.
|
5550
|
+
expires_at: The new UTC expiration time of the service connector.
|
4223
5551
|
expires_skew_tolerance: The allowed expiration skew for the service
|
4224
5552
|
connector credentials.
|
4225
5553
|
expiration_seconds: The expiration time of the service connector.
|
@@ -4286,11 +5614,11 @@ class Client(metaclass=ClientMetaClass):
|
|
4286
5614
|
connector_type=connector.connector_type,
|
4287
5615
|
description=description or connector_model.description,
|
4288
5616
|
auth_method=auth_method or connector_model.auth_method,
|
5617
|
+
expires_at=expires_at,
|
4289
5618
|
expires_skew_tolerance=expires_skew_tolerance,
|
4290
5619
|
expiration_seconds=expiration_seconds,
|
4291
|
-
user=self.active_user.id,
|
4292
|
-
workspace=self.active_workspace.id,
|
4293
5620
|
)
|
5621
|
+
|
4294
5622
|
# Validate and configure the resources
|
4295
5623
|
if configuration is not None:
|
4296
5624
|
# The supplied configuration is a drop-in replacement for the
|
@@ -4331,21 +5659,32 @@ class Client(metaclass=ClientMetaClass):
|
|
4331
5659
|
|
4332
5660
|
if verify:
|
4333
5661
|
# Prefer to verify the connector config server-side if the
|
4334
|
-
# implementation if available there, because it ensures
|
5662
|
+
# implementation, if available there, because it ensures
|
4335
5663
|
# that the connector can be shared with other users or used
|
4336
5664
|
# from other machines and because some auth methods rely on the
|
4337
5665
|
# server-side authentication environment
|
5666
|
+
|
5667
|
+
# Convert the update model to a request model for validation
|
5668
|
+
connector_request_dict = connector_update.model_dump()
|
5669
|
+
connector_request_dict.update(
|
5670
|
+
user=self.active_user.id,
|
5671
|
+
workspace=self.active_workspace.id,
|
5672
|
+
)
|
5673
|
+
connector_request = ServiceConnectorRequest.model_validate(
|
5674
|
+
connector_request_dict
|
5675
|
+
)
|
5676
|
+
|
4338
5677
|
if connector.remote:
|
4339
5678
|
connector_resources = (
|
4340
5679
|
self.zen_store.verify_service_connector_config(
|
4341
|
-
|
5680
|
+
service_connector=connector_request,
|
4342
5681
|
list_resources=list_resources,
|
4343
5682
|
)
|
4344
5683
|
)
|
4345
5684
|
else:
|
4346
5685
|
connector_instance = (
|
4347
5686
|
service_connector_registry.instantiate_connector(
|
4348
|
-
model=
|
5687
|
+
model=connector_request,
|
4349
5688
|
)
|
4350
5689
|
)
|
4351
5690
|
connector_resources = connector_instance.verify(
|
@@ -4509,6 +5848,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4509
5848
|
name_id_or_prefix=name_id_or_prefix,
|
4510
5849
|
resource_type=resource_type,
|
4511
5850
|
resource_id=resource_id,
|
5851
|
+
verify=False,
|
4512
5852
|
)
|
4513
5853
|
|
4514
5854
|
connector_client.configure_local_client(
|
@@ -4522,6 +5862,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4522
5862
|
name_id_or_prefix: Union[UUID, str],
|
4523
5863
|
resource_type: Optional[str] = None,
|
4524
5864
|
resource_id: Optional[str] = None,
|
5865
|
+
verify: bool = False,
|
4525
5866
|
) -> "ServiceConnector":
|
4526
5867
|
"""Get the client side of a service connector instance to use with a local client.
|
4527
5868
|
|
@@ -4537,6 +5878,8 @@ class Client(metaclass=ClientMetaClass):
|
|
4537
5878
|
equivalent to the one requested, a `ValueError` exception is
|
4538
5879
|
raised. May be omitted for connectors and resource types that do
|
4539
5880
|
not support multiple resource instances.
|
5881
|
+
verify: Whether to verify that the service connector configuration
|
5882
|
+
and credentials can be used to gain access to the resource.
|
4540
5883
|
|
4541
5884
|
Returns:
|
4542
5885
|
The client side of the indicated service connector instance that can
|
@@ -4574,9 +5917,10 @@ class Client(metaclass=ClientMetaClass):
|
|
4574
5917
|
)
|
4575
5918
|
)
|
4576
5919
|
|
4577
|
-
|
4578
|
-
|
4579
|
-
|
5920
|
+
if verify:
|
5921
|
+
# Verify the connector client on the local machine, because the
|
5922
|
+
# server-side implementation may not be able to do so
|
5923
|
+
connector_client.verify()
|
4580
5924
|
else:
|
4581
5925
|
connector_instance = (
|
4582
5926
|
service_connector_registry.instantiate_connector(
|
@@ -4727,6 +6071,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4727
6071
|
ethics: Optional[str] = None,
|
4728
6072
|
add_tags: Optional[List[str]] = None,
|
4729
6073
|
remove_tags: Optional[List[str]] = None,
|
6074
|
+
save_models_to_registry: Optional[bool] = None,
|
4730
6075
|
) -> ModelResponse:
|
4731
6076
|
"""Updates an existing model in Model Control Plane.
|
4732
6077
|
|
@@ -4742,6 +6087,8 @@ class Client(metaclass=ClientMetaClass):
|
|
4742
6087
|
ethics: The ethical implications of the model.
|
4743
6088
|
add_tags: Tags to add to the model.
|
4744
6089
|
remove_tags: Tags to remove from to the model.
|
6090
|
+
save_models_to_registry: Whether to save the model to the
|
6091
|
+
registry.
|
4745
6092
|
|
4746
6093
|
Returns:
|
4747
6094
|
The updated model.
|
@@ -4761,6 +6108,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4761
6108
|
ethics=ethics,
|
4762
6109
|
add_tags=add_tags,
|
4763
6110
|
remove_tags=remove_tags,
|
6111
|
+
save_models_to_registry=save_models_to_registry,
|
4764
6112
|
),
|
4765
6113
|
)
|
4766
6114
|
|
@@ -4779,6 +6127,10 @@ class Client(metaclass=ClientMetaClass):
|
|
4779
6127
|
Returns:
|
4780
6128
|
The model of interest.
|
4781
6129
|
"""
|
6130
|
+
if cll := client_lazy_loader(
|
6131
|
+
"get_model", model_name_or_id=model_name_or_id, hydrate=hydrate
|
6132
|
+
):
|
6133
|
+
return cll # type: ignore[return-value]
|
4782
6134
|
return self.zen_store.get_model(
|
4783
6135
|
model_name_or_id=model_name_or_id,
|
4784
6136
|
hydrate=hydrate,
|
@@ -4793,6 +6145,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4793
6145
|
created: Optional[Union[datetime, str]] = None,
|
4794
6146
|
updated: Optional[Union[datetime, str]] = None,
|
4795
6147
|
name: Optional[str] = None,
|
6148
|
+
user: Optional[Union[UUID, str]] = None,
|
4796
6149
|
hydrate: bool = False,
|
4797
6150
|
tag: Optional[str] = None,
|
4798
6151
|
) -> Page[ModelResponse]:
|
@@ -4806,6 +6159,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4806
6159
|
created: Use to filter by time of creation
|
4807
6160
|
updated: Use the last updated date for filtering
|
4808
6161
|
name: The name of the model to filter by.
|
6162
|
+
user: Filter by user name/ID.
|
4809
6163
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
4810
6164
|
by including metadata fields in the response.
|
4811
6165
|
tag: The tag of the model to filter by.
|
@@ -4822,6 +6176,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4822
6176
|
created=created,
|
4823
6177
|
updated=updated,
|
4824
6178
|
tag=tag,
|
6179
|
+
user=user,
|
4825
6180
|
)
|
4826
6181
|
|
4827
6182
|
return self.zen_store.list_models(
|
@@ -4879,7 +6234,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4879
6234
|
|
4880
6235
|
def get_model_version(
|
4881
6236
|
self,
|
4882
|
-
model_name_or_id: Union[str, UUID],
|
6237
|
+
model_name_or_id: Optional[Union[str, UUID]] = None,
|
4883
6238
|
model_version_name_or_number_or_id: Optional[
|
4884
6239
|
Union[str, int, ModelStages, UUID]
|
4885
6240
|
] = None,
|
@@ -4902,7 +6257,25 @@ class Client(metaclass=ClientMetaClass):
|
|
4902
6257
|
Raises:
|
4903
6258
|
RuntimeError: In case method inputs don't adhere to restrictions.
|
4904
6259
|
KeyError: In case no model version with the identifiers exists.
|
6260
|
+
ValueError: In case retrieval is attempted using non UUID model version
|
6261
|
+
identifier and no model identifier provided.
|
4905
6262
|
"""
|
6263
|
+
if (
|
6264
|
+
not is_valid_uuid(model_version_name_or_number_or_id)
|
6265
|
+
and model_name_or_id is None
|
6266
|
+
):
|
6267
|
+
raise ValueError(
|
6268
|
+
"No model identifier provided and model version identifier "
|
6269
|
+
f"`{model_version_name_or_number_or_id}` is not a valid UUID."
|
6270
|
+
)
|
6271
|
+
if cll := client_lazy_loader(
|
6272
|
+
"get_model_version",
|
6273
|
+
model_name_or_id=model_name_or_id,
|
6274
|
+
model_version_name_or_number_or_id=model_version_name_or_number_or_id,
|
6275
|
+
hydrate=hydrate,
|
6276
|
+
):
|
6277
|
+
return cll # type: ignore[return-value]
|
6278
|
+
|
4906
6279
|
if model_version_name_or_number_or_id is None:
|
4907
6280
|
model_version_name_or_number_or_id = ModelStages.LATEST
|
4908
6281
|
|
@@ -4983,6 +6356,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4983
6356
|
name: Optional[str] = None,
|
4984
6357
|
number: Optional[int] = None,
|
4985
6358
|
stage: Optional[Union[str, ModelStages]] = None,
|
6359
|
+
user: Optional[Union[UUID, str]] = None,
|
4986
6360
|
hydrate: bool = False,
|
4987
6361
|
tag: Optional[str] = None,
|
4988
6362
|
) -> Page[ModelVersionResponse]:
|
@@ -5000,6 +6374,7 @@ class Client(metaclass=ClientMetaClass):
|
|
5000
6374
|
name: name or id of the model version.
|
5001
6375
|
number: number of the model version.
|
5002
6376
|
stage: stage of the model version.
|
6377
|
+
user: Filter by user name/ID.
|
5003
6378
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
5004
6379
|
by including metadata fields in the response.
|
5005
6380
|
tag: The tag to filter by.
|
@@ -5018,6 +6393,7 @@ class Client(metaclass=ClientMetaClass):
|
|
5018
6393
|
number=number,
|
5019
6394
|
stage=stage,
|
5020
6395
|
tag=tag,
|
6396
|
+
user=user,
|
5021
6397
|
)
|
5022
6398
|
|
5023
6399
|
return self.zen_store.list_model_versions(
|
@@ -5085,9 +6461,6 @@ class Client(metaclass=ClientMetaClass):
|
|
5085
6461
|
logical_operator: LogicalOperators = LogicalOperators.AND,
|
5086
6462
|
created: Optional[Union[datetime, str]] = None,
|
5087
6463
|
updated: Optional[Union[datetime, str]] = None,
|
5088
|
-
workspace_id: Optional[Union[UUID, str]] = None,
|
5089
|
-
user_id: Optional[Union[UUID, str]] = None,
|
5090
|
-
model_id: Optional[Union[UUID, str]] = None,
|
5091
6464
|
model_version_id: Optional[Union[UUID, str]] = None,
|
5092
6465
|
artifact_version_id: Optional[Union[UUID, str]] = None,
|
5093
6466
|
artifact_name: Optional[str] = None,
|
@@ -5095,6 +6468,7 @@ class Client(metaclass=ClientMetaClass):
|
|
5095
6468
|
only_model_artifacts: Optional[bool] = None,
|
5096
6469
|
only_deployment_artifacts: Optional[bool] = None,
|
5097
6470
|
has_custom_name: Optional[bool] = None,
|
6471
|
+
user: Optional[Union[UUID, str]] = None,
|
5098
6472
|
hydrate: bool = False,
|
5099
6473
|
) -> Page[ModelVersionArtifactResponse]:
|
5100
6474
|
"""Get model version to artifact links by filter in Model Control Plane.
|
@@ -5106,9 +6480,6 @@ class Client(metaclass=ClientMetaClass):
|
|
5106
6480
|
logical_operator: Which logical operator to use [and, or]
|
5107
6481
|
created: Use to filter by time of creation
|
5108
6482
|
updated: Use the last updated date for filtering
|
5109
|
-
workspace_id: Use the workspace id for filtering
|
5110
|
-
user_id: Use the user id for filtering
|
5111
|
-
model_id: Use the model id for filtering
|
5112
6483
|
model_version_id: Use the model version id for filtering
|
5113
6484
|
artifact_version_id: Use the artifact id for filtering
|
5114
6485
|
artifact_name: Use the artifact name for filtering
|
@@ -5116,6 +6487,7 @@ class Client(metaclass=ClientMetaClass):
|
|
5116
6487
|
only_model_artifacts: Use to filter by model artifacts
|
5117
6488
|
only_deployment_artifacts: Use to filter by deployment artifacts
|
5118
6489
|
has_custom_name: Filter artifacts with/without custom names.
|
6490
|
+
user: Filter by user name/ID.
|
5119
6491
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
5120
6492
|
by including metadata fields in the response.
|
5121
6493
|
|
@@ -5130,9 +6502,6 @@ class Client(metaclass=ClientMetaClass):
|
|
5130
6502
|
size=size,
|
5131
6503
|
created=created,
|
5132
6504
|
updated=updated,
|
5133
|
-
workspace_id=workspace_id,
|
5134
|
-
user_id=user_id,
|
5135
|
-
model_id=model_id,
|
5136
6505
|
model_version_id=model_version_id,
|
5137
6506
|
artifact_version_id=artifact_version_id,
|
5138
6507
|
artifact_name=artifact_name,
|
@@ -5140,6 +6509,7 @@ class Client(metaclass=ClientMetaClass):
|
|
5140
6509
|
only_model_artifacts=only_model_artifacts,
|
5141
6510
|
only_deployment_artifacts=only_deployment_artifacts,
|
5142
6511
|
has_custom_name=has_custom_name,
|
6512
|
+
user=user,
|
5143
6513
|
),
|
5144
6514
|
hydrate=hydrate,
|
5145
6515
|
)
|
@@ -5203,12 +6573,10 @@ class Client(metaclass=ClientMetaClass):
|
|
5203
6573
|
logical_operator: LogicalOperators = LogicalOperators.AND,
|
5204
6574
|
created: Optional[Union[datetime, str]] = None,
|
5205
6575
|
updated: Optional[Union[datetime, str]] = None,
|
5206
|
-
workspace_id: Optional[Union[UUID, str]] = None,
|
5207
|
-
user_id: Optional[Union[UUID, str]] = None,
|
5208
|
-
model_id: Optional[Union[UUID, str]] = None,
|
5209
6576
|
model_version_id: Optional[Union[UUID, str]] = None,
|
5210
6577
|
pipeline_run_id: Optional[Union[UUID, str]] = None,
|
5211
6578
|
pipeline_run_name: Optional[str] = None,
|
6579
|
+
user: Optional[Union[UUID, str]] = None,
|
5212
6580
|
hydrate: bool = False,
|
5213
6581
|
) -> Page[ModelVersionPipelineRunResponse]:
|
5214
6582
|
"""Get all model version to pipeline run links by filter.
|
@@ -5220,12 +6588,10 @@ class Client(metaclass=ClientMetaClass):
|
|
5220
6588
|
logical_operator: Which logical operator to use [and, or]
|
5221
6589
|
created: Use to filter by time of creation
|
5222
6590
|
updated: Use the last updated date for filtering
|
5223
|
-
workspace_id: Use the workspace id for filtering
|
5224
|
-
user_id: Use the user id for filtering
|
5225
|
-
model_id: Use the model id for filtering
|
5226
6591
|
model_version_id: Use the model version id for filtering
|
5227
6592
|
pipeline_run_id: Use the pipeline run id for filtering
|
5228
6593
|
pipeline_run_name: Use the pipeline run name for filtering
|
6594
|
+
user: Filter by user name or ID.
|
5229
6595
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
5230
6596
|
by including metadata fields in the response
|
5231
6597
|
|
@@ -5240,12 +6606,10 @@ class Client(metaclass=ClientMetaClass):
|
|
5240
6606
|
size=size,
|
5241
6607
|
created=created,
|
5242
6608
|
updated=updated,
|
5243
|
-
workspace_id=workspace_id,
|
5244
|
-
user_id=user_id,
|
5245
|
-
model_id=model_id,
|
5246
6609
|
model_version_id=model_version_id,
|
5247
6610
|
pipeline_run_id=pipeline_run_id,
|
5248
6611
|
pipeline_run_name=pipeline_run_name,
|
6612
|
+
user=user,
|
5249
6613
|
),
|
5250
6614
|
hydrate=hydrate,
|
5251
6615
|
)
|
@@ -5265,6 +6629,7 @@ class Client(metaclass=ClientMetaClass):
|
|
5265
6629
|
client_id: Union[UUID, str, None] = None,
|
5266
6630
|
status: Union[OAuthDeviceStatus, str, None] = None,
|
5267
6631
|
trusted_device: Union[bool, str, None] = None,
|
6632
|
+
user: Optional[Union[UUID, str]] = None,
|
5268
6633
|
failed_auth_attempts: Union[int, str, None] = None,
|
5269
6634
|
last_login: Optional[Union[datetime, str, None]] = None,
|
5270
6635
|
hydrate: bool = False,
|
@@ -5282,6 +6647,7 @@ class Client(metaclass=ClientMetaClass):
|
|
5282
6647
|
expires: Use the expiration date for filtering.
|
5283
6648
|
client_id: Use the client id for filtering.
|
5284
6649
|
status: Use the status for filtering.
|
6650
|
+
user: Filter by user name/ID.
|
5285
6651
|
trusted_device: Use the trusted device flag for filtering.
|
5286
6652
|
failed_auth_attempts: Use the failed auth attempts for filtering.
|
5287
6653
|
last_login: Use the last login date for filtering.
|
@@ -5301,6 +6667,7 @@ class Client(metaclass=ClientMetaClass):
|
|
5301
6667
|
updated=updated,
|
5302
6668
|
expires=expires,
|
5303
6669
|
client_id=client_id,
|
6670
|
+
user=user,
|
5304
6671
|
status=status,
|
5305
6672
|
trusted_device=trusted_device,
|
5306
6673
|
failed_auth_attempts=failed_auth_attempts,
|
@@ -5392,10 +6759,79 @@ class Client(metaclass=ClientMetaClass):
|
|
5392
6759
|
)
|
5393
6760
|
self.zen_store.delete_authorized_device(device.id)
|
5394
6761
|
|
6762
|
+
# --------------------------- Trigger Executions ---------------------------
|
6763
|
+
|
6764
|
+
def get_trigger_execution(
|
6765
|
+
self,
|
6766
|
+
trigger_execution_id: UUID,
|
6767
|
+
hydrate: bool = True,
|
6768
|
+
) -> TriggerExecutionResponse:
|
6769
|
+
"""Get a trigger execution by ID.
|
6770
|
+
|
6771
|
+
Args:
|
6772
|
+
trigger_execution_id: The ID of the trigger execution to get.
|
6773
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
6774
|
+
by including metadata fields in the response.
|
6775
|
+
|
6776
|
+
Returns:
|
6777
|
+
The trigger execution.
|
6778
|
+
"""
|
6779
|
+
return self.zen_store.get_trigger_execution(
|
6780
|
+
trigger_execution_id=trigger_execution_id, hydrate=hydrate
|
6781
|
+
)
|
6782
|
+
|
6783
|
+
def list_trigger_executions(
|
6784
|
+
self,
|
6785
|
+
sort_by: str = "created",
|
6786
|
+
page: int = PAGINATION_STARTING_PAGE,
|
6787
|
+
size: int = PAGE_SIZE_DEFAULT,
|
6788
|
+
logical_operator: LogicalOperators = LogicalOperators.AND,
|
6789
|
+
trigger_id: Optional[UUID] = None,
|
6790
|
+
user: Optional[Union[UUID, str]] = None,
|
6791
|
+
hydrate: bool = False,
|
6792
|
+
) -> Page[TriggerExecutionResponse]:
|
6793
|
+
"""List all trigger executions matching the given filter criteria.
|
6794
|
+
|
6795
|
+
Args:
|
6796
|
+
sort_by: The column to sort by.
|
6797
|
+
page: The page of items.
|
6798
|
+
size: The maximum size of all pages.
|
6799
|
+
logical_operator: Which logical operator to use [and, or].
|
6800
|
+
trigger_id: ID of the trigger to filter by.
|
6801
|
+
user: Filter by user name/ID.
|
6802
|
+
hydrate: Flag deciding whether to hydrate the output model(s)
|
6803
|
+
by including metadata fields in the response.
|
6804
|
+
|
6805
|
+
Returns:
|
6806
|
+
A list of all trigger executions matching the filter criteria.
|
6807
|
+
"""
|
6808
|
+
filter_model = TriggerExecutionFilter(
|
6809
|
+
trigger_id=trigger_id,
|
6810
|
+
sort_by=sort_by,
|
6811
|
+
page=page,
|
6812
|
+
size=size,
|
6813
|
+
user=user,
|
6814
|
+
logical_operator=logical_operator,
|
6815
|
+
)
|
6816
|
+
filter_model.set_scope_workspace(self.active_workspace.id)
|
6817
|
+
return self.zen_store.list_trigger_executions(
|
6818
|
+
trigger_execution_filter_model=filter_model, hydrate=hydrate
|
6819
|
+
)
|
6820
|
+
|
6821
|
+
def delete_trigger_execution(self, trigger_execution_id: UUID) -> None:
|
6822
|
+
"""Delete a trigger execution.
|
6823
|
+
|
6824
|
+
Args:
|
6825
|
+
trigger_execution_id: The ID of the trigger execution to delete.
|
6826
|
+
"""
|
6827
|
+
self.zen_store.delete_trigger_execution(
|
6828
|
+
trigger_execution_id=trigger_execution_id
|
6829
|
+
)
|
6830
|
+
|
5395
6831
|
# ---- utility prefix matching get functions -----
|
5396
6832
|
|
5397
|
-
@staticmethod
|
5398
6833
|
def _get_entity_by_id_or_name_or_prefix(
|
6834
|
+
self,
|
5399
6835
|
get_method: Callable[..., AnyResponse],
|
5400
6836
|
list_method: Callable[..., Page[AnyResponse]],
|
5401
6837
|
name_id_or_prefix: Union[str, UUID],
|
@@ -5441,7 +6877,7 @@ class Client(metaclass=ClientMetaClass):
|
|
5441
6877
|
|
5442
6878
|
# If still no match, try with prefix now
|
5443
6879
|
if entity.total == 0:
|
5444
|
-
return
|
6880
|
+
return self._get_entity_by_prefix(
|
5445
6881
|
get_method=get_method,
|
5446
6882
|
list_method=list_method,
|
5447
6883
|
partial_id_or_name=name_id_or_prefix,
|
@@ -5465,8 +6901,8 @@ class Client(metaclass=ClientMetaClass):
|
|
5465
6901
|
f"only one of the {entity_label}s."
|
5466
6902
|
)
|
5467
6903
|
|
5468
|
-
@staticmethod
|
5469
6904
|
def _get_entity_version_by_id_or_name_or_prefix(
|
6905
|
+
self,
|
5470
6906
|
get_method: Callable[..., AnyResponse],
|
5471
6907
|
list_method: Callable[..., Page[AnyResponse]],
|
5472
6908
|
name_id_or_prefix: Union[str, UUID],
|
@@ -5530,8 +6966,8 @@ class Client(metaclass=ClientMetaClass):
|
|
5530
6966
|
f"only one of the {entity_label}s."
|
5531
6967
|
)
|
5532
6968
|
|
5533
|
-
@staticmethod
|
5534
6969
|
def _get_entity_by_prefix(
|
6970
|
+
self,
|
5535
6971
|
get_method: Callable[..., AnyResponse],
|
5536
6972
|
list_method: Callable[..., Page[AnyResponse]],
|
5537
6973
|
partial_id_or_name: str,
|
@@ -5800,6 +7236,7 @@ class Client(metaclass=ClientMetaClass):
|
|
5800
7236
|
NotImplementedError: If the client is not connected to a ZenML
|
5801
7237
|
server.
|
5802
7238
|
"""
|
7239
|
+
from zenml.login.credentials_store import get_credentials_store
|
5803
7240
|
from zenml.zen_stores.rest_zen_store import RestZenStore
|
5804
7241
|
|
5805
7242
|
zen_store = self.zen_store
|
@@ -5808,8 +7245,15 @@ class Client(metaclass=ClientMetaClass):
|
|
5808
7245
|
"API key configuration is only supported if connected to a "
|
5809
7246
|
"ZenML server."
|
5810
7247
|
)
|
7248
|
+
|
7249
|
+
credentials_store = get_credentials_store()
|
5811
7250
|
assert isinstance(zen_store, RestZenStore)
|
5812
|
-
|
7251
|
+
|
7252
|
+
credentials_store.set_api_key(server_url=zen_store.url, api_key=key)
|
7253
|
+
|
7254
|
+
# Force a re-authentication to start using the new API key
|
7255
|
+
# right away.
|
7256
|
+
zen_store.authenticate(force=True)
|
5813
7257
|
|
5814
7258
|
def list_api_keys(
|
5815
7259
|
self,
|