craft-ai-sdk 0.55.0__py3-none-any.whl → 0.55.1rc1__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 +101 -102
- craft_ai_sdk/sdk.py +1 -1
- {craft_ai_sdk-0.55.0.dist-info → craft_ai_sdk-0.55.1rc1.dist-info}/METADATA +1 -1
- {craft_ai_sdk-0.55.0.dist-info → craft_ai_sdk-0.55.1rc1.dist-info}/RECORD +10 -10
- documentation.pdf +0 -0
- {craft_ai_sdk-0.55.0.dist-info → craft_ai_sdk-0.55.1rc1.dist-info}/LICENSE +0 -0
- {craft_ai_sdk-0.55.0.dist-info → craft_ai_sdk-0.55.1rc1.dist-info}/WHEEL +0 -0
- {craft_ai_sdk-0.55.0.dist-info → craft_ai_sdk-0.55.1rc1.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["inputs"]
|
|
69
|
-
input_types = {input["
|
|
68
|
+
pipeline_inputs = pipeline["parameters"]["inputs"]
|
|
69
|
+
input_types = {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,59 +124,58 @@ 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
|
-
* ``"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):
|
|
127
|
+
* ``"parameters"`` (:obj:`dict`): Information used to create the pipeline with
|
|
128
|
+
the following keys:
|
|
129
|
+
|
|
130
|
+
* ``"pipeline_name"`` (:obj:`str`): Name of the pipeline.
|
|
131
|
+
* ``"function_path"`` (:obj:`str`): Path to the file that contains the
|
|
132
|
+
function.
|
|
133
|
+
* ``"function_name"`` (:obj:`str`): Name of the function in that file.
|
|
134
|
+
* ``"description"`` (:obj:`str`): Description.
|
|
135
|
+
* ``"inputs"`` (:obj:`list` of :obj:`dict`): List of inputs represented
|
|
136
|
+
as a :obj:`dict` with the following keys:
|
|
137
|
+
|
|
138
|
+
* ``"name"`` (:obj:`str`): Input name.
|
|
139
|
+
* ``"data_type"`` (:obj:`str`): Input data type.
|
|
140
|
+
* ``"is_required"`` (:obj:`bool`): Whether the input is required.
|
|
141
|
+
* ``"default_value"`` (:obj:`str`): Input default value.
|
|
142
|
+
|
|
143
|
+
* ``"outputs"`` (:obj:`list` of :obj:`dict`): List of outputs
|
|
144
|
+
represented as a :obj:`dict` with the following keys:
|
|
145
|
+
|
|
146
|
+
* ``"name"`` (:obj:`str`): Output name.
|
|
147
|
+
* ``"data_type"`` (:obj:`str`): Output data type.
|
|
148
|
+
* ``"description"`` (:obj:`str`): Output description.
|
|
149
|
+
|
|
150
|
+
* ``"container_config"`` (:obj:`dict[str, str]`): Some pipeline
|
|
151
|
+
configuration, with the following optional keys:
|
|
152
|
+
|
|
153
|
+
* ``"language"`` (:obj:`str`): Language and version used for the pipeline.
|
|
154
|
+
The accepted formats are "python:3.X-slim", where "3.X" is a supported
|
|
155
|
+
version of Python, and "python-cuda:3.X-Y.Z" for GPU environments,
|
|
156
|
+
where "Y.Z" is a supported version of CUDA. The list of supported
|
|
157
|
+
versions is available on the official documentation website at
|
|
158
|
+
https://mlops-platform-documentation.craft.ai.
|
|
159
|
+
* ``"repository_url"`` (:obj:`str`): Remote repository url.
|
|
160
|
+
* ``"repository_branch"`` (:obj:`str`): Branch name.
|
|
161
|
+
* ``"included_folders"`` (:obj:`list[str]`): List of folders and
|
|
162
|
+
files in the repository required for the pipeline execution.
|
|
163
|
+
* ``"system_dependencies"`` (:obj:`list[str]`): List of system
|
|
164
|
+
dependencies.
|
|
165
|
+
* ``"dockerfile_path"`` (:obj:`str`): Path to the Dockerfile.
|
|
166
|
+
* ``"requirements_path"`` (:obj:`str`): Path to the requirements.txt
|
|
167
|
+
file.
|
|
173
168
|
|
|
169
|
+
* ``"creation_info"`` (:obj:`dict`): Information about the pipeline creation:
|
|
170
|
+
|
|
171
|
+
* ``"created_at"`` (:obj:`str`): The creation date in ISO format.
|
|
174
172
|
* ``"commit_id"`` (:obj:`str`): The commit id on which the pipeline was
|
|
175
173
|
built.
|
|
176
|
-
* ``"status"`` (:obj:`str`):
|
|
177
|
-
|
|
178
|
-
* ``"origin"`` (:obj:`str`): The origin of the step, can be
|
|
174
|
+
* ``"status"`` (:obj:`str`): either ``"creation_pending"`` or ``"ready"``.
|
|
175
|
+
* ``"origin"`` (:obj:`str`): The origin of the pipeline, can be
|
|
179
176
|
``"git_repository"`` or ``"local"``.
|
|
177
|
+
* ``"last_execution_id"`` (:obj:`str`): The id of the last execution of
|
|
178
|
+
the pipeline.
|
|
180
179
|
"""
|
|
181
180
|
# For backward compatibility, a pipeline can be created with a single step:
|
|
182
181
|
args_are_none = all(
|
|
@@ -259,61 +258,59 @@ def get_pipeline(
|
|
|
259
258
|
None if the pipeline does not exist, otherwise pipeline information, with
|
|
260
259
|
the following keys:
|
|
261
260
|
|
|
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
|
-
|
|
304
|
-
|
|
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:
|
|
261
|
+
* ``"parameters"`` (:obj:`dict`): Information used to create the pipeline with
|
|
262
|
+
the following keys:
|
|
263
|
+
|
|
264
|
+
* ``"pipeline_name"`` (:obj:`str`): Name of the pipeline.
|
|
265
|
+
* ``"function_path"`` (:obj:`str`): Path to the file that contains the
|
|
266
|
+
function.
|
|
267
|
+
* ``"function_name"`` (:obj:`str`): Name of the function in that file.
|
|
268
|
+
* ``"description"`` (:obj:`str`): Description.
|
|
269
|
+
* ``"inputs"`` (:obj:`list` of :obj:`dict`): List of inputs represented
|
|
270
|
+
as a :obj:`dict` with the following keys:
|
|
271
|
+
|
|
272
|
+
* ``"name"`` (:obj:`str`): Input name.
|
|
273
|
+
* ``"data_type"`` (:obj:`str`): Input data type.
|
|
274
|
+
* ``"is_required"`` (:obj:`bool`): Whether the input is required.
|
|
275
|
+
* ``"default_value"`` (:obj:`str`): Input default value.
|
|
276
|
+
|
|
277
|
+
* ``"outputs"`` (:obj:`list` of :obj:`dict`): List of outputs
|
|
278
|
+
represented as a :obj:`dict` with the following keys:
|
|
279
|
+
|
|
280
|
+
* ``"name"`` (:obj:`str`): Output name.
|
|
281
|
+
* ``"data_type"`` (:obj:`str`): Output data type.
|
|
282
|
+
* ``"description"`` (:obj:`str`): Output description.
|
|
283
|
+
|
|
284
|
+
* ``"container_config"`` (:obj:`dict[str, str]`): Some pipeline
|
|
285
|
+
configuration, with the following optional keys:
|
|
286
|
+
|
|
287
|
+
* ``"language"`` (:obj:`str`): Language and version used for the pipeline.
|
|
288
|
+
The accepted formats are "python:3.X-slim", where "3.X" is a supported
|
|
289
|
+
version of Python, and "python-cuda:3.X-Y.Z" for GPU environments,
|
|
290
|
+
where "Y.Z" is a supported version of CUDA. The list of supported
|
|
291
|
+
versions is available on the official documentation website at
|
|
292
|
+
https://mlops-platform-documentation.craft.ai.
|
|
293
|
+
* ``"repository_url"`` (:obj:`str`): Remote repository url.
|
|
294
|
+
* ``"repository_branch"`` (:obj:`str`): Branch name.
|
|
295
|
+
* ``"included_folders"`` (:obj:`list[str]`): List of folders and
|
|
296
|
+
files in the repository required for the pipeline execution.
|
|
297
|
+
* ``"system_dependencies"`` (:obj:`list[str]`): List of system
|
|
298
|
+
dependencies.
|
|
299
|
+
* ``"dockerfile_path"`` (:obj:`str`): Path to the Dockerfile.
|
|
300
|
+
* ``"requirements_path"`` (:obj:`str`): Path to the requirements.txt
|
|
301
|
+
file.
|
|
302
|
+
|
|
303
|
+
* ``"creation_info"`` (:obj:`dict`): Information about the pipeline creation:
|
|
310
304
|
|
|
305
|
+
* ``"created_at"`` (:obj:`str`): The creation date in ISO format.
|
|
306
|
+
* ``"created_by"`` (:obj:`str`): The user who created the pipeline.
|
|
311
307
|
* ``"commit_id"`` (:obj:`str`): The commit id on which the pipeline was
|
|
312
308
|
built.
|
|
313
|
-
* ``"status"`` (:obj:`str`):
|
|
314
|
-
|
|
315
|
-
* ``"origin"`` (:obj:`str`): The origin of the step, can be
|
|
309
|
+
* ``"status"`` (:obj:`str`): either ``"creation_pending"`` or ``"ready"``.
|
|
310
|
+
* ``"origin"`` (:obj:`str`): The origin of the pipeline, can be
|
|
316
311
|
``"git_repository"`` or ``"local"``.
|
|
312
|
+
* ``"last_execution_id"`` (:obj:`str`): The id of the last execution of
|
|
313
|
+
the pipeline.
|
|
317
314
|
"""
|
|
318
315
|
try:
|
|
319
316
|
base_url = f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}"
|
|
@@ -338,12 +335,14 @@ def get_pipeline(
|
|
|
338
335
|
latest_execution = sdk._get(
|
|
339
336
|
f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}/executions/latest"
|
|
340
337
|
)
|
|
341
|
-
pipeline["last_execution_id"] = (
|
|
338
|
+
pipeline["creation_info"]["last_execution_id"] = (
|
|
342
339
|
latest_execution.get("execution_id", None)
|
|
343
340
|
if latest_execution is not None
|
|
344
341
|
else None
|
|
345
342
|
)
|
|
346
|
-
return remove_keys_from_dict(
|
|
343
|
+
return remove_keys_from_dict(
|
|
344
|
+
pipeline, {"creation_info.is_archived", "creation_info.id"}
|
|
345
|
+
)
|
|
347
346
|
|
|
348
347
|
|
|
349
348
|
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.1rc1" # 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=fZkpdM_nSiAXaajh7y1mKYzmu-zs9H8yMW7nLh3EiJQ,407
|
|
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=-ClmW3qtPIA9LIhs_tiECCPL6ykSmG2zMLnrBNDGZiU,18665
|
|
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=r-wTMDvH6D_4gDMjjWzjGYQdph6vv_DO8uh0wlec9S8,20331
|
|
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=BEqJVl-vCG0PSecYfqS3aR8uEQHjLgo6Ay82C-Ku2t8,10071
|
|
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=eSLh9i3QDQnRe1zz0upLX_J4AU7qy_Eo8XDoEZhthh8,334078
|
|
19
|
+
craft_ai_sdk-0.55.1rc1.dist-info/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
|
|
20
|
+
craft_ai_sdk-0.55.1rc1.dist-info/METADATA,sha256=svsgM22xoweX0sBLicpRKw6gCLTqsfCYlqzwRNKwlUo,1617
|
|
21
|
+
craft_ai_sdk-0.55.1rc1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
22
|
+
craft_ai_sdk-0.55.1rc1.dist-info/entry_points.txt,sha256=eV9YD0zCAb88_wNMDV99sRxVKVC-WOQF3b1Pepaytcg,385
|
|
23
|
+
craft_ai_sdk-0.55.1rc1.dist-info/RECORD,,
|
documentation.pdf
CHANGED
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|