Follow the deployment executions
A deployment - is a way to run a Machine Learning pipeline in a repeatable and automated way. Once it is created, you can find the setup of your deployments in the pipeline store. In addition, you can find all the information about the executions of the deployments in the execution tracking.
Warning
Dates provided by the Web UI and SDK are always expressed in Coordinated Universal Time (UTC).
Summary
- Get information about a deployment
- Delete a deployment or an execution
- Follow the execution tracking
Function name | Method | Return type | Description |
---|---|---|---|
list_deployments | list_deployments() | list of dict | Get the list of all deployments. |
get_deployment | get_deployment(deployment_name) | dict | Get information of a deployment. |
delete_deployment | delete_deployment(deployment_name) | dict | Delete a deployment identified by its name. |
get_pipeline_execution | get_pipeline_execution(execution_id) | dict | Get the status of one pipeline execution identified by its name. |
delete_pipeline_execution | delete_pipeline_execution(execution_id) | dict | Delete pipeline execution. |
get_pipeline_execution_input | get_pipeline_execution_input(execution_id, input_name) | dict | Get information about an input of an execution. |
get_pipeline_execution_output | get_pipeline_execution_output(execution_id, output_name) | dict | Get information about an output of an execution. |
get_pipeline_execution_logs | get_pipeline_execution_logs(execution_id, from_datetime=None, to_datetime=None, limit=None) | dict | Get the logs of an executed pipeline identified by its name. |
Get information about a deployment
List of deployments
Get the list of all deployments.
Returns
List of deployments represented as dict with the following keys:
name
(str): Name of the deployment.pipeline_name
(str): Name of the pipeline associated to the deployment.execution_rule
(str): Execution rule of the deployment. Can beendpoint
orperiodic
.is_enabled
(bool): Whether the deployment is enabled.created_at
(str): Date of creation of the deployment.
Get deployment information
Get information of a deployment.
Parameters
deployment_name
(str) -- Name of the deployment.
Returns
Deployment information represented as dict with the following keys:
name
(str): Name of the deployment.mode
(str): The deployment mode. Can be "elastic" or "low_latency".pipeline
(dict): Pipeline associated with the deployment represented as dict with the following keys:name
(str): Name of the pipeline.inputs_mapping
(list of dict): List of inputs mapping represented as dict with the following keys:pipeline_input_name
(str): Name of the pipeline input.data_type
(str): Data type of the pipeline input.description
(str): Description of the pipeline input.constant_value
(str): Constant value of the pipeline input. Note that this key is only returned if the pipeline input is mapped to a constant value.environment_variable_name
(str): Name of the environment variable. Note that this key is only returned if the pipeline input is mapped to an environment variable.endpoint_input_name
(str): Name of the endpoint input. Note that this key is only returned if the pipeline input is mapped to an endpoint input.is_null
(bool): Whether the pipeline input is mapped to null. Note that this key is only returned if the pipeline input is mapped to null.datastore_path
(str): Datastore path of the pipeline input. Note that this key is only returned if the pipeline input is mapped to the datastore.is_required
(bool): Whether the pipeline input is required. Note that this key is only returned if the pipeline input is required.default_value
(str): Default value of the pipeline input. Note that this key is only returned if the pipeline input has a default value.outputs_mapping
(list of dict): List of outputs mapping represented as dict with the following keys:pipeline_output_name
(str): Name of the pipeline output.data_type
(str): Data type of the pipeline output.description
(str): Description of the pipeline output.endpoint_output_name
(str): Name of the endpoint output. Note that this key is only returned if the pipeline output is mapped to an endpoint output.is_null
(bool): Whether the pipeline output is mapped to null. Note that this key is only returned if the pipeline output is mapped to null.datastore_path
(str): Datastore path of the pipeline output. Note that this key is only returned if the pipeline output is mapped to the datastore.endpoint_token
(str): Token of the endpoint. Note that this key is only returned if the deployment is an endpoint.schedule
(str): Schedule of the deployment. Note that this key is only returned if the execution rule of the deployment is "periodic".human_readable_schedule
(str): Human readable schedule of the deployment. Note that this key is only returned if the execution rule of the deployment is "periodic".created_at
(str): Date of creation of the deployment.created_by
(str): ID of the user who created the deployment.updated_at
(str): Date of last update of the deployment.updated_by
(str): ID of the user who last updated the deployment.last_execution_id
(str): ID of the last execution of the deployment.is_enabled
(bool): Whether the deployment is enabled.description
(str): Description of the deployment.execution_rule
(str): Execution rule of the deployment.status
(str): The deployment status. Can be "pending", "up", "failed" or "standby".pods
(list of dict): List of pods associated with the low latency deployment. Note that this key is only returned if the deployment is in low latency mode. Each pod is represented as dict with the following keys:pod_id
(str): ID of the pod.status
(str): Status of the pod.
Return type
dict
Delete a deployment or an execution
Delete a deployment
Delete a deployment identified by its name.
Parameters
deployment_name
(str) - Name of the deployment.
Returns
Deleted deployment represented as dict (with keys name
, execution_rule
). The
return data type is dict.
Warning
Be careful, deleting a deployment will delete all its executions.
Delete an execution
Delete one pipeline execution identified by its execution_id.
Parameters
execution_id
(str) - Name of the pipeline execution.
Returns
Deleted pipeline execution represented as dict with the following keys:
execution_id
(str): Name of the pipeline execution deleted.
Follow the execution tracking
Get execution list
Get the status of one pipeline execution identified by its name.
Parameters
execution_id
(str) - ID of the pipeline execution.
Returns
Information on the pipeline execution with id execution_id represented as dict.
execution_id
(str): Name of the pipeline execution.status
(str): Status of the pipeline execution.created_at
(str): Date of creation of the pipelinecreated_by
(str): ID of the user who created the pipeline execution. In the case of a pipeline run, this is the user who triggered the run. In the case of an execution via a deployment, this is the user who created the deployment.end_date
(str): Date of completion of the pipeline execution.pipeline_name
(str): Name of the pipeline used for the execution.deployment_name
(str): Name of the deployment used for the execution.steps
(list of obj): List of the step executions represented as dict with the following keys:name
(str): Name of the step.status
(str): Status of the step.start_date
(str): Date of start of the step execution.end_date
(str): Date of completion of the step execution.commit_id
(str): Id of the commit used to build the step.repository_url
(str): Url of the repository used to build the step.repository_branch
(str): Branch of the repository used to build the step.requirements_path
(str): Path of the requirements.txt file.origin
(str): The origin of the step, can begit_repository
orlocal
.inputs
(list of dict): List of inputs represented as a dict with the following keys:pipeline_input_name
(str): Name of the input.- `data_type (str): Data type of the input.
source (str)
: Source of type of the input. Can beenvironment_variable
,datastore
,constant
,is_null
endpoint
orrun
.endpoint_input_name
(str): Name of the input in the endpoint execution if source isendpoint
.constant_value
(str): Value of the constant if source isconstant
.environment_variable_name
(str): Name of the environment variable if source isenvironment_variable
.is_null
(bool): True if source isis_null
.value
: Value of the input.outputs
(list of dict): List of outputs represented as a dict with the following keys:pipeline_output_name
(str): Name of the output.- `data_type (str): Data type of the output.
destination (str)
: Destination of type of the output. Can bedatastore
,is_null
endpoint
orrun
.endpoint_output_name
(str): Name of the output in the endpoint execution if destination isendpoint
.is_null
(bool): True if destination isis_null
.value
: Value of the output.
Get execution logs
Get the logs of an executed pipeline identified by its name.
CraftAiSdk.CraftAiSdk.get_pipeline_execution_logs(*execution_id*, from_datetime=None, to_datetime=None, limit=None)
Parameters
execution_id
(str) -- ID of the pipeline execution.from_datetime
(datetime.time, optional) -- Datetime from which the logs are collected.to_datetime
(datetime.time, optional) -- Datetime until which the logs are collected.limit
(int, optional) -- Maximum number of logs that are collected.
Returns
List of collected logs represented as dict (with keys message
,
timestamp
and stream
). The return type is a list.
Get Input and Output of an execution
Input
Get the input value of an executed pipeline identified by its execution_id.
Parameters
execution_id
(str) - ID of the pipeline execution.input_name
(str) - Name of the input.
Returns
Information on the input represented as a dict with the following keys :
pipeline_input_name
(str): Name of the input.data_type
(str): Data type of the input.source
(str): Source of type of the input. Can beenvironment_variable
,datastore
,constant
,is_null
endpoint
orrun
.endpoint_input_name
(str): Name of the input in the endpoint execution if source isendpoint
.constant_value
(str): Value of the constant if source isconstant
.environment_variable_name
(str): Name of the environment variable if source isenvironment_variable
.is_null
(bool): True if source isis_null
.value
: Value of the input.
Output
Get the output value of an executed pipeline identified by its execution_id.
Parameters
execution_id
(str) - ID of the pipeline execution.output_name
(str) - Name of the output.
Returns
Information on the output represented as a dict with the following keys :
pipeline_output_name
(str): Name of the output.data_type
(str): Data type of the output.destination (str): Destination of type of the output. Can be
datastore,
is_nullendpoint
or
run`.endpoint_output_name
(str): Name of the output in the endpoint ex- ecution if destination isendpoint
.is_null
(bool): True if destination isis_null
.value
: Value of the output.