code: def _make_pipeline_proto(
      pipeline: pipeline_py.Pipeline,
  ) -> pipeline_pb2.Pipeline:
      """Resolve pip dependencies and compile Pipeline object."""
      if isinstance(pipeline, pipeline_pb2.Pipeline):
          raise ValueError(
              'The "run" method, which is only meant for running Pipeline objects, '
              "was called with a Pipeline IR. Did you mean to call the "
              '"run_with_ir" method instead?'
          )
      for component in pipeline.components:
          # TODO(b/187122662): Pass through pip dependencies as a first-class
          # component flag.
          if isinstance(component, base_component.BaseComponent):
              component._resolve_pip_dependencies(  # pylint: disable=protected-access
                  pipeline.pipeline_info.pipeline_root
              )
      return compiler.Compiler().compile(pipeline)
  
file_path: tfx/tfx/orchestration/portable/tfx_runner.py
imports: import abc
  from typing import Any, Optional
  from tfx.dsl.compiler import compiler
  from tfx.dsl.components.base import base_component
  from tfx.orchestration import pipeline
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import doc_controls
label_desc: Use image node_id 1 for calling a global function with example usage: _make_pipeline_proto(pipeline) and returns: compiler