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

[BEAM-11607] Add word count tasks #14467

Merged
merged 6 commits into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,13 @@ task("pushAllDockerImages") {
}
}

// Use this task to validate the environment set up for Go, Python and Java
task("checkSetup") {
dependsOn(":sdks:go:examples:wordCount")
dependsOn(":sdks:python:wordCount")
dependsOn(":examples:java:wordCount")
}

// Configure the release plugin to do only local work; the release manager determines what, if
// anything, to push. On failure, the release manager can reset the branch without pushing.
release {
Expand Down
9 changes: 9 additions & 0 deletions examples/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,12 @@ task execute (type:JavaExec) {
systemProperties System.getProperties()
args System.getProperty("exec.args", "").split()
}

// Run this task to validate the Java environment setup for contributors
task wordCount(type:JavaExec) {
isidroamv marked this conversation as resolved.
Show resolved Hide resolved
description "Run the Java word count example"
main = "org.apache.beam.examples.WordCount"
classpath = sourceSets.main.runtimeClasspath
systemProperties = System.getProperties()
args = ["--output=/tmp/ouput.txt"]
}
7 changes: 7 additions & 0 deletions sdks/go/examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,10 @@ golang {
continueOnFailure = true
}
}

// Run this task to validate the Go environment setup for contributors
task wordCount(type: com.github.blindpirate.gogradle.Go) {
description "Run the Go word count example"
dependsOn goVendor
go 'build -o ./build/bin/${GOOS}_${GOARCH}/wordcount github.com/apache/beam/sdks/go/examples/wordcount'
}
12 changes: 12 additions & 0 deletions sdks/python/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,15 @@ task startPortableRunner {
}
}
}

// Run this task to validate the python environment setup for contributors
task wordCount {
description "Run the Python word count example"
dependsOn 'installGcpTest'
doLast {
exec {
executable 'sh'
args '-c', ". ${envdir}/bin/activate && python -m apache_beam.examples.wordcount --runner DirectRunner --output /tmp/output.txt"
}
}
}