Skip to content

Commit

Permalink
[BEAM-12422] Locally-installing vendored gRPC 1.36.0-0.2
Browse files Browse the repository at this point in the history
This commit is not intended to be merged into master.

This commit installs the vendored gRPC 1.36.0-0.2 to local
Maven repository and runs the tests against the version.
  • Loading branch information
suztomo committed Jun 30, 2021
1 parent 5690af7 commit 6ed8c01
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .test-infra/validate-runner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ repositories {
maven {
url "https://packages.confluent.io/maven/"
}
// Maven local is not needed. Just for vendored gRPC testing
mavenLocal()
}

dependencies {
Expand Down
34 changes: 34 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.tools.ant.taskdefs.condition.Os
import java.nio.file.Paths

plugins {
base
Expand Down Expand Up @@ -358,6 +360,38 @@ release {
}
}

// TODO: Do not merge this to master
task("installVendoredGrpc") {
dependsOn(":vendor:grpc-1_36_0:shadowJar")

doLast {
val jenkinsMvn = "/home/jenkins/tools/maven/apache-maven-3.5.4/bin/mvn"
val executable = if (file(jenkinsMvn).canExecute()) jenkinsMvn else (
if (Os.isFamily(Os.FAMILY_WINDOWS)) "mvn.cmd" else "mvn"
)
val jar = Paths.get("vendor","grpc-1_36_0","build","libs","beam-vendor-grpc-1_36_0-0.2.jar")
project.exec {
commandLine = listOf(
executable, "--batch-mode",
"install:install-file", "-Dpackaging=jar",
"-DgroupId=org.apache.beam", "-DartifactId=beam-vendor-grpc-1_36_0",
"-Dversion=0.2", "-Dfile=$jar"
)
}
}
}

// Because :model:job-management:runtimeClasspath requires the vendored gRPC at configuration phase
// (before execution phase), we cannot rely on task dependencies.
if (!project.hasProperty("installVendoredGrpcFlag")) {
val executable = if (Os.isFamily(Os.FAMILY_WINDOWS)) "gradlew.bat" else "./gradlew"
project.exec {
commandLine = listOf(
executable, ":installVendoredGrpc", "-PinstallVendoredGrpcFlag", "--info", "--stacktrace"
)
}
}

// Reports linkage errors across multiple Apache Beam artifact ids.
//
// To use (from the root of project):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ class BeamModulePlugin implements Plugin<Project> {
testcontainers_postgresql : "org.testcontainers:postgresql:$testcontainers_version",
testcontainers_gcloud : "org.testcontainers:gcloud:$testcontainers_version",
vendored_bytebuddy_1_11_0 : "org.apache.beam:beam-vendor-bytebuddy-1_11_0:0.1",
vendored_grpc_1_36_0 : "org.apache.beam:beam-vendor-grpc-1_36_0:0.1",
vendored_grpc_1_36_0 : "org.apache.beam:beam-vendor-grpc-1_36_0:0.2",
vendored_guava_26_0_jre : "org.apache.beam:beam-vendor-guava-26_0-jre:0.1",
vendored_calcite_1_20_0 : "org.apache.beam:beam-vendor-calcite-1_20_0:0.1",
woodstox_core_asl : "org.codehaus.woodstox:woodstox-core-asl:4.4.1",
Expand Down

0 comments on commit 6ed8c01

Please sign in to comment.