Skip to content

[BEAM-10670] Use non-SDF based translation for Read by default on all runners except Dataflow - #14801

Merged
boyuanzz merged 1 commit into
apache:masterfrom
boyuanzz:read_again
May 19, 2021
Merged

[BEAM-10670] Use non-SDF based translation for Read by default on all runners except Dataflow#14801
boyuanzz merged 1 commit into
apache:masterfrom
boyuanzz:read_again

Conversation

@boyuanzz

Copy link
Copy Markdown
Contributor

Applied the same logic as #14755 except Dataflow

R: @kennknowles@iemejia
cc: @ibzib@lukecwik

Please add a meaningful description for your change here


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

ValidatesRunner compliance status (on master branch)

LangULRDataflowFlinkSamzaSparkTwister2
Go---Build StatusBuild Status---Build Status---
JavaBuild StatusBuild Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build StatusBuild Status
Build Status
Build Status
Build Status
Python---Build Status
Build Status
Build Status
Build Status
Build Status
---Build Status---
XLangBuild StatusBuild StatusBuild Status---Build Status---

Examples testing status on various runners

LangULRDataflowFlinkSamzaSparkTwister2
Go---------------------
Java---Build Status
Build Status
Build Status
---------------
Python---------------------
XLang---------------------

Post-Commit SDK/Transform Integration Tests Status (on master branch)

GoJavaPython
Build StatusBuild StatusBuild Status
Build Status
Build Status

Pre-Commit Tests Status (on master branch)

---JavaPythonGoWebsiteWhitespaceTypescript
Non-portableBuild Status
Build Status
Build Status
Build Status
Build Status
Build StatusBuild StatusBuild StatusBuild Status
Portable---Build StatusBuild Status---------

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@boyuanzz
boyuanzzforce-pushed the read_again branch 2 times, most recently from 13f6e02 to 89489f7CompareMay 12, 2021 22:27

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xinyuiscool is this issue something that affects you or that you have noticed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pulasthi is this issue something that affects you or that you have noticed?

@boyuanzz

Copy link
Copy Markdown
ContributorAuthor

Unfortunately, adding io-kafka into direct-runner will cause circular dependency.

@iemejia

Copy link
Copy Markdown
Member

You may solve the circular dependency issue and the need for the extra dependency on runners by giving the specific Kafka transform a stable URN and then do the translation override via URNs (see for example how they do for PTransformTranslation.READ_TRANSFORM_URN).

@boyuanzz

Copy link
Copy Markdown
ContributorAuthor

READ_TRANSFORM_URN

I'm hesitated to do so because ReadFromKafkaViaSDF should just be a normal DoFn. One way I'm thinking about is to always populate beam_fn_api_use_deprecated_read and use_deprecated_read when use_sdf_read is not specified. beam_fn_api_use_deprecated_read and use_deprecated_read control the KafkaIO expansion directly.

@boyuanzz
boyuanzzforce-pushed the read_again branch 4 times, most recently from bc5e86f to 645defdCompareMay 14, 2021 03:31
Comment threadrunners/flink/flink_runner.gradle Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth to add the TODOs to remove this once SDF is fixed because it does not make sense that runners depend on IOs at least not for non test scopes

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Added TODO all build files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One way I'm thinking about is to always populate beam_fn_api_use_deprecated_read and use_deprecated_read when use_sdf_read is not specified.

I think the method mentioned above might be a better way to do this since we could avoid the io dependency on runners.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually populating experiments from runner is the least preferred one for me. With applying override utils from transform directly, we will have a centralized place to change the logic if needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it makes sense. But I still prefer to not introduce the additional io dependency to runners given that this change is temporary and will be reverted soon once we fix the performance issue (I'm not totally against the current implementation though so it's good to go if other folks don't have any preference).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really want this to move on but I have to say that I agree with @ihji, another reason is that adding the KafkaIO dependency to almost all runners will bring a lot of the extra baggage that KafkaIO has including extra confluent and spring dependencies that will leak into the user system's classpath and can produce conflicts.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to populating experiments directly.

@boyuanzz
boyuanzzforce-pushed the read_again branch 5 times, most recently from 3a0f299 to fb76672CompareMay 18, 2021 23:49
@boyuanzz

Copy link
Copy Markdown
ContributorAuthor

@ihji Heejong, would you like to take another look?

@ihjiihji left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@Override
public PipelineResult run(Pipeline pipeline) {
SplittableParDo.convertReadBasedSplittableDoFnsToPrimitiveReadsIfNecessary(pipeline);
// Portable flink only support SDF as read.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A side question: does this mean that portable Flink doesn't currently support "use_deprecated_read" flag? What happens if we specify "use_deprecated_read" for portable Flink? Runtime error?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no deprecated read under beam_fn_api context. Splittable DoFn is the only source-like operation when with beam_fn_api. So if a fnapi job is using deprecated read, there is no runtime error but the pipeline will just stuck.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But good part is that I don't think we have many fnapi usages on OSS runners.

@boyuanzz
boyuanzz merged commit 2d37477 into apache:masterMay 19, 2021
@boyuanzz

Copy link
Copy Markdown
ContributorAuthor

I'll open a cherry-pick as well.

@iemejia

Copy link
Copy Markdown
Member

Thanks @boyuanzz for working on this!

@ibzib

Copy link
Copy Markdown

I think this broke Spark postcommits: BEAM-12374

@boyuanzz

Copy link
Copy Markdown
ContributorAuthor

I think this broke Spark postcommits: BEAM-12374

Yeah I'm looking into it now and I should have a fix today.

@boyuanzz

Copy link
Copy Markdown
ContributorAuthor

Sorry that I misunderstood the execution of Transform.expand(). The transform expansion happens during applying a PTransform to a certain PCollection before we calling runner.run(pipeline). So populating experiments doesn't work for our need. Another way I'm thinking about is to have KafkaIO run expansion based on the given runner. It can be done via checking runner class prefix.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@boyuanzz@iemejia@ibzib@ihji@kennknowles