mantlebio.core.pipeline_run.mantle_pipeline_run module#

class mantlebio.core.pipeline_run.mantle_pipeline_run.MantlePipelineRun(pipeline_run, session, storage_client, dataset_client)[source]#

Bases: _IPipelineRun

_build_pipeline_data(pipeline_data, data_class)[source]#

Generic function to build pipeline data.

Parameters:
  • pipeline_data (Dict[str, Any]) – Dictionary of pipeline data.

  • data_class – The protobuf class for either PipelineOutputs or PipelineInputs.

Return type:

Any

Returns:

An instance of data_class with populated data.

_build_pipeline_input(pipeline_inputs)[source]#

Build a PipelineInputs object from a dictionary of pipeline inputs.

Parameters:

pipeline_inputs (Dict[str, Any]) – Dictionary of pipeline input data.

Return type:

PipelineInputs

Returns:

PipelineInputs protobuf object.

_build_pipeline_kickoff(pipeline_id, pipeline_version='', external=False, inputs=None)[source]#
Return type:

PipelineKickOff

_build_pipeline_output(pipeline_outputs)[source]#

Build a PipelineOutputs object from a dictionary of pipeline outputs.

Parameters:

pipeline_outputs (Dict[str, Any]) – Dictionary of pipeline output data.

Return type:

PipelineOutputs

Returns:

PipelineOutputs protobuf object.

_build_pipeline_run_value(value)[source]#
Return type:

PipelineRunValue

_wrap_method(method)[source]#
add_entity_output(output_key, entity)[source]#
add_file_output(output_key, local_path)[source]#
add_folder_output(output_key, local_path_str)[source]#
add_input(key, value)[source]#

Add an input to the pipeline run

Parameters:
  • key (str) – Input key

  • value (Any) – Input value

Returns:

PipelineRun object

Return type:

PipelineRun

add_output(key, value)[source]#

Add an output to the pipeline run

Parameters:
  • key (str) – Output key

  • value (Any) – Output value

Returns:

PipelineRun object

Return type:

PipelineRun

add_s3_output(url, output_key)[source]#
get_id()[source]#
Return type:

str

get_input(key)[source]#

Get an input from the pipeline run

Parameters:

key (str) – Input key

Returns:

PipelineRunValue object

Return type:

PipelineRunValue

get_input_dataset(key)[source]#

Get a dataset from the pipeline run from an input key

Parameters:

key (str) – Input key

Returns:

Dataset object

Return type:

Dataset

get_input_dataset_list(key)[source]#

Get a list of datasets from the pipeline run that belong to a given input key

Parameters:

key (str) – Input key

Returns:

List of Dataset objects

Return type:

list

get_input_entities(key)[source]#
Return type:

Iterable[_IDataset]

get_input_entity(key)[source]#
Return type:

_IDataset

get_output(key)[source]#

Get an output from the pipeline run

Parameters:

key (str) – Output key

Returns:

PipelineRunValue object

Return type:

PipelineRunValue

get_output_dataset_list(key)[source]#
Return type:

Iterable[_IDataset]

get_output_entities(key)[source]#
Return type:

Iterable[_IDataset]

get_pipeline_id()[source]#
Return type:

str

get_pipeline_version()[source]#
Return type:

str

get_s3_input(key, local_path)[source]#

Pull a pipeline input from the pipeline run input

Return type:

None

get_unique_id()[source]#
Return type:

str

property pipeline_run_pb2: PipelineRun#
post_input(key, value)[source]#
post_output(key, value)[source]#
pull_entities_input(key)[source]#
Return type:

Optional[Iterable[_IDataset]]

pull_entity_input(key)[source]#
Return type:

Optional[_IDataset]

pull_input(key)[source]#

Pull a pipeline input from the pipeline run input

Return type:

PipelineRunValue

pull_output(key)[source]#

Pull a pipeline output from the pipeline run output

Return type:

PipelineRunValue

pull_s3_input(key, local_path)[source]#
Return type:

None

push_output(key, value)[source]#

Add an output to the pipeline run

Parameters:
  • key (str) – Output key

  • value (Any) – Output value

Returns:

PipelineRun proto object

Return type:

PipelineRun

update_status(status)[source]#

Update the status of a Pipeline Run

Parameters:

status (str) – Pipeline Status

Returns:

PipelineRun object

Return type:

PipelineRun

class mantlebio.core.pipeline_run.mantle_pipeline_run._IPipelineRun(pipeline_run, session, storage_client, dataset_client)[source]#

Bases: object

abstract _build_pipeline_data(pipeline_data, data_class)[source]#
Return type:

Any

abstract _build_pipeline_input(pipeline_inputs)[source]#
Return type:

PipelineInputs

abstract _build_pipeline_kickoff(pipeline_id, pipeline_version='', external=False, inputs=None)[source]#
Return type:

PipelineKickOff

abstract _build_pipeline_output(pipeline_outputs)[source]#
Return type:

PipelineOutputs

abstract _build_pipeline_run_value(value)[source]#
Return type:

PipelineRunValue

abstract add_dataset_output(output_key, dataset)[source]#
abstract add_entity_output(output_key, entity)[source]#
abstract add_file_output(output_key, local_path)[source]#
abstract add_folder_output(output_key, local_path_str)[source]#
abstract add_input(key, value)[source]#
abstract add_output(key, value)[source]#
abstract add_s3_output(url, output_key)[source]#
abstract get_id()[source]#
Return type:

str

abstract get_input(key)[source]#
Return type:

Union[PipelineRunValue, _IDataset]

abstract get_input_dataset(key)[source]#
Return type:

_IDataset

abstract get_input_dataset_list(key)[source]#
Return type:

Iterable[_IDataset]

abstract get_input_entities(key)[source]#
Return type:

Iterable[_IDataset]

abstract get_input_entity(key)[source]#
Return type:

_IDataset

abstract get_output(key)[source]#
Return type:

Union[PipelineRunValue, _IDataset]

abstract get_output_dataset_list(key)[source]#
Return type:

Iterable[_IDataset]

abstract get_output_entities(key)[source]#
Return type:

Iterable[_IDataset]

abstract get_pipeline_id()[source]#
Return type:

str

abstract get_pipeline_version()[source]#
Return type:

str

abstract get_s3_input(key, local_path)[source]#
Return type:

None

abstract get_unique_id()[source]#
Return type:

str

pipeline_run_pb2#
abstract post_input(key, value)[source]#
abstract post_output(key, value)[source]#
abstract pull_entities_input(key)[source]#
Return type:

Optional[Iterable[_IDataset]]

abstract pull_entity_input(key)[source]#
Return type:

Optional[_IDataset]

abstract pull_input(key)[source]#
Return type:

PipelineRunValue

abstract pull_output(key)[source]#
Return type:

PipelineRunValue

abstract pull_s3_input(key, local_path)[source]#
Return type:

None

abstract push_output(key, value)[source]#
abstract update_status(status)[source]#