-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-431] Move example dependency on runners into a profile #609
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
Conversation
Even an optional runtime dependency, such as from the examples to a runner, does get pulled in for testing. This meant that all the dependencies for all runners had to be resolvable in an integration testing context. It is quite inconvient. Explicitly excluding runners via flags such as `-pl !runners/spark` does not work since it causes errors in dependency resolution. This change adds a profile, active by default, that can be explicitly disabled to avoid pulling in dependencies.
|
I'd love to lift this up to the parent module, since it applies to both examples, but the way profiles are activated the Java 8 profile would turn it off and break the idea. But I hesitated to actually copy/paste it into the Java 7 examples module. And anyhow, the Java 7 examples have bigger issues, such as an actual compile-time dep on the Dataflow runner and also a cyclic dependency on the Spark runner until #539 is completed. After #539, a trivial activation like JDK 1.4+ might be a way to have "active by default" that is not automatically deactivated. |
|
Looks good to me! |
|
LGTM |
|
I think this needs a little more thought. Can we at least put each runner
|
|
I agree with the spirit, @dhalperi, but actually have a different perspective: The runners are not real dependencies of these runner-agnostic Beam examples, but a hack for convenient interactive use of this maven module by users who are exploring. It isn't really about enabling/disabling runners. So it is the build without this new profile that is accurately configured. Hence there is a use case for surgically adding runners to the classpath (via the standard dependency mechanisms) but not for surgically removing them; the latter assumes a configuration that is somewhat erroneous by default. It would actually be pretty ideal to have a profile activation that was specifically "interactive command line use" but I don't know if there is a clever way to make that happen. |
Source-Link: googleapis/synthtool@d2871d9 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b2dc5f80edcf5d4486c39068c9fa11f7f851d9568eea4dcba130f994ea9b5e97 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
[BEAM-<Jira issue #>] Description of pull requestmvn clean verify. (Even better, enableTravis-CI on your fork and ensure the whole test matrix passes).
<Jira issue #>in the title with the actual Jira issuenumber, if there is one.
Individual Contributor License Agreement.
Even an optional runtime dependency, such as from the examples
to a runner, does get pulled in for testing. This meant that
all the dependencies for all runners had to be resolvable in an
integration testing context. It is quite inconvenient.
Explicitly excluding runners via flags such as
-pl !runners/sparkdoes not work since it causes errors in dependency resolution.
This change adds a profile, active by default, that can be
explicitly disabled to avoid pulling in dependencies.