-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-258] Configure RunnableOnService tests for Flink runner #291
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
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
5e45de8
Add Window.Bound translator to Flink batch
kennknowles 95f915a
Add TestFlinkPipelineRunner to FlinkRunnerRegistrar
kennknowles c15be55
Configure RunnableOnService tests for Flink in batch mode
kennknowles 9071bbe
Fix Dangling Flink DataSets
aljoscha f76d09d
Add hamcrest dep to Flink Runner
aljoscha bdb77da
Fix Flink Create and GroupByNullKeyTest, Remove Special VoidSerializer
aljoscha 7ad190b
Fix faulty Flink Flatten with empty PCollectionList
aljoscha eddbbb1
Fix Flink Batch Partial Combine/Combine
aljoscha ba1e4d4
Disable MaybeEmptyTestITCase
aljoscha 2ac9998
Add RequiresFixedWindows test category
kennknowles 21614a1
Exclude RequiresFixedWindows test category from Flink batch tests
kennknowles ff7051f
Remove unused threadCount from integration tests
kennknowles 1df8038
Disable Flink streaming integration tests for now
kennknowles 155dc26
Special casing job exec AssertionError in TestFlinkPipelineRunner
kennknowles f418a22
Use Int instead of Void in Combine.globally default insertion
aljoscha 76450e8
Fix accumulator update in Flink Reduce Function
aljoscha bd404b0
Use Int instead of Void in Sample
aljoscha 76ae7a4
Use Int instead of Void in FlattenTest
aljoscha 0452755
Add RequiresTimestampControl category and tag some tests
kennknowles 29a7752
Exclude groups from Flink batch integration tests
kennknowles 1dc63f8
Fix checkstyle of FlattenTest
kennknowles 6a13182
Add RequiresTimestampControl to WithTimestampsTest
kennknowles 31cb37d
Temporarily disable failing Spark streaming tests
kennknowles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...ers/flink/runner/src/main/java/org/apache/beam/runners/flink/TestFlinkPipelineRunner.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.beam.runners.flink; | ||
|
|
||
| import org.apache.beam.sdk.Pipeline; | ||
| import org.apache.beam.sdk.options.PipelineOptions; | ||
| import org.apache.beam.sdk.options.PipelineOptionsFactory; | ||
| import org.apache.beam.sdk.options.PipelineOptionsValidator; | ||
| import org.apache.beam.sdk.runners.PipelineRunner; | ||
| import org.apache.beam.sdk.transforms.PTransform; | ||
| import org.apache.beam.sdk.values.PInput; | ||
| import org.apache.beam.sdk.values.POutput; | ||
|
|
||
| import org.apache.flink.runtime.client.JobExecutionException; | ||
|
|
||
| public class TestFlinkPipelineRunner extends PipelineRunner<FlinkRunnerResult> { | ||
|
|
||
| private FlinkPipelineRunner delegate; | ||
|
|
||
| private TestFlinkPipelineRunner(FlinkPipelineOptions options) { | ||
| // We use [auto] for testing since this will make it pick up the Testing ExecutionEnvironment | ||
| options.setFlinkMaster("[auto]"); | ||
| this.delegate = FlinkPipelineRunner.fromOptions(options); | ||
| } | ||
|
|
||
| public static TestFlinkPipelineRunner fromOptions(PipelineOptions options) { | ||
| FlinkPipelineOptions flinkOptions = PipelineOptionsValidator.validate(FlinkPipelineOptions.class, options); | ||
| return new TestFlinkPipelineRunner(flinkOptions); | ||
| } | ||
|
|
||
| public static TestFlinkPipelineRunner create(boolean streaming) { | ||
| FlinkPipelineOptions flinkOptions = PipelineOptionsFactory.as(FlinkPipelineOptions.class); | ||
| flinkOptions.setStreaming(streaming); | ||
| return TestFlinkPipelineRunner.fromOptions(flinkOptions); | ||
| } | ||
|
|
||
| @Override | ||
| public <OutputT extends POutput, InputT extends PInput> | ||
| OutputT apply(PTransform<InputT,OutputT> transform, InputT input) { | ||
| return delegate.apply(transform, input); | ||
| } | ||
|
|
||
| @Override | ||
| public FlinkRunnerResult run(Pipeline pipeline) { | ||
| try { | ||
| return delegate.run(pipeline); | ||
| } catch (RuntimeException e) { | ||
| // Special case hack to pull out assertion errors from PAssert; instead there should | ||
| // probably be a better story along the lines of UserCodeException. | ||
| if (e.getCause() != null | ||
| && e.getCause() instanceof JobExecutionException | ||
| && e.getCause().getCause() instanceof AssertionError) { | ||
| throw (AssertionError) e.getCause().getCause(); | ||
| } else { | ||
| throw e; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| public PipelineOptions getPipelineOptions() { | ||
| return delegate.getPipelineOptions(); | ||
| } | ||
| } | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davorbonaci @jasonkuster @lukecwik my maven-fu might be lacking. I think I can remove the
phaseandgoalshere, since the execution has an id, and maybe lift some of the configuration, but most importantly, I could not getrunnableOnServicePipelineOptionsto do anything, instead having to setbeamTestPipelineOptions. This seems mostly fine but please advise.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want to drop the whole plugin configuration and either:
I don't know if you need the executions block or not, I would think it would inherit it from plugin but could be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We definitely need two executions for now, since we need to pass
--streaming=trueand--streaming=false. It actually seems to confuse Jenkins, since the test class is duplicated. It probably will also confuse it with the direct runner and spark runner tests.For Flink and Spark, running against a local endpoint as a unit test (not really an integration test per se) is reasonable. We want to support both, so Jenkins can also run a real integration test against a cluster by overrides on the command line.