[prism] Dev prism builds for python and Python Direct Runner fallbacks.
This change does two tasks:
- Enables Python SDK developers to have prism automatically build and run locally using local changes to Prism when using PrismRunner.
- Sets Prism to be attempted to be used in the Python DirectRunner in some circumstances.
The main change is to the prism_runner behavior when the SDK reports a .dev version.
In that case:
- Try to
go install github.com/apache/beam/sdks/v2/go/cmd/prismto the binary cache directory. - If that doesn't succeed, inspect the output for module errors
- If there are no module errors, then the local version of prism couldn't compile, OR go isn't installed. Either way, this is a developer addressable error.
- If there are module errors, then those modules don't have access to a version of Beam Go, so instead install the latest released version of prism.
- This can be avoided by having a go.work file set up to direct Beam to a local version of the beam repo. This will be documented in a forthcoming SDK Development guide.
Arguably independently, is Attempt To Use Prism in the direct runner.
- This currently only happens if we can't use the FnAPI runner.
- If Prism fails on receiving the job, on job submission, then fallback to the DirectRunner instead.
Other changes are a refactor to reverse a few if blocks and return earlier, improving readability and reducing indentations.
Part of #32564
Fixes #32877.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] 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, commentfixes #<ISSUE NUMBER>instead. - [ ] Update
CHANGES.mdwith 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)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.
Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:
R: @damccorm for label python.
Available commands:
stop reviewer notifications- opt out of the automated review toolingremind me after tests pass- tag the comment author after tests passwaiting on author- shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
The PR bot will only process comments in the main thread (not review comments).
I discovered the root of my problem was using a newer yapf than Beam does, (0.40, instead of 0.29), so now I can have the formatting enabled on save, which will help! Local Linting on the other hand eludes me. I'm fortunately not tickling that as often.