craft-ai-sdk 0.55.1rc1__tar.gz → 0.55.2__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.
Files changed (22) hide show
  1. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/PKG-INFO +1 -1
  2. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/__init__.py +1 -1
  3. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/core/pipeline_executions.py +2 -2
  4. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/core/pipelines.py +102 -101
  5. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/sdk.py +1 -1
  6. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/documentation.pdf +0 -0
  7. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/pyproject.toml +1 -1
  8. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/LICENSE +0 -0
  9. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/README.md +0 -0
  10. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/constants.py +0 -0
  11. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/core/data_store.py +0 -0
  12. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/core/deployments.py +0 -0
  13. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/core/endpoints.py +0 -0
  14. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/core/environment_variables.py +0 -0
  15. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/core/pipeline_metrics.py +0 -0
  16. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/core/resource_metrics.py +0 -0
  17. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/core/steps.py +0 -0
  18. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/core/users.py +0 -0
  19. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/exceptions.py +0 -0
  20. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/io.py +0 -0
  21. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/craft_ai_sdk/utils.py +0 -0
  22. {craft_ai_sdk-0.55.1rc1 → craft_ai_sdk-0.55.2}/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.55.1rc1
3
+ Version: 0.55.2
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.55.1rc1"
17
+ __version__ = "0.55.2"
@@ -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["parameters"]["inputs"]
69
- input_types = {input["name"]: input["data_type"] for input in pipeline_inputs}
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 = {}
@@ -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
- * ``"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.
168
-
169
- * ``"creation_info"`` (:obj:`dict`): Information about the pipeline creation:
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`): either ``"creation_pending"`` or ``"ready"``.
175
- * ``"origin"`` (:obj:`str`): The origin of the pipeline, can be
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
- * ``"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:
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`): either ``"creation_pending"`` or ``"ready"``.
310
- * ``"origin"`` (:obj:`str`): The origin of the pipeline, can be
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["creation_info"]["last_execution_id"] = (
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):
@@ -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.1rc1" # Would be better to share it somewhere
133
+ _version = "0.55.2" # 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.55.1rc1"
3
+ version = "0.55.2"
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