[Dataflow] Added Portable Runner alias to java runners#38411
[Dataflow] Added Portable Runner alias to java runners#38411TongruiLi wants to merge 2 commits intoapache:masterfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Dataflow runner configuration by introducing the 'enable_portable_runner' experiment. This change standardizes how Runner v2 is enabled and managed across the Java, Go, and Python SDKs, while also adding safeguards to prevent invalid configurations by explicitly flagging conflicting experiments like 'disable_portable_runner' and 'enable_streaming_java_runner'. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request integrates the "enable_portable_runner" experiment across the Java, Go, and Python SDKs to support Dataflow Runner v2. It also updates validation logic to include "disable_portable_runner" and "enable_streaming_java_runner". Review feedback highlights a logic error in the Java runner's automatic enablement condition, a typo in an experiment name in the Go SDK, and the need to update error messages to include the new experiments.
| if (DataflowRunner.isMultiLanguagePipeline(pipeline) || includesTransformUpgrades(pipeline)) { | ||
| List<String> experiments = firstNonNull(options.getExperiments(), Collections.emptyList()); | ||
| if (!experiments.contains("use_runner_v2")) { | ||
| if (!experiments.contains("use_runner_v2") || !experiments.contains("enable_portable_runner")) { |
There was a problem hiding this comment.
The logic here is incorrect. Using || with negated conditions (!A || !B) is equivalent to !(A && B), which means this block will execute if either experiment is missing. If a user has already provided use_runner_v2, they have explicitly enabled Runner v2, but this condition will still be true (because enable_portable_runner is missing), causing a misleading log message about "Automatically enabling" the runner. It should use && to only trigger if neither experiment is present.
| if (!experiments.contains("use_runner_v2") || !experiments.contains("enable_portable_runner")) { | |
| if (!experiments.contains("use_runner_v2") && !experiments.contains("enable_portable_runner")) { |
| if strings.Contains(e, "enable_portable_runner") { | ||
| portableRunnerSet = true | ||
| } | ||
| if strings.Contains(e, "disable_runner_v2") || strings.Contains(e, "disable_runner_v2_until_2023") || strings.Contains(e, "disable_prime_runner_v2") || strings.Contains(e, "disable_portable_runner") || strings.Contains(e, "enable_java_streaming_runner") { |
There was a problem hiding this comment.
There is a typo in the experiment name: enable_java_streaming_runner should be enable_streaming_java_runner to maintain consistency with the Java and Python SDKs and the PR description. This is also evidenced by the test case in dataflow_test.go which uses the correct name.
| if strings.Contains(e, "disable_runner_v2") || strings.Contains(e, "disable_runner_v2_until_2023") || strings.Contains(e, "disable_prime_runner_v2") || strings.Contains(e, "disable_portable_runner") || strings.Contains(e, "enable_java_streaming_runner") { | |
| if strings.Contains(e, "disable_runner_v2") || strings.Contains(e, "disable_runner_v2_until_2023") || strings.Contains(e, "disable_prime_runner_v2") || strings.Contains(e, "disable_portable_runner") || strings.Contains(e, "enable_streaming_java_runner") { |
| portableRunnerSet = true | ||
| } | ||
| if strings.Contains(e, "disable_runner_v2") || strings.Contains(e, "disable_runner_v2_until_2023") || strings.Contains(e, "disable_prime_runner_v2") || strings.Contains(e, "disable_portable_runner") || strings.Contains(e, "enable_java_streaming_runner") { | ||
| return nil, errors.New("detected one of the following experiments: disable_runner_v2 | disable_runner_v2_until_2023 | disable_prime_runner_v2. Disabling runner v2 is no longer supported as of Beam version 2.45.0+") |
There was a problem hiding this comment.
The error message should be updated to include the new experiments (disable_portable_runner and enable_streaming_java_runner) that now trigger this validation error.
| return nil, errors.New("detected one of the following experiments: disable_runner_v2 | disable_runner_v2_until_2023 | disable_prime_runner_v2. Disabling runner v2 is no longer supported as of Beam version 2.45.0+") | |
| return nil, errors.New("detected one of the following experiments: disable_runner_v2 | disable_runner_v2_until_2023 | disable_prime_runner_v2 | disable_portable_runner | enable_streaming_java_runner. Disabling runner v2 is no longer supported as of Beam version 2.45.0+") |
d9ddbfe to
b72ec0a
Compare
4e5003f to
30a8677
Compare
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
Added Portable Runner Passing for Java Runners. This includes the following experiment options
See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.