Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use existing pickle_library flag in expansion service. #23111

Merged
merged 2 commits into from
Sep 9, 2022

Conversation

robertwb
Copy link
Contributor

@robertwb robertwb commented Sep 8, 2022


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).
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • 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.

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)

Build python source distribution and wheels
Python tests
Java tests
Go tests

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

@robertwb
Copy link
Contributor Author

robertwb commented Sep 8, 2022

R: @tvalentyn

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2022

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Merging #23111 (36d5085) into master (70f8728) will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           master   #23111   +/-   ##
=======================================
  Coverage   73.58%   73.58%           
=======================================
  Files         716      716           
  Lines       95301    95300    -1     
=======================================
+ Hits        70125    70127    +2     
+ Misses      23880    23877    -3     
  Partials     1296     1296           
Flag Coverage Δ
python 83.40% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...beam/runners/portability/expansion_service_main.py 0.00% <0.00%> (ø)
sdks/python/apache_beam/runners/common.py 88.59% <0.00%> (-0.13%) ⬇️
...hon/apache_beam/runners/worker/bundle_processor.py 93.54% <0.00%> (+0.12%) ⬆️
sdks/python/apache_beam/transforms/combiners.py 93.43% <0.00%> (+0.38%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

pickler.set_library(known_args.default_pickler)
# Set this before any pipeline construction occurs.
# See https://github.com/apache/beam/issues/21615
pickler.set_library(pipeline_options.view_as(SetupOptions).pickle_library)
Copy link
Contributor

Choose a reason for hiding this comment

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

How early in construction does this code get called? If its early enough it should resolve the issue of needing to set the pickle library as well as the pipeline options.

Copy link
Contributor

@tvalentyn tvalentyn Sep 9, 2022

Choose a reason for hiding this comment

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

looks like it is called right at the entrypoint of the expansion service (the process that will be responsible for expanding an external python transform to incorporate into a Java pipeline).

@@ -449,8 +449,7 @@ public OutputT expand(InputT input) {
} else {
int port = PythonService.findAvailablePort();
ImmutableList.Builder<String> args = ImmutableList.builder();
args.add(
"--port=" + port, "--fully_qualified_name_glob=*", "--default_pickler=cloudpickle");
args.add("--port=" + port, "--fully_qualified_name_glob=*", "--pickle_library=cloudpickle");
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also curious if this will break a bunch of tests. Maybe in the portable version of beam it is fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

this only applies to external transforms where Python transform is called from Java. this is new functionality and there are not a lot of tests to break.

@tvalentyn
Copy link
Contributor

@robertwb do we need to run some postcommit tests that exercise the relevant XLang functionality?

@robertwb
Copy link
Contributor Author

robertwb commented Sep 9, 2022

Run XVR_Direct PostCommit

Copy link
Contributor

@ryanthompson591 ryanthompson591 left a comment

Choose a reason for hiding this comment

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

SG. Thanks for answering my concerns valentyn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants