Skip to content

Commit

Permalink
Fixes unintentional dependencies overriding in KFP container entrypoint.
Browse files Browse the repository at this point in the history
After #1699 we're always using an ephemeral package that encodes the TFX dependency when running on Dataflow, so this additional argument is no longer needed in KFP entrypoint.

Closes #1696

PiperOrigin-RevId: 309082184
  • Loading branch information
tfx-copybara committed May 1, 2020
1 parent e7c7cf8 commit d52862f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
2 changes: 2 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* Removed `python-snappy` from `[all]` extra dependency list.
* Tests depends on `apache-airflow>=1.10.10,<2`;
* Removed test dependency to tzlocal.
* Fixes unintentional overriding of user-specified setup.py file for Dataflow
jobs when running on KFP container.

### Deprecations

Expand Down
24 changes: 1 addition & 23 deletions tfx/orchestration/kubeflow/container_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,28 +115,6 @@ def _get_grpc_metadata_connection_config(
return connection_config


def _make_beam_pipeline_args(json_beam_pipeline_args: Text) -> List[Text]:
"""Constructs beam_pipeline_args for ComponentLauncher.
Args:
json_beam_pipeline_args: JSON serialized list of beam pipeline args.
Returns:
List containing `beam_pipeline_args`.
"""
beam_pipeline_args = json.loads(json_beam_pipeline_args)

# Ensure beam pipelines args has a setup.py file so we can use
# DataflowRunner.
module_dir = os.environ['TFX_SRC_DIR']
setup_file = os.path.join(module_dir, 'setup.py')
absl.logging.info('Using setup_file \'%s\' to capture TFX dependencies',
setup_file)
beam_pipeline_args.append('--setup_file={}'.format(setup_file))

return beam_pipeline_args


def _sanitize_underscore(name: Text) -> Text:
"""Sanitize the underscore in pythonic name for markdown visualization."""
if name:
Expand Down Expand Up @@ -350,7 +328,7 @@ def main():
_get_metadata_connection_config(kubeflow_metadata_config))
driver_args = data_types.DriverArgs(enable_cache=args.enable_cache)

beam_pipeline_args = _make_beam_pipeline_args(args.beam_pipeline_args)
beam_pipeline_args = json.loads(args.beam_pipeline_args)

additional_pipeline_args = json.loads(args.additional_pipeline_args)

Expand Down

0 comments on commit d52862f

Please sign in to comment.