Skip to content

Commit

Permalink
Use 'local_pip_package_path' to install pip when the path refers to a…
Browse files Browse the repository at this point in the history
… remote file system (#6937)

* Use local_pip_package_path to install pip when the path refers to a remote file system

* Initialised local_pip_package_path

* Initialised local_pip_package_path to empty string

* Initialised local_pip_package_path to empty list

* Added additional list local_pip_packages

* Trimmed trailing whitespace
  • Loading branch information
janasangeetha authored Oct 23, 2024
1 parent 815bab3 commit 56eb0d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tfx/components/evaluator/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ def Do(self, input_dict: Dict[str, List[types.Artifact]],
# Make sure user packages get propagated to the remote Beam worker.
unused_module_path, extra_pip_packages = udf_utils.decode_user_module_key(
exec_properties.get(standard_component_specs.MODULE_PATH_KEY, None))
local_pip_packages = []
for pip_package_path in extra_pip_packages:
local_pip_package_path = io_utils.ensure_local(pip_package_path)
local_pip_packages.append(local_pip_package_path)
self._beam_pipeline_args.append('--extra_package=%s' %
local_pip_package_path)

Expand Down Expand Up @@ -241,7 +243,7 @@ def Do(self, input_dict: Dict[str, List[types.Artifact]],
# may be created by the Beam multi-process DirectRunner) can find the
# needed dependencies.
# TODO(b/187122662): Move this to the ExecutorOperator or Launcher.
with udf_utils.TempPipInstallContext(extra_pip_packages):
with udf_utils.TempPipInstallContext(local_pip_packages):
with self._make_beam_pipeline() as pipeline:
examples_list = []
tensor_adapter_config = None
Expand Down

0 comments on commit 56eb0d0

Please sign in to comment.