craft-ai-sdk 0.69.1__py3-none-any.whl → 0.70.2rc1__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.
craft_ai_sdk/__init__.py CHANGED
@@ -13,4 +13,4 @@ from .io import ( # noqa: F401
13
13
  )
14
14
  from .sdk import CraftAiSdk # noqa: F401
15
15
 
16
- __version__ = "0.69.1"
16
+ __version__ = "0.70.2rc1"
@@ -236,9 +236,16 @@ def create_deployment(
236
236
  deployment. This is only available for "low_latency" deployments mode.
237
237
  wait_for_completion (:obj:`bool`, optional): Whether to wait for the deployment
238
238
  to be ready. Defaults to ``True``.
239
- timeout_s (:obj:`int`): Maximum time (in seconds) to wait for the deployment to
240
- be ready. Set to None to wait indefinitely. Defaults to None.
241
- Only applicable if ``wait_for_completion`` is ``True``.
239
+ timeout_s (:obj:`int`): The execution timeout parameter defines how long code
240
+ can run before it is automatically stopped.
241
+ Parallel mode:
242
+ Async code: The timeout works correctly, if the execution exceeds the limit,
243
+ the task is canceled.
244
+ Non-async code: The timeout is applied, but the running thread is not
245
+ forcibly stopped, which may delay termination.
246
+ Queue mode:
247
+ Async code: The execution is canceled on timeout.
248
+ Non-async code: No timeout is applied (runs in the main thread).
242
249
  endpoint_token (:obj:`str`, optional): Applicable only if ``execution_rule``
243
250
  is ``"endpoint"``. The token to access the endpoint. If not set, a token
244
251
  will be generated. This token is different from the SDK token, you can find it
@@ -474,6 +474,7 @@ def get_pipeline(
474
474
  the pipeline.
475
475
  """
476
476
  base_url = f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}"
477
+ log_action(sdk, f'Get pipeline: "{pipeline_name}", "{wait_for_completion}".')
477
478
  if wait_for_completion:
478
479
  pipeline = wait_create_until_ready(
479
480
  sdk,
@@ -487,6 +488,7 @@ def get_pipeline(
487
488
  )
488
489
  else:
489
490
  pipeline = sdk._get(base_url)
491
+ log_action(sdk, "Get pipeline done.")
490
492
 
491
493
  latest_execution = sdk._get(
492
494
  f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}/executions/latest"
craft_ai_sdk/py.typed ADDED
File without changes
craft_ai_sdk/sdk.py CHANGED
@@ -143,7 +143,7 @@ class CraftAiSdk(BaseCraftAiSdk):
143
143
  )
144
144
  # Default timeout of proxy network components
145
145
  _access_token_margin = timedelta(seconds=120)
146
- _version = "0.69.1" # Would be better to share it somewhere
146
+ _version = "0.70.2rc1" # Would be better to share it somewhere
147
147
 
148
148
  def __init__(
149
149
  self,
@@ -1,15 +1,23 @@
1
1
  from craft_ai_sdk.exceptions import SdkException
2
+ from craft_ai_sdk.shared.logger import log_action
2
3
 
3
4
 
4
5
  def wait_create_until_ready(sdk, name, get_func, timeout_s, start_time, get_log_func):
5
6
  elapsed_time = sdk._get_time() - start_time
6
7
  status = "creation_pending"
8
+ log_action(sdk, f'Start waiting for "{name}" to be created.')
7
9
  while status == "creation_pending" and (
8
10
  timeout_s is None or elapsed_time < timeout_s
9
11
  ):
10
12
  created_obj = get_func(sdk, name)
11
13
  status = created_obj.get("creation_info", {}).get("status", None)
12
14
  elapsed_time = sdk._get_time() - start_time
15
+ log_action(
16
+ sdk,
17
+ f'Still waiting for "{name}" to be created, \
18
+ status="{status}", elapsed time={elapsed_time}s.',
19
+ )
20
+ log_action(sdk, f'End waiting for "{name}" to be created, status="{status}".')
13
21
 
14
22
  if status == "creation_failed":
15
23
  raise SdkException(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: craft-ai-sdk
3
- Version: 0.69.1
3
+ Version: 0.70.2rc1
4
4
  Summary: Craft AI MLOps platform SDK
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -1,24 +1,25 @@
1
- craft_ai_sdk/__init__.py,sha256=WqS0ML_ev6HZ7O0xXvod9zYd5kBSeOxdzi0_zgDt9Rg,363
1
+ craft_ai_sdk/__init__.py,sha256=sVCVFpWg0ULpTiPN4qIWL09sLb6mK-BPt3M1-caTufw,366
2
2
  craft_ai_sdk/constants.py,sha256=rH4JrGlTpbjjjNRrKhk5oScbj5G5INrcVza6Bb6kIzY,980
3
3
  craft_ai_sdk/core/data_store.py,sha256=BPQalGcm6bujgkgu-MtNWWhKiJEg4MiVuCtByNbTbK8,9956
4
- craft_ai_sdk/core/deployments.py,sha256=Hig0Z6tZXbaLxms9ENtKI4OG3ki7G4Iz3wGk2V2Gmfg,37731
4
+ craft_ai_sdk/core/deployments.py,sha256=sRN7-VzCUhiMysrjcKB1K0Jig5fJ_iluxscm1KQCv8U,38073
5
5
  craft_ai_sdk/core/endpoints.py,sha256=cFf8scftD7XlMvpglLNRew-fesLUC_TcZ2UPyCbmUaA,8158
6
6
  craft_ai_sdk/core/environment_variables.py,sha256=CpkyneLf8UF-1QXe36Ay_RZJ8grSfbZZWBvGSQzKlLs,2221
7
7
  craft_ai_sdk/core/pipeline_executions.py,sha256=EfhNDzWiKro9-gDUPHJFMFcdPXtznlJo2leFKLloDmA,18709
8
8
  craft_ai_sdk/core/pipeline_metrics.py,sha256=AYxF5HpLCfTYK-TydEHswaAHat3N9NiOTHpPd_R9-rY,7190
9
9
  craft_ai_sdk/core/pipeline_templates.py,sha256=3WjM4vsURpTNF3dt42h_xk68ysxFkz4kiOxqAb4VyRE,5623
10
- craft_ai_sdk/core/pipelines.py,sha256=FD6ai2_YhE1tz6QO57bj_lA-i93TXZzm0Y9PA0mpocg,26587
10
+ craft_ai_sdk/core/pipelines.py,sha256=GHFKEEJErKEC0RKWzLtTIze5Mu4HN5dwjfsNmOE4x6o,26711
11
11
  craft_ai_sdk/core/resource_metrics.py,sha256=ubCe6QOhud3f-EQr_TXKBsrFFaxZubqTS3fZqfV7kgg,3457
12
12
  craft_ai_sdk/core/steps.py,sha256=TwOWXAAVpLPuSZ_gvf-3E5uKEvfGIzR52Y58bqKn_Ds,23487
13
13
  craft_ai_sdk/core/users.py,sha256=q5et87q0SOMpRTBOiLX026oaEOTaY1aGqKdbUC51zbA,618
14
14
  craft_ai_sdk/core/vector_database.py,sha256=NzlYeEvq4eH75Y47Z0Gam7BWJIJ0E2IPXajmPipHUAU,4553
15
15
  craft_ai_sdk/exceptions.py,sha256=IC-JfZmmmaTsbMCgirOEByRmWnatQLjKe8BErRkuwM0,1075
16
16
  craft_ai_sdk/io.py,sha256=x1G7ga10W_SeTDLHe-FrhU26_WNwWW32-yprMmCZ5Ck,11836
17
- craft_ai_sdk/sdk.py,sha256=9wQEfSmAU3HAIQCFnRkpyrJvIzYnB88kR3Hxx_J3p-4,11749
17
+ craft_ai_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ craft_ai_sdk/sdk.py,sha256=nPNEQnRwo6Obb8DmrbNJEXVeDF7FKM-GIuc0oQRupMc,11752
18
19
  craft_ai_sdk/shared/authentication.py,sha256=mnsEhG0mWwG9ZY-GToHDNnYERoou_cjt4k8l_87QW6s,1024
19
20
  craft_ai_sdk/shared/environments.py,sha256=JOV3s0KIFVl_zskJb--bybzIXEGQJjrf_T4dL-szSlQ,500
20
21
  craft_ai_sdk/shared/execution_context.py,sha256=B2Ghq-wiUvq81q5mhsm79Oc59c8c00uQxMIpApFD03o,585
21
- craft_ai_sdk/shared/helpers.py,sha256=5ZBiHlS-k1OgKejZgMlDJiYwIPYk7yg-lzeJI67poCc,1070
22
+ craft_ai_sdk/shared/helpers.py,sha256=BRBkOZat9HFnibZZmj2gZWNeE0aZlP0PNSaHat-C57o,1425
22
23
  craft_ai_sdk/shared/logger.py,sha256=pGZ_Zb4yH_KyaTdEYx1c4wd1OCa9I8xjKeLiktStwtk,1336
23
24
  craft_ai_sdk/shared/request_response_handler.py,sha256=ZDivkVWRXBt241mO6o6BQhgsFBLjQv9OsjKjFgSqCOM,4014
24
25
  craft_ai_sdk/shared/types.py,sha256=ByoR5ePdoFK4idC9bJLBvZH1kTcGg74cfxumi3o9Oks,89
@@ -27,8 +28,8 @@ craft_ai_sdk/utils/__init__.py,sha256=A0sLCXSPD1Z3q2GP1uLDjvif4ivOr__Hzg9RQysEuq
27
28
  craft_ai_sdk/utils/datetime_utils.py,sha256=yYP5HVdI879WXxQCajPTnas1pWrwInOxMux-mxqQNQM,734
28
29
  craft_ai_sdk/utils/dict_utils.py,sha256=1HQ3A14SN48XPFDmQleujGAgksmkjIs3hyPLpwhwh24,748
29
30
  craft_ai_sdk/utils/file_utils.py,sha256=o10-CDt4qzgCJNPykvlNrL6WTouhVLY8C8BVpHJYt18,2795
30
- craft_ai_sdk-0.69.1.dist-info/METADATA,sha256=WB2PxXoscvAtXYvylCYBajE56Vjx1besLlhDOzIk-lk,1571
31
- craft_ai_sdk-0.69.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
32
- craft_ai_sdk-0.69.1.dist-info/entry_points.txt,sha256=QC96WcXvvUfLMRgFD-l_y7_TgC9SqZybLs9EQ8dsGiQ,417
33
- craft_ai_sdk-0.69.1.dist-info/licenses/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
34
- craft_ai_sdk-0.69.1.dist-info/RECORD,,
31
+ craft_ai_sdk-0.70.2rc1.dist-info/METADATA,sha256=n5rxk9E_fK7VpC3PIvrrjyk5I034W0fyqSI6HvuLME4,1574
32
+ craft_ai_sdk-0.70.2rc1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
33
+ craft_ai_sdk-0.70.2rc1.dist-info/entry_points.txt,sha256=QC96WcXvvUfLMRgFD-l_y7_TgC9SqZybLs9EQ8dsGiQ,417
34
+ craft_ai_sdk-0.70.2rc1.dist-info/licenses/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
35
+ craft_ai_sdk-0.70.2rc1.dist-info/RECORD,,