craft-ai-sdk 0.56.0rc1__tar.gz → 0.57.0rc1__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.
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/PKG-INFO +1 -1
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/__init__.py +1 -1
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/core/deployments.py +10 -4
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/core/pipelines.py +14 -20
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/sdk.py +1 -1
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/documentation.pdf +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/pyproject.toml +1 -1
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/LICENSE +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/README.md +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/constants.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/core/data_store.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/core/endpoints.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/core/environment_variables.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/core/pipeline_executions.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/core/pipeline_metrics.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/core/resource_metrics.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/core/steps.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/core/users.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/exceptions.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/io.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/utils.py +0 -0
- {craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/warnings.py +0 -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
|
|
533
|
-
|
|
534
|
-
|
|
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
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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.
|
|
133
|
+
_version = "0.57.0rc1" # Would be better to share it somewhere
|
|
134
134
|
|
|
135
135
|
def __init__(
|
|
136
136
|
self,
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{craft_ai_sdk-0.56.0rc1 → craft_ai_sdk-0.57.0rc1}/craft_ai_sdk/core/environment_variables.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|