zenml-nightly 0.75.0.dev20250313__py3-none-any.whl → 0.75.0.dev20250315__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/analytics/context.py +4 -4
- zenml/analytics/enums.py +2 -2
- zenml/artifacts/utils.py +2 -2
- zenml/cli/__init__.py +8 -9
- zenml/cli/base.py +2 -2
- zenml/cli/code_repository.py +1 -1
- zenml/cli/login.py +21 -18
- zenml/cli/pipeline.py +3 -3
- zenml/cli/project.py +172 -0
- zenml/cli/server.py +5 -5
- zenml/cli/service_accounts.py +0 -1
- zenml/cli/service_connectors.py +15 -16
- zenml/cli/stack.py +0 -2
- zenml/cli/stack_components.py +2 -2
- zenml/cli/utils.py +3 -3
- zenml/client.py +352 -341
- zenml/config/global_config.py +41 -43
- zenml/config/server_config.py +9 -9
- zenml/constants.py +5 -3
- zenml/event_hub/event_hub.py +1 -1
- zenml/integrations/gcp/__init__.py +1 -0
- zenml/integrations/gcp/flavors/vertex_orchestrator_flavor.py +5 -0
- zenml/integrations/gcp/flavors/vertex_step_operator_flavor.py +5 -28
- zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +125 -78
- zenml/integrations/gcp/service_connectors/gcp_service_connector.py +7 -6
- zenml/integrations/gcp/vertex_custom_job_parameters.py +50 -0
- zenml/integrations/mlflow/steps/mlflow_registry.py +3 -3
- zenml/integrations/wandb/__init__.py +1 -1
- zenml/integrations/wandb/experiment_trackers/wandb_experiment_tracker.py +29 -9
- zenml/integrations/wandb/flavors/wandb_experiment_tracker_flavor.py +2 -0
- zenml/login/credentials.py +26 -27
- zenml/login/credentials_store.py +5 -5
- zenml/login/pro/client.py +9 -9
- zenml/login/pro/utils.py +8 -8
- zenml/login/pro/{tenant → workspace}/__init__.py +1 -1
- zenml/login/pro/{tenant → workspace}/client.py +25 -25
- zenml/login/pro/{tenant → workspace}/models.py +27 -28
- zenml/model/model.py +2 -2
- zenml/model_registries/base_model_registry.py +1 -1
- zenml/models/__init__.py +29 -29
- zenml/models/v2/base/filter.py +1 -1
- zenml/models/v2/base/scoped.py +49 -53
- zenml/models/v2/core/action.py +12 -12
- zenml/models/v2/core/artifact.py +15 -15
- zenml/models/v2/core/artifact_version.py +15 -15
- zenml/models/v2/core/code_repository.py +12 -12
- zenml/models/v2/core/event_source.py +12 -12
- zenml/models/v2/core/model.py +26 -18
- zenml/models/v2/core/model_version.py +15 -15
- zenml/models/v2/core/pipeline.py +15 -15
- zenml/models/v2/core/pipeline_build.py +14 -14
- zenml/models/v2/core/pipeline_deployment.py +12 -14
- zenml/models/v2/core/pipeline_run.py +16 -16
- zenml/models/v2/core/project.py +203 -0
- zenml/models/v2/core/run_metadata.py +2 -2
- zenml/models/v2/core/run_template.py +15 -15
- zenml/models/v2/core/schedule.py +12 -12
- zenml/models/v2/core/secret.py +1 -1
- zenml/models/v2/core/service.py +14 -14
- zenml/models/v2/core/step_run.py +13 -13
- zenml/models/v2/core/tag.py +96 -3
- zenml/models/v2/core/trigger.py +13 -13
- zenml/models/v2/core/trigger_execution.py +2 -2
- zenml/models/v2/core/user.py +0 -17
- zenml/models/v2/misc/server_models.py +6 -6
- zenml/models/v2/misc/statistics.py +4 -4
- zenml/orchestrators/cache_utils.py +7 -7
- zenml/orchestrators/input_utils.py +1 -1
- zenml/orchestrators/step_launcher.py +1 -1
- zenml/orchestrators/step_run_utils.py +3 -3
- zenml/orchestrators/utils.py +4 -4
- zenml/pipelines/build_utils.py +2 -2
- zenml/pipelines/pipeline_definition.py +5 -5
- zenml/pipelines/run_utils.py +1 -1
- zenml/service_connectors/service_connector.py +0 -3
- zenml/service_connectors/service_connector_utils.py +0 -1
- zenml/stack/stack.py +0 -1
- zenml/steps/base_step.py +10 -2
- zenml/utils/dashboard_utils.py +1 -1
- zenml/utils/tag_utils.py +0 -12
- zenml/zen_server/cloud_utils.py +3 -3
- zenml/zen_server/feature_gate/endpoint_utils.py +1 -1
- zenml/zen_server/feature_gate/zenml_cloud_feature_gate.py +1 -1
- zenml/zen_server/rbac/endpoint_utils.py +17 -17
- zenml/zen_server/rbac/models.py +47 -22
- zenml/zen_server/rbac/rbac_sql_zen_store.py +3 -3
- zenml/zen_server/rbac/utils.py +23 -25
- zenml/zen_server/rbac/zenml_cloud_rbac.py +7 -74
- zenml/zen_server/routers/artifact_version_endpoints.py +10 -10
- zenml/zen_server/routers/auth_endpoints.py +6 -6
- zenml/zen_server/routers/code_repositories_endpoints.py +12 -14
- zenml/zen_server/routers/model_versions_endpoints.py +13 -15
- zenml/zen_server/routers/models_endpoints.py +7 -9
- zenml/zen_server/routers/pipeline_builds_endpoints.py +14 -16
- zenml/zen_server/routers/pipeline_deployments_endpoints.py +13 -15
- zenml/zen_server/routers/pipelines_endpoints.py +16 -18
- zenml/zen_server/routers/{workspaces_endpoints.py → projects_endpoints.py} +111 -68
- zenml/zen_server/routers/run_metadata_endpoints.py +7 -9
- zenml/zen_server/routers/run_templates_endpoints.py +15 -17
- zenml/zen_server/routers/runs_endpoints.py +12 -14
- zenml/zen_server/routers/schedule_endpoints.py +12 -14
- zenml/zen_server/routers/secrets_endpoints.py +1 -3
- zenml/zen_server/routers/server_endpoints.py +7 -7
- zenml/zen_server/routers/service_connectors_endpoints.py +11 -13
- zenml/zen_server/routers/service_endpoints.py +7 -9
- zenml/zen_server/routers/stack_components_endpoints.py +9 -11
- zenml/zen_server/routers/stacks_endpoints.py +9 -11
- zenml/zen_server/routers/steps_endpoints.py +6 -6
- zenml/zen_server/routers/users_endpoints.py +5 -43
- zenml/zen_server/template_execution/utils.py +4 -4
- zenml/zen_server/utils.py +10 -10
- zenml/zen_server/zen_server_api.py +6 -5
- zenml/zen_stores/base_zen_store.py +38 -42
- zenml/zen_stores/migrations/versions/12eff0206201_rename_workspace_to_project.py +768 -0
- zenml/zen_stores/migrations/versions/41b28cae31ce_make_artifacts_workspace_scoped.py +3 -3
- zenml/zen_stores/migrations/versions/cbc6acd71f92_add_workspace_display_name.py +58 -0
- zenml/zen_stores/rest_zen_store.py +55 -63
- zenml/zen_stores/schemas/__init__.py +2 -2
- zenml/zen_stores/schemas/action_schemas.py +9 -9
- zenml/zen_stores/schemas/artifact_schemas.py +15 -17
- zenml/zen_stores/schemas/code_repository_schemas.py +16 -18
- zenml/zen_stores/schemas/event_source_schemas.py +9 -9
- zenml/zen_stores/schemas/model_schemas.py +15 -17
- zenml/zen_stores/schemas/pipeline_build_schemas.py +7 -7
- zenml/zen_stores/schemas/pipeline_deployment_schemas.py +7 -7
- zenml/zen_stores/schemas/pipeline_run_schemas.py +9 -9
- zenml/zen_stores/schemas/pipeline_schemas.py +9 -9
- zenml/zen_stores/schemas/{workspace_schemas.py → project_schemas.py} +47 -41
- zenml/zen_stores/schemas/run_metadata_schemas.py +5 -5
- zenml/zen_stores/schemas/run_template_schemas.py +9 -9
- zenml/zen_stores/schemas/schedule_schema.py +9 -9
- zenml/zen_stores/schemas/service_schemas.py +7 -7
- zenml/zen_stores/schemas/step_run_schemas.py +7 -7
- zenml/zen_stores/schemas/trigger_schemas.py +9 -9
- zenml/zen_stores/schemas/user_schemas.py +0 -12
- zenml/zen_stores/sql_zen_store.py +318 -275
- zenml/zen_stores/zen_store_interface.py +56 -70
- {zenml_nightly-0.75.0.dev20250313.dist-info → zenml_nightly-0.75.0.dev20250315.dist-info}/METADATA +1 -1
- {zenml_nightly-0.75.0.dev20250313.dist-info → zenml_nightly-0.75.0.dev20250315.dist-info}/RECORD +143 -140
- zenml/cli/workspace.py +0 -160
- zenml/models/v2/core/workspace.py +0 -131
- {zenml_nightly-0.75.0.dev20250313.dist-info → zenml_nightly-0.75.0.dev20250315.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.75.0.dev20250313.dist-info → zenml_nightly-0.75.0.dev20250315.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.75.0.dev20250313.dist-info → zenml_nightly-0.75.0.dev20250315.dist-info}/entry_points.txt +0 -0
@@ -33,9 +33,9 @@ from zenml.config.global_config import GlobalConfiguration
|
|
33
33
|
from zenml.config.server_config import ServerConfiguration
|
34
34
|
from zenml.config.store_config import StoreConfiguration
|
35
35
|
from zenml.constants import (
|
36
|
+
DEFAULT_PROJECT_NAME,
|
36
37
|
DEFAULT_STACK_AND_COMPONENT_NAME,
|
37
|
-
|
38
|
-
ENV_ZENML_DEFAULT_WORKSPACE_NAME,
|
38
|
+
ENV_ZENML_DEFAULT_PROJECT_NAME,
|
39
39
|
ENV_ZENML_SERVER,
|
40
40
|
IS_DEBUG_ENV,
|
41
41
|
)
|
@@ -46,6 +46,7 @@ from zenml.enums import (
|
|
46
46
|
from zenml.exceptions import IllegalOperationError
|
47
47
|
from zenml.logger import get_logger
|
48
48
|
from zenml.models import (
|
49
|
+
ProjectResponse,
|
49
50
|
ServerDatabaseType,
|
50
51
|
ServerDeploymentType,
|
51
52
|
ServerModel,
|
@@ -53,7 +54,6 @@ from zenml.models import (
|
|
53
54
|
StackResponse,
|
54
55
|
UserFilter,
|
55
56
|
UserResponse,
|
56
|
-
WorkspaceResponse,
|
57
57
|
)
|
58
58
|
from zenml.utils.pydantic_utils import before_validator_handler
|
59
59
|
from zenml.zen_stores.zen_store_interface import ZenStoreInterface
|
@@ -292,56 +292,54 @@ class BaseZenStore(
|
|
292
292
|
|
293
293
|
def validate_active_config(
|
294
294
|
self,
|
295
|
-
|
295
|
+
active_project_name_or_id: Optional[Union[str, UUID]] = None,
|
296
296
|
active_stack_id: Optional[UUID] = None,
|
297
297
|
config_name: str = "",
|
298
|
-
) -> Tuple[Optional[
|
298
|
+
) -> Tuple[Optional[ProjectResponse], StackResponse]:
|
299
299
|
"""Validate the active configuration.
|
300
300
|
|
301
|
-
Call this method to validate the supplied active
|
301
|
+
Call this method to validate the supplied active project and active
|
302
302
|
stack values.
|
303
303
|
|
304
|
-
This method returns a valid
|
305
|
-
supplied
|
306
|
-
do not exist or are not accessible), the default
|
304
|
+
This method returns a valid project and stack values. If the
|
305
|
+
supplied project and stack are not set or are not valid (e.g. they
|
306
|
+
do not exist or are not accessible), the default project and default
|
307
307
|
stack will be returned in their stead.
|
308
308
|
|
309
309
|
Args:
|
310
|
-
|
310
|
+
active_project_name_or_id: The name or ID of the active project.
|
311
311
|
active_stack_id: The ID of the active stack.
|
312
312
|
config_name: The name of the configuration to validate (used in the
|
313
313
|
displayed logs/messages).
|
314
314
|
|
315
315
|
Returns:
|
316
|
-
A tuple containing the active
|
316
|
+
A tuple containing the active project and active stack.
|
317
317
|
"""
|
318
|
-
|
318
|
+
active_project: Optional[ProjectResponse] = None
|
319
319
|
|
320
|
-
if
|
320
|
+
if active_project_name_or_id:
|
321
321
|
try:
|
322
|
-
|
323
|
-
active_workspace_name_or_id
|
324
|
-
)
|
322
|
+
active_project = self.get_project(active_project_name_or_id)
|
325
323
|
except (KeyError, IllegalOperationError):
|
326
|
-
|
324
|
+
active_project_name_or_id = None
|
327
325
|
logger.warning(
|
328
|
-
f"The current {config_name} active
|
326
|
+
f"The current {config_name} active project is no longer "
|
329
327
|
f"available."
|
330
328
|
)
|
331
329
|
|
332
|
-
if
|
330
|
+
if active_project is None:
|
333
331
|
try:
|
334
|
-
|
332
|
+
active_project = self._get_default_project()
|
335
333
|
except (KeyError, IllegalOperationError):
|
336
334
|
logger.warning(
|
337
|
-
"An active
|
338
|
-
"
|
339
|
-
"<
|
335
|
+
"An active project is not set. Please set the active "
|
336
|
+
"project by running `zenml project set "
|
337
|
+
"<project-name>`."
|
340
338
|
)
|
341
339
|
else:
|
342
340
|
logger.info(
|
343
|
-
f"Setting the {config_name} active
|
344
|
-
f"to '{
|
341
|
+
f"Setting the {config_name} active project "
|
342
|
+
f"to '{active_project.name}'."
|
345
343
|
)
|
346
344
|
|
347
345
|
active_stack: StackResponse
|
@@ -366,7 +364,7 @@ class BaseZenStore(
|
|
366
364
|
)
|
367
365
|
active_stack = self._get_default_stack()
|
368
366
|
|
369
|
-
return
|
367
|
+
return active_project, active_stack
|
370
368
|
|
371
369
|
def get_store_info(self) -> ServerModel:
|
372
370
|
"""Get information about the store.
|
@@ -407,9 +405,9 @@ class BaseZenStore(
|
|
407
405
|
store_info.pro_api_url = pro_config.api_url
|
408
406
|
store_info.pro_dashboard_url = pro_config.dashboard_url
|
409
407
|
store_info.pro_organization_id = pro_config.organization_id
|
410
|
-
store_info.
|
411
|
-
if pro_config.
|
412
|
-
store_info.
|
408
|
+
store_info.pro_workspace_id = pro_config.workspace_id
|
409
|
+
if pro_config.workspace_name:
|
410
|
+
store_info.pro_workspace_name = pro_config.workspace_name
|
413
411
|
if pro_config.organization_name:
|
414
412
|
store_info.pro_organization_name = pro_config.organization_name
|
415
413
|
|
@@ -424,33 +422,31 @@ class BaseZenStore(
|
|
424
422
|
return self.get_store_info().is_local()
|
425
423
|
|
426
424
|
# -----------------------------
|
427
|
-
# Default
|
425
|
+
# Default projects and stacks
|
428
426
|
# -----------------------------
|
429
427
|
|
430
428
|
@property
|
431
|
-
def
|
432
|
-
"""Get the default
|
429
|
+
def _default_project_name(self) -> str:
|
430
|
+
"""Get the default project name.
|
433
431
|
|
434
432
|
Returns:
|
435
|
-
The default
|
433
|
+
The default project name.
|
436
434
|
"""
|
437
|
-
return os.getenv(
|
438
|
-
ENV_ZENML_DEFAULT_WORKSPACE_NAME, DEFAULT_WORKSPACE_NAME
|
439
|
-
)
|
435
|
+
return os.getenv(ENV_ZENML_DEFAULT_PROJECT_NAME, DEFAULT_PROJECT_NAME)
|
440
436
|
|
441
|
-
def
|
442
|
-
"""Get the default
|
437
|
+
def _get_default_project(self) -> ProjectResponse:
|
438
|
+
"""Get the default project.
|
443
439
|
|
444
440
|
Raises:
|
445
|
-
KeyError: If the default
|
441
|
+
KeyError: If the default project doesn't exist.
|
446
442
|
|
447
443
|
Returns:
|
448
|
-
The default
|
444
|
+
The default project.
|
449
445
|
"""
|
450
446
|
try:
|
451
|
-
return self.
|
447
|
+
return self.get_project(self._default_project_name)
|
452
448
|
except KeyError:
|
453
|
-
raise KeyError("Unable to find default
|
449
|
+
raise KeyError("Unable to find default project.")
|
454
450
|
|
455
451
|
def _get_default_stack(
|
456
452
|
self,
|