zenml-nightly 0.72.0.dev20250121__py3-none-any.whl → 0.73.0.dev20250123__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 (157) hide show
  1. zenml/VERSION +1 -1
  2. zenml/cli/service_connectors.py +8 -4
  3. zenml/cli/stack.py +2 -2
  4. zenml/config/pipeline_configurations.py +2 -2
  5. zenml/config/server_config.py +20 -0
  6. zenml/event_hub/base_event_hub.py +2 -2
  7. zenml/integrations/airflow/orchestrators/airflow_orchestrator.py +4 -2
  8. zenml/integrations/gcp/__init__.py +3 -0
  9. zenml/integrations/gcp/experiment_trackers/__init__.py +18 -0
  10. zenml/integrations/gcp/experiment_trackers/vertex_experiment_tracker.py +214 -0
  11. zenml/integrations/gcp/flavors/__init__.py +6 -0
  12. zenml/integrations/gcp/flavors/vertex_experiment_tracker_flavor.py +199 -0
  13. zenml/integrations/kubernetes/orchestrators/kube_utils.py +2 -2
  14. zenml/integrations/mlflow/experiment_trackers/mlflow_experiment_tracker.py +0 -1
  15. zenml/integrations/whylogs/data_validators/whylogs_data_validator.py +3 -1
  16. zenml/models/v2/core/api_key.py +2 -2
  17. zenml/orchestrators/publish_utils.py +4 -4
  18. zenml/orchestrators/step_launcher.py +3 -3
  19. zenml/orchestrators/step_run_utils.py +2 -2
  20. zenml/pipelines/run_utils.py +2 -2
  21. zenml/service_connectors/service_connector.py +2 -2
  22. zenml/stack/stack.py +3 -3
  23. zenml/stack_deployments/stack_deployment.py +5 -0
  24. zenml/utils/git_utils.py +1 -1
  25. zenml/utils/string_utils.py +2 -2
  26. zenml/zen_server/auth.py +13 -6
  27. zenml/zen_server/dashboard/assets/{404-Dfq64Boz.js → 404-c8OuXDAT.js} +1 -1
  28. zenml/zen_server/dashboard/assets/{@reactflow-BUNIMFeC.js → @reactflow-6JPoencd.js} +1 -1
  29. zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-B73Vs10T.js → AlertDialogDropdownItem-8yPFDxEI.js} +1 -1
  30. zenml/zen_server/dashboard/assets/{CodeSnippet-DIJRT2NT.js → CodeSnippet-Qh1ae_DJ.js} +1 -1
  31. zenml/zen_server/dashboard/assets/{CollapsibleCard-BzUHGZOU.js → CollapsibleCard-TiI4lId1.js} +1 -1
  32. zenml/zen_server/dashboard/assets/{Commands-BEGyld4c.js → Commands-BcR2Arie.js} +1 -1
  33. zenml/zen_server/dashboard/assets/{ComponentBadge-xyKiek1s.js → ComponentBadge-BqQNUZgb.js} +1 -1
  34. zenml/zen_server/dashboard/assets/{CopyButton-DhW-mapu.js → CopyButton-DCiXO3JC.js} +1 -1
  35. zenml/zen_server/dashboard/assets/{CsvVizualization-D8oazBiE.js → CsvVizualization-O9cVIaL8.js} +1 -1
  36. zenml/zen_server/dashboard/assets/{DeleteAlertDialog-WkSIIgfy.js → DeleteAlertDialog-DrPjHtXX.js} +1 -1
  37. zenml/zen_server/dashboard/assets/{DialogItem-Bgroeg29.js → DialogItem-BYG7d_M2.js} +1 -1
  38. zenml/zen_server/dashboard/assets/{Error-CY5tlu17.js → Error-C1zbWr19.js} +1 -1
  39. zenml/zen_server/dashboard/assets/{ExecutionStatus-G8mjIaeA.js → ExecutionStatus-Ct9srgHC.js} +1 -1
  40. zenml/zen_server/dashboard/assets/{Helpbox-Bb1ed--O.js → Helpbox-Bm_1Zx9f.js} +1 -1
  41. zenml/zen_server/dashboard/assets/{Infobox-Da6-76M2.js → Infobox-OQdkCLSP.js} +1 -1
  42. zenml/zen_server/dashboard/assets/{InlineAvatar-DqnZaBNq.js → InlineAvatar-CQNjKoEQ.js} +1 -1
  43. zenml/zen_server/dashboard/assets/{NestedCollapsible-aK5ojKoF.js → NestedCollapsible-DDgd2SGb.js} +1 -1
  44. zenml/zen_server/dashboard/assets/Partials-MD3e95Dk.js +1 -0
  45. zenml/zen_server/dashboard/assets/{ProBadge-B4tRUYve.js → ProBadge-D784iVNC.js} +1 -1
  46. zenml/zen_server/dashboard/assets/{ProCta-CZuP29Qz.js → ProCta-W2PEvNow.js} +1 -1
  47. zenml/zen_server/dashboard/assets/{ProviderIcon-Bd7GUQ1_.js → ProviderIcon-DfDUOeAy.js} +1 -1
  48. zenml/zen_server/dashboard/assets/{ProviderRadio-mstdqzsS.js → ProviderRadio-B81Elxrc.js} +1 -1
  49. zenml/zen_server/dashboard/assets/{RunSelector-CsruSB4i.js → RunSelector-DOXgdry5.js} +1 -1
  50. zenml/zen_server/dashboard/assets/{RunsBody-DxxtWVYz.js → RunsBody-Bnx2fxub.js} +1 -1
  51. zenml/zen_server/dashboard/assets/SearchField-Yjv-KRW4.js +1 -0
  52. zenml/zen_server/dashboard/assets/{SecretTooltip-CLzJIYW_.js → SecretTooltip-EKpMlG2f.js} +1 -1
  53. zenml/zen_server/dashboard/assets/{SetPassword-Yn50ooBC.js → SetPassword-CDLy57PZ.js} +1 -1
  54. zenml/zen_server/dashboard/assets/StackList-DKQaLDo4.js +1 -0
  55. zenml/zen_server/dashboard/assets/{Tabs-CNv-eTYM.js → Tabs-B5E-o_h6.js} +1 -1
  56. zenml/zen_server/dashboard/assets/{Tick-jEIevzVf.js → Tick-DSYBiuXU.js} +1 -1
  57. zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-C16GW-kX.js → UpdatePasswordSchemas-HBNOeyoP.js} +1 -1
  58. zenml/zen_server/dashboard/assets/{UsageReason-Bf2tzhv1.js → UsageReason-DXtPS5nE.js} +1 -1
  59. zenml/zen_server/dashboard/assets/{WizardFooter-D6i-AP1K.js → WizardFooter-_1VSMZ_c.js} +1 -1
  60. zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-DUti43aF.js → all-pipeline-runs-query-D0qDLdKB.js} +1 -1
  61. zenml/zen_server/dashboard/assets/{create-stack-Ch2WPs9U.js → create-stack-7JzgAYAm.js} +1 -1
  62. zenml/zen_server/dashboard/assets/{delete-run-Byf9hTjA.js → delete-run-CUdtYFLl.js} +1 -1
  63. zenml/zen_server/dashboard/assets/{form-schemas-BZqKBPBF.js → form-schemas-B6PCV3Y4.js} +1 -1
  64. zenml/zen_server/dashboard/assets/index-B6U0OkEN.css +1 -0
  65. zenml/zen_server/dashboard/assets/{index-CyBKZcpO.js → index-CJ5IfeAl.js} +1 -1
  66. zenml/zen_server/dashboard/assets/{index-CtdYkjUi.js → index-Ceyzb1yI.js} +1 -1
  67. zenml/zen_server/dashboard/assets/{index-CE0aQlv8.js → index-CxO6541P.js} +3 -3
  68. zenml/zen_server/dashboard/assets/{index-v6gQjDEo.js → index-D4yoZ_gH.js} +1 -1
  69. zenml/zen_server/dashboard/assets/{login-mutation-DNDVp_2H.js → login-mutation-BaeJ7MAg.js} +1 -1
  70. zenml/zen_server/dashboard/assets/{not-found-Bmup4ctE.js → not-found-MGptrNBk.js} +1 -1
  71. zenml/zen_server/dashboard/assets/{page-DGlm1RVc.js → page-Aeu3v0MQ.js} +1 -1
  72. zenml/zen_server/dashboard/assets/{page-CltCNL0T.js → page-BCgEdmhP.js} +1 -1
  73. zenml/zen_server/dashboard/assets/{page-Hn8q9iJZ.js → page-BKwwfTNy.js} +1 -1
  74. zenml/zen_server/dashboard/assets/{page-BNxYrN0q.js → page-BUjw8Tp1.js} +1 -1
  75. zenml/zen_server/dashboard/assets/{page-BYJfqgLN.js → page-BXgXP-Qj.js} +1 -1
  76. zenml/zen_server/dashboard/assets/{page-DN4BVIOL.js → page-BXrtxEbw.js} +1 -1
  77. zenml/zen_server/dashboard/assets/{page-CHRn1fQm.js → page-BaUDR9Ri.js} +1 -1
  78. zenml/zen_server/dashboard/assets/{page-DlIi5ThM.js → page-BbljjC-k.js} +1 -1
  79. zenml/zen_server/dashboard/assets/{page-BrmJp1Wt.js → page-BhOXn-s9.js} +1 -1
  80. zenml/zen_server/dashboard/assets/{page-Cc8ZEuj4.js → page-C37IDa-Q.js} +1 -1
  81. zenml/zen_server/dashboard/assets/{page-Dif8CWyZ.js → page-C4JpDeUM.js} +1 -1
  82. zenml/zen_server/dashboard/assets/{page-BC27C_OI.js → page-CB2_GdBA.js} +1 -1
  83. zenml/zen_server/dashboard/assets/{page-B5Sr8pib.js → page-CBiT2Ox9.js} +1 -1
  84. zenml/zen_server/dashboard/assets/{page-IhckKFnD.js → page-CXPc-HN1.js} +1 -1
  85. zenml/zen_server/dashboard/assets/{page-Dth9X1Ih.js → page-CbwI6emp.js} +1 -1
  86. zenml/zen_server/dashboard/assets/{page-DweqqCkF.js → page-CeNL9JWi.js} +1 -1
  87. zenml/zen_server/dashboard/assets/{page-LyZ_l8vR.js → page-CkPwPmLZ.js} +1 -1
  88. zenml/zen_server/dashboard/assets/{page-C70wZtV2.js → page-CmJU3Gqo.js} +1 -1
  89. zenml/zen_server/dashboard/assets/{page-D9Oh05fl.js → page-CoFVtzhG.js} +1 -1
  90. zenml/zen_server/dashboard/assets/{page-PamGpk0j.js → page-D-KPzeQb.js} +1 -1
  91. zenml/zen_server/dashboard/assets/{page-DoW7YxTu.js → page-DKQ3wZgr.js} +1 -1
  92. zenml/zen_server/dashboard/assets/page-DWWhxCoF.js +1 -0
  93. zenml/zen_server/dashboard/assets/{page-CmlYj7Nl.js → page-DbW8MfQ4.js} +1 -1
  94. zenml/zen_server/dashboard/assets/{page-CWr96ZKN.js → page-Dv5lN2w7.js} +1 -1
  95. zenml/zen_server/dashboard/assets/{page-ANYGfEUL.js → page-Dvbq1BoF.js} +1 -1
  96. zenml/zen_server/dashboard/assets/{page-D6Ev5P8V.js → page-DyAuja95.js} +1 -1
  97. zenml/zen_server/dashboard/assets/{page-DyOJ_pq3.js → page-DzrdL2v1.js} +1 -1
  98. zenml/zen_server/dashboard/assets/{page-CXAbSyp9.js → page-I2B4Ocv8.js} +1 -1
  99. zenml/zen_server/dashboard/assets/page-OdjGauvw.js +2 -0
  100. zenml/zen_server/dashboard/assets/{page-CaeI9ptC.js → page-Ox-eC1ik.js} +1 -1
  101. zenml/zen_server/dashboard/assets/{page-B_0XkV48.js → page-khp8QJ6b.js} +1 -1
  102. zenml/zen_server/dashboard/assets/{page--XLMzHrn.js → page-yNh6PQKt.js} +1 -1
  103. zenml/zen_server/dashboard/assets/{persist-vP0-Xl4f.js → persist-DBTFy--v.js} +1 -1
  104. zenml/zen_server/dashboard/assets/{persist-DeXRG61d.js → persist-K7AY0ju4.js} +1 -1
  105. zenml/zen_server/dashboard/assets/{service-DH_oUqQj.js → service-BvOYLH5b.js} +1 -1
  106. zenml/zen_server/dashboard/assets/{sharedSchema-Bw1_Wa7l.js → sharedSchema-xJDsJNgJ.js} +1 -1
  107. zenml/zen_server/dashboard/assets/{stack-detail-query-B_0R_fd6.js → stack-detail-query-DMJoxwgv.js} +1 -1
  108. zenml/zen_server/dashboard/assets/{update-server-settings-mutation-D9qYhfaN.js → update-server-settings-mutation-ATZDNNZk.js} +1 -1
  109. zenml/zen_server/dashboard/assets/{url-Dh93fvh0.js → url-BWJXzuI4.js} +1 -1
  110. zenml/zen_server/dashboard/index.html +4 -4
  111. zenml/zen_server/deploy/helm/Chart.yaml +1 -1
  112. zenml/zen_server/deploy/helm/README.md +2 -2
  113. zenml/zen_server/deploy/helm/templates/server-db-job.yaml +5 -3
  114. zenml/zen_server/deploy/helm/values.yaml +4 -0
  115. zenml/zen_server/routers/devices_endpoints.py +4 -2
  116. zenml/zen_stores/migrations/versions/0.73.0_release.py +23 -0
  117. zenml/zen_stores/migrations/versions/25155145c545_separate_actions_and_triggers.py +2 -2
  118. zenml/zen_stores/migrations/versions/46506f72f0ed_add_server_settings.py +2 -2
  119. zenml/zen_stores/migrations/versions/5994f9ad0489_introduce_role_permissions.py +6 -6
  120. zenml/zen_stores/migrations/versions/7500f434b71c_remove_shared_columns.py +2 -2
  121. zenml/zen_stores/migrations/versions/a91762e6be36_artifact_version_table.py +3 -3
  122. zenml/zen_stores/schemas/action_schemas.py +2 -2
  123. zenml/zen_stores/schemas/api_key_schemas.py +4 -4
  124. zenml/zen_stores/schemas/artifact_schemas.py +3 -3
  125. zenml/zen_stores/schemas/base_schemas.py +7 -3
  126. zenml/zen_stores/schemas/code_repository_schemas.py +2 -2
  127. zenml/zen_stores/schemas/component_schemas.py +2 -2
  128. zenml/zen_stores/schemas/device_schemas.py +4 -4
  129. zenml/zen_stores/schemas/event_source_schemas.py +2 -2
  130. zenml/zen_stores/schemas/flavor_schemas.py +2 -2
  131. zenml/zen_stores/schemas/model_schemas.py +3 -3
  132. zenml/zen_stores/schemas/pipeline_run_schemas.py +3 -3
  133. zenml/zen_stores/schemas/pipeline_schemas.py +2 -2
  134. zenml/zen_stores/schemas/run_template_schemas.py +2 -2
  135. zenml/zen_stores/schemas/schedule_schema.py +2 -2
  136. zenml/zen_stores/schemas/secret_schemas.py +2 -2
  137. zenml/zen_stores/schemas/server_settings_schemas.py +9 -5
  138. zenml/zen_stores/schemas/service_connector_schemas.py +2 -2
  139. zenml/zen_stores/schemas/service_schemas.py +2 -2
  140. zenml/zen_stores/schemas/stack_schemas.py +2 -2
  141. zenml/zen_stores/schemas/step_run_schemas.py +2 -2
  142. zenml/zen_stores/schemas/tag_schemas.py +2 -2
  143. zenml/zen_stores/schemas/trigger_schemas.py +2 -2
  144. zenml/zen_stores/schemas/user_schemas.py +3 -3
  145. zenml/zen_stores/schemas/workspace_schemas.py +2 -2
  146. zenml/zen_stores/sql_zen_store.py +10 -1
  147. {zenml_nightly-0.72.0.dev20250121.dist-info → zenml_nightly-0.73.0.dev20250123.dist-info}/METADATA +2 -2
  148. {zenml_nightly-0.72.0.dev20250121.dist-info → zenml_nightly-0.73.0.dev20250123.dist-info}/RECORD +151 -147
  149. zenml/zen_server/dashboard/assets/Partials-CqZp5NMX.js +0 -1
  150. zenml/zen_server/dashboard/assets/SearchField-D6tPxyqw.js +0 -1
  151. zenml/zen_server/dashboard/assets/StackList-U537qoYd.js +0 -1
  152. zenml/zen_server/dashboard/assets/index-DXvT1_Um.css +0 -1
  153. zenml/zen_server/dashboard/assets/page-C2nU3Gxn.js +0 -1
  154. zenml/zen_server/dashboard/assets/page-PxOWfKgF.js +0 -2
  155. {zenml_nightly-0.72.0.dev20250121.dist-info → zenml_nightly-0.73.0.dev20250123.dist-info}/LICENSE +0 -0
  156. {zenml_nightly-0.72.0.dev20250121.dist-info → zenml_nightly-0.73.0.dev20250123.dist-info}/WHEEL +0 -0
  157. {zenml_nightly-0.72.0.dev20250121.dist-info → zenml_nightly-0.73.0.dev20250123.dist-info}/entry_points.txt +0 -0
@@ -13,7 +13,7 @@
13
13
  # permissions and limitations under the License.
14
14
  """Utilities to publish pipeline and step runs."""
15
15
 
16
- from datetime import datetime
16
+ from datetime import datetime, timezone
17
17
  from typing import TYPE_CHECKING, Dict, List
18
18
 
19
19
  from zenml.client import Client
@@ -48,7 +48,7 @@ def publish_successful_step_run(
48
48
  step_run_id=step_run_id,
49
49
  step_run_update=StepRunUpdate(
50
50
  status=ExecutionStatus.COMPLETED,
51
- end_time=datetime.utcnow(),
51
+ end_time=datetime.now(timezone.utc),
52
52
  outputs=output_artifact_ids,
53
53
  ),
54
54
  )
@@ -67,7 +67,7 @@ def publish_failed_step_run(step_run_id: "UUID") -> "StepRunResponse":
67
67
  step_run_id=step_run_id,
68
68
  step_run_update=StepRunUpdate(
69
69
  status=ExecutionStatus.FAILED,
70
- end_time=datetime.utcnow(),
70
+ end_time=datetime.now(timezone.utc),
71
71
  ),
72
72
  )
73
73
 
@@ -87,7 +87,7 @@ def publish_failed_pipeline_run(
87
87
  run_id=pipeline_run_id,
88
88
  run_update=PipelineRunUpdate(
89
89
  status=ExecutionStatus.FAILED,
90
- end_time=datetime.utcnow(),
90
+ end_time=datetime.now(timezone.utc),
91
91
  ),
92
92
  )
93
93
 
@@ -16,7 +16,7 @@
16
16
  import os
17
17
  import time
18
18
  from contextlib import nullcontext
19
- from datetime import datetime
19
+ from datetime import datetime, timezone
20
20
  from functools import partial
21
21
  from typing import TYPE_CHECKING, Any, Callable, Dict, Tuple
22
22
 
@@ -201,7 +201,7 @@ class StepLauncher:
201
201
  f"Failed preparing step `{self._step_name}`."
202
202
  )
203
203
  step_run_request.status = ExecutionStatus.FAILED
204
- step_run_request.end_time = datetime.utcnow()
204
+ step_run_request.end_time = datetime.now(timezone.utc)
205
205
  raise
206
206
  finally:
207
207
  step_run = Client().zen_store.create_run_step(
@@ -305,7 +305,7 @@ class StepLauncher:
305
305
  The created or existing pipeline run,
306
306
  and a boolean indicating whether the run was created or reused.
307
307
  """
308
- start_time = datetime.utcnow()
308
+ start_time = datetime.now(timezone.utc)
309
309
  run_name = string_utils.format_name_template(
310
310
  name_template=self._deployment.run_name_template,
311
311
  substitutions=self._deployment.pipeline_configuration._get_full_substitutions(
@@ -13,7 +13,7 @@
13
13
  # permissions and limitations under the License.
14
14
  """Utilities for creating step runs."""
15
15
 
16
- from datetime import datetime
16
+ from datetime import datetime, timezone
17
17
  from typing import Dict, List, Optional, Set, Tuple
18
18
 
19
19
  from zenml.client import Client
@@ -75,7 +75,7 @@ class StepRunRequestFactory:
75
75
  pipeline_run_id=self.pipeline_run.id,
76
76
  deployment=self.deployment.id,
77
77
  status=ExecutionStatus.RUNNING,
78
- start_time=datetime.utcnow(),
78
+ start_time=datetime.now(timezone.utc),
79
79
  user=Client().active_user.id,
80
80
  workspace=Client().active_workspace.id,
81
81
  )
@@ -1,7 +1,7 @@
1
1
  """Utility functions for running pipelines."""
2
2
 
3
3
  import time
4
- from datetime import datetime
4
+ from datetime import datetime, timezone
5
5
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Union
6
6
  from uuid import UUID
7
7
 
@@ -65,7 +65,7 @@ def create_placeholder_run(
65
65
 
66
66
  if deployment.schedule:
67
67
  return None
68
- start_time = datetime.utcnow()
68
+ start_time = datetime.now(timezone.utc)
69
69
  run_request = PipelineRunRequest(
70
70
  name=string_utils.format_name_template(
71
71
  name_template=deployment.run_name_template,
@@ -799,8 +799,8 @@ class ServiceConnector(BaseModel, metaclass=ServiceConnectorMeta):
799
799
  name=name,
800
800
  body=ServiceConnectorResponseBody(
801
801
  user=user,
802
- created=datetime.utcnow(),
803
- updated=datetime.utcnow(),
802
+ created=datetime.now(timezone.utc),
803
+ updated=datetime.now(timezone.utc),
804
804
  description=description,
805
805
  connector_type=self.get_type(),
806
806
  auth_method=self.auth_method,
zenml/stack/stack.py CHANGED
@@ -16,7 +16,7 @@
16
16
  import itertools
17
17
  import json
18
18
  import os
19
- from datetime import datetime
19
+ from datetime import datetime, timezone
20
20
  from typing import (
21
21
  TYPE_CHECKING,
22
22
  AbstractSet,
@@ -751,8 +751,8 @@ class Stack:
751
751
  config=LocalImageBuilderConfig(),
752
752
  user=Client().active_user.id,
753
753
  workspace=Client().active_workspace.id,
754
- created=datetime.utcnow(),
755
- updated=datetime.utcnow(),
754
+ created=datetime.now(timezone.utc),
755
+ updated=datetime.now(timezone.utc),
756
756
  )
757
757
 
758
758
  self._image_builder = image_builder
@@ -197,6 +197,11 @@ class ZenMLCloudStackDeployment(BaseModel):
197
197
  # that was registered after this deployment was created.
198
198
 
199
199
  # Get all stacks created after the start date
200
+
201
+ if date_start and date_start.tzinfo:
202
+ date_start = date_start.astimezone(datetime.timezone.utc).replace(
203
+ tzinfo=None
204
+ )
200
205
  stacks = client.list_stacks(
201
206
  created=f"gt:{str(date_start.replace(microsecond=0))}"
202
207
  if date_start
zenml/utils/git_utils.py CHANGED
@@ -16,7 +16,7 @@
16
16
  import os
17
17
  from typing import Optional
18
18
 
19
- from git import GitCommandError
19
+ from git.exc import GitCommandError
20
20
  from git.repo import Repo
21
21
 
22
22
 
@@ -17,7 +17,7 @@ import base64
17
17
  import functools
18
18
  import random
19
19
  import string
20
- from datetime import datetime
20
+ from datetime import datetime, timezone
21
21
  from typing import Any, Callable, Dict, Optional, TypeVar, cast
22
22
 
23
23
  from pydantic import BaseModel
@@ -180,7 +180,7 @@ def format_name_template(
180
180
  start_time = None
181
181
 
182
182
  if start_time is None:
183
- start_time = datetime.utcnow()
183
+ start_time = datetime.now(timezone.utc)
184
184
  substitutions.setdefault("date", start_time.strftime("%Y_%m_%d"))
185
185
  substitutions.setdefault("time", start_time.strftime("%H_%M_%S_%f"))
186
186
 
zenml/zen_server/auth.py CHANGED
@@ -14,7 +14,7 @@
14
14
  """Authentication module for ZenML server."""
15
15
 
16
16
  from contextvars import ContextVar
17
- from datetime import datetime, timedelta
17
+ from datetime import datetime, timedelta, timezone
18
18
  from typing import Callable, Optional, Union
19
19
  from urllib.parse import urlencode, urlparse
20
20
  from uuid import UUID, uuid4
@@ -350,7 +350,7 @@ def authenticate_credentials(
350
350
 
351
351
  if (
352
352
  device_model.expires
353
- and datetime.utcnow() >= device_model.expires
353
+ and datetime.now(timezone.utc) >= device_model.expires
354
354
  ):
355
355
  error = (
356
356
  f"Authentication error: device {decoded_token.device_id} "
@@ -587,7 +587,10 @@ def authenticate_device(client_id: UUID, device_code: str) -> AuthContext:
587
587
  error_description=error,
588
588
  )
589
589
 
590
- if device_model.expires and datetime.utcnow() >= device_model.expires:
590
+ if (
591
+ device_model.expires
592
+ and datetime.now(timezone.utc) >= device_model.expires
593
+ ):
591
594
  error = (
592
595
  f"Authentication error: device for client ID {client_id} has "
593
596
  "expired"
@@ -889,17 +892,21 @@ def generate_access_token(
889
892
  if expires_in == 0:
890
893
  expires_in = None
891
894
  elif expires_in is not None:
892
- expires = datetime.utcnow() + timedelta(seconds=expires_in)
895
+ expires = datetime.now(timezone.utc) + timedelta(seconds=expires_in)
893
896
  elif device:
894
897
  # If a device was used for authentication, the token will expire
895
898
  # at the same time as the device.
896
899
  expires = device.expires
897
900
  if expires:
898
901
  expires_in = max(
899
- int(expires.timestamp() - datetime.utcnow().timestamp()), 0
902
+ int(
903
+ expires.timestamp()
904
+ - datetime.now(timezone.utc).timestamp()
905
+ ),
906
+ 0,
900
907
  )
901
908
  elif config.jwt_token_expire_minutes:
902
- expires = datetime.utcnow() + timedelta(
909
+ expires = datetime.now(timezone.utc) + timedelta(
903
910
  minutes=config.jwt_token_expire_minutes
904
911
  )
905
912
  expires_in = config.jwt_token_expire_minutes * 60
@@ -1 +1 @@
1
- import{j as e}from"./@radix-DeK6qiuw.js";import{f as s,r as t}from"./index-CE0aQlv8.js";import{E as r}from"./EmptyState-BzdlCwp3.js";import{S as a}from"./help-Cc9bBIJH.js";import{L as o}from"./@react-router-B3Z5rLr2.js";import"./@tanstack-DT5WLu9C.js";import"./@reactflow-BUNIMFeC.js";function d(){return e.jsx("div",{className:"flex min-h-screen w-full flex-col",children:e.jsx(r,{icon:e.jsx(a,{className:"h-[120px] w-[120px] fill-neutral-300"}),children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-2 text-display-xs font-semibold",children:"We can't find the page you are looking for"}),e.jsx("p",{className:"text-lg text-theme-text-secondary",children:"You can try typing a different URL or we can bring you back to your Homepage."}),e.jsx("div",{className:"mt-5 flex justify-center",children:e.jsx(s,{size:"md",asChild:!0,children:e.jsx(o,{className:"w-min self-center whitespace-nowrap",to:t.home,children:e.jsx("span",{className:"px-0.5",children:"Go to Home"})})})})]})})})}export{d as default};
1
+ import{j as e}from"./@radix-DeK6qiuw.js";import{f as s,r as t}from"./index-CxO6541P.js";import{E as r}from"./EmptyState-BzdlCwp3.js";import{S as a}from"./help-Cc9bBIJH.js";import{L as o}from"./@react-router-B3Z5rLr2.js";import"./@tanstack-DT5WLu9C.js";import"./@reactflow-6JPoencd.js";function d(){return e.jsx("div",{className:"flex min-h-screen w-full flex-col",children:e.jsx(r,{icon:e.jsx(a,{className:"h-[120px] w-[120px] fill-neutral-300"}),children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-2 text-display-xs font-semibold",children:"We can't find the page you are looking for"}),e.jsx("p",{className:"text-lg text-theme-text-secondary",children:"You can try typing a different URL or we can bring you back to your Homepage."}),e.jsx("div",{className:"mt-5 flex justify-center",children:e.jsx(s,{size:"md",asChild:!0,children:e.jsx(o,{className:"w-min self-center whitespace-nowrap",to:t.home,children:e.jsx("span",{className:"px-0.5",children:"Go to Home"})})})})]})})})}export{d as default};