zenml-nightly 0.75.0.dev20250310__py3-none-any.whl → 0.75.0.dev20250312__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.75.0.dev20250310
1
+ 0.75.0.dev20250312
zenml/cli/utils.py CHANGED
@@ -1419,7 +1419,7 @@ def describe_pydantic_object(schema_json: Dict[str, Any]) -> None:
1419
1419
  prop_type = prop_schema["type"]
1420
1420
  elif "anyOf" in prop_schema.keys():
1421
1421
  prop_type = ", ".join(
1422
- [p["type"] for p in prop_schema["anyOf"]]
1422
+ [p.get("type", "object") for p in prop_schema["anyOf"]]
1423
1423
  )
1424
1424
  prop_type = f"one of: {prop_type}"
1425
1425
  else:
zenml/client.py CHANGED
@@ -2674,6 +2674,7 @@ class Client(metaclass=ClientMetaClass):
2674
2674
  python_version: Optional[str] = None,
2675
2675
  checksum: Optional[str] = None,
2676
2676
  stack_checksum: Optional[str] = None,
2677
+ duration: Optional[Union[int, str]] = None,
2677
2678
  hydrate: bool = False,
2678
2679
  ) -> Page[PipelineBuildResponse]:
2679
2680
  """List all builds.
@@ -2699,6 +2700,7 @@ class Client(metaclass=ClientMetaClass):
2699
2700
  python_version: The Python version to filter by.
2700
2701
  checksum: The build checksum to filter by.
2701
2702
  stack_checksum: The stack checksum to filter by.
2703
+ duration: The duration of the build in seconds to filter by.
2702
2704
  hydrate: Flag deciding whether to hydrate the output model(s)
2703
2705
  by including metadata fields in the response.
2704
2706
 
@@ -2725,6 +2727,7 @@ class Client(metaclass=ClientMetaClass):
2725
2727
  python_version=python_version,
2726
2728
  checksum=checksum,
2727
2729
  stack_checksum=stack_checksum,
2730
+ duration=duration,
2728
2731
  )
2729
2732
  build_filter_model.set_scope_workspace(self.active_workspace.id)
2730
2733
  return self.zen_store.list_builds(
@@ -54,7 +54,7 @@ class GitLabCodeRepositoryConfig(BaseCodeRepositoryConfig):
54
54
  group: str
55
55
  project: str
56
56
  host: Optional[str] = "gitlab.com"
57
- token: str = SecretField()
57
+ token: Optional[str] = SecretField(default=None)
58
58
 
59
59
  url: Optional[str] = None
60
60
  _deprecation_validator = deprecation_utils.deprecate_pydantic_attributes(
@@ -109,10 +109,11 @@ class GitLabCodeRepository(BaseCodeRepository):
109
109
  self._gitlab_session = Gitlab(
110
110
  url=self.config.instance_url, private_token=self.config.token
111
111
  )
112
- self._gitlab_session.auth()
113
- user = self._gitlab_session.user or None
114
- if user:
115
- logger.debug(f"Logged in as {user.username}")
112
+
113
+ if self.config.token:
114
+ self._gitlab_session.auth()
115
+ if user := self._gitlab_session.user:
116
+ logger.debug(f"Logged into GitLab as {user.username}")
116
117
  except Exception as e:
117
118
  raise RuntimeError(f"An error occurred while logging in: {str(e)}")
118
119
 
@@ -72,6 +72,9 @@ class PipelineBuildBase(BaseZenModel):
72
72
  python_version: Optional[str] = Field(
73
73
  title="The Python version used for this build.", default=None
74
74
  )
75
+ duration: Optional[int] = Field(
76
+ title="The duration of the build in seconds.", default=None
77
+ )
75
78
 
76
79
  # Helper methods
77
80
  @property
@@ -223,6 +226,9 @@ class PipelineBuildResponseMetadata(WorkspaceScopedResponseMetadata):
223
226
  contains_code: bool = Field(
224
227
  title="Whether any image of the build contains user code.",
225
228
  )
229
+ duration: Optional[int] = Field(
230
+ title="The duration of the build in seconds.", default=None
231
+ )
226
232
 
227
233
 
228
234
  class PipelineBuildResponseResources(WorkspaceScopedResponseResources):
@@ -454,6 +460,15 @@ class PipelineBuildResponse(
454
460
  """
455
461
  return self.get_metadata().contains_code
456
462
 
463
+ @property
464
+ def duration(self) -> Optional[int]:
465
+ """The `duration` property.
466
+
467
+ Returns:
468
+ the value of the property.
469
+ """
470
+ return self.get_metadata().duration
471
+
457
472
 
458
473
  # ------------------ Filter Model ------------------
459
474
 
@@ -502,6 +517,9 @@ class PipelineBuildFilter(WorkspaceScopedFilter):
502
517
  stack_checksum: Optional[str] = Field(
503
518
  description="The stack checksum.", default=None
504
519
  )
520
+ duration: Optional[Union[int, str]] = Field(
521
+ description="The duration of the build in seconds.", default=None
522
+ )
505
523
 
506
524
  def get_custom_filters(
507
525
  self,
@@ -15,6 +15,7 @@
15
15
 
16
16
  import hashlib
17
17
  import platform
18
+ import time
18
19
  from typing import (
19
20
  TYPE_CHECKING,
20
21
  Dict,
@@ -327,6 +328,7 @@ def create_pipeline_build(
327
328
  "Building Docker image(s) for pipeline `%s`.",
328
329
  deployment.pipeline_configuration.name,
329
330
  )
331
+ start_time = time.time()
330
332
 
331
333
  docker_image_builder = PipelineDockerImageBuilder()
332
334
  images: Dict[str, BuildItem] = {}
@@ -409,6 +411,7 @@ def create_pipeline_build(
409
411
 
410
412
  logger.info("Finished building Docker image(s).")
411
413
 
414
+ duration = round(time.time() - start_time)
412
415
  is_local = stack.container_registry is None
413
416
  contains_code = any(item.contains_code for item in images.values())
414
417
  build_checksum = compute_build_checksum(
@@ -427,6 +430,7 @@ def create_pipeline_build(
427
430
  python_version=platform.python_version(),
428
431
  checksum=build_checksum,
429
432
  stack_checksum=stack_checksum,
433
+ duration=duration,
430
434
  )
431
435
  return client.zen_store.create_build(build_request)
432
436
 
@@ -0,0 +1,34 @@
1
+ """Add build duration [0392807467dc].
2
+
3
+ Revision ID: 0392807467dc
4
+ Revises: 0.75.0
5
+ Create Date: 2025-02-28 15:50:06.960529
6
+
7
+ """
8
+
9
+ import sqlalchemy as sa
10
+ from alembic import op
11
+
12
+ # revision identifiers, used by Alembic.
13
+ revision = "0392807467dc"
14
+ down_revision = "0.75.0"
15
+ branch_labels = None
16
+ depends_on = None
17
+
18
+
19
+ def upgrade() -> None:
20
+ """Upgrade database schema and/or data, creating a new revision."""
21
+ # ### commands auto generated by Alembic - please adjust! ###
22
+ with op.batch_alter_table("pipeline_build", schema=None) as batch_op:
23
+ batch_op.add_column(sa.Column("duration", sa.Integer(), nullable=True))
24
+
25
+ # ### end Alembic commands ###
26
+
27
+
28
+ def downgrade() -> None:
29
+ """Downgrade database schema and/or data back to the previous revision."""
30
+ # ### commands auto generated by Alembic - please adjust! ###
31
+ with op.batch_alter_table("pipeline_build", schema=None) as batch_op:
32
+ batch_op.drop_column("duration")
33
+
34
+ # ### end Alembic commands ###
@@ -100,6 +100,8 @@ class PipelineBuildSchema(BaseSchema, table=True):
100
100
  python_version: Optional[str]
101
101
  checksum: Optional[str]
102
102
  stack_checksum: Optional[str]
103
+ # Build duration in seconds
104
+ duration: Optional[int] = None
103
105
 
104
106
  @classmethod
105
107
  def from_request(
@@ -125,6 +127,7 @@ class PipelineBuildSchema(BaseSchema, table=True):
125
127
  python_version=request.python_version,
126
128
  checksum=request.checksum,
127
129
  stack_checksum=request.stack_checksum,
130
+ duration=request.duration,
128
131
  )
129
132
 
130
133
  def to_model(
@@ -162,6 +165,7 @@ class PipelineBuildSchema(BaseSchema, table=True):
162
165
  stack_checksum=self.stack_checksum,
163
166
  is_local=self.is_local,
164
167
  contains_code=self.contains_code,
168
+ duration=self.duration,
165
169
  )
166
170
  return PipelineBuildResponse(
167
171
  id=self.id,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: zenml-nightly
3
- Version: 0.75.0.dev20250310
3
+ Version: 0.75.0.dev20250312
4
4
  Summary: ZenML: Write production-ready ML code.
5
5
  License: Apache-2.0
6
6
  Keywords: machine learning,production,pipeline,mlops,devops
@@ -1,5 +1,5 @@
1
1
  zenml/README.md,sha256=827dekbOWAs1BpW7VF1a4d7EbwPbjwccX-2zdXBENZo,1777
2
- zenml/VERSION,sha256=XnOrqbxLYtJOamCOfqZBBLGbgglmmBMCxMXAI2D8IAk,19
2
+ zenml/VERSION,sha256=WKPWjLdCyQPwGFHDNY91sE5KrdVWKRkJNQkmmNhO_DI,19
3
3
  zenml/__init__.py,sha256=SkMObQA41ajqdZqGErN00S1Vf3KAxpLvbZ-OBy5uYoo,2130
4
4
  zenml/actions/__init__.py,sha256=mrt6wPo73iKRxK754_NqsGyJ3buW7RnVeIGXr1xEw8Y,681
5
5
  zenml/actions/base_action.py,sha256=UcaHev6BTuLDwuswnyaPjdA8AgUqB5xPZ-lRtuvf2FU,25553
@@ -52,10 +52,10 @@ zenml/cli/stack_components.py,sha256=7RXVCJTX6sU-CiyDeu4kGYPJZ7QRQjDTptsvl__sI_A
52
52
  zenml/cli/tag.py,sha256=Co-AL1eNZMf_AsqlcnJpoZ_k7UKa0l5X_g_TLpJdGes,4884
53
53
  zenml/cli/text_utils.py,sha256=bY1GIjoULt1cW2FyrPlMoAXNS2R7cSOjDFEZQqrpVQ8,3553
54
54
  zenml/cli/user_management.py,sha256=fTuRworQahst_j78qPYTtgciUeUOxwo7efiyPwmj2tI,13075
55
- zenml/cli/utils.py,sha256=oQm8clYsuATzEjXJNVMwmdTiygOwxErvUGONPIxb7no,86478
55
+ zenml/cli/utils.py,sha256=ktTScIfvbm_RTSbw6ydlZT2CbjRm_sUBzON4wqF1WqY,86492
56
56
  zenml/cli/version.py,sha256=nm1iSU_1V6-MUwpMKeXcwFhLYGUMLswvQL67cEuCpxA,3635
57
57
  zenml/cli/workspace.py,sha256=bp02aXou574ToWPD8OAIB_cg3mvpE011H8aMKegT-nU,2970
58
- zenml/client.py,sha256=VGpvUNfs6D_7JthAjocEO6pDNfjeNkWwNudWVYrbgqo,283571
58
+ zenml/client.py,sha256=24HZcdRn44-R_RBkBh-nQ-DdzvibcQkvKMyekQFiOyc,283727
59
59
  zenml/client_lazy_loader.py,sha256=MOBgS1ITYqGvPUnWQ6edn9s8Hr_72YfWbwEIfHKUr9g,7104
60
60
  zenml/code_repositories/__init__.py,sha256=W5bDfzAG8OXIKZSV1L-VHuzMcSCYa9qzTdPb3jqfyYw,920
61
61
  zenml/code_repositories/base_code_repository.py,sha256=Id6VjbUu8N3ZpNvBGhOgbahtoMiCAtYXed3G7YQ_iAc,5225
@@ -283,7 +283,7 @@ zenml/integrations/github/plugins/event_sources/github_webhook_event_source.py,s
283
283
  zenml/integrations/github/plugins/github_webhook_event_source_flavor.py,sha256=jth8sxrmyg22-wT5Ax0fdsiLhTQwHXxaiTnB3kD97pk,1669
284
284
  zenml/integrations/gitlab/__init__.py,sha256=4Vz6XiPJYDZ9mos6L1FlgWsmueRCck86Sd8KRVj9NWQ,1003
285
285
  zenml/integrations/gitlab/code_repositories/__init__.py,sha256=Ds7NL6tCqLApRsOgvUofEq3Ms2No5_Z095uvi1gLVIk,817
286
- zenml/integrations/gitlab/code_repositories/gitlab_code_repository.py,sha256=1i4XLkHoaR1ap5ZlQOkfG2G_-mkXLs3yQmvPABgdK5k,6421
286
+ zenml/integrations/gitlab/code_repositories/gitlab_code_repository.py,sha256=41Alp4mzdofEI_SejQXfrDTQ8L2w_FiU1rYOgyxEUhg,6475
287
287
  zenml/integrations/great_expectations/__init__.py,sha256=Vp7qJ2iA3BfPK1QZFYEiE8SB8lIM2S8SGmW35dW8A7M,2448
288
288
  zenml/integrations/great_expectations/data_validators/__init__.py,sha256=Z16qmLfUoataEABQ6Ec-HSLM_a9VRALHFa4OoAyozIk,857
289
289
  zenml/integrations/great_expectations/data_validators/ge_data_validator.py,sha256=qp2ZFqQiYPszRc6vGhZhK22GEHhGoTQ0Y9u0trXNQyg,21404
@@ -643,7 +643,7 @@ zenml/models/v2/core/model_version.py,sha256=fkERxxFR_08LosUdbPF5hIeoz0n4C0703f5
643
643
  zenml/models/v2/core/model_version_artifact.py,sha256=ZyupuEsfPSjgaHDIUOojwJepJt1LTXDoUyE2h9htB_s,9086
644
644
  zenml/models/v2/core/model_version_pipeline_run.py,sha256=JbPZZEQvOK9I32htkWdAONy7gvtoz_Jo45B5gYrh2vs,7036
645
645
  zenml/models/v2/core/pipeline.py,sha256=cql05iz2jqrlyRfn3jB4iQ_AgpHapD6Sr5Kd_6Q1W30,12044
646
- zenml/models/v2/core/pipeline_build.py,sha256=bjSvmNnTF9xAycYfmTHO2wzgR-ZVWyy5V5-9ajZUxag,16399
646
+ zenml/models/v2/core/pipeline_build.py,sha256=X3aK0HzmyUueAqSCw9sykLPOOWJKua8U8JacOuTY7NQ,16955
647
647
  zenml/models/v2/core/pipeline_deployment.py,sha256=6PbpnEUAbTT-_jPmyNtKuTJHFGdGLD2h5Zu_pXIHW1I,12108
648
648
  zenml/models/v2/core/pipeline_run.py,sha256=mmr3EP5jWq7sQ5FnUTD4kXYWY-yF5x6SW9Ei2a78Stc,33195
649
649
  zenml/models/v2/core/run_metadata.py,sha256=YDiPVRzTUMVHqW4T_Ke4GJMdscp0aS_g8I4P8n70szc,2436
@@ -692,7 +692,7 @@ zenml/orchestrators/topsort.py,sha256=D8evz3X47zwpXd90NMLsJD-_uCeXtV6ClzNfDUrq7c
692
692
  zenml/orchestrators/utils.py,sha256=faRm86Ed_KVFBYbiMriSM0z3NwsydJWDvLYX-7DSrkc,13153
693
693
  zenml/orchestrators/wheeled_orchestrator.py,sha256=eOnMcnd3sCzfhA2l6qRAzF0rOXzaojbjvvYvTkqixQo,4791
694
694
  zenml/pipelines/__init__.py,sha256=hpIX7hN8jsQRHT5R-xSXZL88qrHwkmrvGLQeu1rWt4o,873
695
- zenml/pipelines/build_utils.py,sha256=DkID1YnRYkw569uU-gidpF8WR8E7K55_wn3CzRPQ3Cs,27562
695
+ zenml/pipelines/build_utils.py,sha256=S5lTxzScaYGiJuC8ytf26f3FIB46y5kqN5OzxmfxnNI,27677
696
696
  zenml/pipelines/pipeline_context.py,sha256=V_p-F9W7cBIlTjS0iv5-uJYMzaOj8bAUkc_uNhQgBms,3579
697
697
  zenml/pipelines/pipeline_decorator.py,sha256=FIbflYOMavbuyGmqsx3F5zZgg0oXMTi1eAcGXciljOs,4293
698
698
  zenml/pipelines/pipeline_definition.py,sha256=pl5tV4_h03MQDaIJZQCJJ8mY5S3Js-89r5NFIBpxB6A,57244
@@ -1150,6 +1150,7 @@ zenml/zen_stores/migrations/versions/0.74.0_release.py,sha256=G21sCXOaWXDLLMQHs7
1150
1150
  zenml/zen_stores/migrations/versions/0.75.0_release.py,sha256=dRlxBHwDGALjM5whROu145SQ6tDocjJ29XBWQC4bxFw,450
1151
1151
  zenml/zen_stores/migrations/versions/026d4577b6a0_add_code_path.py,sha256=hXLzvQcylNrbCVD6vha52PFkSPNC2klW9kA0vuQX_cE,1091
1152
1152
  zenml/zen_stores/migrations/versions/03742aa7fdd7_add_secrets.py,sha256=gewKqu1AnzvNTjVvK1eaAwP0hVneWDUyDRSLTvRCdpg,1587
1153
+ zenml/zen_stores/migrations/versions/0392807467dc_add_build_duration.py,sha256=YlkDBlfBBv45FsrMO11YcdRn4Maqmlg77t8gWJO4DfA,982
1153
1154
  zenml/zen_stores/migrations/versions/0701da9951a0_added_service_table.py,sha256=dmMUbQhcQparYdV9nfxcgcJTwlEbUWJlzMQ9d0YQyrs,3399
1154
1155
  zenml/zen_stores/migrations/versions/0b06faa59c93_add_service_connectors.py,sha256=z7Bz5jVP0MVSX3__GN0CtZZhI_t88gcgZzNpPxsIJl4,4400
1155
1156
  zenml/zen_stores/migrations/versions/0d707865f404_adding_labels_to_stacks.py,sha256=l9WImB9dM5X2CfU4Fd_tzTNo2-cP2xTFg9FongasMYc,787
@@ -1258,7 +1259,7 @@ zenml/zen_stores/schemas/event_source_schemas.py,sha256=qhkyKg3zl7pFaxDYcXsDvJEI
1258
1259
  zenml/zen_stores/schemas/flavor_schemas.py,sha256=cEKHrQp4fr16SDjOqBubM-jAbq4dK3MVyZSe-70e-ME,5054
1259
1260
  zenml/zen_stores/schemas/logs_schemas.py,sha256=qv6fs3JiVgzlmTXJqb_gG5NsU5q_50e0167JiWIxR14,3588
1260
1261
  zenml/zen_stores/schemas/model_schemas.py,sha256=95q5OaQ9DFmTno76wLaLmeBj3cePrVju20flWiJHPOk,25460
1261
- zenml/zen_stores/schemas/pipeline_build_schemas.py,sha256=QK3sVPYhumUx_x-H3YZ-RfnsxGhKfkMGdP5FC9WrQgU,5718
1262
+ zenml/zen_stores/schemas/pipeline_build_schemas.py,sha256=IN5vHCzZ6ULUN1bG15O5-B-lQLpjTYwnT1MIUnlDfww,5864
1262
1263
  zenml/zen_stores/schemas/pipeline_deployment_schemas.py,sha256=fdsROPBE1QrWKvSkaZYz2Sc1MwXogAembs8TfZML3ks,10201
1263
1264
  zenml/zen_stores/schemas/pipeline_run_schemas.py,sha256=ylodIinwKGqKCIcZaKJwiA27g0rkNjKY3DLx_E2lylo,18046
1264
1265
  zenml/zen_stores/schemas/pipeline_schemas.py,sha256=tUgBics0QOszIN870_-ADcBHINH8v32-CLjPW0vHzMg,7159
@@ -1289,8 +1290,8 @@ zenml/zen_stores/secrets_stores/sql_secrets_store.py,sha256=nEO0bAPlULBLxLVk-UTR
1289
1290
  zenml/zen_stores/sql_zen_store.py,sha256=L3PtBT-VULJVh4udD4eY4TbU_o1iEC23VyUh26uBo5Y,415902
1290
1291
  zenml/zen_stores/template_utils.py,sha256=EKYBgmDLTS_PSMWaIO5yvHPLiQvMqHcsAe6NUCrv-i4,9068
1291
1292
  zenml/zen_stores/zen_store_interface.py,sha256=vf2gKBWfUUPtcGZC35oQB6pPNVzWVyQC8nWxVLjfrxM,92692
1292
- zenml_nightly-0.75.0.dev20250310.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
1293
- zenml_nightly-0.75.0.dev20250310.dist-info/METADATA,sha256=iePs9jYfQIsL6LLZSbkaphHjKJ3HJGKNES5PV6XkyuE,24274
1294
- zenml_nightly-0.75.0.dev20250310.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
1295
- zenml_nightly-0.75.0.dev20250310.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
1296
- zenml_nightly-0.75.0.dev20250310.dist-info/RECORD,,
1293
+ zenml_nightly-0.75.0.dev20250312.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
1294
+ zenml_nightly-0.75.0.dev20250312.dist-info/METADATA,sha256=mmZp_NSq_xJgmAPLEJIkZHfoGiUNb4wU8--2380rMqA,24274
1295
+ zenml_nightly-0.75.0.dev20250312.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
1296
+ zenml_nightly-0.75.0.dev20250312.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
1297
+ zenml_nightly-0.75.0.dev20250312.dist-info/RECORD,,