Skip to content

Commit

Permalink
Add pipeline_start_post_processing to Orchestrator env
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 620324534
  • Loading branch information
kmonte authored and tfx-copybara committed Apr 1, 2024
1 parent 6844762 commit 431fb1d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tfx/orchestration/experimental/core/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,21 @@ def set_health_status(self, status: status_lib.Status) -> None:
def check_if_can_orchestrate(self, pipeline: pipeline_pb2.Pipeline) -> None:
"""Check if this orchestrator is capable of orchestrating the pipeline."""

@abc.abstractmethod
def pipeline_start_post_processing(
self, pipeline: pipeline_pb2.Pipeline
) -> pipeline_pb2.Pipeline:
"""Method for processing a pipeline at the end of its initialization, before it starts running.
Does not mutate the input pipeline.
Args:
pipeline: The pipeline IR to process.
Returns:
The updated pipeline IR.
"""


class _DefaultEnv(Env):
"""Default environment."""
Expand Down Expand Up @@ -104,6 +119,11 @@ def set_health_status(self, status: status_lib.Status) -> None:
def check_if_can_orchestrate(self, pipeline: pipeline_pb2.Pipeline) -> None:
pass

def pipeline_start_post_processing(
self, pipeline: pipeline_pb2.Pipeline
) -> pipeline_pb2.Pipeline:
return pipeline


_ENV = _DefaultEnv()

Expand Down

0 comments on commit 431fb1d

Please sign in to comment.