zenml-nightly 0.75.0.dev20250312__py3-none-any.whl → 0.75.0.dev20250313__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 +2 -0
- zenml/analytics/context.py +7 -0
- zenml/artifacts/utils.py +0 -2
- zenml/cli/login.py +6 -0
- zenml/cli/model.py +7 -15
- zenml/cli/secret.py +47 -44
- zenml/cli/service_connectors.py +0 -1
- zenml/cli/stack.py +0 -1
- zenml/cli/tag.py +3 -5
- zenml/cli/utils.py +25 -23
- zenml/cli/workspace.py +79 -5
- zenml/client.py +615 -348
- zenml/config/global_config.py +16 -3
- zenml/config/pipeline_configurations.py +3 -2
- zenml/config/pipeline_run_configuration.py +2 -1
- zenml/config/secret_reference_mixin.py +1 -1
- zenml/constants.py +1 -3
- zenml/enums.py +0 -7
- zenml/event_hub/event_hub.py +3 -1
- zenml/exceptions.py +0 -24
- zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +5 -3
- zenml/integrations/bitbucket/plugins/event_sources/bitbucket_webhook_event_source.py +1 -4
- zenml/integrations/github/plugins/event_sources/github_webhook_event_source.py +1 -4
- zenml/integrations/mlflow/steps/mlflow_registry.py +1 -1
- zenml/integrations/seldon/model_deployers/seldon_model_deployer.py +1 -1
- zenml/integrations/wandb/flavors/wandb_experiment_tracker_flavor.py +3 -3
- zenml/model/model.py +8 -8
- zenml/models/__init__.py +18 -1
- zenml/models/v2/base/base.py +0 -5
- zenml/models/v2/base/filter.py +1 -1
- zenml/models/v2/base/scoped.py +104 -121
- zenml/models/v2/core/api_key.py +1 -1
- zenml/models/v2/core/artifact.py +31 -18
- zenml/models/v2/core/artifact_version.py +42 -25
- zenml/models/v2/core/component.py +22 -33
- zenml/models/v2/core/device.py +3 -2
- zenml/models/v2/core/event_source.py +2 -2
- zenml/models/v2/core/flavor.py +19 -47
- zenml/models/v2/core/logs.py +1 -2
- zenml/models/v2/core/model.py +7 -4
- zenml/models/v2/core/model_version.py +36 -27
- zenml/models/v2/core/pipeline.py +1 -1
- zenml/models/v2/core/pipeline_run.py +5 -13
- zenml/models/v2/core/run_template.py +1 -2
- zenml/models/v2/core/schedule.py +0 -9
- zenml/models/v2/core/secret.py +93 -127
- zenml/models/v2/core/server_settings.py +2 -2
- zenml/models/v2/core/service.py +43 -12
- zenml/models/v2/core/service_connector.py +14 -16
- zenml/models/v2/core/stack.py +24 -26
- zenml/models/v2/core/step_run.py +3 -15
- zenml/models/v2/core/tag.py +41 -15
- zenml/models/v2/core/user.py +19 -2
- zenml/models/v2/misc/statistics.py +45 -0
- zenml/models/v2/misc/tag.py +27 -0
- zenml/orchestrators/cache_utils.py +1 -1
- zenml/orchestrators/input_utils.py +1 -0
- zenml/orchestrators/step_launcher.py +0 -1
- zenml/orchestrators/step_run_utils.py +0 -2
- zenml/orchestrators/step_runner.py +10 -1
- zenml/pipelines/build_utils.py +0 -2
- zenml/pipelines/pipeline_decorator.py +3 -2
- zenml/pipelines/pipeline_definition.py +4 -5
- zenml/pipelines/run_utils.py +3 -3
- zenml/service_connectors/service_connector.py +0 -7
- zenml/service_connectors/service_connector_utils.py +0 -1
- zenml/stack/authentication_mixin.py +1 -1
- zenml/stack/flavor.py +3 -14
- zenml/stack/stack_component.py +1 -5
- zenml/steps/step_context.py +19 -0
- zenml/utils/string_utils.py +1 -1
- zenml/utils/tag_utils.py +642 -0
- zenml/zen_server/cloud_utils.py +21 -0
- zenml/zen_server/exceptions.py +0 -6
- zenml/zen_server/rbac/endpoint_utils.py +134 -46
- zenml/zen_server/rbac/models.py +65 -3
- zenml/zen_server/rbac/rbac_interface.py +9 -0
- zenml/zen_server/rbac/rbac_sql_zen_store.py +15 -7
- zenml/zen_server/rbac/utils.py +156 -29
- zenml/zen_server/rbac/zenml_cloud_rbac.py +43 -11
- zenml/zen_server/routers/actions_endpoints.py +3 -5
- zenml/zen_server/routers/artifact_endpoint.py +0 -5
- zenml/zen_server/routers/artifact_version_endpoints.py +15 -9
- zenml/zen_server/routers/auth_endpoints.py +22 -7
- zenml/zen_server/routers/code_repositories_endpoints.py +56 -3
- zenml/zen_server/routers/devices_endpoints.py +0 -4
- zenml/zen_server/routers/event_source_endpoints.py +0 -5
- zenml/zen_server/routers/flavors_endpoints.py +0 -5
- zenml/zen_server/routers/logs_endpoints.py +0 -1
- zenml/zen_server/routers/model_versions_endpoints.py +102 -23
- zenml/zen_server/routers/models_endpoints.py +51 -68
- zenml/zen_server/routers/pipeline_builds_endpoints.py +58 -4
- zenml/zen_server/routers/pipeline_deployments_endpoints.py +58 -4
- zenml/zen_server/routers/pipelines_endpoints.py +73 -4
- zenml/zen_server/routers/plugin_endpoints.py +0 -1
- zenml/zen_server/routers/run_metadata_endpoints.py +99 -0
- zenml/zen_server/routers/run_templates_endpoints.py +66 -3
- zenml/zen_server/routers/runs_endpoints.py +60 -8
- zenml/zen_server/routers/schedule_endpoints.py +69 -6
- zenml/zen_server/routers/secrets_endpoints.py +40 -4
- zenml/zen_server/routers/server_endpoints.py +53 -1
- zenml/zen_server/routers/service_accounts_endpoints.py +14 -15
- zenml/zen_server/routers/service_connectors_endpoints.py +96 -14
- zenml/zen_server/routers/service_endpoints.py +20 -7
- zenml/zen_server/routers/stack_components_endpoints.py +68 -7
- zenml/zen_server/routers/stacks_endpoints.py +98 -7
- zenml/zen_server/routers/steps_endpoints.py +17 -11
- zenml/zen_server/routers/tag_resource_endpoints.py +115 -0
- zenml/zen_server/routers/tags_endpoints.py +6 -17
- zenml/zen_server/routers/triggers_endpoints.py +5 -8
- zenml/zen_server/routers/users_endpoints.py +47 -12
- zenml/zen_server/routers/workspaces_endpoints.py +56 -1285
- zenml/zen_server/template_execution/utils.py +5 -4
- zenml/zen_server/utils.py +21 -0
- zenml/zen_server/zen_server_api.py +4 -0
- zenml/zen_stores/base_zen_store.py +29 -44
- zenml/zen_stores/migrations/versions/1cb6477f72d6_move_artifact_save_type.py +20 -10
- zenml/zen_stores/migrations/versions/1f9d1cd00b90_add_unique_name_constraints.py +231 -0
- zenml/zen_stores/migrations/versions/288f4fb6e112_make_tags_user_scoped.py +74 -0
- zenml/zen_stores/migrations/versions/2e695a26fe7a_add_user_default_workspace.py +45 -0
- zenml/zen_stores/migrations/versions/3b1776345020_remove_workspace_from_globals.py +81 -0
- zenml/zen_stores/migrations/versions/41b28cae31ce_make_artifacts_workspace_scoped.py +136 -0
- zenml/zen_stores/migrations/versions/9e7bf0970266_adding_exclusive_attribute_to_tags.py +47 -0
- zenml/zen_stores/migrations/versions/b557b2871693_update_step_run_input_types.py +8 -4
- zenml/zen_stores/migrations/versions/cc269488e5a9_separate_run_metadata.py +12 -6
- zenml/zen_stores/migrations/versions/f1d723fd723b_add_secret_private_attr.py +61 -0
- zenml/zen_stores/migrations/versions/f76a368a25a5_add_stack_description.py +35 -0
- zenml/zen_stores/rest_zen_store.py +172 -171
- zenml/zen_stores/schemas/action_schemas.py +8 -1
- zenml/zen_stores/schemas/api_key_schemas.py +8 -1
- zenml/zen_stores/schemas/artifact_schemas.py +28 -1
- zenml/zen_stores/schemas/code_repository_schemas.py +8 -1
- zenml/zen_stores/schemas/component_schemas.py +9 -14
- zenml/zen_stores/schemas/event_source_schemas.py +8 -1
- zenml/zen_stores/schemas/flavor_schemas.py +14 -20
- zenml/zen_stores/schemas/model_schemas.py +3 -0
- zenml/zen_stores/schemas/pipeline_deployment_schemas.py +3 -1
- zenml/zen_stores/schemas/pipeline_run_schemas.py +0 -3
- zenml/zen_stores/schemas/run_template_schemas.py +8 -4
- zenml/zen_stores/schemas/schedule_schema.py +9 -14
- zenml/zen_stores/schemas/secret_schemas.py +15 -25
- zenml/zen_stores/schemas/service_connector_schemas.py +8 -17
- zenml/zen_stores/schemas/service_schemas.py +0 -1
- zenml/zen_stores/schemas/stack_schemas.py +12 -15
- zenml/zen_stores/schemas/step_run_schemas.py +7 -8
- zenml/zen_stores/schemas/tag_schemas.py +30 -2
- zenml/zen_stores/schemas/trigger_schemas.py +8 -1
- zenml/zen_stores/schemas/user_schemas.py +24 -2
- zenml/zen_stores/schemas/utils.py +16 -0
- zenml/zen_stores/schemas/workspace_schemas.py +7 -25
- zenml/zen_stores/secrets_stores/service_connector_secrets_store.py +0 -3
- zenml/zen_stores/sql_zen_store.py +2905 -2280
- zenml/zen_stores/template_utils.py +1 -1
- zenml/zen_stores/zen_store_interface.py +82 -58
- {zenml_nightly-0.75.0.dev20250312.dist-info → zenml_nightly-0.75.0.dev20250313.dist-info}/METADATA +1 -1
- {zenml_nightly-0.75.0.dev20250312.dist-info → zenml_nightly-0.75.0.dev20250313.dist-info}/RECORD +160 -147
- {zenml_nightly-0.75.0.dev20250312.dist-info → zenml_nightly-0.75.0.dev20250313.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.75.0.dev20250312.dist-info → zenml_nightly-0.75.0.dev20250313.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.75.0.dev20250312.dist-info → zenml_nightly-0.75.0.dev20250313.dist-info}/entry_points.txt +0 -0
@@ -63,7 +63,7 @@ def validate_deployment_is_templatable(
|
|
63
63
|
"associated stack has no flavor."
|
64
64
|
)
|
65
65
|
|
66
|
-
if component.flavor_schema.
|
66
|
+
if component.flavor_schema.is_custom:
|
67
67
|
raise ValueError(
|
68
68
|
"Unable to create run template as a component of the "
|
69
69
|
"associated stack has a custom flavor."
|
@@ -132,6 +132,8 @@ from zenml.models import (
|
|
132
132
|
StepRunUpdate,
|
133
133
|
TagFilter,
|
134
134
|
TagRequest,
|
135
|
+
TagResourceRequest,
|
136
|
+
TagResourceResponse,
|
135
137
|
TagResponse,
|
136
138
|
TagUpdate,
|
137
139
|
TriggerExecutionFilter,
|
@@ -744,11 +746,14 @@ class ZenStoreInterface(ABC):
|
|
744
746
|
@abstractmethod
|
745
747
|
def prune_artifact_versions(
|
746
748
|
self,
|
749
|
+
workspace_name_or_id: Union[str, UUID],
|
747
750
|
only_versions: bool = True,
|
748
751
|
) -> None:
|
749
752
|
"""Prunes unused artifact versions and their artifacts.
|
750
753
|
|
751
754
|
Args:
|
755
|
+
workspace_name_or_id: The workspace name or ID to prune artifact
|
756
|
+
versions for.
|
752
757
|
only_versions: Only delete artifact versions, keeping artifacts
|
753
758
|
"""
|
754
759
|
|
@@ -889,7 +894,7 @@ class ZenStoreInterface(ABC):
|
|
889
894
|
The created stack component.
|
890
895
|
|
891
896
|
Raises:
|
892
|
-
|
897
|
+
EntityExistsError: If a stack component with the same name
|
893
898
|
and type is already owned by this user in this workspace.
|
894
899
|
"""
|
895
900
|
|
@@ -1531,30 +1536,30 @@ class ZenStoreInterface(ABC):
|
|
1531
1536
|
# -------------------- Pipeline runs --------------------
|
1532
1537
|
|
1533
1538
|
@abstractmethod
|
1534
|
-
def
|
1539
|
+
def get_or_create_run(
|
1535
1540
|
self, pipeline_run: PipelineRunRequest
|
1536
|
-
) -> PipelineRunResponse:
|
1537
|
-
"""
|
1541
|
+
) -> Tuple[PipelineRunResponse, bool]:
|
1542
|
+
"""Gets or creates a pipeline run.
|
1543
|
+
|
1544
|
+
If a run with the same ID or name already exists, it is returned.
|
1545
|
+
Otherwise, a new run is created.
|
1538
1546
|
|
1539
1547
|
Args:
|
1540
|
-
pipeline_run: The pipeline run to create.
|
1548
|
+
pipeline_run: The pipeline run to get or create.
|
1541
1549
|
|
1542
1550
|
Returns:
|
1543
|
-
The
|
1544
|
-
|
1545
|
-
Raises:
|
1546
|
-
EntityExistsError: If an identical pipeline run already exists.
|
1547
|
-
KeyError: If the pipeline does not exist.
|
1551
|
+
The pipeline run, and a boolean indicating whether the run was
|
1552
|
+
created or not.
|
1548
1553
|
"""
|
1549
1554
|
|
1550
1555
|
@abstractmethod
|
1551
1556
|
def get_run(
|
1552
|
-
self,
|
1557
|
+
self, run_id: UUID, hydrate: bool = True
|
1553
1558
|
) -> PipelineRunResponse:
|
1554
1559
|
"""Gets a pipeline run.
|
1555
1560
|
|
1556
1561
|
Args:
|
1557
|
-
|
1562
|
+
run_id: The ID of the pipeline run to get.
|
1558
1563
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
1559
1564
|
by including metadata fields in the response.
|
1560
1565
|
|
@@ -1611,23 +1616,6 @@ class ZenStoreInterface(ABC):
|
|
1611
1616
|
KeyError: if the pipeline run doesn't exist.
|
1612
1617
|
"""
|
1613
1618
|
|
1614
|
-
@abstractmethod
|
1615
|
-
def get_or_create_run(
|
1616
|
-
self, pipeline_run: PipelineRunRequest
|
1617
|
-
) -> Tuple[PipelineRunResponse, bool]:
|
1618
|
-
"""Gets or creates a pipeline run.
|
1619
|
-
|
1620
|
-
If a run with the same ID or name already exists, it is returned.
|
1621
|
-
Otherwise, a new run is created.
|
1622
|
-
|
1623
|
-
Args:
|
1624
|
-
pipeline_run: The pipeline run to get or create.
|
1625
|
-
|
1626
|
-
Returns:
|
1627
|
-
The pipeline run, and a boolean indicating whether the run was
|
1628
|
-
created or not.
|
1629
|
-
"""
|
1630
|
-
|
1631
1619
|
# -------------------- Run metadata --------------------
|
1632
1620
|
|
1633
1621
|
@abstractmethod
|
@@ -2147,18 +2135,13 @@ class ZenStoreInterface(ABC):
|
|
2147
2135
|
@abstractmethod
|
2148
2136
|
def list_service_connector_resources(
|
2149
2137
|
self,
|
2150
|
-
|
2151
|
-
connector_type: Optional[str] = None,
|
2152
|
-
resource_type: Optional[str] = None,
|
2153
|
-
resource_id: Optional[str] = None,
|
2138
|
+
filter_model: ServiceConnectorFilter,
|
2154
2139
|
) -> List[ServiceConnectorResourcesModel]:
|
2155
2140
|
"""List resources that can be accessed by service connectors.
|
2156
2141
|
|
2157
2142
|
Args:
|
2158
|
-
|
2159
|
-
|
2160
|
-
resource_type: The type of resource to scope to.
|
2161
|
-
resource_id: The ID of the resource to scope to.
|
2143
|
+
filter_model: The filter model to use when fetching service
|
2144
|
+
connectors.
|
2162
2145
|
|
2163
2146
|
Returns:
|
2164
2147
|
The matching list of resources that available service
|
@@ -2213,11 +2196,8 @@ class ZenStoreInterface(ABC):
|
|
2213
2196
|
The created stack.
|
2214
2197
|
|
2215
2198
|
Raises:
|
2216
|
-
EntityExistsError: If a
|
2217
|
-
already exists.
|
2218
|
-
StackComponentExistsError: If a stack component with the same name
|
2219
|
-
already exists.
|
2220
|
-
StackExistsError: If a stack with the same name already exists.
|
2199
|
+
EntityExistsError: If a stack, stack component or service connector
|
2200
|
+
with the same name already exists.
|
2221
2201
|
"""
|
2222
2202
|
|
2223
2203
|
@abstractmethod
|
@@ -2499,7 +2479,7 @@ class ZenStoreInterface(ABC):
|
|
2499
2479
|
trigger_execution_id: UUID,
|
2500
2480
|
hydrate: bool = True,
|
2501
2481
|
) -> TriggerExecutionResponse:
|
2502
|
-
"""Get
|
2482
|
+
"""Get a trigger execution by ID.
|
2503
2483
|
|
2504
2484
|
Args:
|
2505
2485
|
trigger_execution_id: The ID of the trigger execution to get.
|
@@ -2725,14 +2705,14 @@ class ZenStoreInterface(ABC):
|
|
2725
2705
|
"""
|
2726
2706
|
|
2727
2707
|
@abstractmethod
|
2728
|
-
def delete_model(self,
|
2708
|
+
def delete_model(self, model_id: UUID) -> None:
|
2729
2709
|
"""Deletes a model.
|
2730
2710
|
|
2731
2711
|
Args:
|
2732
|
-
|
2712
|
+
model_id: id of the model to be deleted.
|
2733
2713
|
|
2734
2714
|
Raises:
|
2735
|
-
KeyError: specified ID
|
2715
|
+
KeyError: model with specified ID not found.
|
2736
2716
|
"""
|
2737
2717
|
|
2738
2718
|
@abstractmethod
|
@@ -2752,13 +2732,11 @@ class ZenStoreInterface(ABC):
|
|
2752
2732
|
"""
|
2753
2733
|
|
2754
2734
|
@abstractmethod
|
2755
|
-
def get_model(
|
2756
|
-
self, model_name_or_id: Union[str, UUID], hydrate: bool = True
|
2757
|
-
) -> ModelResponse:
|
2735
|
+
def get_model(self, model_id: UUID, hydrate: bool = True) -> ModelResponse:
|
2758
2736
|
"""Get an existing model.
|
2759
2737
|
|
2760
2738
|
Args:
|
2761
|
-
|
2739
|
+
model_id: id of the model to be retrieved.
|
2762
2740
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2763
2741
|
by including metadata fields in the response.
|
2764
2742
|
|
@@ -2766,7 +2744,7 @@ class ZenStoreInterface(ABC):
|
|
2766
2744
|
The model of interest.
|
2767
2745
|
|
2768
2746
|
Raises:
|
2769
|
-
KeyError: specified ID
|
2747
|
+
KeyError: model with specified ID not found.
|
2770
2748
|
"""
|
2771
2749
|
|
2772
2750
|
@abstractmethod
|
@@ -2845,14 +2823,11 @@ class ZenStoreInterface(ABC):
|
|
2845
2823
|
def list_model_versions(
|
2846
2824
|
self,
|
2847
2825
|
model_version_filter_model: ModelVersionFilter,
|
2848
|
-
model_name_or_id: Optional[Union[str, UUID]] = None,
|
2849
2826
|
hydrate: bool = False,
|
2850
2827
|
) -> Page[ModelVersionResponse]:
|
2851
2828
|
"""Get all model versions by filter.
|
2852
2829
|
|
2853
2830
|
Args:
|
2854
|
-
model_name_or_id: name or id of the model containing the model
|
2855
|
-
versions.
|
2856
2831
|
model_version_filter_model: All filter parameters including
|
2857
2832
|
pagination params.
|
2858
2833
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
@@ -3005,9 +2980,7 @@ class ZenStoreInterface(ABC):
|
|
3005
2980
|
KeyError: specified ID not found.
|
3006
2981
|
"""
|
3007
2982
|
|
3008
|
-
|
3009
|
-
# Tags
|
3010
|
-
#################
|
2983
|
+
# -------------------- Tags --------------------
|
3011
2984
|
|
3012
2985
|
@abstractmethod
|
3013
2986
|
def create_tag(self, tag: TagRequest) -> TagResponse:
|
@@ -3039,7 +3012,9 @@ class ZenStoreInterface(ABC):
|
|
3039
3012
|
|
3040
3013
|
@abstractmethod
|
3041
3014
|
def get_tag(
|
3042
|
-
self,
|
3015
|
+
self,
|
3016
|
+
tag_name_or_id: Union[str, UUID],
|
3017
|
+
hydrate: bool = True,
|
3043
3018
|
) -> TagResponse:
|
3044
3019
|
"""Get an existing tag.
|
3045
3020
|
|
@@ -3090,3 +3065,52 @@ class ZenStoreInterface(ABC):
|
|
3090
3065
|
Raises:
|
3091
3066
|
KeyError: If the tag is not found
|
3092
3067
|
"""
|
3068
|
+
|
3069
|
+
# -------------------- Tag Resources --------------------
|
3070
|
+
|
3071
|
+
@abstractmethod
|
3072
|
+
def create_tag_resource(
|
3073
|
+
self, tag_resource: TagResourceRequest
|
3074
|
+
) -> TagResourceResponse:
|
3075
|
+
"""Create a new tag resource relationship.
|
3076
|
+
|
3077
|
+
Args:
|
3078
|
+
tag_resource: The tag resource relationship to be created.
|
3079
|
+
|
3080
|
+
Returns:
|
3081
|
+
The newly created tag resource relationship.
|
3082
|
+
"""
|
3083
|
+
|
3084
|
+
@abstractmethod
|
3085
|
+
def batch_create_tag_resource(
|
3086
|
+
self, tag_resources: List[TagResourceRequest]
|
3087
|
+
) -> List[TagResourceResponse]:
|
3088
|
+
"""Create a new tag resource relationship.
|
3089
|
+
|
3090
|
+
Args:
|
3091
|
+
tag_resources: The tag resource relationships to be created.
|
3092
|
+
|
3093
|
+
Returns:
|
3094
|
+
The newly created tag resource relationships.
|
3095
|
+
"""
|
3096
|
+
|
3097
|
+
@abstractmethod
|
3098
|
+
def delete_tag_resource(
|
3099
|
+
self,
|
3100
|
+
tag_resource: TagResourceRequest,
|
3101
|
+
) -> None:
|
3102
|
+
"""Delete a tag resource relationship.
|
3103
|
+
|
3104
|
+
Args:
|
3105
|
+
tag_resource: The tag resource relationship to delete.
|
3106
|
+
"""
|
3107
|
+
|
3108
|
+
@abstractmethod
|
3109
|
+
def batch_delete_tag_resource(
|
3110
|
+
self, tag_resources: List[TagResourceRequest]
|
3111
|
+
) -> None:
|
3112
|
+
"""Delete a batch of tag resource relationships.
|
3113
|
+
|
3114
|
+
Args:
|
3115
|
+
tag_resources: The tag resource relationships to be deleted.
|
3116
|
+
"""
|