zenml-nightly 0.70.0.dev20241126__py3-none-any.whl → 0.70.0.dev20241127__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 CHANGED
@@ -1 +1 @@
1
- 0.70.0.dev20241126
1
+ 0.70.0.dev20241127
@@ -267,11 +267,11 @@ class BaseArtifactStore(StackComponent):
267
267
 
268
268
  # --- User interface ---
269
269
  @abstractmethod
270
- def open(self, name: PathType, mode: str = "r") -> Any:
270
+ def open(self, path: PathType, mode: str = "r") -> Any:
271
271
  """Open a file at the given path.
272
272
 
273
273
  Args:
274
- name: The path of the file to open.
274
+ path: The path of the file to open.
275
275
  mode: The mode to open the file.
276
276
 
277
277
  Returns:
zenml/artifacts/utils.py CHANGED
@@ -575,7 +575,7 @@ def download_artifact_files_from_response(
575
575
  )
576
576
  file_path = str(Path(artifact.uri) / file_str)
577
577
  with artifact_store.open(
578
- name=file_path, mode="rb"
578
+ file_path, mode="rb"
579
579
  ) as store_file:
580
580
  # Use a loop to read and write chunks of the file
581
581
  # instead of reading the entire file into memory
zenml/cli/__init__.py CHANGED
@@ -2242,6 +2242,9 @@ export ZENML_STORE_URL=https://...
2242
2242
  export ZENML_STORE_API_KEY=<API_KEY>
2243
2243
  ```
2244
2244
 
2245
+ You don't need to run `zenml login` after setting these two environment
2246
+ variables and can start interacting with your server right away.
2247
+
2245
2248
  To see all the service accounts you've created and their API keys, use the
2246
2249
  following commands:
2247
2250
 
zenml/cli/login.py CHANGED
@@ -14,6 +14,7 @@
14
14
  """CLI for managing ZenML server deployments."""
15
15
 
16
16
  import ipaddress
17
+ import os
17
18
  import re
18
19
  import sys
19
20
  import time
@@ -413,6 +414,27 @@ def connect_to_pro_server(
413
414
  cli_utils.declare(f"Connected to ZenML Pro server: {server.name}.")
414
415
 
415
416
 
417
+ def _fail_if_authentication_environment_variables_set() -> None:
418
+ """Fail if any of the authentication environment variables are set."""
419
+ environment_variables = [
420
+ "ZENML_STORE_URL",
421
+ "ZENML_STORE_API_KEY",
422
+ "ZENML_STORE_USERNAME",
423
+ "ZENML_STORE_PASSWORD",
424
+ ]
425
+
426
+ if any(env_var in os.environ for env_var in environment_variables):
427
+ cli_utils.error(
428
+ "You're running to login/logout while having one of the "
429
+ f"{environment_variables} environment variables set. "
430
+ "If you want to use those environment variables to authenticate "
431
+ "to your ZenML server, there is no need to login/logout, you can "
432
+ "start interacting with your server right away. If you want to use "
433
+ "the `zenml login` command for authentication, please unset these "
434
+ "environment variables first."
435
+ )
436
+
437
+
416
438
  @cli.command(
417
439
  "login",
418
440
  help=(
@@ -670,6 +692,8 @@ def login(
670
692
  dashboard on a public domain. Primarily used for accessing the
671
693
  dashboard in Colab.
672
694
  """
695
+ _fail_if_authentication_environment_variables_set()
696
+
673
697
  if local:
674
698
  if api_key:
675
699
  cli_utils.error(
@@ -849,6 +873,8 @@ def logout(
849
873
  """
850
874
  from zenml.login.credentials_store import get_credentials_store
851
875
 
876
+ _fail_if_authentication_environment_variables_set()
877
+
852
878
  credentials_store = get_credentials_store()
853
879
  gc = GlobalConfiguration()
854
880
  store_cfg = gc.store_configuration
@@ -305,8 +305,21 @@ class SagemakerOrchestrator(ContainerizedOrchestrator):
305
305
  # Retrieve Executor arguments provided in the Step settings.
306
306
  if use_training_step:
307
307
  args_for_step_executor = step_settings.estimator_args or {}
308
+ args_for_step_executor.setdefault(
309
+ "volume_size", step_settings.volume_size_in_gb
310
+ )
311
+ args_for_step_executor.setdefault(
312
+ "max_run", step_settings.max_runtime_in_seconds
313
+ )
308
314
  else:
309
315
  args_for_step_executor = step_settings.processor_args or {}
316
+ args_for_step_executor.setdefault(
317
+ "volume_size_in_gb", step_settings.volume_size_in_gb
318
+ )
319
+ args_for_step_executor.setdefault(
320
+ "max_runtime_in_seconds",
321
+ step_settings.max_runtime_in_seconds,
322
+ )
310
323
 
311
324
  # Set default values from configured orchestrator Component to
312
325
  # arguments to be used when they are not present in processor_args.
@@ -314,12 +327,7 @@ class SagemakerOrchestrator(ContainerizedOrchestrator):
314
327
  "role",
315
328
  step_settings.execution_role or self.config.execution_role,
316
329
  )
317
- args_for_step_executor.setdefault(
318
- "volume_size_in_gb", step_settings.volume_size_in_gb
319
- )
320
- args_for_step_executor.setdefault(
321
- "max_runtime_in_seconds", step_settings.max_runtime_in_seconds
322
- )
330
+
323
331
  tags = step_settings.tags
324
332
  args_for_step_executor.setdefault(
325
333
  "tags",
zenml/io/filesystem.py CHANGED
@@ -54,11 +54,11 @@ class BaseFilesystem(ABC):
54
54
 
55
55
  @staticmethod
56
56
  @abstractmethod
57
- def open(name: PathType, mode: str = "r") -> Any:
57
+ def open(path: PathType, mode: str = "r") -> Any:
58
58
  """Opens a file.
59
59
 
60
60
  Args:
61
- name: The path to the file.
61
+ path: The path to the file.
62
62
  mode: The mode to open the file in.
63
63
 
64
64
  Returns:
@@ -55,18 +55,18 @@ class LocalFilesystem(BaseFilesystem):
55
55
  SUPPORTED_SCHEMES: ClassVar[Set[str]] = {""}
56
56
 
57
57
  @staticmethod
58
- def open(name: PathType, mode: str = "r") -> Any:
58
+ def open(path: PathType, mode: str = "r") -> Any:
59
59
  """Open a file at the given path.
60
60
 
61
61
  Args:
62
- name: The path to the file.
62
+ path: The path to the file.
63
63
  mode: The mode to open the file.
64
64
 
65
65
  Returns:
66
66
  Any: The file object.
67
67
  """
68
68
  encoding = "utf-8" if "b" not in mode else None
69
- return open(name, mode=mode, encoding=encoding)
69
+ return open(path, mode=mode, encoding=encoding)
70
70
 
71
71
  @staticmethod
72
72
  def copyfile(
zenml/model/model.py CHANGED
@@ -13,14 +13,12 @@
13
13
  # permissions and limitations under the License.
14
14
  """Model user facing interface to pass into pipeline or step."""
15
15
 
16
- import datetime
17
16
  from typing import (
18
17
  TYPE_CHECKING,
19
18
  Any,
20
19
  Dict,
21
20
  List,
22
21
  Optional,
23
- Tuple,
24
22
  Union,
25
23
  )
26
24
  from uuid import UUID
@@ -41,7 +39,6 @@ if TYPE_CHECKING:
41
39
  ModelResponse,
42
40
  ModelVersionResponse,
43
41
  PipelineRunResponse,
44
- StepRunResponse,
45
42
  )
46
43
 
47
44
  logger = get_logger(__name__)
@@ -743,85 +740,6 @@ class Model(BaseModel):
743
740
  )
744
741
  )
745
742
 
746
- def _prepare_model_version_before_step_launch(
747
- self,
748
- pipeline_run: "PipelineRunResponse",
749
- step_run: Optional["StepRunResponse"],
750
- return_logs: bool,
751
- ) -> Tuple[str, "PipelineRunResponse", Optional["StepRunResponse"]]:
752
- """Prepares model version inside pipeline run.
753
-
754
- Args:
755
- pipeline_run: pipeline run
756
- step_run: step run (passed only if model version is defined in a step explicitly)
757
- return_logs: whether to return logs or not
758
-
759
- Returns:
760
- Logs related to the Dashboard URL to show later.
761
- """
762
- from zenml.client import Client
763
- from zenml.models import PipelineRunUpdate, StepRunUpdate
764
-
765
- logs = ""
766
-
767
- # copy Model instance to prevent corrupting configs of the
768
- # subsequent runs, if they share the same config object
769
- self_copy = self.model_copy()
770
-
771
- # in case request is within the step and no self-configuration is provided
772
- # try reuse what's in the pipeline run first
773
- if step_run is None and pipeline_run.model_version is not None:
774
- self_copy.version = pipeline_run.model_version.name
775
- self_copy.model_version_id = pipeline_run.model_version.id
776
- # otherwise try to fill the templated name, if needed
777
- elif isinstance(self_copy.version, str):
778
- if pipeline_run.start_time:
779
- start_time = pipeline_run.start_time
780
- else:
781
- start_time = datetime.datetime.now(datetime.timezone.utc)
782
- self_copy.version = format_name_template(
783
- self_copy.version,
784
- date=start_time.strftime("%Y_%m_%d"),
785
- time=start_time.strftime("%H_%M_%S_%f"),
786
- )
787
-
788
- # if exact model not yet defined - try to get/create and update it
789
- # back to the run accordingly
790
- if self_copy.model_version_id is None:
791
- model_version_response = self_copy._get_or_create_model_version()
792
-
793
- client = Client()
794
- # update the configured model version id in runs accordingly
795
- if step_run:
796
- step_run = client.zen_store.update_run_step(
797
- step_run_id=step_run.id,
798
- step_run_update=StepRunUpdate(
799
- model_version_id=model_version_response.id
800
- ),
801
- )
802
- else:
803
- pipeline_run = client.zen_store.update_run(
804
- run_id=pipeline_run.id,
805
- run_update=PipelineRunUpdate(
806
- model_version_id=model_version_response.id
807
- ),
808
- )
809
-
810
- if return_logs:
811
- from zenml.utils.cloud_utils import try_get_model_version_url
812
-
813
- if logs_to_show := try_get_model_version_url(
814
- model_version_response
815
- ):
816
- logs = logs_to_show
817
- else:
818
- logs = (
819
- "Models can be viewed in the dashboard using ZenML Pro. Sign up "
820
- "for a free trial at https://www.zenml.io/pro/"
821
- )
822
- self.model_version_id = self_copy.model_version_id
823
- return logs, pipeline_run, step_run
824
-
825
743
  @property
826
744
  def _lazy_version(self) -> Optional[str]:
827
745
  """Get version name for lazy loader.
@@ -518,10 +518,15 @@ def log_model_version_dashboard_url(
518
518
  Args:
519
519
  model_version: The model version for which to log the dashboard URL.
520
520
  """
521
- from zenml.utils.cloud_utils import try_get_model_version_url
521
+ from zenml.utils.dashboard_utils import get_model_version_url
522
522
 
523
- if model_version_url_logs := try_get_model_version_url(model_version):
524
- logger.info(model_version_url_logs)
523
+ if model_version_url := get_model_version_url(model_version.id):
524
+ logger.info(
525
+ "Dashboard URL for Model Version `%s (%s)`:\n%s",
526
+ model_version.model.name,
527
+ model_version.name,
528
+ model_version_url,
529
+ )
525
530
  else:
526
531
  logger.info(
527
532
  "Models can be viewed in the dashboard using ZenML Pro. Sign up "
@@ -195,7 +195,9 @@ class EntrypointFunctionDefinition(NamedTuple):
195
195
  parameter: The function parameter for which the value was provided.
196
196
  value: The input value.
197
197
  """
198
- config_dict = ConfigDict(arbitrary_types_allowed=False)
198
+ # We allow passing None for optional annotations that would otherwise
199
+ # not be allowed as a parameter
200
+ config_dict = ConfigDict(arbitrary_types_allowed=value is None)
199
201
 
200
202
  # Create a pydantic model with just a single required field with the
201
203
  # type annotation of the parameter to verify the input type including
@@ -170,7 +170,9 @@ class ZenMLCloudConnection:
170
170
  token = self._fetch_auth_token()
171
171
  self._session.headers.update({"Authorization": "Bearer " + token})
172
172
 
173
- retries = Retry(total=5, backoff_factor=0.1)
173
+ retries = Retry(
174
+ total=5, backoff_factor=0.1, status_forcelist=[502, 504]
175
+ )
174
176
  self._session.mount(
175
177
  "https://",
176
178
  HTTPAdapter(
@@ -189,7 +189,7 @@ def verify_permissions_and_list_entities(
189
189
  def verify_permissions_and_update_entity(
190
190
  id: UUIDOrStr,
191
191
  update_model: AnyUpdate,
192
- get_method: Callable[[UUIDOrStr], AnyResponse],
192
+ get_method: Callable[[UUIDOrStr, bool], AnyResponse],
193
193
  update_method: Callable[[UUIDOrStr, AnyUpdate], AnyResponse],
194
194
  ) -> AnyResponse:
195
195
  """Verify permissions and update an entity.
@@ -203,7 +203,8 @@ def verify_permissions_and_update_entity(
203
203
  Returns:
204
204
  A model of the updated entity.
205
205
  """
206
- model = get_method(id)
206
+ # We don't need the hydrated version here
207
+ model = get_method(id, False)
207
208
  verify_permission_for_model(model, action=Action.UPDATE)
208
209
  updated_model = update_method(model.id, update_model)
209
210
  return dehydrate_response_model(updated_model)
@@ -211,7 +212,7 @@ def verify_permissions_and_update_entity(
211
212
 
212
213
  def verify_permissions_and_delete_entity(
213
214
  id: UUIDOrStr,
214
- get_method: Callable[[UUIDOrStr], AnyResponse],
215
+ get_method: Callable[[UUIDOrStr, bool], AnyResponse],
215
216
  delete_method: Callable[[UUIDOrStr], None],
216
217
  ) -> AnyResponse:
217
218
  """Verify permissions and delete an entity.
@@ -224,7 +225,8 @@ def verify_permissions_and_delete_entity(
224
225
  Returns:
225
226
  The deleted entity.
226
227
  """
227
- model = get_method(id)
228
+ # We don't need the hydrated version here
229
+ model = get_method(id, False)
228
230
  verify_permission_for_model(model, action=Action.DELETE)
229
231
  delete_method(model.id)
230
232
 
@@ -59,7 +59,6 @@ class ResourceType(StrEnum):
59
59
  PIPELINE_DEPLOYMENT = "pipeline_deployment"
60
60
  PIPELINE_BUILD = "pipeline_build"
61
61
  RUN_TEMPLATE = "run_template"
62
- USER = "user"
63
62
  SERVICE = "service"
64
63
  RUN_METADATA = "run_metadata"
65
64
  SECRET = "secret"
@@ -70,7 +69,9 @@ class ResourceType(StrEnum):
70
69
  TAG = "tag"
71
70
  TRIGGER = "trigger"
72
71
  TRIGGER_EXECUTION = "trigger_execution"
73
- WORKSPACE = "workspace"
72
+ # Deactivated for now
73
+ # USER = "user"
74
+ # WORKSPACE = "workspace"
74
75
 
75
76
 
76
77
  class Resource(BaseModel):
@@ -413,8 +413,6 @@ def get_resource_type_for_model(
413
413
  TagResponse,
414
414
  TriggerExecutionResponse,
415
415
  TriggerResponse,
416
- UserResponse,
417
- WorkspaceResponse,
418
416
  )
419
417
 
420
418
  mapping: Dict[
@@ -434,8 +432,8 @@ def get_resource_type_for_model(
434
432
  ModelVersionResponse: ResourceType.MODEL_VERSION,
435
433
  ArtifactResponse: ResourceType.ARTIFACT,
436
434
  ArtifactVersionResponse: ResourceType.ARTIFACT_VERSION,
437
- WorkspaceResponse: ResourceType.WORKSPACE,
438
- UserResponse: ResourceType.USER,
435
+ # WorkspaceResponse: ResourceType.WORKSPACE,
436
+ # UserResponse: ResourceType.USER,
439
437
  PipelineDeploymentResponse: ResourceType.PIPELINE_DEPLOYMENT,
440
438
  PipelineBuildResponse: ResourceType.PIPELINE_BUILD,
441
439
  PipelineRunResponse: ResourceType.PIPELINE_RUN,
@@ -570,7 +568,6 @@ def get_schema_for_resource_type(
570
568
  TriggerExecutionSchema,
571
569
  TriggerSchema,
572
570
  UserSchema,
573
- WorkspaceSchema,
574
571
  )
575
572
 
576
573
  mapping: Dict[ResourceType, Type["BaseSchema"]] = {
@@ -588,13 +585,13 @@ def get_schema_for_resource_type(
588
585
  ResourceType.SERVICE: ServiceSchema,
589
586
  ResourceType.TAG: TagSchema,
590
587
  ResourceType.SERVICE_ACCOUNT: UserSchema,
591
- ResourceType.WORKSPACE: WorkspaceSchema,
588
+ # ResourceType.WORKSPACE: WorkspaceSchema,
592
589
  ResourceType.PIPELINE_RUN: PipelineRunSchema,
593
590
  ResourceType.PIPELINE_DEPLOYMENT: PipelineDeploymentSchema,
594
591
  ResourceType.PIPELINE_BUILD: PipelineBuildSchema,
595
592
  ResourceType.RUN_TEMPLATE: RunTemplateSchema,
596
593
  ResourceType.RUN_METADATA: RunMetadataSchema,
597
- ResourceType.USER: UserSchema,
594
+ # ResourceType.USER: UserSchema,
598
595
  ResourceType.ACTION: ActionSchema,
599
596
  ResourceType.EVENT_SOURCE: EventSourceSchema,
600
597
  ResourceType.TRIGGER: TriggerSchema,
@@ -46,14 +46,10 @@ from zenml.zen_server.auth import (
46
46
  )
47
47
  from zenml.zen_server.exceptions import error_response
48
48
  from zenml.zen_server.rate_limit import RequestLimiter
49
- from zenml.zen_server.rbac.endpoint_utils import (
50
- verify_permissions_and_create_entity,
51
- )
52
49
  from zenml.zen_server.rbac.models import Action, Resource, ResourceType
53
50
  from zenml.zen_server.rbac.utils import (
54
51
  dehydrate_page,
55
52
  dehydrate_response_model,
56
- get_allowed_resource_ids,
57
53
  get_schema_for_resource_type,
58
54
  update_resource_membership,
59
55
  verify_permission_for_model,
@@ -112,17 +108,18 @@ def list_users(
112
108
  Returns:
113
109
  A list of all users.
114
110
  """
115
- allowed_ids = get_allowed_resource_ids(resource_type=ResourceType.USER)
116
- if allowed_ids is not None:
117
- # Make sure users can see themselves
118
- allowed_ids.add(auth_context.user.id)
119
- else:
120
- if not auth_context.user.is_admin and not server_config().rbac_enabled:
121
- allowed_ids = {auth_context.user.id}
122
-
123
- user_filter_model.configure_rbac(
124
- authenticated_user_id=auth_context.user.id, id=allowed_ids
125
- )
111
+ # allowed_ids = get_allowed_resource_ids(resource_type=ResourceType.USER)
112
+ # if allowed_ids is not None:
113
+ # # Make sure users can see themselves
114
+ # allowed_ids.add(auth_context.user.id)
115
+ # else:
116
+ # if not auth_context.user.is_admin and not server_config().rbac_enabled:
117
+ # allowed_ids = {auth_context.user.id}
118
+ if not auth_context.user.is_admin and not server_config().rbac_enabled:
119
+ user_filter_model.configure_rbac(
120
+ authenticated_user_id=auth_context.user.id,
121
+ id={auth_context.user.id},
122
+ )
126
123
 
127
124
  page = zen_store().list_users(
128
125
  user_filter_model=user_filter_model, hydrate=hydrate
@@ -175,11 +172,12 @@ if server_config().auth_scheme != AuthScheme.EXTERNAL:
175
172
  auth_context.user.is_admin, "create user"
176
173
  )
177
174
 
178
- new_user = verify_permissions_and_create_entity(
179
- request_model=user,
180
- resource_type=ResourceType.USER,
181
- create_method=zen_store().create_user,
182
- )
175
+ # new_user = verify_permissions_and_create_entity(
176
+ # request_model=user,
177
+ # resource_type=ResourceType.USER,
178
+ # create_method=zen_store().create_user,
179
+ # )
180
+ new_user = zen_store().create_user(user)
183
181
 
184
182
  # add back the original unhashed activation token, if generated, to
185
183
  # send it back to the client
@@ -217,10 +215,10 @@ def get_user(
217
215
  verify_admin_status_if_no_rbac(
218
216
  auth_context.user.is_admin, "get other user"
219
217
  )
220
- verify_permission_for_model(
221
- user,
222
- action=Action.READ,
223
- )
218
+ # verify_permission_for_model(
219
+ # user,
220
+ # action=Action.READ,
221
+ # )
224
222
 
225
223
  return dehydrate_response_model(user)
226
224
 
@@ -304,10 +302,10 @@ if server_config().auth_scheme != AuthScheme.EXTERNAL:
304
302
  verify_admin_status_if_no_rbac(
305
303
  auth_context.user.is_admin, "update other user account"
306
304
  )
307
- verify_permission_for_model(
308
- user,
309
- action=Action.UPDATE,
310
- )
305
+ # verify_permission_for_model(
306
+ # user,
307
+ # action=Action.UPDATE,
308
+ # )
311
309
 
312
310
  # Validate a password change
313
311
  if user_update.password is not None:
@@ -497,10 +495,10 @@ if server_config().auth_scheme != AuthScheme.EXTERNAL:
497
495
  verify_admin_status_if_no_rbac(
498
496
  auth_context.user.is_admin, "deactivate user"
499
497
  )
500
- verify_permission_for_model(
501
- user,
502
- action=Action.UPDATE,
503
- )
498
+ # verify_permission_for_model(
499
+ # user,
500
+ # action=Action.UPDATE,
501
+ # )
504
502
 
505
503
  user_update = UserUpdate(
506
504
  active=False,
@@ -548,10 +546,10 @@ if server_config().auth_scheme != AuthScheme.EXTERNAL:
548
546
  verify_admin_status_if_no_rbac(
549
547
  auth_context.user.is_admin, "delete user"
550
548
  )
551
- verify_permission_for_model(
552
- user,
553
- action=Action.DELETE,
554
- )
549
+ # verify_permission_for_model(
550
+ # user,
551
+ # action=Action.DELETE,
552
+ # )
555
553
 
556
554
  zen_store().delete_user(user_name_or_id=user_name_or_id)
557
555
 
@@ -746,7 +744,7 @@ if server_config().rbac_enabled:
746
744
  KeyError: If no resource with the given type and ID exists.
747
745
  """
748
746
  user = zen_store().get_user(user_name_or_id)
749
- verify_permission_for_model(user, action=Action.READ)
747
+ # verify_permission_for_model(user, action=Action.READ)
750
748
 
751
749
  if user.id == auth_context.user.id:
752
750
  raise ValueError(
@@ -98,13 +98,12 @@ from zenml.zen_server.feature_gate.endpoint_utils import (
98
98
  )
99
99
  from zenml.zen_server.rbac.endpoint_utils import (
100
100
  verify_permissions_and_create_entity,
101
- verify_permissions_and_delete_entity,
102
- verify_permissions_and_get_entity,
103
101
  verify_permissions_and_list_entities,
104
- verify_permissions_and_update_entity,
105
102
  )
106
103
  from zenml.zen_server.rbac.models import Action, ResourceType
107
104
  from zenml.zen_server.rbac.utils import (
105
+ dehydrate_page,
106
+ dehydrate_response_model,
108
107
  get_allowed_resource_ids,
109
108
  verify_permission,
110
109
  verify_permission_for_model,
@@ -146,12 +145,10 @@ def list_workspaces(
146
145
  Returns:
147
146
  A list of workspaces.
148
147
  """
149
- return verify_permissions_and_list_entities(
150
- filter_model=workspace_filter_model,
151
- resource_type=ResourceType.WORKSPACE,
152
- list_method=zen_store().list_workspaces,
153
- hydrate=hydrate,
148
+ workspaces = zen_store().list_workspaces(
149
+ workspace_filter_model, hydrate=hydrate
154
150
  )
151
+ return dehydrate_page(workspaces)
155
152
 
156
153
 
157
154
  @router.post(
@@ -160,7 +157,7 @@ def list_workspaces(
160
157
  )
161
158
  @handle_exceptions
162
159
  def create_workspace(
163
- workspace: WorkspaceRequest,
160
+ workspace_request: WorkspaceRequest,
164
161
  _: AuthContext = Security(authorize),
165
162
  ) -> WorkspaceResponse:
166
163
  """Creates a workspace based on the requestBody.
@@ -168,16 +165,13 @@ def create_workspace(
168
165
  # noqa: DAR401
169
166
 
170
167
  Args:
171
- workspace: Workspace to create.
168
+ workspace_request: Workspace to create.
172
169
 
173
170
  Returns:
174
171
  The created workspace.
175
172
  """
176
- return verify_permissions_and_create_entity(
177
- request_model=workspace,
178
- resource_type=ResourceType.WORKSPACE,
179
- create_method=zen_store().create_workspace,
180
- )
173
+ workspace = zen_store().create_workspace(workspace_request)
174
+ return dehydrate_response_model(workspace)
181
175
 
182
176
 
183
177
  @router.get(
@@ -203,11 +197,10 @@ def get_workspace(
203
197
  Returns:
204
198
  The requested workspace.
205
199
  """
206
- return verify_permissions_and_get_entity(
207
- id=workspace_name_or_id,
208
- get_method=zen_store().get_workspace,
209
- hydrate=hydrate,
200
+ workspace = zen_store().get_workspace(
201
+ workspace_name_or_id, hydrate=hydrate
210
202
  )
203
+ return dehydrate_response_model(workspace)
211
204
 
212
205
 
213
206
  @router.put(
@@ -231,12 +224,11 @@ def update_workspace(
231
224
  Returns:
232
225
  The updated workspace.
233
226
  """
234
- return verify_permissions_and_update_entity(
235
- id=workspace_name_or_id,
236
- update_model=workspace_update,
237
- get_method=zen_store().get_workspace,
238
- update_method=zen_store().update_workspace,
227
+ workspace = zen_store().get_workspace(workspace_name_or_id, hydrate=False)
228
+ updated_workspace = zen_store().update_workspace(
229
+ workspace_id=workspace.id, workspace_update=workspace_update
239
230
  )
231
+ return dehydrate_response_model(updated_workspace)
240
232
 
241
233
 
242
234
  @router.delete(
@@ -253,11 +245,7 @@ def delete_workspace(
253
245
  Args:
254
246
  workspace_name_or_id: Name or ID of the workspace.
255
247
  """
256
- verify_permissions_and_delete_entity(
257
- id=workspace_name_or_id,
258
- get_method=zen_store().get_workspace,
259
- delete_method=zen_store().delete_workspace,
260
- )
248
+ zen_store().delete_workspace(workspace_name_or_id)
261
249
 
262
250
 
263
251
  @router.get(
@@ -951,20 +939,21 @@ def get_or_create_pipeline_run(
951
939
  "is not supported."
952
940
  )
953
941
 
954
- verify_permission(
955
- resource_type=ResourceType.PIPELINE_RUN, action=Action.CREATE
956
- )
942
+ def _pre_creation_hook() -> None:
943
+ verify_permission(
944
+ resource_type=ResourceType.PIPELINE_RUN, action=Action.CREATE
945
+ )
946
+ check_entitlement(resource_type=ResourceType.PIPELINE_RUN)
957
947
 
958
948
  run, created = zen_store().get_or_create_run(
959
- pipeline_run=pipeline_run,
960
- pre_creation_hook=lambda: check_entitlement(
961
- resource_type=ResourceType.PIPELINE_RUN
962
- ),
949
+ pipeline_run=pipeline_run, pre_creation_hook=_pre_creation_hook
963
950
  )
964
951
  if created:
965
952
  report_usage(
966
953
  resource_type=ResourceType.PIPELINE_RUN, resource_id=run.id
967
954
  )
955
+ else:
956
+ verify_permission_for_model(run, action=Action.READ)
968
957
 
969
958
  return run, created
970
959
 
@@ -5329,6 +5329,19 @@ class SqlZenStore(BaseZenStore):
5329
5329
  "orchestrator run ID."
5330
5330
  )
5331
5331
 
5332
+ try:
5333
+ # We first try the most likely case that the run was already
5334
+ # created by a previous step in the same pipeline run.
5335
+ return (
5336
+ self._get_run_by_orchestrator_run_id(
5337
+ orchestrator_run_id=pipeline_run.orchestrator_run_id,
5338
+ deployment_id=pipeline_run.deployment,
5339
+ ),
5340
+ False,
5341
+ )
5342
+ except KeyError:
5343
+ pass
5344
+
5332
5345
  try:
5333
5346
  return (
5334
5347
  self._replace_placeholder_run(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zenml-nightly
3
- Version: 0.70.0.dev20241126
3
+ Version: 0.70.0.dev20241127
4
4
  Summary: ZenML: Write production-ready ML code.
5
5
  Home-page: https://zenml.io
6
6
  License: Apache-2.0
@@ -6,7 +6,7 @@ RELEASE_NOTES.md,sha256=DleauURHESDrTrcVzCVLqPiSM9NIAk5vldvEFMc7qlk,389375
6
6
  ROADMAP.md,sha256=hiLSmr16BH8Dfx7SaQM4JcXCGCVl6mFZPFAwJeDTrJU,407
7
7
  SECURITY.md,sha256=9DepA8y03yvCZLHEfcXLTDH4lUyKHquAdukBsccNN7c,682
8
8
  zenml/README.md,sha256=827dekbOWAs1BpW7VF1a4d7EbwPbjwccX-2zdXBENZo,1777
9
- zenml/VERSION,sha256=VekbxgJitTHxKg9JtTIM8dJo4IBfivy53_RdaRxjkO8,19
9
+ zenml/VERSION,sha256=ABVQIWEjcsl8ujX_CSg3mt4aGfIhe3dLr9X3GJHNxrU,19
10
10
  zenml/__init__.py,sha256=SkMObQA41ajqdZqGErN00S1Vf3KAxpLvbZ-OBy5uYoo,2130
11
11
  zenml/actions/__init__.py,sha256=mrt6wPo73iKRxK754_NqsGyJ3buW7RnVeIGXr1xEw8Y,681
12
12
  zenml/actions/base_action.py,sha256=UcaHev6BTuLDwuswnyaPjdA8AgUqB5xPZ-lRtuvf2FU,25553
@@ -24,7 +24,7 @@ zenml/analytics/utils.py,sha256=JZeBZCdhZix0uwF212IR9o2wCOYoIYzNrI87DAK1krw,8009
24
24
  zenml/annotators/__init__.py,sha256=rtH5wfYavUREkinnJHOhnYgjx9CJ7Urj20qWsTrZZ6w,769
25
25
  zenml/annotators/base_annotator.py,sha256=9eTHvt14h3DNsSz8xvaEAXV3KntT_U58CYhBNz-it5U,4988
26
26
  zenml/artifact_stores/__init__.py,sha256=9AvGSpHj8lN0Bs0RKOJtR9jWNZLYW1d8gbOft-hYoIg,1804
27
- zenml/artifact_stores/base_artifact_store.py,sha256=UvptftE6xdVPHpUt7FbshFXMnpirFBww97A8vBIvoOo,15539
27
+ zenml/artifact_stores/base_artifact_store.py,sha256=jiOoRCYM9Pcll5NbdvhU5FJIG8b1f6j8nGMIO_BioMk,15539
28
28
  zenml/artifact_stores/local_artifact_store.py,sha256=pGgbc4o870XadSree9x7lK-Zzt11t02tz24QSt60Rmg,5883
29
29
  zenml/artifacts/__init__.py,sha256=knhroJ2h0uHBCGzAiBBGJEiuhEA3cwI6XYBRIyXdbkQ,613
30
30
  zenml/artifacts/artifact_config.py,sha256=u0VDBkjbmwkm1nHsgTgvtpLHQiL0RUfQcMCb2mYxSkA,3995
@@ -32,8 +32,8 @@ zenml/artifacts/external_artifact.py,sha256=7nLANV0vsGC36H1s_B_awX4hnZgXHCGIscQ2
32
32
  zenml/artifacts/external_artifact_config.py,sha256=P172p0JOu8Xx1F8RCQut1dnRpt5lpWXGNqMbY-V90sI,3323
33
33
  zenml/artifacts/preexisting_data_materializer.py,sha256=dcahDcHUD3Lvn0-6zE2BG84bkyo_ydAgzBWxtbyJJZQ,3325
34
34
  zenml/artifacts/unmaterialized_artifact.py,sha256=JNPKq_sNifQx5wP8jEw7TGBEi26zwKirPGlWX9uxbJI,1300
35
- zenml/artifacts/utils.py,sha256=iqAESu_Wy5n8tMl9jTiD8vohLQy1xoo7H3oQ1MM1ohM,34529
36
- zenml/cli/__init__.py,sha256=o72CwXCP9TxQpS-FH9RZuDfA2FifFpIsISESNORh6aI,74915
35
+ zenml/artifacts/utils.py,sha256=jvAs15q0UAzsJEh2C0a3yn4FarIPmllZzq2kNXAY5vw,34524
36
+ zenml/cli/__init__.py,sha256=ZsOn6CVDgpcmaQPEWKqmLDou_Jh1jisULiJIuusFYlA,75053
37
37
  zenml/cli/annotator.py,sha256=tEdducGdFn57DFLJVZQ-MyXH1auTGFueRmDc78N-vPQ,6970
38
38
  zenml/cli/artifact.py,sha256=7lsAS52DroBTFkFWxkyb-lIDOGP5jPL_Se_RDG_2jgg,9564
39
39
  zenml/cli/authorized_device.py,sha256=_1PzE3BM2SmwtuzRliEMStvbBRKWQmg_lbwCRtn8dBg,4324
@@ -45,7 +45,7 @@ zenml/cli/downgrade.py,sha256=eTpXts8y4s3wEUwOlvZGWsTngoMV8Stuzj0K-SAQUGU,1887
45
45
  zenml/cli/feature.py,sha256=Q8tNvWBlRze3FUyn0_VpOdl316ZW87476j7ezJb16GA,4387
46
46
  zenml/cli/formatter.py,sha256=mHyRFEbmbPQEihm53ybBCUzHAyJGcYHDzjY95WN_qOc,6441
47
47
  zenml/cli/integration.py,sha256=O-JbkDMyJfwrzwm--Ddh41siLZ8lDuXwIiCaZvjdCt4,16208
48
- zenml/cli/login.py,sha256=2JG7mxBs_BgzxojDeielZuTVp96FrbbTzCSZ48WZdzA,34202
48
+ zenml/cli/login.py,sha256=xZdDiTbFiHvzvd5o08VRL01Oim5-0NSeKlxpBayAvss,35232
49
49
  zenml/cli/model.py,sha256=hXRXkMUOOf0eTo07WnQHNeeDDQLiH0m76E-xypFLYF0,22993
50
50
  zenml/cli/model_registry.py,sha256=cNAZ3iBa0ofdMD8inQil05yLJq7rWKgadSKMmVdlHOQ,20806
51
51
  zenml/cli/pipeline.py,sha256=_SfjpnVqPDr22dYKl3xuKz5IBPMaDMaL89_f4TbgsP4,18048
@@ -150,7 +150,7 @@ zenml/integrations/aws/flavors/aws_container_registry_flavor.py,sha256=GIDLOySz1
150
150
  zenml/integrations/aws/flavors/sagemaker_orchestrator_flavor.py,sha256=UyHXFP9rn9DQ-Erd9Rtqun9GTcp3Rftbn2a9Xysh_TU,12826
151
151
  zenml/integrations/aws/flavors/sagemaker_step_operator_flavor.py,sha256=OnNokixzGvOTBoZJQ5TDG3k4FFsP1pJmxbiij2VLW4s,5978
152
152
  zenml/integrations/aws/orchestrators/__init__.py,sha256=Wh0Fhtt_uo6YrkvXY9kL0M478FL7XpapjoFreUZbgUg,794
153
- zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py,sha256=uPB8tdR8Uya86R8LCat4RJgcl5c1pSdb-jkhaG-Jv-A,26482
153
+ zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py,sha256=OlnXr_KTWE8fOyO6bNmsCbRdRaCPqWGrUEX4gyVbD80,26801
154
154
  zenml/integrations/aws/orchestrators/sagemaker_orchestrator_entrypoint_config.py,sha256=WXCWdVojIZxx5_3-g1T95S2vsJ-RLNGcp-V409wgme0,1555
155
155
  zenml/integrations/aws/service_connectors/__init__.py,sha256=w2Md40yG89PwmU9eBceh6dGy3XYZ3MKusNAZ51sGOgE,783
156
156
  zenml/integrations/aws/service_connectors/aws_service_connector.py,sha256=O524UfOHJ3wRiPq7jpGPmgIWmn9ezhgmS5iilbyfNvg,92327
@@ -567,9 +567,9 @@ zenml/integrations/xgboost/materializers/xgboost_booster_materializer.py,sha256=
567
567
  zenml/integrations/xgboost/materializers/xgboost_dmatrix_materializer.py,sha256=G_lL1AZywJdnffVlk5VEnfYK0drAov2Z3EGppN2GSkw,2803
568
568
  zenml/io/__init__.py,sha256=a3YmPvRq9mw0IAcJft3IjD6CKcgxYGBY2gsiJW1Jrmk,843
569
569
  zenml/io/fileio.py,sha256=6Z4ywg-1X49Xemf22sm7r9Z603kqUSpQAkw46UDBTyk,8758
570
- zenml/io/filesystem.py,sha256=KHngX6kfSLT7VxV-K3wI-iv-SMDrctg18btgtCZapdc,6580
570
+ zenml/io/filesystem.py,sha256=3z13GIQpEVmatGXzrTZj8nIsaYb_N3bHwmgH_FKrMiA,6580
571
571
  zenml/io/filesystem_registry.py,sha256=stujDg4a5k983WMwp3rj4Z4puiUco4REyVoIoMIpIII,4541
572
- zenml/io/local_filesystem.py,sha256=0UMptQHbm-FfXgrbwQ1oX9AtXqZpQ7KaJL9rpxMfxOY,7386
572
+ zenml/io/local_filesystem.py,sha256=xQTZPT5cpooptUV8KiifxZojS6pWCv1-6UUxitUYb_E,7386
573
573
  zenml/logger.py,sha256=hS0fHWu2o7MSAgkPfDIkipRE36SfXrMKLPwJvddcYk4,6651
574
574
  zenml/logging/__init__.py,sha256=lnqbOa31wAHwPP5f8vZazOrUwnP2QviLiIVwxoAefD8,975
575
575
  zenml/logging/step_logging.py,sha256=zN0qgj9iNt4yGf6DPmq_C9Z5zd98uYGYSFXtYw2FiQQ,17649
@@ -604,7 +604,7 @@ zenml/metadata/lazy_load.py,sha256=DtYSkhdTr2LDJoq2GYkwfLHy-3xcVoOFu_y4PKhVU_o,2
604
604
  zenml/metadata/metadata_types.py,sha256=ts1EhF2qGZb8siKv1nkPSeFeyR2kbiIODkpk-hyoTxE,6745
605
605
  zenml/model/__init__.py,sha256=bFPHnWCgAGAjUPCmODHUmwbB0KGljNSEik857Yi-QX0,673
606
606
  zenml/model/lazy_load.py,sha256=nnu37QaIPU0peqVCEwG3k37LJe_D1i6RCs_8xoId6yk,4583
607
- zenml/model/model.py,sha256=C9a-BX70nOFpyNI0yUq6kNoA5-ocjywiaQqmtndlup0,30497
607
+ zenml/model/model.py,sha256=htrDWFjvkv2Cu6jgOGR-UVJ9lwITi8uQP3ht1J8SZAs,27166
608
608
  zenml/model/utils.py,sha256=BWGsGUfdo0UYNPazhnxRWCgQto38MJeny3RnTdMcPzY,5838
609
609
  zenml/model_deployers/__init__.py,sha256=oVBLtTfrNenl5OI1iqtQUvJ0vpocRVUN_HIt8qpoZmY,1730
610
610
  zenml/model_deployers/base_model_deployer.py,sha256=Xg5lxBFYM41vqxQhaB54Dxu_zLCyPDgqwrTyMcAxiS4,24609
@@ -680,7 +680,7 @@ zenml/orchestrators/local_docker/local_docker_orchestrator.py,sha256=kzxvmKwEi7i
680
680
  zenml/orchestrators/output_utils.py,sha256=Gz7SX2cbQ3w4eyfU0XuhKEKGtalQGBoc6moDRNVHN8M,3311
681
681
  zenml/orchestrators/publish_utils.py,sha256=aNwgTDmVSq9qCDP3Ldk77YNXnWx_YHjYNTEJwYeZo9s,4579
682
682
  zenml/orchestrators/step_launcher.py,sha256=HGdshxQAwYHLHa_nJyIkMgrSTbxTQKqI63mKaSQ3ZVg,17758
683
- zenml/orchestrators/step_run_utils.py,sha256=f8PLhfEKfMpY8S8vkqzyTwyy-94idl3rzr1xAaZzLzc,19852
683
+ zenml/orchestrators/step_run_utils.py,sha256=FjnNGYz8NF-F_WP_8w7Zny0zDd6JanCp3IAFMjKFU9g,19996
684
684
  zenml/orchestrators/step_runner.py,sha256=rInaBHdU-43xkho2xW_OlMsAZRVCanry8jRCBveVBpA,25076
685
685
  zenml/orchestrators/topsort.py,sha256=D8evz3X47zwpXd90NMLsJD-_uCeXtV6ClzNfDUrq7cM,5784
686
686
  zenml/orchestrators/utils.py,sha256=mW-abfIeLRsprE1Y-wGvURfJzNNtFHMyRrkgX_LEpkw,11446
@@ -741,7 +741,7 @@ zenml/step_operators/step_operator_entrypoint_configuration.py,sha256=WoNO-fXukV
741
741
  zenml/steps/__init__.py,sha256=KKWFOmCZGLDEikOD2E5YmDA7QHo47uPV37by21WwI0U,1453
742
742
  zenml/steps/base_step.py,sha256=jDwHpN5R1P8_14QL67k9E6EUk5pt3UVY6u45jBdKxmY,43379
743
743
  zenml/steps/decorated_step.py,sha256=C8Ng5PCLc9eql4JF1N345HQ6LyC1qCUdTnysUTeoAJs,1315
744
- zenml/steps/entrypoint_function_utils.py,sha256=ZfN6ASKH3lRdI-OYT-bQSD6kHUD-0bY3Y0-a-BwLT20,9436
744
+ zenml/steps/entrypoint_function_utils.py,sha256=GJJ4WgKdqwHg1ZcEKVKJZwT9DwczAFMjGtjGBoZVKGE,9562
745
745
  zenml/steps/step_context.py,sha256=zONoTVhjcdTnAla7pwgBRgxljWWBQx2seEi4trQx7zg,14820
746
746
  zenml/steps/step_decorator.py,sha256=LG2Ni_jB-juSMcaImexic6sBH5UcpP0GmKsc3rI3io4,6248
747
747
  zenml/steps/step_invocation.py,sha256=ETfOaV-P4_iXGk9y1-xK54Kfg2QRYaGoj_jTyEYZfb0,4861
@@ -750,7 +750,6 @@ zenml/types.py,sha256=56K01kcY3t-qzBIykRM_JNqgARkGqcaVKsNyVL3nebQ,1123
750
750
  zenml/utils/__init__.py,sha256=jaMTbjm8tLYkaRoxlZ0Em4ye_ZHOHKgP2goPTTiYGUQ,797
751
751
  zenml/utils/archivable.py,sha256=vabL1-2G7_-p-0jyKslxbvlad8fyN1ot-DvOJ19jsOA,5275
752
752
  zenml/utils/callback_registry.py,sha256=QBWdaraLAxBxi8DKbv9X1SUpTKDhhj-XE0JomB2Ax2Y,2411
753
- zenml/utils/cloud_utils.py,sha256=qSi8sCRs8N-YAEHrGizBUF87PnJqviLyuHEVU3UxxUo,1464
754
753
  zenml/utils/code_repository_utils.py,sha256=CobRYMYfP2yNoA0hcu_WRz5oAff_jY95oyLCHz4fDOo,4734
755
754
  zenml/utils/code_utils.py,sha256=rLRYUAgc9hvrxDc6QooZaVngmzJ_hgjUfQGF8g1n6Wc,11260
756
755
  zenml/utils/cuda_utils.py,sha256=RR21m__Zs-OnI5n-veFUzWniZjwLSbalHE5QV3jK1Hw,1624
@@ -792,7 +791,7 @@ zenml/utils/yaml_utils.py,sha256=DsbvKcJ_HYXDnNT2uSF1oKsPgP9xGpZ6G-qTFg6nQn4,575
792
791
  zenml/zen_server/__init__.py,sha256=WyltI9TzFW2mEHZVOs6alLWMCQrrZaFALtrQXs83STA,1355
793
792
  zenml/zen_server/auth.py,sha256=XeqQD1syY7TcW0DZGBDqaq_oSDqOpWeVau7lnYjBrzk,34816
794
793
  zenml/zen_server/cache.py,sha256=Tc4TSugmsU1bhThxlYfE8rv0KmltIX1CcVHgzrJ0Eus,6633
795
- zenml/zen_server/cloud_utils.py,sha256=DUHUReLlg7dD8AFPGp4PHVtyomn5_9n9xg5Gp2KQy5E,8399
794
+ zenml/zen_server/cloud_utils.py,sha256=Pb0tpLyVy1XkXZgZHqA9kUC5V39hikEW2YqReBtArS4,8458
796
795
  zenml/zen_server/dashboard/assets/404-NVXKFp-x.js,sha256=aFn4X43gnJmtd5UI_QGTKp0AJlKClqFIFgV4ySZeomc,1033
797
796
  zenml/zen_server/dashboard/assets/@radix-DeK6qiuw.js,sha256=ksXSriMjxhb_3DmaEDYuN89nxeMJtseEkkkYso4iwE0,300701
798
797
  zenml/zen_server/dashboard/assets/@react-router-B3Z5rLr2.js,sha256=d_CQ3tJg4gfvGl6tXr87Bp8BWBIgl95vvUynXxoO5AQ,64845
@@ -1003,10 +1002,10 @@ zenml/zen_server/feature_gate/zenml_cloud_feature_gate.py,sha256=X6sQGR70SHHFxQe
1003
1002
  zenml/zen_server/jwt.py,sha256=cr-rGusdxuBss2kpCCFoUTdF0X4FmsMnmGde7EkON9c,6796
1004
1003
  zenml/zen_server/rate_limit.py,sha256=rOg5H_6rOGQ_qiSCtMKPREmL1LL3bZyn4czKILtImJg,6057
1005
1004
  zenml/zen_server/rbac/__init__.py,sha256=nACbn_G7nZt_AWM3zeFL0FCmELvQnvaOFMwvTG3-6ZE,637
1006
- zenml/zen_server/rbac/endpoint_utils.py,sha256=Q2QqnoDky_UF8DB0cs4SC6U75lZLNmGPs3-pUo1-y6w,7903
1007
- zenml/zen_server/rbac/models.py,sha256=U3I-nw6yWhbuqK0IHJkgct6G3B4XQJZSC96ghj1a27Y,2404
1005
+ zenml/zen_server/rbac/endpoint_utils.py,sha256=2cVmC1kawaCSsTT7YOupWTE9KDh6ikRE9JKgh1B6pRY,8021
1006
+ zenml/zen_server/rbac/models.py,sha256=EpFDbsNeV5gV_9RHeNIAlvZR-lCRGU0zDmzf2g6ouW4,2434
1008
1007
  zenml/zen_server/rbac/rbac_interface.py,sha256=pNdfNtis5YhQgpWYkli7xNwfzNT_uXQlBaYKlSFi5HA,2881
1009
- zenml/zen_server/rbac/utils.py,sha256=06VwifEJb-CfUD1Ad3yFkEKCetiTc0x5eZDiwSKiit0,19857
1008
+ zenml/zen_server/rbac/utils.py,sha256=Wc5-tPQeysSOTluOw-RMJpUJrFvrdbZEIiN_RhWVHVI,19791
1010
1009
  zenml/zen_server/rbac/zenml_cloud_rbac.py,sha256=mFWwskAEmeZyNCVF4aImEZpZNqm4SWALnSgbv7s0Zk4,6747
1011
1010
  zenml/zen_server/routers/__init__.py,sha256=ViyAhWL-ogHxE9wBvB_iMcur5H1NRVrzXkpogVY7FBA,641
1012
1011
  zenml/zen_server/routers/actions_endpoints.py,sha256=TgFFU9fMu43iqTu-ybnxJ5QokzV-eivRAd6pW2TrFe0,9549
@@ -1038,9 +1037,9 @@ zenml/zen_server/routers/stacks_endpoints.py,sha256=imL7s26xFOf4EY4zwSz8y8-Ggl6-
1038
1037
  zenml/zen_server/routers/steps_endpoints.py,sha256=w-mOkidTIw_h0L0JZrc5XHr7oo80O5X9YZwlatqKN_M,7695
1039
1038
  zenml/zen_server/routers/tags_endpoints.py,sha256=oK-A-EqAsrIXXgl7A870I2PT8_fct1dZVQDQ-g8GHys,4941
1040
1039
  zenml/zen_server/routers/triggers_endpoints.py,sha256=1fHKDRDr6WsjnGCvkV7SOcX9cggw1rvHzce27uAzM9A,10190
1041
- zenml/zen_server/routers/users_endpoints.py,sha256=VdhR7oNgZLyh8nVrBu66vdtrDNqcw-5XSWEqKXN244k,24926
1040
+ zenml/zen_server/routers/users_endpoints.py,sha256=sXCu6fdSl5LtPl1ZCGesz96h2Ea3SA48MwpVLpJ05h0,25019
1042
1041
  zenml/zen_server/routers/webhook_endpoints.py,sha256=QVvLwVPq5sF4oSWeHln5v76xJP7yjjnyXs8xVMu6g3M,3999
1043
- zenml/zen_server/routers/workspaces_endpoints.py,sha256=Pm1TvxDqkr5Fdrai0_ZkfoONTEEOQ5OcVb0YiQuEEr8,46590
1042
+ zenml/zen_server/routers/workspaces_endpoints.py,sha256=7BWe8KTQg_gbJ77QEVk2LpJrD6r3xk4wPp9Qjlob0so,46385
1044
1043
  zenml/zen_server/secure_headers.py,sha256=glh6QujnjyeoH1_FK-tAS-105G-qKS_34AqSzqJ6TRc,4182
1045
1044
  zenml/zen_server/template_execution/__init__.py,sha256=79knXLKfegsvVSVSWecpqrepq6iAavTUA4hKuiDk-WE,613
1046
1045
  zenml/zen_server/template_execution/runner_entrypoint_configuration.py,sha256=Y8aYJhqqs8Kv8I1q-dM1WemS5VBIfyoaaYH_YkzC7iY,1541
@@ -1266,11 +1265,11 @@ zenml/zen_stores/secrets_stores/hashicorp_secrets_store.py,sha256=NfW1EHIA99lseb
1266
1265
  zenml/zen_stores/secrets_stores/secrets_store_interface.py,sha256=Q2Jbnt2Pp7NGlR-u1YBfRZV2g8su2Fd0ArBMdksAE-Q,2819
1267
1266
  zenml/zen_stores/secrets_stores/service_connector_secrets_store.py,sha256=kPYX-Z_OOhZCI1CP77ncfV7IsV4e8brklnTXmKxZYNc,7078
1268
1267
  zenml/zen_stores/secrets_stores/sql_secrets_store.py,sha256=Bq1djrUP9saoD7vECjS7-TlA_7sjJGgw1talri4spjU,8656
1269
- zenml/zen_stores/sql_zen_store.py,sha256=v9aIoBght-Pjivr2OYxvANBOhSqx8cUOzZh0G_oJOnw,404327
1268
+ zenml/zen_stores/sql_zen_store.py,sha256=rJT3Uth4J6D1iVfBdNHipgI54jcqIItNVc-IMNEU8Zc,404787
1270
1269
  zenml/zen_stores/template_utils.py,sha256=EKYBgmDLTS_PSMWaIO5yvHPLiQvMqHcsAe6NUCrv-i4,9068
1271
1270
  zenml/zen_stores/zen_store_interface.py,sha256=vf2gKBWfUUPtcGZC35oQB6pPNVzWVyQC8nWxVLjfrxM,92692
1272
- zenml_nightly-0.70.0.dev20241126.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
1273
- zenml_nightly-0.70.0.dev20241126.dist-info/METADATA,sha256=huJkRT_pOk_Bp-1GZPGkTY37YTXSVS2w9xVfoR7HqBI,21208
1274
- zenml_nightly-0.70.0.dev20241126.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
1275
- zenml_nightly-0.70.0.dev20241126.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
1276
- zenml_nightly-0.70.0.dev20241126.dist-info/RECORD,,
1271
+ zenml_nightly-0.70.0.dev20241127.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
1272
+ zenml_nightly-0.70.0.dev20241127.dist-info/METADATA,sha256=KeeoaNmNjtSScsuRqF9RjmRVytjnekiiKvTDU1XaAJY,21208
1273
+ zenml_nightly-0.70.0.dev20241127.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
1274
+ zenml_nightly-0.70.0.dev20241127.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
1275
+ zenml_nightly-0.70.0.dev20241127.dist-info/RECORD,,
@@ -1,40 +0,0 @@
1
- # Copyright (c) ZenML GmbH 2024. All Rights Reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at:
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12
- # or implied. See the License for the specific language governing
13
- # permissions and limitations under the License.
14
- """Utilities for ZenML Pro."""
15
-
16
- from zenml.logger import get_logger
17
- from zenml.models.v2.core.model_version import ModelVersionResponse
18
- from zenml.utils.dashboard_utils import get_model_version_url
19
-
20
- logger = get_logger(__name__)
21
-
22
-
23
- def try_get_model_version_url(model_version: ModelVersionResponse) -> str:
24
- """Check if a model version is from a ZenML Pro server and return its' URL.
25
-
26
- Args:
27
- model_version: The model version to check.
28
-
29
- Returns:
30
- URL if the model version is from a ZenML Pro server, else empty string.
31
- """
32
- model_version_url = get_model_version_url(model_version.id)
33
- if model_version_url:
34
- return (
35
- "Dashboard URL for created Model Version "
36
- f"`{model_version.model.name}::{model_version.name}`:\n"
37
- + model_version_url
38
- )
39
- else:
40
- return ""