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-12422][no need to review] Testing BEAM-12422 by installing the vendored gRPC to local Maven repository #15103

Closed
wants to merge 2 commits into from
Closed
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
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",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR runs test with the new version of the vendored gRPC (this hasn't been published to Maven Central yet)

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