zenml-nightly 0.66.0.dev20240914__py3-none-any.whl → 0.66.0.dev20240917__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.66.0.dev20240914
1
+ 0.66.0.dev20240917
zenml/client.py CHANGED
@@ -3748,6 +3748,7 @@ class Client(metaclass=ClientMetaClass):
3748
3748
  end_time: Optional[Union[datetime, str]] = None,
3749
3749
  num_steps: Optional[Union[int, str]] = None,
3750
3750
  unlisted: Optional[bool] = None,
3751
+ templatable: Optional[bool] = None,
3751
3752
  tag: Optional[str] = None,
3752
3753
  hydrate: bool = False,
3753
3754
  ) -> Page[PipelineRunResponse]:
@@ -3778,6 +3779,7 @@ class Client(metaclass=ClientMetaClass):
3778
3779
  end_time: The end_time for the pipeline run
3779
3780
  num_steps: The number of steps for the pipeline run
3780
3781
  unlisted: If the runs should be unlisted or not.
3782
+ templatable: If the runs should be templatable or not.
3781
3783
  tag: Tag to filter by.
3782
3784
  hydrate: Flag deciding whether to hydrate the output model(s)
3783
3785
  by including metadata fields in the response.
@@ -3811,6 +3813,7 @@ class Client(metaclass=ClientMetaClass):
3811
3813
  num_steps=num_steps,
3812
3814
  tag=tag,
3813
3815
  unlisted=unlisted,
3816
+ templatable=templatable,
3814
3817
  )
3815
3818
  runs_filter_model.set_scope_workspace(self.active_workspace.id)
3816
3819
  return self.zen_store.list_runs(
@@ -235,6 +235,9 @@ class PipelineRunResponseMetadata(WorkspaceScopedResponseMetadata):
235
235
  default=None,
236
236
  description="Template used for the pipeline run.",
237
237
  )
238
+ is_templatable: bool = Field(
239
+ description="Whether a template can be created from this run.",
240
+ )
238
241
 
239
242
 
240
243
  class PipelineRunResponseResources(WorkspaceScopedResponseResources):
@@ -477,6 +480,15 @@ class PipelineRunResponse(
477
480
  """
478
481
  return self.get_metadata().template_id
479
482
 
483
+ @property
484
+ def is_templatable(self) -> bool:
485
+ """The `is_templatable` property.
486
+
487
+ Returns:
488
+ the value of the property.
489
+ """
490
+ return self.get_metadata().is_templatable
491
+
480
492
  @property
481
493
  def model_version(self) -> Optional[ModelVersionResponse]:
482
494
  """The `model_version` property.
@@ -511,6 +523,7 @@ class PipelineRunFilter(WorkspaceScopedTaggableFilter):
511
523
  "stack_id",
512
524
  "template_id",
513
525
  "pipeline_name",
526
+ "templatable",
514
527
  ]
515
528
  name: Optional[str] = Field(
516
529
  default=None,
@@ -584,6 +597,7 @@ class PipelineRunFilter(WorkspaceScopedTaggableFilter):
584
597
  union_mode="left_to_right",
585
598
  )
586
599
  unlisted: Optional[bool] = None
600
+ templatable: Optional[bool] = None
587
601
 
588
602
  def get_custom_filters(
589
603
  self,
@@ -595,7 +609,7 @@ class PipelineRunFilter(WorkspaceScopedTaggableFilter):
595
609
  """
596
610
  custom_filters = super().get_custom_filters()
597
611
 
598
- from sqlmodel import and_
612
+ from sqlmodel import and_, col, or_
599
613
 
600
614
  from zenml.zen_stores.schemas import (
601
615
  CodeReferenceSchema,
@@ -668,4 +682,40 @@ class PipelineRunFilter(WorkspaceScopedTaggableFilter):
668
682
  )
669
683
  custom_filters.append(run_template_filter)
670
684
 
685
+ if self.templatable is not None:
686
+ if self.templatable is True:
687
+ templatable_filter = and_(
688
+ # The following condition is not perfect as it does not
689
+ # consider stacks with custom flavor components or local
690
+ # components, but the best we can do currently with our
691
+ # table columns.
692
+ PipelineRunSchema.deployment_id
693
+ == PipelineDeploymentSchema.id,
694
+ PipelineDeploymentSchema.build_id
695
+ == PipelineBuildSchema.id,
696
+ col(PipelineBuildSchema.is_local).is_(False),
697
+ col(PipelineBuildSchema.stack_id).is_not(None),
698
+ )
699
+ else:
700
+ templatable_filter = or_(
701
+ col(PipelineRunSchema.deployment_id).is_(None),
702
+ and_(
703
+ PipelineRunSchema.deployment_id
704
+ == PipelineDeploymentSchema.id,
705
+ col(PipelineDeploymentSchema.build_id).is_(None),
706
+ ),
707
+ and_(
708
+ PipelineRunSchema.deployment_id
709
+ == PipelineDeploymentSchema.id,
710
+ PipelineDeploymentSchema.build_id
711
+ == PipelineBuildSchema.id,
712
+ or_(
713
+ col(PipelineBuildSchema.is_local).is_(True),
714
+ col(PipelineBuildSchema.stack_id).is_(None),
715
+ ),
716
+ ),
717
+ )
718
+
719
+ custom_filters.append(templatable_filter)
720
+
671
721
  return custom_filters
@@ -261,8 +261,18 @@ class DockerServiceConnector(ServiceConnector):
261
261
  """
262
262
  assert self.resource_id is not None
263
263
 
264
+ # The reason we need to configure the local client here instead of
265
+ # using the `docker_client.login(...)` method is the following:
266
+ # When calling the login method on the python client, it stores the
267
+ # credentials in memory, but doesn't actually use them in future calls
268
+ # to push/pull images in case a credential store or credential helper is
269
+ # configured. If the cred store/helper contains invalid/expired
270
+ # credentials for the registry, these calls will fail.
271
+ # This solution is not ideal as we're now replacing potentially
272
+ # long-lived credentials in the cred store with our short lived ones,
273
+ # but the best we can do without modifying the docker library.
274
+ self._configure_local_client()
264
275
  docker_client = docker_utils._try_get_docker_client_from_env()
265
-
266
276
  self._authorize_client(docker_client, self.resource_id)
267
277
 
268
278
  return docker_client
zenml/stack/stack.py CHANGED
@@ -751,21 +751,6 @@ class Stack:
751
751
  updated=datetime.utcnow(),
752
752
  )
753
753
 
754
- logger.warning(
755
- "The stack `%s` contains components that require building "
756
- "Docker images. Older versions of ZenML always built these "
757
- "images locally, but since version 0.32.0 this behavior can be "
758
- "configured using the `image_builder` stack component. This "
759
- "stack will temporarily default to a local image builder that "
760
- "mirrors the previous behavior, but this will be removed in "
761
- "future versions of ZenML. Please add an image builder to this "
762
- "stack:\n"
763
- "`zenml image-builder register <NAME> ...\n"
764
- "zenml stack update %s -i <NAME>`",
765
- self.name,
766
- self.id,
767
- )
768
-
769
754
  self._image_builder = image_builder
770
755
 
771
756
  def prepare_pipeline_deployment(
@@ -328,6 +328,15 @@ class PipelineRunSchema(NamedSchema, table=True):
328
328
  )
329
329
  metadata = None
330
330
  if include_metadata:
331
+ is_templatable = False
332
+ if (
333
+ self.deployment
334
+ and self.deployment.build
335
+ and not self.deployment.build.is_local
336
+ and self.deployment.build.stack
337
+ ):
338
+ is_templatable = True
339
+
331
340
  steps = {step.name: step.to_model() for step in self.step_runs}
332
341
 
333
342
  metadata = PipelineRunResponseMetadata(
@@ -346,6 +355,7 @@ class PipelineRunSchema(NamedSchema, table=True):
346
355
  template_id=self.deployment.template_id
347
356
  if self.deployment
348
357
  else None,
358
+ is_templatable=is_templatable,
349
359
  )
350
360
 
351
361
  resources = None
@@ -177,6 +177,7 @@ class RunTemplateSchema(BaseSchema, table=True):
177
177
  if (
178
178
  self.source_deployment
179
179
  and self.source_deployment.build
180
+ and not self.source_deployment.build.is_local
180
181
  and self.source_deployment.build.stack
181
182
  ):
182
183
  runnable = True
@@ -974,6 +974,7 @@ class SqlZenStore(BaseZenStore):
974
974
  RuntimeError: if the schema does not have a `to_model` method.
975
975
  """
976
976
  query = filter_model.apply_filter(query=query, table=table)
977
+ query = query.distinct()
977
978
 
978
979
  # Get the total amount of items in the database for a given query
979
980
  custom_fetch_result: Optional[Sequence[Any]] = None
@@ -7218,6 +7219,8 @@ class SqlZenStore(BaseZenStore):
7218
7219
  )
7219
7220
 
7220
7221
  # ----------------------------- Stacks -----------------------------
7222
+
7223
+ @track_decorator(AnalyticsEvent.REGISTERED_STACK)
7221
7224
  def create_stack(self, stack: StackRequest) -> StackResponse:
7222
7225
  """Register a full stack.
7223
7226
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zenml-nightly
3
- Version: 0.66.0.dev20240914
3
+ Version: 0.66.0.dev20240917
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=GjuHlUd-5AcepXC8ETMkIRMxKVQtBekiuY_CW0oP4XQ,365106
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=UpeMLZWAYhpkLA7pj4EGlixlGYWN-fPOYNaVrpD7CrI,19
9
+ zenml/VERSION,sha256=RmdR3phaUXDcxvkuDNRu6MvVTzwL_IbFUjhrkbBvizc,19
10
10
  zenml/__init__.py,sha256=X_JnjAYTBG2ZYgcM2_FDPssygdj7z7VTAmU9HEi17p0,2306
11
11
  zenml/actions/__init__.py,sha256=mrt6wPo73iKRxK754_NqsGyJ3buW7RnVeIGXr1xEw8Y,681
12
12
  zenml/actions/base_action.py,sha256=UcaHev6BTuLDwuswnyaPjdA8AgUqB5xPZ-lRtuvf2FU,25553
@@ -63,7 +63,7 @@ zenml/cli/utils.py,sha256=whFzoFBxlDlldLahW7YzZc8HWcb7vGk0Jr5O5VlGcLk,91136
63
63
  zenml/cli/version.py,sha256=nm1iSU_1V6-MUwpMKeXcwFhLYGUMLswvQL67cEuCpxA,3635
64
64
  zenml/cli/web_login.py,sha256=yqJ4VRcnyz-QhWIyR2wfGpSVo_3pe3vOcRRYdluJsgI,7647
65
65
  zenml/cli/workspace.py,sha256=bp02aXou574ToWPD8OAIB_cg3mvpE011H8aMKegT-nU,2970
66
- zenml/client.py,sha256=HrwvGhrcNicL8SLDADinx4dZAJ753c8SCm19Pl4W8A4,279610
66
+ zenml/client.py,sha256=IZw7AGeqI84zjIE3Bv8r31NvxQY7_0KmDGsPcoAH468,279758
67
67
  zenml/client_lazy_loader.py,sha256=O3PK5yB3dfqdKINfOs_LNsmnOVTvKsUl80r3JsvKldQ,6570
68
68
  zenml/code_repositories/__init__.py,sha256=W5bDfzAG8OXIKZSV1L-VHuzMcSCYa9qzTdPb3jqfyYw,920
69
69
  zenml/code_repositories/base_code_repository.py,sha256=_DbxIBxvJlN0PFhST0vlTIQ26Q6V3Nar0kYdeGaJrk8,4386
@@ -618,7 +618,7 @@ zenml/models/v2/core/model_version_pipeline_run.py,sha256=ghxCdCckYyzOwiJHhB0LU0
618
618
  zenml/models/v2/core/pipeline.py,sha256=ZaKZ-Y0bmB6mokckLRpMXgR-UMAIwsa9NSRrdKoq6_k,8368
619
619
  zenml/models/v2/core/pipeline_build.py,sha256=-Y-9V1pcHq-jI2VPEyT-Chw5hGQMljvbcDF8s2-wiko,14875
620
620
  zenml/models/v2/core/pipeline_deployment.py,sha256=J10yhxqzSPXqTQZZPIN1zhe-yrZ5cEVvilkXBRiZwjg,12451
621
- zenml/models/v2/core/pipeline_run.py,sha256=VqxC8rI1OXbpuimmkm-F4dpyHrzQGke-hq-f8bhGwy0,21137
621
+ zenml/models/v2/core/pipeline_run.py,sha256=qMwbqapkJFhBdLABtPZAjzrczmNOorNjTFdxkkpsuAE,23192
622
622
  zenml/models/v2/core/run_metadata.py,sha256=u7c3LtZikb6EY6uwhXuqSIcaOgb0jDfGU8tQt3Ccerk,7863
623
623
  zenml/models/v2/core/run_template.py,sha256=baa6q0z40n6sa5XgmTXxS2gJmpq-kFvu7jnXMjWu47g,11728
624
624
  zenml/models/v2/core/schedule.py,sha256=QE6_2KFmamGMClS7-sE43hyNBfkVnml6rDqvmRmyiB8,10215
@@ -692,7 +692,7 @@ zenml/secret/schemas/azure_secret_schema.py,sha256=3WP-DRgqoHJVsJit8fQcxjd1KYX2E
692
692
  zenml/secret/schemas/basic_auth_secret_schema.py,sha256=q-4dDtycHyWkIdZGd-qnIp4n8cxZO13qT7w_sTA4hWY,1021
693
693
  zenml/secret/schemas/gcp_secret_schema.py,sha256=tDSxPXlfh4BOSICZjfJjUukfzEyBEgxpQzk4y-OV1AE,1677
694
694
  zenml/service_connectors/__init__.py,sha256=gIBAVUPBZtdO6JtEBCixy9YG4wZRA1mnaxaGAxi3T1Q,645
695
- zenml/service_connectors/docker_service_connector.py,sha256=vplyZNUxZhAyzXRdtAiSGMFZT87h9Wq8izE0HWh7OSQ,12441
695
+ zenml/service_connectors/docker_service_connector.py,sha256=_6WPqYCcSUf8JPakipbkJRvaN2ghhY7zCr38WCHG0SI,13218
696
696
  zenml/service_connectors/service_connector.py,sha256=HW8dTE826ZSD1vWQlqQRm8XYq08v7tDZQ8ORnJ5rTcE,55351
697
697
  zenml/service_connectors/service_connector_registry.py,sha256=lP0s0k7RIp9WZEW36Q0ygHD5urzF-wUwh41rbXWS5ss,9186
698
698
  zenml/service_connectors/service_connector_utils.py,sha256=h3wfVSPO0sQnARVRnih3l8P7LwkCmAgijThuHp2Z53E,18026
@@ -716,7 +716,7 @@ zenml/stack/__init__.py,sha256=vfHzaoRhPtS-XSlM8Vx1noJZDHF1Pj6LDz2knpn_QBg,1236
716
716
  zenml/stack/authentication_mixin.py,sha256=sg7GkpB-Ao9Gsa7Po0jxMn-_mVYUB42etmspZ6dk8cI,3982
717
717
  zenml/stack/flavor.py,sha256=rut-jFQFB6OGm25RRyMtYlJ3mm_6wrHYVI54Hmf9te4,9726
718
718
  zenml/stack/flavor_registry.py,sha256=IL0fRrxxQJ9YkCYCeADP7nwWEQo4XBElJY4owMjKGbQ,6108
719
- zenml/stack/stack.py,sha256=5pgR30_Xgj4Qi09zKYyleuaWwMhe0zvi4k7yF1r8_BM,38021
719
+ zenml/stack/stack.py,sha256=JIRSNX1fRCubXGPCg-qjeVtlT9fDeAX-xiToDa9CeVk,37235
720
720
  zenml/stack/stack_component.py,sha256=9sgAu2EGZ2yiEn_D0dq_kmytFmlt8spJ3iG0GlHIFVU,31634
721
721
  zenml/stack/stack_validator.py,sha256=hWbvvGIeWLj6NwSsF4GCc6RAxAWvxHXTcBZL9nJvcak,3111
722
722
  zenml/stack/utils.py,sha256=dcJsbLZf-hJYM9Ut8BfNzrWygmz6shHegqHPRVLoLWE,5840
@@ -1370,10 +1370,10 @@ zenml/zen_stores/schemas/logs_schemas.py,sha256=qv6fs3JiVgzlmTXJqb_gG5NsU5q_50e0
1370
1370
  zenml/zen_stores/schemas/model_schemas.py,sha256=wLf1SeJPPzyq7Bm7oTTBdVHfZbOAWw027aKn_TJZ_JI,25559
1371
1371
  zenml/zen_stores/schemas/pipeline_build_schemas.py,sha256=QK3sVPYhumUx_x-H3YZ-RfnsxGhKfkMGdP5FC9WrQgU,5718
1372
1372
  zenml/zen_stores/schemas/pipeline_deployment_schemas.py,sha256=ihJswWXvaXilyNS8RnOfnZM1Yi1B9t7PN8t7f1vOoho,10177
1373
- zenml/zen_stores/schemas/pipeline_run_schemas.py,sha256=LbGX3Srz-zbhnCY4th9SVSlNoF3e5ss9WP4E1p5ODWw,15300
1373
+ zenml/zen_stores/schemas/pipeline_run_schemas.py,sha256=PP_r3HI9oWwV0v0lewUyf7LUUZiXlZ1FR53Y2NrWbFQ,15630
1374
1374
  zenml/zen_stores/schemas/pipeline_schemas.py,sha256=HjQfuH3WDpkf_gXPv5ExN6lMrzf82mHXttTqzdSitc0,5863
1375
1375
  zenml/zen_stores/schemas/run_metadata_schemas.py,sha256=pWu-WO0PCITPY5gcIB1uqGBWDT51J7LDzMrOLtNkAGg,6033
1376
- zenml/zen_stores/schemas/run_template_schemas.py,sha256=cT90S8gRYkijrMLqBK6WgpQC1c6LbBnOtMpAgAxhwrg,8768
1376
+ zenml/zen_stores/schemas/run_template_schemas.py,sha256=4uE7lHkIQROJRNpNdvATwEJMkeij6pXnHvOsT3q3VrI,8826
1377
1377
  zenml/zen_stores/schemas/schedule_schema.py,sha256=w3tAHt2mEQ7ILPz4ogRdLV4KivB7E2LtIZWkzXLzAIU,7354
1378
1378
  zenml/zen_stores/schemas/schema_utils.py,sha256=2qPNPfasnTmCW1RPeViXoTAp6oO-uRnUpEZ_rugcoNw,2612
1379
1379
  zenml/zen_stores/schemas/secret_schemas.py,sha256=nRzFkgR940BbS1nlBs4H3YuvFCiGGYZ1vQIsu3Y0Mvk,9884
@@ -1396,11 +1396,11 @@ zenml/zen_stores/secrets_stores/hashicorp_secrets_store.py,sha256=NfW1EHIA99lseb
1396
1396
  zenml/zen_stores/secrets_stores/secrets_store_interface.py,sha256=Q2Jbnt2Pp7NGlR-u1YBfRZV2g8su2Fd0ArBMdksAE-Q,2819
1397
1397
  zenml/zen_stores/secrets_stores/service_connector_secrets_store.py,sha256=kPYX-Z_OOhZCI1CP77ncfV7IsV4e8brklnTXmKxZYNc,7078
1398
1398
  zenml/zen_stores/secrets_stores/sql_secrets_store.py,sha256=Bq1djrUP9saoD7vECjS7-TlA_7sjJGgw1talri4spjU,8656
1399
- zenml/zen_stores/sql_zen_store.py,sha256=4z458K5ItHkAO0bEUAl6rWJDHKh6GS-sRrt2RPridnE,392435
1399
+ zenml/zen_stores/sql_zen_store.py,sha256=Sfw5nql38ZGfPbdIUNLMYsVrfMP1faRGMj0f1r1IYnk,392523
1400
1400
  zenml/zen_stores/template_utils.py,sha256=UB_CBoMIfBequa8g3H7aTI6V_ke1SJr4IW1qwFCL1jc,8932
1401
1401
  zenml/zen_stores/zen_store_interface.py,sha256=kzR_i8vHjULld3MquSaMorcab8lJk1e9RZquw1VXjHY,93510
1402
- zenml_nightly-0.66.0.dev20240914.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
1403
- zenml_nightly-0.66.0.dev20240914.dist-info/METADATA,sha256=BY28zlC6T5ke23Yrq8nL4xXdxBc98kE3ouTXpTxao-w,20961
1404
- zenml_nightly-0.66.0.dev20240914.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1405
- zenml_nightly-0.66.0.dev20240914.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
1406
- zenml_nightly-0.66.0.dev20240914.dist-info/RECORD,,
1402
+ zenml_nightly-0.66.0.dev20240917.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
1403
+ zenml_nightly-0.66.0.dev20240917.dist-info/METADATA,sha256=vq_ebA3JUAWCtPqmMB6j260s05gjJszNf7LgrvHU35o,20961
1404
+ zenml_nightly-0.66.0.dev20240917.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1405
+ zenml_nightly-0.66.0.dev20240917.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
1406
+ zenml_nightly-0.66.0.dev20240917.dist-info/RECORD,,