craft-ai-sdk 0.56.0rc1__tar.gz → 0.57.0__tar.gz

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.

Potentially problematic release.


This version of craft-ai-sdk might be problematic. Click here for more details.

Files changed (22) hide show
  1. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/PKG-INFO +1 -1
  2. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/__init__.py +1 -1
  3. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/core/deployments.py +10 -4
  4. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/core/pipelines.py +14 -20
  5. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/sdk.py +1 -1
  6. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/documentation.pdf +0 -0
  7. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/pyproject.toml +1 -1
  8. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/LICENSE +0 -0
  9. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/README.md +0 -0
  10. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/constants.py +0 -0
  11. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/core/data_store.py +0 -0
  12. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/core/endpoints.py +0 -0
  13. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/core/environment_variables.py +0 -0
  14. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/core/pipeline_executions.py +0 -0
  15. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/core/pipeline_metrics.py +0 -0
  16. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/core/resource_metrics.py +0 -0
  17. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/core/steps.py +0 -0
  18. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/core/users.py +0 -0
  19. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/exceptions.py +0 -0
  20. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/io.py +0 -0
  21. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/utils.py +0 -0
  22. {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0}/craft_ai_sdk/warnings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: craft-ai-sdk
3
- Version: 0.56.0rc1
3
+ Version: 0.57.0
4
4
  Summary: Craft AI MLOps platform SDK
5
5
  Home-page: https://www.craft.ai/
6
6
  License: Apache-2.0
@@ -14,4 +14,4 @@ from .io import ( # noqa: F401
14
14
  )
15
15
 
16
16
 
17
- __version__ = "0.56.0rc1"
17
+ __version__ = "0.57.0"
@@ -529,10 +529,14 @@ def get_deployment(
529
529
  deployment_status = deployment.get("status", None)
530
530
  elapsed_time = sdk._get_time() - start_time
531
531
 
532
- if deployment_status not in [
533
- DEPLOYMENT_STATUS.UP,
534
- DEPLOYMENT_STATUS.CREATION_FAILED,
535
- ]:
532
+ if deployment_status == DEPLOYMENT_STATUS.CREATION_FAILED:
533
+ raise SdkException(
534
+ "The deployment creation failed. Please check the logs for more \
535
+ details.",
536
+ name="CreationFailedException",
537
+ )
538
+
539
+ if deployment_status != DEPLOYMENT_STATUS.UP:
536
540
  raise SdkException(
537
541
  'The deployment was not ready in time. It is still being created but \
538
542
  this function stopped trying. Please check its status with "get_deployment" with \
@@ -579,6 +583,8 @@ def get_deployment_logs(
579
583
 
580
584
  * ``"timestamp"`` (:obj:`str`): Timestamp of the log.
581
585
  * ``"message"`` (:obj:`str`): Message of the log.
586
+ * ``"stream"`` (:obj:`str`): Stream of the log. Typically, ``"stdout"`` or
587
+ ``"stderr"``
582
588
  * ``"pod_id"`` (:obj:`str`): ID of the pod.
583
589
  * ``"type"`` (:obj:`str`): Type of the log. Can be ``"deployment"``.
584
590
  """
@@ -2,7 +2,6 @@ import warnings
2
2
  import os
3
3
  import requests
4
4
 
5
- from ..exceptions import SdkException
6
5
  from ..sdk import BaseCraftAiSdk
7
6
  from ..utils import (
8
7
  log_action,
@@ -312,25 +311,20 @@ def get_pipeline(
312
311
  * ``"last_execution_id"`` (:obj:`str`): The id of the last execution of
313
312
  the pipeline.
314
313
  """
315
- try:
316
- base_url = f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}"
317
- if wait_for_completion:
318
- pipeline = _wait_create_until_ready(
319
- sdk,
320
- pipeline_name,
321
- lambda sdk, _: sdk._get(
322
- f"{base_url}?wait_for_completion=true", allow_redirects=False
323
- ),
324
- timeout_s,
325
- sdk._get_time(),
326
- get_pipeline_logs,
327
- )
328
- else:
329
- pipeline = sdk._get(base_url)
330
- except SdkException as error:
331
- if error.status_code == 404:
332
- return None
333
- raise error
314
+ base_url = f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}"
315
+ if wait_for_completion:
316
+ pipeline = _wait_create_until_ready(
317
+ sdk,
318
+ pipeline_name,
319
+ lambda sdk, _: sdk._get(
320
+ f"{base_url}?wait_for_completion=true", allow_redirects=False
321
+ ),
322
+ timeout_s,
323
+ sdk._get_time(),
324
+ get_pipeline_logs,
325
+ )
326
+ else:
327
+ pipeline = sdk._get(base_url)
334
328
 
335
329
  latest_execution = sdk._get(
336
330
  f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}/executions/latest"
@@ -130,7 +130,7 @@ class CraftAiSdk(BaseCraftAiSdk):
130
130
  os.environ.get("CRAFT_AI__MULTIPART_PART_SIZE__B", str(38 * 256 * 1024))
131
131
  )
132
132
  _access_token_margin = timedelta(seconds=30)
133
- _version = "0.56.0rc1" # Would be better to share it somewhere
133
+ _version = "0.57.0" # Would be better to share it somewhere
134
134
 
135
135
  def __init__(
136
136
  self,
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "craft-ai-sdk"
3
- version = "0.56.0rc1"
3
+ version = "0.57.0"
4
4
  description = "Craft AI MLOps platform SDK"
5
5
  license = "Apache-2.0"
6
6
  authors = ["Craft AI <contact@craft.ai>"]
File without changes