Skip to content

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

  1. Get information about a deployment
  2. Delete a deployment or an execution
  3. 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 information about a deployment

List of deployments

Get the list of all deployments.

CraftAiSdk.list_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.
  • version (str): Version of the pipeline associated to the deployment.
  • execution_rule (str): Execution rule of the deployment. Can be endpoint or periodic.
  • 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.

CraftAiSdk.get_deployment(deployment_name)

Parameters

  • deployment_name (str) -- Name of the deployment.

Returns

Deployment information represented as dict (with keys id, name and pipeline).

  • name (str): Name of the deployment.
  • mode (str): The deployment mode. Can be “elastic”.
  • pipeline (dict): Pipeline associated to 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:
  • step_input_name (str): Name of the step input.
  • data_type (str): Data type of the step input.
  • description (str): Description of the step input.
  • constant_value (str): Constant value of the step input. Note that this key is only returned if the step 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 step 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 step input is mapped to an endpoint input.
  • is_null (bool): Whether the step input is mapped to null. Note that this key is only returned if the step input is mapped to null.
  • datastore_path (str): Datastore path of the step input. Note that this key is only returned if the step input is mapped to the datastore.
  • is_required (bool): Whether the step input is required. Note that this key is only returned if the step input is required.
  • default_value (str): Default value of the step input. Note that this key is only returned if the step input has a default value.
  • outputs_mapping (list of dict): List of outputs mapping represented as dict with the following keys:
  • step_output_name (str): Name of the step output.
  • data_type (str): Data type of the step output.
  • description (str): Description of the step output.
  • endpoint_output_name (str): Name of the endpoint output. Note that this key is only returned if the step output is mapped to an endpoint output.
  • is_null (bool): Whether the step output is mapped to null. Note that this key is only returned if the step output is mapped to null.
  • datastore_path (str): Datastore path of the step output. Note that this key is only returned if the step 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 deployment is a periodic deployment.
  • human_readable_schedule (str): Human readable schedule of the deployment. Note that this key is only returned if the deployment is a periodic deployment.
  • 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.
  • update_status (str): The deployment status. Can be creating,updating,success or failed.

Return type

dict

Delete a deployment or an execution

Delete a deployment

Delete a deployment identified by its name.

CraftAiSdk.delete_deployment(deployment_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.

CraftAiSdk.delete_pipeline_execution(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.

CraftAiSdk.get_pipeline_execution(execution_id)

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 pipeline
  • created_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.
  • inputs (list of dict): List of inputs represented as a dict with the following keys:
  • step_input_name (str): Name of the input.
  • `data_type (str): Data type of the input.
  • source (str): Source of type of the input. Can be environment_variable, datastore, constant, is_null endpoint or run.
  • endpoint_input_name (str): Name of the input in the endpoint execution if source is endpoint.
  • constant_value (str): Value of the constant if source is constant.
  • environment_variable_name (str): Name of the environment variable if source is environment_variable.
  • is_null (bool): True if source is is_null.
  • value: Value of the input.
  • outputs (list of dict): List of outputs represented as a dict with the following keys:
  • step_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_null endpoint or run.
  • endpoint_output_name (str): Name of the output in the endpoint execution if destination is endpoint.
  • is_null (bool): True if destination is is_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(*pipeline_name*, *execution_id*,
from_datetime=None, to_datetime=None, limit=None)

Parameters

  • pipeline_name (str) -- Name of an existing pipeline.
  • 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.

CraftAiSdk.get_pipeline_execution_input(execution_id, input_name)

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 :

  • step_input_name (str): Name of the input.
  • data_type (str): Data type of the input.
  • source (str): Source of type of the input. Can be environment_variable, datastore, constant, is_null endpoint or run.
  • endpoint_input_name (str): Name of the input in the endpoint execution if source is endpoint.
  • constant_value (str): Value of the constant if source is constant.
  • environment_variable_name (str): Name of the environment variable if source is environment_variable.
  • is_null (bool): True if source is is_null.
  • value: Value of the input.

Output

Get the output value of an executed pipeline identified by its execution_id.

CraftAiSdk.get_pipeline_execution_output(execution_id, output_name)

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 :

  • step_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_nullendpointorrun`.
  • endpoint_output_name (str): Name of the output in the endpoint ex- ecution if destination is endpoint.
  • is_null (bool): True if destination is is_null.
  • value: Value of the output.