Join the SIG TFX-Addons community and help make TFX even better!

tfx.orchestration.experimental.core.pipeline_state.PipelineState

Class for dealing with pipeline state. Can be used as a context manager.

pipeline

Methods

commit

View source

Commits pipeline state to MLMD if there are any mutations.

initiate_node_start

View source

Updates pipeline state to signal that a node should be started.

initiate_node_stop

View source

Updates pipeline state to signal that a node should be stopped.

initiate_stop

View source

Updates pipeline state to signal stopping pipeline execution.

load

View source

Loads pipeline state from MLMD.

Args
mlmd_handle A handle to the MLMD db.
pipeline_uid Uid of the pipeline state to load.

Returns
A PipelineState object.

Raises
status_lib.StatusNotOkError With code=NOT_FOUND if no active pipeline with the given pipeline uid exists in MLMD. With code=INTERNAL if more than 1 active execution exists for given pipeline uid.

load_from_orchestrator_context

View source

Loads pipeline state for active pipeline under given orchestrator context.

Args
mlmd_handle A handle to the MLMD db.
context Pipeline context under which to find the pipeline execution.

Returns
A PipelineState object.

Raises
status_lib.StatusNotOkError With code=NOT_FOUND if no active pipeline exists for the given context in MLMD. With code=INTERNAL if more than 1 active execution exists for given pipeline uid.

new

View source

Creates a PipelineState object for a new pipeline.

No active pipeline with the same pipeline uid should exist for the call to be successful.

Args
mlmd_handle A handle to the MLMD db.
pipeline IR of the pipeline.

Returns
A PipelineState object.

Raises
status_lib.StatusNotOkError If a pipeline with same UID already exists.

node_stop_initiated_reason

View source

Returns status object if node stop initiated, None otherwise.

remove_property

View source

Removes a custom property of the pipeline execution if exists.

save_property

View source

Saves a custom property to the pipeline execution.

stop_initiated_reason

View source

Returns status object if stop initiated, None otherwise.

update_pipeline_execution_state

View source

__enter__

View source

__exit__

View source