craft-ai-sdk 0.55.1rc1__py3-none-any.whl → 0.55.2__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.
Potentially problematic release.
This version of craft-ai-sdk might be problematic. Click here for more details.
- craft_ai_sdk/__init__.py +1 -1
- craft_ai_sdk/core/pipeline_executions.py +2 -2
- craft_ai_sdk/core/pipelines.py +102 -101
- craft_ai_sdk/sdk.py +1 -1
- {craft_ai_sdk-0.55.1rc1.dist-info → craft_ai_sdk-0.55.2.dist-info}/METADATA +1 -1
- {craft_ai_sdk-0.55.1rc1.dist-info → craft_ai_sdk-0.55.2.dist-info}/RECORD +10 -10
- documentation.pdf +0 -0
- {craft_ai_sdk-0.55.1rc1.dist-info → craft_ai_sdk-0.55.2.dist-info}/LICENSE +0 -0
- {craft_ai_sdk-0.55.1rc1.dist-info → craft_ai_sdk-0.55.2.dist-info}/WHEEL +0 -0
- {craft_ai_sdk-0.55.1rc1.dist-info → craft_ai_sdk-0.55.2.dist-info}/entry_points.txt +0 -0
craft_ai_sdk/__init__.py
CHANGED
|
@@ -65,8 +65,8 @@ def run_pipeline(
|
|
|
65
65
|
inputs = {}
|
|
66
66
|
# Retrieve pipeline input types
|
|
67
67
|
pipeline = sdk._get(f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}")
|
|
68
|
-
pipeline_inputs = pipeline["
|
|
69
|
-
input_types = {input["
|
|
68
|
+
pipeline_inputs = pipeline["inputs"]
|
|
69
|
+
input_types = {input["input_name"]: input["data_type"] for input in pipeline_inputs}
|
|
70
70
|
|
|
71
71
|
# Get files to upload and data to send
|
|
72
72
|
files = {}
|
craft_ai_sdk/core/pipelines.py
CHANGED
|
@@ -124,58 +124,59 @@ def create_pipeline(
|
|
|
124
124
|
:obj:`dict`: Created pipeline represented as :obj:`dict` with the following
|
|
125
125
|
keys:
|
|
126
126
|
|
|
127
|
-
* ``"
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
* ``"
|
|
134
|
-
* ``"
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
* ``"
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
127
|
+
* ``"pipeline_name"`` (:obj:`str`): Name of the pipeline.
|
|
128
|
+
* ``"created_at"`` (:obj:`str`): Pipeline date of creation.
|
|
129
|
+
* ``"inputs"`` (:obj:`list` of :obj:`dict`): List of open inputs
|
|
130
|
+
of the pipeline. Each open input is represented as a :obj:`dict` with the
|
|
131
|
+
following keys:
|
|
132
|
+
|
|
133
|
+
* ``"input_name"`` (:obj:`str`): Name of the open input.
|
|
134
|
+
* ``"step_name"`` (:obj:`str`): Name of the step that provides the open
|
|
135
|
+
input.
|
|
136
|
+
* ``"data_type"`` (:obj:`str`): Data type of the open input.
|
|
137
|
+
* ``"description"`` (:obj:`str`): Description of the open input.
|
|
138
|
+
* ``"default_value"`` (:obj:`str`): Default value of the open input.
|
|
139
|
+
* ``"is_required"`` (:obj:`bool`): Whether the open input is required or
|
|
140
|
+
not.
|
|
141
|
+
|
|
142
|
+
* ``"outputs"`` (:obj:`list` of :obj:`dict`): List of open outputs
|
|
143
|
+
of the pipeline. Each open output is represented as a :obj:`dict` with the
|
|
144
|
+
following keys:
|
|
145
|
+
|
|
146
|
+
* ``"output_name"`` (:obj:`str`): Name of the open output.
|
|
147
|
+
* ``"step_name"`` (:obj:`str`): Name of the step that provides the open
|
|
148
|
+
output.
|
|
149
|
+
* ``"data_type"`` (:obj:`str`): Data type of the open output.
|
|
150
|
+
* ``"description"`` (:obj:`str`): Description of the open output.
|
|
151
|
+
|
|
152
|
+
* ``"container_config"`` (:obj:`dict[str, str]`): Some pipeline
|
|
153
|
+
configuration, with the following optional keys:
|
|
154
|
+
|
|
155
|
+
* ``"language"`` (:obj:`str`): Language and version used for the pipeline.
|
|
156
|
+
The accepted formats are "python:3.X-slim", where "3.X" is a supported
|
|
157
|
+
version of Python, and "python-cuda:3.X-Y.Z" for GPU environments,
|
|
158
|
+
where "Y.Z" is a supported version of CUDA. The list of supported
|
|
159
|
+
versions is available on the official documentation website at
|
|
160
|
+
https://mlops-platform-documentation.craft.ai.
|
|
161
|
+
* ``"repository_branch"`` (:obj:`str`): Branch name.
|
|
162
|
+
* ``"repository_url"`` (:obj:`str`): Remote repository url.
|
|
163
|
+
* ``"included_folders"`` (:obj:`list[str]`): List of folders and
|
|
164
|
+
files in the repository required for the pipeline execution.
|
|
165
|
+
* ``"system_dependencies"`` (:obj:`list[str]`): List of system
|
|
166
|
+
dependencies.
|
|
167
|
+
* ``"dockerfile_path"`` (:obj:`str`): Path to the Dockerfile.
|
|
168
|
+
* ``"requirements_path"`` (:obj:`str`): Path to the requirements.txt
|
|
169
|
+
file.
|
|
170
|
+
|
|
171
|
+
* ``"creation_info"`` (:obj:`dict`): Information about the step creation (Note
|
|
172
|
+
that this is only returned if the pipeline was created without a step):
|
|
170
173
|
|
|
171
|
-
* ``"created_at"`` (:obj:`str`): The creation date in ISO format.
|
|
172
174
|
* ``"commit_id"`` (:obj:`str`): The commit id on which the pipeline was
|
|
173
175
|
built.
|
|
174
|
-
* ``"status"`` (:obj:`str`):
|
|
175
|
-
|
|
176
|
+
* ``"status"`` (:obj:`str`): The pipeline status, always ``"ready"`` when
|
|
177
|
+
this function returns.
|
|
178
|
+
* ``"origin"`` (:obj:`str`): The origin of the step, can be
|
|
176
179
|
``"git_repository"`` or ``"local"``.
|
|
177
|
-
* ``"last_execution_id"`` (:obj:`str`): The id of the last execution of
|
|
178
|
-
the pipeline.
|
|
179
180
|
"""
|
|
180
181
|
# For backward compatibility, a pipeline can be created with a single step:
|
|
181
182
|
args_are_none = all(
|
|
@@ -258,59 +259,61 @@ def get_pipeline(
|
|
|
258
259
|
None if the pipeline does not exist, otherwise pipeline information, with
|
|
259
260
|
the following keys:
|
|
260
261
|
|
|
261
|
-
* ``"
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
* ``"
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
262
|
+
* ``"pipeline_name"`` (:obj:`str`): Name of the pipeline.
|
|
263
|
+
* ``"created_at"`` (:obj:`str`): Pipeline date of creation.
|
|
264
|
+
* ``"created_by"`` (:obj:`str`): ID of the user who created the deployment.
|
|
265
|
+
* ``"last_execution_id"`` (:obj:`str`): ID of the last execution of the
|
|
266
|
+
pipeline.
|
|
267
|
+
* ``"inputs"`` (:obj:`list` of :obj:`dict`): List of open inputs
|
|
268
|
+
of the pipeline. Each open input is represented as a :obj:`dict` with the
|
|
269
|
+
following keys:
|
|
270
|
+
|
|
271
|
+
* ``"input_name"`` (:obj:`str`): Name of the open input.
|
|
272
|
+
* ``"step_name"`` (:obj:`str`): Name of the step that provides the open
|
|
273
|
+
input.
|
|
274
|
+
* ``"data_type"`` (:obj:`str`): Data type of the open input.
|
|
275
|
+
* ``"description"`` (:obj:`str`): Description of the open input.
|
|
276
|
+
* ``"default_value"`` (:obj:`str`): Default value of the open input.
|
|
277
|
+
* ``"is_required"`` (:obj:`bool`): Whether the open input is required or
|
|
278
|
+
not.
|
|
279
|
+
|
|
280
|
+
* ``"outputs"`` (:obj:`list` of :obj:`dict`): List of open outputs
|
|
281
|
+
of the pipeline. Each open output is represented as a :obj:`dict` with the
|
|
282
|
+
following keys:
|
|
283
|
+
|
|
284
|
+
* ``"output_name"`` (:obj:`str`): Name of the open output.
|
|
285
|
+
* ``"step_name"`` (:obj:`str`): Name of the step that provides the open
|
|
286
|
+
output.
|
|
287
|
+
* ``"data_type"`` (:obj:`str`): Data type of the open output.
|
|
288
|
+
* ``"description"`` (:obj:`str`): Description of the open output.
|
|
289
|
+
|
|
290
|
+
* ``"container_config"`` (:obj:`dict[str, str]`): Some pipeline
|
|
291
|
+
configuration, with the following optional keys:
|
|
292
|
+
|
|
293
|
+
* ``"language"`` (:obj:`str`): Language and version used for the pipeline.
|
|
294
|
+
The accepted formats are "python:3.X-slim", where "3.X" is a supported
|
|
295
|
+
version of Python, and "python-cuda:3.X-Y.Z" for GPU environments,
|
|
296
|
+
where "Y.Z" is a supported version of CUDA. The list of supported
|
|
297
|
+
versions is available on the official documentation website at
|
|
298
|
+
https://mlops-platform-documentation.craft.ai.
|
|
299
|
+
* ``"repository_branch"`` (:obj:`str`): Branch name.
|
|
300
|
+
* ``"repository_url"`` (:obj:`str`): Remote repository url.
|
|
301
|
+
* ``"included_folders"`` (:obj:`list[str]`): List of folders and
|
|
302
|
+
files in the repository required for the pipeline execution.
|
|
303
|
+
* ``"system_dependencies"`` (:obj:`list[str]`): List of system
|
|
304
|
+
dependencies.
|
|
305
|
+
* ``"dockerfile_path"`` (:obj:`str`): Path to the Dockerfile.
|
|
306
|
+
* ``"requirements_path"`` (:obj:`str`): Path to the requirements.txt
|
|
307
|
+
file.
|
|
308
|
+
|
|
309
|
+
* ``"creation_info"`` (:obj:`dict`): Information about the step creation:
|
|
304
310
|
|
|
305
|
-
* ``"created_at"`` (:obj:`str`): The creation date in ISO format.
|
|
306
|
-
* ``"created_by"`` (:obj:`str`): The user who created the pipeline.
|
|
307
311
|
* ``"commit_id"`` (:obj:`str`): The commit id on which the pipeline was
|
|
308
312
|
built.
|
|
309
|
-
* ``"status"`` (:obj:`str`):
|
|
310
|
-
|
|
313
|
+
* ``"status"`` (:obj:`str`): The pipeline status, always ``"ready"`` when
|
|
314
|
+
this function returns.
|
|
315
|
+
* ``"origin"`` (:obj:`str`): The origin of the step, can be
|
|
311
316
|
``"git_repository"`` or ``"local"``.
|
|
312
|
-
* ``"last_execution_id"`` (:obj:`str`): The id of the last execution of
|
|
313
|
-
the pipeline.
|
|
314
317
|
"""
|
|
315
318
|
try:
|
|
316
319
|
base_url = f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}"
|
|
@@ -335,14 +338,12 @@ def get_pipeline(
|
|
|
335
338
|
latest_execution = sdk._get(
|
|
336
339
|
f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}/executions/latest"
|
|
337
340
|
)
|
|
338
|
-
pipeline["
|
|
341
|
+
pipeline["last_execution_id"] = (
|
|
339
342
|
latest_execution.get("execution_id", None)
|
|
340
343
|
if latest_execution is not None
|
|
341
344
|
else None
|
|
342
345
|
)
|
|
343
|
-
return remove_keys_from_dict(
|
|
344
|
-
pipeline, {"creation_info.is_archived", "creation_info.id"}
|
|
345
|
-
)
|
|
346
|
+
return remove_keys_from_dict(pipeline, {"is_archived", "pipeline_id"})
|
|
346
347
|
|
|
347
348
|
|
|
348
349
|
def list_pipelines(sdk: BaseCraftAiSdk):
|
craft_ai_sdk/sdk.py
CHANGED
|
@@ -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.55.
|
|
133
|
+
_version = "0.55.2" # Would be better to share it somewhere
|
|
134
134
|
|
|
135
135
|
def __init__(
|
|
136
136
|
self,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
craft_ai_sdk/__init__.py,sha256=
|
|
1
|
+
craft_ai_sdk/__init__.py,sha256=5UXdjh1QLhhuFskMfUwDDbjmI0Q2b3J4EcrRTcfMU6c,404
|
|
2
2
|
craft_ai_sdk/constants.py,sha256=5dR4JfKVz3KhBKRFSdN1nrb06kFkNiYP2mRnacsbzJA,629
|
|
3
3
|
craft_ai_sdk/core/data_store.py,sha256=USONqCEwG_KoTv5a1fgZJmi7FIjbfo4Vi-zq82keo4E,8511
|
|
4
4
|
craft_ai_sdk/core/deployments.py,sha256=fUZBHTgOWHPShMcIvNF7XEHJLAZJwJI8zLzMtdv-Dzc,31427
|
|
5
5
|
craft_ai_sdk/core/endpoints.py,sha256=ggJ8IU0QVrGa7A0RBWiJY1Lo7Klfi9BbfGnovZD97FQ,4592
|
|
6
6
|
craft_ai_sdk/core/environment_variables.py,sha256=wy0U7y0C7tRXOXOiWGz0vX5ajHSmOb_7J1fXlSahGpI,2045
|
|
7
|
-
craft_ai_sdk/core/pipeline_executions.py,sha256
|
|
7
|
+
craft_ai_sdk/core/pipeline_executions.py,sha256=caFN7-4tyVoxuAVNlldcRi2PmnvUYcazIZwmTOBBqik,18657
|
|
8
8
|
craft_ai_sdk/core/pipeline_metrics.py,sha256=Tt5p6guHAf7nhq1wvJG3t7WqsYKqrNQ7sZcFKqXYmdM,6465
|
|
9
|
-
craft_ai_sdk/core/pipelines.py,sha256=
|
|
9
|
+
craft_ai_sdk/core/pipelines.py,sha256=J1zcuvOjCVAsau2YxZ_VLV1ctM4LnPUsADq3kFEJQ0U,20440
|
|
10
10
|
craft_ai_sdk/core/resource_metrics.py,sha256=yaco_AZ4Wu5sxLRKsA3qt2R3-PMs2e32EGO0gsHtq2Y,2336
|
|
11
11
|
craft_ai_sdk/core/steps.py,sha256=1yTqcGrAKkVQWzslLjz2XQ3I7hILq8Oyc11Z9FeuFk0,20217
|
|
12
12
|
craft_ai_sdk/core/users.py,sha256=Qi3xg7Vzk_0MepccNIZbFzjI0bBqouqkFStTuejUY6s,509
|
|
13
13
|
craft_ai_sdk/exceptions.py,sha256=IC-JfZmmmaTsbMCgirOEByRmWnatQLjKe8BErRkuwM0,1075
|
|
14
14
|
craft_ai_sdk/io.py,sha256=Jh9bFfXRzwCequXvJ3DKO-SIdZ7teYfzO64N940FyDY,11861
|
|
15
|
-
craft_ai_sdk/sdk.py,sha256=
|
|
15
|
+
craft_ai_sdk/sdk.py,sha256=ehS0Jf9kaQxcbuHYxYFDeL_xZKrHfgg7FUmWT1zoYGg,10068
|
|
16
16
|
craft_ai_sdk/utils.py,sha256=syOtpNgV8XF9VoeRVnWGkjIdWv0vyS_Z8RN5QfHCfIo,11891
|
|
17
17
|
craft_ai_sdk/warnings.py,sha256=xJXbUR66SVbG_ZO7rxpAZ2hkGxdUtM5JAx6JoWg77Qs,6678
|
|
18
|
-
documentation.pdf,sha256=
|
|
19
|
-
craft_ai_sdk-0.55.
|
|
20
|
-
craft_ai_sdk-0.55.
|
|
21
|
-
craft_ai_sdk-0.55.
|
|
22
|
-
craft_ai_sdk-0.55.
|
|
23
|
-
craft_ai_sdk-0.55.
|
|
18
|
+
documentation.pdf,sha256=pZdOoPnLklDUVAhdldYvgESbsC4-3NJRqMN_p6k2Nl8,333529
|
|
19
|
+
craft_ai_sdk-0.55.2.dist-info/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
|
|
20
|
+
craft_ai_sdk-0.55.2.dist-info/METADATA,sha256=TMpKA6COOTsh1btq-S_Wh-LCmvjSToLLddCtp3vkDoA,1614
|
|
21
|
+
craft_ai_sdk-0.55.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
22
|
+
craft_ai_sdk-0.55.2.dist-info/entry_points.txt,sha256=eV9YD0zCAb88_wNMDV99sRxVKVC-WOQF3b1Pepaytcg,385
|
|
23
|
+
craft_ai_sdk-0.55.2.dist-info/RECORD,,
|
documentation.pdf
CHANGED
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|