zenml-nightly 0.58.0.dev20240529__py3-none-any.whl → 0.58.1.dev20240608__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.
Files changed (145) hide show
  1. CONTRIBUTING.md +1 -1
  2. README.md +3 -3
  3. RELEASE_NOTES.md +37 -1
  4. zenml/VERSION +1 -1
  5. zenml/artifacts/utils.py +19 -3
  6. zenml/cli/__init__.py +28 -22
  7. zenml/cli/base.py +17 -6
  8. zenml/cli/pipeline.py +18 -3
  9. zenml/cli/server.py +1 -1
  10. zenml/cli/stack.py +1 -1
  11. zenml/client.py +24 -4
  12. zenml/config/docker_settings.py +3 -0
  13. zenml/config/global_config.py +1 -1
  14. zenml/config/secret_reference_mixin.py +1 -1
  15. zenml/environment.py +1 -1
  16. zenml/integrations/huggingface/materializers/huggingface_tokenizer_materializer.py +11 -12
  17. zenml/integrations/kaniko/flavors/kaniko_image_builder_flavor.py +2 -44
  18. zenml/integrations/kubernetes/flavors/kubernetes_orchestrator_flavor.py +4 -1
  19. zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py +4 -16
  20. zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint.py +2 -1
  21. zenml/integrations/kubernetes/orchestrators/manifest_utils.py +15 -15
  22. zenml/integrations/s3/flavors/s3_artifact_store_flavor.py +0 -38
  23. zenml/integrations/spark/flavors/spark_step_operator_flavor.py +1 -38
  24. zenml/materializers/base_materializer.py +3 -3
  25. zenml/materializers/cloudpickle_materializer.py +1 -1
  26. zenml/orchestrators/base_orchestrator.py +1 -1
  27. zenml/orchestrators/local_docker/local_docker_orchestrator.py +1 -37
  28. zenml/orchestrators/step_runner.py +2 -2
  29. zenml/stack/flavor.py +3 -1
  30. zenml/stack/stack.py +2 -2
  31. zenml/stack/stack_component.py +42 -2
  32. zenml/steps/base_step.py +1 -1
  33. zenml/steps/entrypoint_function_utils.py +2 -2
  34. zenml/steps/utils.py +1 -1
  35. zenml/utils/dashboard_utils.py +1 -1
  36. zenml/utils/pipeline_docker_image_builder.py +23 -3
  37. zenml/utils/source_utils.py +32 -7
  38. zenml/zen_server/auth.py +2 -2
  39. zenml/zen_server/dashboard/assets/{404-DIgYOHj5.js → 404-D5p6PIdn.js} +1 -1
  40. zenml/zen_server/dashboard/assets/{@radix-BrEjOMvl.js → @radix-C9DBgJhe.js} +9 -9
  41. zenml/zen_server/dashboard/assets/@react-router-DYovave8.js +29 -0
  42. zenml/zen_server/dashboard/assets/@reactflow-C26Olbza.css +1 -0
  43. zenml/zen_server/dashboard/assets/@reactflow-CegZ5GV3.js +17 -0
  44. zenml/zen_server/dashboard/assets/@tanstack-CEbkxrhX.js +30 -0
  45. zenml/zen_server/dashboard/assets/{AwarenessChannel-CqRB1HO9.js → AwarenessChannel-DDpU6zHx.js} +1 -1
  46. zenml/zen_server/dashboard/assets/{Cards-DuJ8uYGM.js → Cards-wfOUm_Ae.js} +1 -1
  47. zenml/zen_server/dashboard/assets/CodeSnippet-iinvcx17.js +9 -0
  48. zenml/zen_server/dashboard/assets/Commands-DGnWeAWF.js +1 -0
  49. zenml/zen_server/dashboard/assets/{CopyButton-BOFZCr5Z.js → CopyButton-eUfW9370.js} +2 -2
  50. zenml/zen_server/dashboard/assets/{CsvVizualization-D4QRvdDk.js → CsvVizualization-CoIkmrjr.js} +7 -7
  51. zenml/zen_server/dashboard/assets/{DisplayDate-BoCi3-Ng.js → DisplayDate-BdguISQF.js} +1 -1
  52. zenml/zen_server/dashboard/assets/{EmptyState-CPJglRv0.js → EmptyState-BkooiGtL.js} +1 -1
  53. zenml/zen_server/dashboard/assets/{Error-C9i5GdiH.js → Error-CDMUBgpN.js} +1 -1
  54. zenml/zen_server/dashboard/assets/{Helpbox-CnuWjxcc.js → Helpbox-BV73V0J6.js} +1 -1
  55. zenml/zen_server/dashboard/assets/Infobox-DG7zmtut.js +1 -0
  56. zenml/zen_server/dashboard/assets/{InlineAvatar-DE_1-SDN.js → InlineAvatar-BiKh3XC5.js} +1 -1
  57. zenml/zen_server/dashboard/assets/{MarkdownVisualization-CMOybYJS.js → MarkdownVisualization-DsB2QZiK.js} +1 -1
  58. zenml/zen_server/dashboard/assets/{PageHeader-D7r1Jb6H.js → PageHeader-D-u0obgg.js} +1 -1
  59. zenml/zen_server/dashboard/assets/{Pagination-0-Hv-4DJ.js → Pagination-ZYqHJ5gE.js} +1 -1
  60. zenml/zen_server/dashboard/assets/{PasswordChecker-C2ImqlTr.js → PasswordChecker-DSLBp7Vl.js} +1 -1
  61. zenml/zen_server/dashboard/assets/{SetPassword-074iDZCm.js → SetPassword-Dq6iUfpW.js} +1 -1
  62. zenml/zen_server/dashboard/assets/{SuccessStep-DEeKB0Wq.js → SuccessStep-BHhPYxz9.js} +1 -1
  63. zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-4be5el9x.js → UpdatePasswordSchemas-4FyPPBY9.js} +1 -1
  64. zenml/zen_server/dashboard/assets/{aws-BaCucHs5.js → aws-t0gKCj_R.js} +1 -1
  65. zenml/zen_server/dashboard/assets/{check-circle-GxOo3117.js → check-circle-BVvhm5dy.js} +1 -1
  66. zenml/zen_server/dashboard/assets/{chevron-down-tsuIW52H.js → chevron-down-zcvCWmyP.js} +1 -1
  67. zenml/zen_server/dashboard/assets/{chevron-right-double-Dfr12EKG.js → chevron-right-double-CJ50E9Gr.js} +1 -1
  68. zenml/zen_server/dashboard/assets/{cloud-only-lInATL8-.js → cloud-only-DsILLhXk.js} +1 -1
  69. zenml/zen_server/dashboard/assets/{copy-B8yRmO5i.js → copy-BRhQz3j-.js} +1 -1
  70. zenml/zen_server/dashboard/assets/{database-BiV4iNgr.js → database-CRRnyFWh.js} +1 -1
  71. zenml/zen_server/dashboard/assets/{docker-EYFTGVBw.js → docker-BAonhm6G.js} +1 -1
  72. zenml/zen_server/dashboard/assets/{file-text-Bp-4kjON.js → file-text-CbVERUON.js} +1 -1
  73. zenml/zen_server/dashboard/assets/{help-hEyYkC3q.js → help-B8rqCvqn.js} +1 -1
  74. zenml/zen_server/dashboard/assets/index-BhYPVFKa.js +55 -0
  75. zenml/zen_server/dashboard/assets/index-CRZ5qzG3.css +1 -0
  76. zenml/zen_server/dashboard/assets/index.esm-F7nqy9zY.js +1 -0
  77. zenml/zen_server/dashboard/assets/{login-mutation-BfEeVmSl.js → login-mutation-CDARn8rx.js} +1 -1
  78. zenml/zen_server/dashboard/assets/{not-found-an_3Z-Ep.js → not-found-D1_I0ubu.js} +1 -1
  79. zenml/zen_server/dashboard/assets/{page-NlxFzoaz.js → page-7IP7WH5_.js} +1 -1
  80. zenml/zen_server/dashboard/assets/page-B5Y_HW80.js +1 -0
  81. zenml/zen_server/dashboard/assets/{page-Ba5l9-eg.js → page-BQT1Zxsp.js} +1 -1
  82. zenml/zen_server/dashboard/assets/page-BR7WTzLa.js +1 -0
  83. zenml/zen_server/dashboard/assets/page-BmuIfr11.js +1 -0
  84. zenml/zen_server/dashboard/assets/{page-C6Xn5o3F.js → page-Bwrw_wb_.js} +1 -1
  85. zenml/zen_server/dashboard/assets/{page-GXA0bsIT.js → page-ByiUk9rA.js} +1 -1
  86. zenml/zen_server/dashboard/assets/{page-68OLHx44.js → page-C9lMl0g8.js} +2 -2
  87. zenml/zen_server/dashboard/assets/{page-NTQrxRsu.js → page-CK0iF8U_.js} +1 -1
  88. zenml/zen_server/dashboard/assets/{page-Cea5XeRB.js → page-CQTaUp7q.js} +1 -1
  89. zenml/zen_server/dashboard/assets/{page-ZJ5Cy_-x.js → page-Ca8Zw2SO.js} +1 -1
  90. zenml/zen_server/dashboard/assets/{page-B90yVxNb.js → page-CaDkuI7b.js} +1 -1
  91. zenml/zen_server/dashboard/assets/{page-C1Jl09zF.js → page-DB_mi8or.js} +1 -1
  92. zenml/zen_server/dashboard/assets/page-DDY5j-6S.js +1 -0
  93. zenml/zen_server/dashboard/assets/page-DIz9_5Du.js +2 -0
  94. zenml/zen_server/dashboard/assets/page-DPrgvGj6.js +9 -0
  95. zenml/zen_server/dashboard/assets/{page-C0opS_t4.js → page-D_Vj_UH1.js} +1 -1
  96. zenml/zen_server/dashboard/assets/page-QPP3iIQH.js +1 -0
  97. zenml/zen_server/dashboard/assets/{page-Bjj9GHVF.js → page-bpP11sGS.js} +1 -1
  98. zenml/zen_server/dashboard/assets/page-xA0WcjLa.js +1 -0
  99. zenml/zen_server/dashboard/assets/{page-DVAcOIuw.js → page-zYQJvPVh.js} +1 -1
  100. zenml/zen_server/dashboard/assets/{play-circle-DsngbHkK.js → play-circle-DK5QMJyp.js} +1 -1
  101. zenml/zen_server/dashboard/assets/{terminal-Cb3ce-nr.js → terminal-B2ovgWuz.js} +1 -1
  102. zenml/zen_server/dashboard/assets/{update-server-settings-mutation-CdcOI8-c.js → update-server-settings-mutation-SaWcyAnk.js} +1 -1
  103. zenml/zen_server/dashboard/assets/{url-DLJUVIKc.js → url-ZKNs861m.js} +1 -1
  104. zenml/zen_server/dashboard/assets/zod-DrZvVLjd.js +1 -0
  105. zenml/zen_server/dashboard/index.html +8 -8
  106. zenml/zen_server/dashboard_legacy/asset-manifest.json +4 -4
  107. zenml/zen_server/dashboard_legacy/index.html +1 -1
  108. zenml/zen_server/dashboard_legacy/{precache-manifest.05e51e85bd64770b2708d408a88d7028.js → precache-manifest.8e59f98d08e9c4c7cb3ef9f0bab7093f.js} +4 -4
  109. zenml/zen_server/dashboard_legacy/service-worker.js +1 -1
  110. zenml/zen_server/dashboard_legacy/static/js/main.a238a4d2.chunk.js +2 -0
  111. zenml/zen_server/dashboard_legacy/static/js/main.a238a4d2.chunk.js.map +1 -0
  112. zenml/zen_server/deploy/helm/Chart.yaml +1 -1
  113. zenml/zen_server/deploy/helm/README.md +3 -3
  114. zenml/zen_server/deploy/helm/values.yaml +7 -7
  115. zenml/zen_server/jwt.py +11 -11
  116. zenml/zen_server/routers/auth_endpoints.py +17 -0
  117. zenml/zen_server/routers/steps_endpoints.py +11 -3
  118. zenml/zen_stores/migrations/versions/0.58.1_release.py +23 -0
  119. zenml/zen_stores/rest_zen_store.py +17 -1
  120. {zenml_nightly-0.58.0.dev20240529.dist-info → zenml_nightly-0.58.1.dev20240608.dist-info}/METADATA +4 -3
  121. {zenml_nightly-0.58.0.dev20240529.dist-info → zenml_nightly-0.58.1.dev20240608.dist-info}/RECORD +124 -123
  122. zenml/zen_server/dashboard/assets/@react-router-CCpyfPW-.js +0 -29
  123. zenml/zen_server/dashboard/assets/@reactflow-CF_wPv-n.js +0 -17
  124. zenml/zen_server/dashboard/assets/@reactflow-lOPj8ZwY.css +0 -1
  125. zenml/zen_server/dashboard/assets/@tanstack-GFKzItNf.js +0 -30
  126. zenml/zen_server/dashboard/assets/CodeSnippet-CBFcxTGW.js +0 -9
  127. zenml/zen_server/dashboard/assets/Commands-BQb0_PAa.js +0 -1
  128. zenml/zen_server/dashboard/assets/Infobox-DV6YqO5N.js +0 -1
  129. zenml/zen_server/dashboard/assets/index-D4zsM9tz.css +0 -1
  130. zenml/zen_server/dashboard/assets/index-DKgtNG83.js +0 -56
  131. zenml/zen_server/dashboard/assets/index.esm-DNxbrOmx.js +0 -1
  132. zenml/zen_server/dashboard/assets/page-0AGNIDYi.js +0 -1
  133. zenml/zen_server/dashboard/assets/page-6Gp_NCQL.js +0 -14
  134. zenml/zen_server/dashboard/assets/page-BiyORkbM.js +0 -1
  135. zenml/zen_server/dashboard/assets/page-BnrWbXYJ.js +0 -2
  136. zenml/zen_server/dashboard/assets/page-CUqLUGbU.js +0 -1
  137. zenml/zen_server/dashboard/assets/page-CWpGAjSi.js +0 -1
  138. zenml/zen_server/dashboard/assets/page-DFQa6C6e.js +0 -1
  139. zenml/zen_server/dashboard/assets/page-Dn87PjPv.js +0 -1
  140. zenml/zen_server/dashboard/assets/zod-DueGCdzx.js +0 -1
  141. zenml/zen_server/dashboard_legacy/static/js/main.41d438ec.chunk.js +0 -2
  142. zenml/zen_server/dashboard_legacy/static/js/main.41d438ec.chunk.js.map +0 -1
  143. {zenml_nightly-0.58.0.dev20240529.dist-info → zenml_nightly-0.58.1.dev20240608.dist-info}/LICENSE +0 -0
  144. {zenml_nightly-0.58.0.dev20240529.dist-info → zenml_nightly-0.58.1.dev20240608.dist-info}/WHEEL +0 -0
  145. {zenml_nightly-0.58.0.dev20240529.dist-info → zenml_nightly-0.58.1.dev20240608.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  apiVersion: v2
2
2
  name: zenml
3
- version: "0.58.0"
3
+ version: "0.58.1"
4
4
  description: Open source MLOps framework for portable production ready ML pipelines
5
5
  keywords:
6
6
  - mlops
@@ -20,8 +20,8 @@ ZenML is an open-source MLOps framework designed to help you create robust, main
20
20
  To install the ZenML chart directly from Amazon ECR, use the following command:
21
21
 
22
22
  ```bash
23
- # example command for version 0.58.0
24
- helm install my-zenml oci://public.ecr.aws/zenml/zenml --version 0.58.0
23
+ # example command for version 0.58.1
24
+ helm install my-zenml oci://public.ecr.aws/zenml/zenml --version 0.58.1
25
25
  ```
26
26
 
27
27
  Note: Ensure you have OCI support enabled in your Helm client and that you are authenticated with Amazon ECR.
@@ -30,7 +30,7 @@ Note: Ensure you have OCI support enabled in your Helm client and that you are a
30
30
 
31
31
  This chart offers a multitude of configuration options. For detailed
32
32
  information, check the default [`values.yaml`](values.yaml) file. For full
33
- details of the configuration options, refer to the [ZenML documentation](https://docs.zenml.io/deploying-zenml/zenml-self-hosted/deploy-with-helm).
33
+ details of the configuration options, refer to the [ZenML documentation](https://docs.zenml.io/getting-started/deploying-zenml/deploy-with-helm).
34
34
 
35
35
  ## Telemetry
36
36
 
@@ -201,7 +201,7 @@ zenml:
201
201
  # ZenML supports backing up the database before DB migrations are performed
202
202
  # and restoring it in case of a DB migration failure. For more information,
203
203
  # see the following documentation:
204
- # https://docs.zenml.io/deploying-zenml/zenml-self-hosted/deploy-with-helm#database-backup-and-recovery
204
+ # https://docs.zenml.io/getting-started/deploying-zenml/deploy-with-helm#database-backup-and-recovery
205
205
  #
206
206
  # Several backup strategies are supported:
207
207
  #
@@ -301,7 +301,7 @@ zenml:
301
301
  #
302
302
  # For a list of supported authentication methods and their configuration
303
303
  # options, see the following documentation:
304
- # https://docs.zenml.io/stacks-and-components/auth-management/aws-service-connector#authentication-methods
304
+ # https://docs.zenml.io/how-to/auth-management/aws-service-connector#authentication-methods
305
305
  #
306
306
  # You can also use the ZenML CLI to get the list of supported authentication
307
307
  # methods and their configuration options, e.g.:
@@ -374,7 +374,7 @@ zenml:
374
374
  #
375
375
  # For a list of supported authentication methods and their configuration
376
376
  # options, see the following documentation:
377
- # https://docs.zenml.io/stacks-and-components/auth-management/gcp-service-connector#authentication-methods
377
+ # https://docs.zenml.io/how-to/auth-management/gcp-service-connector#authentication-methods
378
378
  #
379
379
  # You can also use the ZenML CLI to get the list of supported authentication
380
380
  # methods and their configuration options, e.g.:
@@ -446,7 +446,7 @@ zenml:
446
446
  #
447
447
  # For a list of supported authentication methods and their configuration
448
448
  # options, see the following documentation:
449
- # https://docs.zenml.io/stacks-and-components/auth-management/azure-service-connector#authentication-methods
449
+ # https://docs.zenml.io/how-to/auth-management/azure-service-connector#authentication-methods
450
450
  #
451
451
  # You can also use the ZenML CLI to get the list of supported authentication
452
452
  # methods and their configuration options, e.g.:
@@ -598,7 +598,7 @@ zenml:
598
598
  #
599
599
  # For a list of supported authentication methods and their configuration
600
600
  # options, see the following documentation:
601
- # https://docs.zenml.io/stacks-and-components/auth-management/aws-service-connector#authentication-methods
601
+ # https://docs.zenml.io/how-to/auth-management/aws-service-connector#authentication-methods
602
602
  #
603
603
  # You can also use the ZenML CLI to get the list of supported authentication
604
604
  # methods and their configuration options, e.g.:
@@ -652,7 +652,7 @@ zenml:
652
652
  #
653
653
  # For a list of supported authentication methods and their configuration
654
654
  # options, see the following documentation:
655
- # https://docs.zenml.io/stacks-and-components/auth-management/gcp-service-connector#authentication-methods
655
+ # https://docs.zenml.io/how-to/auth-management/gcp-service-connector#authentication-methods
656
656
  #
657
657
  # You can also use the ZenML CLI to get the list of supported authentication
658
658
  # methods and their configuration options, e.g.:
@@ -717,7 +717,7 @@ zenml:
717
717
  #
718
718
  # For a list of supported authentication methods and their configuration
719
719
  # options, see the following documentation:
720
- # https://docs.zenml.io/stacks-and-components/auth-management/azure-service-connector#authentication-methods
720
+ # https://docs.zenml.io/how-to/auth-management/azure-service-connector#authentication-methods
721
721
  #
722
722
  # You can also use the ZenML CLI to get the list of supported authentication
723
723
  # methods and their configuration options, e.g.:
zenml/zen_server/jwt.py CHANGED
@@ -89,7 +89,7 @@ class JWTToken(BaseModel):
89
89
  except jwt.PyJWTError as e:
90
90
  raise AuthorizationException(f"Invalid JWT token: {e}") from e
91
91
 
92
- subject: str = claims.get("sub", "")
92
+ subject: str = claims.pop("sub", "")
93
93
  if not subject:
94
94
  raise AuthorizationException(
95
95
  "Invalid JWT token: the subject claim is missing"
@@ -105,7 +105,7 @@ class JWTToken(BaseModel):
105
105
  device_id: Optional[UUID] = None
106
106
  if "device_id" in claims:
107
107
  try:
108
- device_id = UUID(claims["device_id"])
108
+ device_id = UUID(claims.pop("device_id"))
109
109
  except ValueError:
110
110
  raise AuthorizationException(
111
111
  "Invalid JWT token: the device_id claim is not a valid "
@@ -115,7 +115,7 @@ class JWTToken(BaseModel):
115
115
  api_key_id: Optional[UUID] = None
116
116
  if "api_key_id" in claims:
117
117
  try:
118
- api_key_id = UUID(claims["api_key_id"])
118
+ api_key_id = UUID(claims.pop("api_key_id"))
119
119
  except ValueError:
120
120
  raise AuthorizationException(
121
121
  "Invalid JWT token: the api_key_id claim is not a valid "
@@ -125,7 +125,7 @@ class JWTToken(BaseModel):
125
125
  pipeline_id: Optional[UUID] = None
126
126
  if "pipeline_id" in claims:
127
127
  try:
128
- pipeline_id = UUID(claims["pipeline_id"])
128
+ pipeline_id = UUID(claims.pop("pipeline_id"))
129
129
  except ValueError:
130
130
  raise AuthorizationException(
131
131
  "Invalid JWT token: the pipeline_id claim is not a valid "
@@ -135,7 +135,7 @@ class JWTToken(BaseModel):
135
135
  schedule_id: Optional[UUID] = None
136
136
  if "schedule_id" in claims:
137
137
  try:
138
- schedule_id = UUID(claims["schedule_id"])
138
+ schedule_id = UUID(claims.pop("schedule_id"))
139
139
  except ValueError:
140
140
  raise AuthorizationException(
141
141
  "Invalid JWT token: the schedule_id claim is not a valid "
@@ -165,14 +165,17 @@ class JWTToken(BaseModel):
165
165
  """
166
166
  config = server_config()
167
167
 
168
- claims: Dict[str, Any] = dict(
169
- sub=str(self.user_id),
170
- )
168
+ claims: Dict[str, Any] = self.claims.copy()
169
+
170
+ claims["sub"] = str(self.user_id)
171
171
  claims["iss"] = config.get_jwt_token_issuer()
172
172
  claims["aud"] = config.get_jwt_token_audience()
173
173
 
174
174
  if expires:
175
175
  claims["exp"] = expires
176
+ else:
177
+ claims.pop("exp", None)
178
+
176
179
  if self.device_id:
177
180
  claims["device_id"] = str(self.device_id)
178
181
  if self.api_key_id:
@@ -182,9 +185,6 @@ class JWTToken(BaseModel):
182
185
  if self.schedule_id:
183
186
  claims["schedule_id"] = str(self.schedule_id)
184
187
 
185
- # Apply custom claims
186
- claims.update(self.claims)
187
-
188
188
  return jwt.encode(
189
189
  claims,
190
190
  config.jwt_secret_key,
@@ -44,6 +44,7 @@ from zenml.enums import (
44
44
  OAuthDeviceStatus,
45
45
  OAuthGrantTypes,
46
46
  )
47
+ from zenml.exceptions import AuthorizationException
47
48
  from zenml.logger import get_logger
48
49
  from zenml.models import (
49
50
  APIKeyInternalResponse,
@@ -510,6 +511,8 @@ def api_token(
510
511
 
511
512
  Raises:
512
513
  HTTPException: If the user is not authenticated.
514
+ AuthorizationException: If trying to scope the API token to a different
515
+ pipeline/schedule than the token used to authorize this request.
513
516
  """
514
517
  token = auth_context.access_token
515
518
  if not token or not auth_context.encoded_access_token:
@@ -523,6 +526,20 @@ def api_token(
523
526
  resource_type=ResourceType.PIPELINE_RUN, action=Action.CREATE
524
527
  )
525
528
 
529
+ if pipeline_id and token.pipeline_id and pipeline_id != token.pipeline_id:
530
+ raise AuthorizationException(
531
+ f"Unable to scope API token to pipeline {pipeline_id}. The "
532
+ f"token used to authorize this request is already scoped to "
533
+ f"pipeline {token.pipeline_id}."
534
+ )
535
+
536
+ if schedule_id and token.schedule_id and schedule_id != token.schedule_id:
537
+ raise AuthorizationException(
538
+ f"Unable to scope API token to schedule {schedule_id}. The "
539
+ f"token used to authorize this request is already scoped to "
540
+ f"schedule {token.schedule_id}."
541
+ )
542
+
526
543
  if not token.device_id and not token.api_key_id:
527
544
  # If not authenticated with a device or a service account, the current
528
545
  # API token is returned as is, without any modifications. Issuing
@@ -13,7 +13,7 @@
13
13
  # permissions and limitations under the License.
14
14
  """Endpoint definitions for steps (and artifacts) of pipeline runs."""
15
15
 
16
- from typing import Any, Dict
16
+ from typing import Any, Dict, Optional
17
17
  from uuid import UUID
18
18
 
19
19
  from fastapi import APIRouter, Depends, HTTPException, Security
@@ -239,12 +239,16 @@ def get_step_status(
239
239
  @handle_exceptions
240
240
  def get_step_logs(
241
241
  step_id: UUID,
242
+ offset: int = 0,
243
+ length: Optional[int] = 1024 * 1024 * 16, # Default to 16MiB of data
242
244
  _: AuthContext = Security(authorize),
243
245
  ) -> str:
244
246
  """Get the logs of a specific step.
245
247
 
246
248
  Args:
247
249
  step_id: ID of the step for which to get the logs.
250
+ offset: The offset from which to start reading.
251
+ length: The amount of bytes that should be read.
248
252
 
249
253
  Returns:
250
254
  The logs of the step.
@@ -265,6 +269,10 @@ def get_step_logs(
265
269
  artifact_store = _load_artifact_store(logs.artifact_store_id, store)
266
270
  return str(
267
271
  _load_file_from_artifact_store(
268
- logs.uri, artifact_store=artifact_store, mode="r"
269
- )
272
+ logs.uri,
273
+ artifact_store=artifact_store,
274
+ mode="rb",
275
+ offset=offset,
276
+ length=length,
277
+ ).decode()
270
278
  )
@@ -0,0 +1,23 @@
1
+ """Release [0.58.1].
2
+
3
+ Revision ID: 0.58.1
4
+ Revises: 0.58.0
5
+ Create Date: 2024-06-06 12:49:10.783249
6
+
7
+ """
8
+
9
+ # revision identifiers, used by Alembic.
10
+ revision = "0.58.1"
11
+ down_revision = "0.58.0"
12
+ branch_labels = None
13
+ depends_on = None
14
+
15
+
16
+ def upgrade() -> None:
17
+ """Upgrade database schema and/or data, creating a new revision."""
18
+ pass
19
+
20
+
21
+ def downgrade() -> None:
22
+ """Downgrade database schema and/or data back to the previous revision."""
23
+ pass
@@ -3730,7 +3730,13 @@ class RestZenStore(BaseZenStore):
3730
3730
  return self._session
3731
3731
 
3732
3732
  def clear_session(self) -> None:
3733
- """Clear the authentication session and any cached API tokens."""
3733
+ """Clear the authentication session and any cached API tokens.
3734
+
3735
+ Raises:
3736
+ AuthorizationException: If the API token can't be reset because
3737
+ the store configuration does not contain username and password
3738
+ or an API key to fetch a new token.
3739
+ """
3734
3740
  self._session = None
3735
3741
  self._api_token = None
3736
3742
  # Clear the configured API token only if it's possible to fetch a new
@@ -3742,6 +3748,16 @@ class RestZenStore(BaseZenStore):
3742
3748
  or self.config.api_key is not None
3743
3749
  ):
3744
3750
  self.config.api_token = None
3751
+ elif self.config.api_token:
3752
+ raise AuthorizationException(
3753
+ "Unable to refresh invalid API token. This is probably "
3754
+ "because you're connected to your ZenML server with device "
3755
+ "authentication. Rerunning `zenml connect --url "
3756
+ f"{self.config.url}` should solve this issue. "
3757
+ "If you're seeing this error from an automated workload, "
3758
+ "you should probably use a service account to start that "
3759
+ "workload to prevent this error."
3760
+ )
3745
3761
 
3746
3762
  @staticmethod
3747
3763
  def _handle_response(response: requests.Response) -> Json:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zenml-nightly
3
- Version: 0.58.0.dev20240529
3
+ Version: 0.58.1.dev20240608
4
4
  Summary: ZenML: Write production-ready ML code.
5
5
  Home-page: https://zenml.io
6
6
  License: Apache-2.0
@@ -348,7 +348,7 @@ you can make use of a control plane to create ZenML servers, also known as tenan
348
348
  These tenants are managed and maintained by ZenML’s dedicated team, alleviating
349
349
  the burden of server management from your end.
350
350
  - **Self-hosted deployment**: Alternatively, you have the flexibility to [deploy
351
- ZenML on your own self-hosted environment](https://docs.zenml.io/deploying-zenml/zenml-self-hosted).
351
+ ZenML on your own self-hosted environment](https://docs.zenml.io/getting-started/deploying-zenml#deploying-a-zenml-server).
352
352
  This can be achieved through various methods, including using our CLI, Docker,
353
353
  Helm, or HuggingFace Spaces.
354
354
 
@@ -426,10 +426,11 @@ the Apache License Version 2.0.
426
426
  <a href="https://github.com/zenml-io/zenml-projects">Projects Showcase</a>
427
427
  <br />
428
428
  <br />
429
- 🎉 Version 0.58.0 is out. Check out the release notes
429
+ 🎉 Version 0.58.1 is out. Check out the release notes
430
430
  <a href="https://github.com/zenml-io/zenml/releases">here</a>.
431
431
  <br />
432
432
  🖥️ Download our VS Code Extension <a href="https://marketplace.visualstudio.com/items?itemName=ZenML.zenml-vscode">here</a>.
433
433
  <br />
434
434
  </p>
435
435
  </div>
436
+