[
https://issues.apache.org/jira/browse/BEAM-4129?focusedWorklogId=94442&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-94442
]
ASF GitHub Bot logged work on BEAM-4129:
----------------------------------------
Author: ASF GitHub Bot
Created on: 24/Apr/18 03:40
Start Date: 24/Apr/18 03:40
Worklog Time Spent: 10m
Work Description: kennknowles closed pull request #5200: [BEAM-4129] Run
WordCount example on Gearpump runner with Gradle
URL: https://github.com/apache/beam/pull/5200
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/release/src/main/groovy/quickstart-java-gearpump.groovy
b/release/src/main/groovy/quickstart-java-gearpump.groovy
new file mode 100644
index 00000000000..85f2d23f476
--- /dev/null
+++ b/release/src/main/groovy/quickstart-java-gearpump.groovy
@@ -0,0 +1,43 @@
+#!groovy
+/*
+ * 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.
+ */
+
+t = new TestScripts(args)
+
+/*
+ * Run the Gearpump quickstart from
https://beam.apache.org/get-started/quickstart-java/
+ */
+
+t.describe 'Run Apache Beam Java SDK Quickstart - Gearpump'
+
+t.intent 'Gets the WordCount Example Code'
+QuickstartArchetype.generate(t)
+
+t.intent 'Runs the WordCount Code with Gearpump runner'
+// Run the wordcount example with the gearpump runner
+t.run """mvn compile exec:java -q \
+ -Dexec.mainClass=org.apache.beam.examples.WordCount \
+ -Dexec.args="--inputFile=pom.xml --output=counts \
+ --runner=TestGearpumpRunner" -Pgearpump-runner"""
+
+// Verify text from the pom.xml input file
+String result = t.run "grep Foundation counts*"
+t.see "Foundation: 1", result
+
+// Clean up
+t.done()
diff --git a/runners/gearpump/README.md b/runners/gearpump/README.md
deleted file mode 100644
index d447d1b25a1..00000000000
--- a/runners/gearpump/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-<!--
- 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.
--->
-
-## Gearpump Beam Runner
-
-The Gearpump Beam runner allows users to execute pipelines written using the
Apache Beam programming API with Apache Gearpump (incubating) as an execution
engine.
-
-##Getting Started
-
-The following shows how to run the WordCount example that is provided with the
source code on Beam.
-
-###Installing Beam
-
-To get the latest version of Beam with Gearpump-Runner, first clone the Beam
repository:
-
-```
-git clone https://github.com/apache/beam
-git checkout gearpump-runner
-```
-
-Then run Gradle to build Apache Beam:
-
-```
-./gradlew :beam-runners-gearpump:build
-```
-
-###Running Wordcount Example
-
-Download something to count:
-
-```
-curl http://www.gutenberg.org/cache/epub/1128/pg1128.txt > /tmp/kinglear.txt
-```
-
-> Note: There is an open issue to update this README for Gradle:
-[BEAM-4129](https://issues.apache.org/jira/browse/BEAM-4129).
-
-Run the pipeline, using the Gearpump runner:
-
-```
-cd examples/java
-mvn exec:java -Dexec.mainClass=org.apache.beam.examples.WordCount
-Dexec.args="--inputFile=/tmp/kinglear.txt --output=/tmp/wordcounts.txt
--runner=TestGearpumpRunner" -Pgearpump-runner
-```
-
-Once completed, check the output file /tmp/wordcounts.txt-00000-of-00001
diff --git a/runners/gearpump/build.gradle b/runners/gearpump/build.gradle
index c85d5cf7340..06007ca1534 100644
--- a/runners/gearpump/build.gradle
+++ b/runners/gearpump/build.gradle
@@ -86,3 +86,5 @@ task validatesRunner {
description "Validates Gearpump runner"
dependsOn validatesRunnerStreaming
}
+
+createJavaExamplesArchetypeValidationTask(type: 'Quickstart', runner:
'Gearpump')
\ No newline at end of file
diff --git
a/sdks/java/maven-archetypes/examples/src/main/resources/archetype-resources/pom.xml
b/sdks/java/maven-archetypes/examples/src/main/resources/archetype-resources/pom.xml
index 4ccedca5bbf..dcd9748311a 100644
---
a/sdks/java/maven-archetypes/examples/src/main/resources/archetype-resources/pom.xml
+++
b/sdks/java/maven-archetypes/examples/src/main/resources/archetype-resources/pom.xml
@@ -295,6 +295,17 @@
</dependency>
</dependencies>
</profile>
+ <profile>
+ <id>gearpump-runner</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.beam</groupId>
+ <artifactId>beam-runners-gearpump</artifactId>
+ <version>${beam.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </profile>
</profiles>
<dependencies>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 94442)
Time Spent: 50m (was: 40m)
> Update Gearpump runner instructions for running WordCount example
> -----------------------------------------------------------------
>
> Key: BEAM-4129
> URL: https://issues.apache.org/jira/browse/BEAM-4129
> Project: Beam
> Issue Type: Sub-task
> Components: runner-gearpump
> Reporter: Scott Wegner
> Assignee: Manu Zhang
> Priority: Minor
> Time Spent: 50m
> Remaining Estimate: 0h
>
> With the move to Gradle, the Gearpump README.md needs to be updated with
> instructions on how to execute WordCount with the new build system.
> [https://github.com/apache/beam/blob/master/runners/gearpump/README.md]
>
> It may be easiest to generate a quickstart task similar to other runners:
> https://github.com/apache/beam/blob/3cdecd0e3e28dd39990d7d1dea8931e871a6ba62/runners/flink/build.gradle#L135
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)