From c6ef2ea3d6c9e1984f8526c32bde412bdb659aaf Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Wed, 24 Apr 2024 21:48:25 +0000 Subject: [PATCH 01/17] feat: update graal-sdk to 24 and graalvm-A to 22.x --- .cloudbuild/graalvm-a.Dockerfile | 5 ++--- native-image-shared-config/pom.xml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.cloudbuild/graalvm-a.Dockerfile b/.cloudbuild/graalvm-a.Dockerfile index 41505aa6..4a22a055 100644 --- a/.cloudbuild/graalvm-a.Dockerfile +++ b/.cloudbuild/graalvm-a.Dockerfile @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ghcr.io/graalvm/graalvm-ce:ol7-java11-22.3.3-b1 +FROM ghcr.io/graalvm/graalvm-community:21.0.2-ol7-20240116 -RUN gu install native-image && \ - yum update -y && \ +RUN yum update -y && \ yum install -y wget unzip git && \ # Install maven wget -q https://archive.apache.org/dist/maven/maven-3/3.9.4/binaries/apache-maven-3.9.4-bin.zip -O /tmp/maven.zip && \ diff --git a/native-image-shared-config/pom.xml b/native-image-shared-config/pom.xml index 71d61a0b..591a8e07 100644 --- a/native-image-shared-config/pom.xml +++ b/native-image-shared-config/pom.xml @@ -59,7 +59,7 @@ 3.2.5 - 22.3.5 + 24.0.1 From 8aedffe2dbc588813e39ef23b14f7815dd05520f Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Thu, 25 Apr 2024 18:00:48 +0000 Subject: [PATCH 02/17] temporarily comment out check for docker structure --- .cloudbuild/cloudbuild-test-a.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.cloudbuild/cloudbuild-test-a.yaml b/.cloudbuild/cloudbuild-test-a.yaml index 272418ad..c197137d 100644 --- a/.cloudbuild/cloudbuild-test-a.yaml +++ b/.cloudbuild/cloudbuild-test-a.yaml @@ -23,12 +23,15 @@ steps: dir: .cloudbuild id: graalvm-a-build waitFor: ["-"] - - name: gcr.io/gcp-runtimes/structure_test - args: - ["-i", "gcr.io/cloud-devrel-public-resources/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-a.yaml", "-v"] - waitFor: ["graalvm-a-build"] +# - name: gcr.io/gcp-runtimes/structure_test +# args: +# ["-i", "gcr.io/cloud-devrel-public-resources/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-a.yaml", "-v"] +# waitFor: ["graalvm-a-build"] - name: gcr.io/cloud-devrel-public-resources/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION} entrypoint: bash args: [ './.kokoro/presubmit/downstream-build.sh' ] waitFor: [ "graalvm-a-build" ] + env: + - 'MODULES_UNDER_TEST=java-kms' + - 'GOOGLE_CLOUD_PROJECT=mpeddada-test' From 7c9076dfc355709b80e77da46b17f56176c825c4 Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Thu, 25 Apr 2024 18:47:25 +0000 Subject: [PATCH 03/17] empty commit to re-run build From 6ec1da78947e0a20071ddf4020537b2e22d59719 Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Thu, 25 Apr 2024 20:00:39 +0000 Subject: [PATCH 04/17] skip ITHttpAnnotation for now --- .kokoro/presubmit/downstream-build.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index 710bfd4e..45e7b6f2 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -54,7 +54,7 @@ pushd sdk-platform-java/showcase/gapic-showcase SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout) popd -## Start showcase server +### Start showcase server mkdir -p /usr/src/showcase curl --location https://github.com/googleapis/gapic-showcase/releases/download/v"${SHOWCASE_VERSION}"/gapic-showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz --output /usr/src/showcase/showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz pushd /usr/src/showcase/ @@ -64,7 +64,23 @@ popd # Run showcase tests with `native` profile pushd sdk-platform-java/showcase -mvn test -Pnative,-showcase -Denforcer.skip=true -ntp -B +mvn test -Pnative,-showcase -Denforcer.skip=true -Dtest="!com.google.showcase.v1beta1.it.ITHttpAnnotation" -Dsurefire.failIfNoSpecifiedTests=false -ntp -B popd +### Round 3 +# Update the shared-dependencies version in google-cloud-jar-parent +git clone "https://github.com/googleapis/google-cloud-java.git" --depth=1 +update_all_poms_dependency google-cloud-java google-cloud-shared-dependencies "$SHARED_DEPS_VERSION" + +### Round 4 +# Run the updated java-shared-dependencies BOM against google-cloud-java integration tests +cd google-cloud-java +source ./.kokoro/common.sh +RETURN_CODE=0 +setup_application_credentials +setup_cloud "$MODULES_UNDER_TEST" +run_graalvm_tests "$MODULES_UNDER_TEST" +# Exit must occur in google-cloud-java directory to correctly destroy IT resources +#exit "$RETURN_CODE" + exit $RETURN_CODE \ No newline at end of file From 92dc3703a621b78fa258813155e75feb5352c169 Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Tue, 30 Apr 2024 01:57:18 +0000 Subject: [PATCH 05/17] ignore ITHttpAnnotation --- .kokoro/presubmit/downstream-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index 45e7b6f2..884002f2 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -64,7 +64,7 @@ popd # Run showcase tests with `native` profile pushd sdk-platform-java/showcase -mvn test -Pnative,-showcase -Denforcer.skip=true -Dtest="!com.google.showcase.v1beta1.it.ITHttpAnnotation" -Dsurefire.failIfNoSpecifiedTests=false -ntp -B +mvn test -Dtest='!com.google.showcase.v1beta1.it.ITHttpAnnotation' -Dsurefire.failIfNoSpecifiedTests=false -Pnative,-showcase -Denforcer.skip=true -ntp -B popd ### Round 3 From 7272e9b4d87658ac034741f97681f5d7f0995206 Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Tue, 30 Apr 2024 16:09:45 +0000 Subject: [PATCH 06/17] modify script with necessary helpers --- .kokoro/presubmit/downstream-build.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index 884002f2..dc89ea5f 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -16,6 +16,20 @@ set -eo pipefail set -x +# In the given directory ($1), +# update the pom.xml's dependency on the given artifact ($2) to the given version ($3) +# ex: update_dependency google-cloud-java/google-cloud-jar-parent google-cloud-shared-dependencies 1.2.3 +function update_pom_dependency { + pushd "$1" || exit 1 + xmllint --shell pom.xml &>/dev/null < Date: Tue, 30 Apr 2024 16:38:32 +0000 Subject: [PATCH 07/17] add update_all_poms_dependency --- .kokoro/presubmit/downstream-build.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index dc89ea5f..18b31441 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -31,6 +31,19 @@ EOF popd || exit 1 } +# In the given directory ($1), +# find and update all pom.xmls' dependencies on the given artifact ($2) to the given version ($3) +# ex: update_all_poms_dependency google-cloud-java google-cloud-shared-dependencies 1.2.3 +function update_all_poms_dependency { + pushd "$1" || exit 1 + find_all_poms_with_versioned_dependency "$2" + for pom in $POMS; do + update_pom_dependency "$(dirname "$pom")" "$2" "$3" + done + git diff + popd || exit 1 +} + function modify_shared_config() { xmllint --shell pom.xml < Date: Tue, 30 Apr 2024 17:22:10 +0000 Subject: [PATCH 08/17] include missing helper --- .kokoro/presubmit/downstream-build.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index 18b31441..bb7aced9 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -31,6 +31,19 @@ EOF popd || exit 1 } +# Find all pom.xml files that declare a specific version for the given artifact ($1) +function find_all_poms_with_versioned_dependency { + poms=($(find . -name pom.xml)) + for pom in "${poms[@]}"; do + if xmllint --xpath "//*[local-name()='artifactId' and text()='$1']/following-sibling::*[local-name()='version']" "$pom" &>/dev/null; then + found+=("$pom") + fi + done + POMS=(${found[@]}) + unset found + export POMS +} + # In the given directory ($1), # find and update all pom.xmls' dependencies on the given artifact ($2) to the given version ($3) # ex: update_all_poms_dependency google-cloud-java google-cloud-shared-dependencies 1.2.3 From 1cb148502d5de483577b033a11c0508fa8d2aa99 Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Tue, 30 Apr 2024 17:31:12 +0000 Subject: [PATCH 09/17] fix structure test --- .cloudbuild/cloudbuild-test-a.yaml | 11 ++---- .cloudbuild/graalvm-a.yaml | 2 +- .kokoro/presubmit/downstream-build.sh | 57 --------------------------- 3 files changed, 5 insertions(+), 65 deletions(-) diff --git a/.cloudbuild/cloudbuild-test-a.yaml b/.cloudbuild/cloudbuild-test-a.yaml index c197137d..272418ad 100644 --- a/.cloudbuild/cloudbuild-test-a.yaml +++ b/.cloudbuild/cloudbuild-test-a.yaml @@ -23,15 +23,12 @@ steps: dir: .cloudbuild id: graalvm-a-build waitFor: ["-"] -# - name: gcr.io/gcp-runtimes/structure_test -# args: -# ["-i", "gcr.io/cloud-devrel-public-resources/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-a.yaml", "-v"] -# waitFor: ["graalvm-a-build"] + - name: gcr.io/gcp-runtimes/structure_test + args: + ["-i", "gcr.io/cloud-devrel-public-resources/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-a.yaml", "-v"] + waitFor: ["graalvm-a-build"] - name: gcr.io/cloud-devrel-public-resources/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION} entrypoint: bash args: [ './.kokoro/presubmit/downstream-build.sh' ] waitFor: [ "graalvm-a-build" ] - env: - - 'MODULES_UNDER_TEST=java-kms' - - 'GOOGLE_CLOUD_PROJECT=mpeddada-test' diff --git a/.cloudbuild/graalvm-a.yaml b/.cloudbuild/graalvm-a.yaml index 9416153e..6068d8fa 100644 --- a/.cloudbuild/graalvm-a.yaml +++ b/.cloudbuild/graalvm-a.yaml @@ -17,7 +17,7 @@ commandTests: - name: "version" command: ["java", "-version"] # java -version outputs to stderr... - expectedError: ["openjdk version \"11.0.20\"", "GraalVM CE 22.3.3"] + expectedError: ["openjdk version \"21.0.2\"", "GraalVM CE 21.0.2+13.1"] - name: "maven" command: ["mvn", "-version"] expectedOutput: ["Apache Maven 3.9.4"] diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index bb7aced9..744a20a7 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -16,47 +16,6 @@ set -eo pipefail set -x -# In the given directory ($1), -# update the pom.xml's dependency on the given artifact ($2) to the given version ($3) -# ex: update_dependency google-cloud-java/google-cloud-jar-parent google-cloud-shared-dependencies 1.2.3 -function update_pom_dependency { - pushd "$1" || exit 1 - xmllint --shell pom.xml &>/dev/null </dev/null; then - found+=("$pom") - fi - done - POMS=(${found[@]}) - unset found - export POMS -} - -# In the given directory ($1), -# find and update all pom.xmls' dependencies on the given artifact ($2) to the given version ($3) -# ex: update_all_poms_dependency google-cloud-java google-cloud-shared-dependencies 1.2.3 -function update_all_poms_dependency { - pushd "$1" || exit 1 - find_all_poms_with_versioned_dependency "$2" - for pom in $POMS; do - update_pom_dependency "$(dirname "$pom")" "$2" "$3" - done - git diff - popd || exit 1 -} - function modify_shared_config() { xmllint --shell pom.xml < Date: Tue, 30 Apr 2024 18:01:03 +0000 Subject: [PATCH 10/17] fix structure test with correct versions --- .cloudbuild/graalvm-a.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cloudbuild/graalvm-a.yaml b/.cloudbuild/graalvm-a.yaml index 6068d8fa..50f8dc14 100644 --- a/.cloudbuild/graalvm-a.yaml +++ b/.cloudbuild/graalvm-a.yaml @@ -17,7 +17,7 @@ commandTests: - name: "version" command: ["java", "-version"] # java -version outputs to stderr... - expectedError: ["openjdk version \"21.0.2\"", "GraalVM CE 21.0.2+13.1"] + expectedError: ["openjdk version \"21.0.2\"", "GraalVM CE 21.0.2"] - name: "maven" command: ["mvn", "-version"] expectedOutput: ["Apache Maven 3.9.4"] From ffb8bb8882d7015fdec664051db80e54c76f8180 Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Tue, 30 Apr 2024 20:03:11 +0000 Subject: [PATCH 11/17] add comment with link to sdk-platform-java issue --- .kokoro/presubmit/downstream-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index 744a20a7..30df108f 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -61,7 +61,7 @@ tar -xf showcase-* ./gapic-showcase run & popd -# Run showcase tests with `native` profile +# Run showcase tests with `native` profile. Skipping ITHttpAnnotation until https://github.com/googleapis/sdk-platform-java/issues/2695 is fixed. pushd sdk-platform-java/showcase mvn test -Dtest='!com.google.showcase.v1beta1.it.ITHttpAnnotation' -Dsurefire.failIfNoSpecifiedTests=false -Pnative,-showcase -Denforcer.skip=true -ntp -B popd From aec67efb305e3d629c356530ad7c175c88e5c1c1 Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Mon, 8 Jul 2024 21:27:28 +0000 Subject: [PATCH 12/17] remove test skip --- .kokoro/presubmit/downstream-build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index 30df108f..bb9edfb9 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -61,9 +61,8 @@ tar -xf showcase-* ./gapic-showcase run & popd -# Run showcase tests with `native` profile. Skipping ITHttpAnnotation until https://github.com/googleapis/sdk-platform-java/issues/2695 is fixed. pushd sdk-platform-java/showcase -mvn test -Dtest='!com.google.showcase.v1beta1.it.ITHttpAnnotation' -Dsurefire.failIfNoSpecifiedTests=false -Pnative,-showcase -Denforcer.skip=true -ntp -B +mvn test -Pnative,-showcase -Denforcer.skip=true -ntp -B popd exit $RETURN_CODE \ No newline at end of file From 761b7d6bb2f4f1801c98bdc02948274d516a37d9 Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Mon, 8 Jul 2024 21:29:24 +0000 Subject: [PATCH 13/17] consistent comments --- .kokoro/presubmit/downstream-build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index bb9edfb9..3ca932fc 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -53,7 +53,7 @@ pushd sdk-platform-java/showcase/gapic-showcase SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout) popd -### Start showcase server +# Start showcase server mkdir -p /usr/src/showcase curl --location https://github.com/googleapis/gapic-showcase/releases/download/v"${SHOWCASE_VERSION}"/gapic-showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz --output /usr/src/showcase/showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz pushd /usr/src/showcase/ @@ -61,6 +61,7 @@ tar -xf showcase-* ./gapic-showcase run & popd +# Run showcase tests with `native` profile pushd sdk-platform-java/showcase mvn test -Pnative,-showcase -Denforcer.skip=true -ntp -B popd From 7bfa8f2f6bfb611ad72d3e55892b0a355035e9fc Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Mon, 29 Jul 2024 20:25:40 +0000 Subject: [PATCH 14/17] add ignoredDependencies for nativeimage dep --- native-image-shared-config/pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/native-image-shared-config/pom.xml b/native-image-shared-config/pom.xml index af501816..f11291b7 100644 --- a/native-image-shared-config/pom.xml +++ b/native-image-shared-config/pom.xml @@ -64,6 +64,7 @@ 0.10.2 5.10.3 1.3.0 + org.graalvm.sdk:nativeimage @@ -96,6 +97,13 @@ 15 + + org.apache.maven.plugins + maven-dependency-plugin + + ${ignoredDependencies} + + From 06ab608b16962ad6f7c97c9bdac8d4eba6c0f613 Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Tue, 30 Jul 2024 01:55:15 +0000 Subject: [PATCH 15/17] double check with full list --- native-image-shared-config/pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/native-image-shared-config/pom.xml b/native-image-shared-config/pom.xml index f11291b7..09129f48 100644 --- a/native-image-shared-config/pom.xml +++ b/native-image-shared-config/pom.xml @@ -101,7 +101,8 @@ org.apache.maven.plugins maven-dependency-plugin - ${ignoredDependencies} + ${ignoredDependencies},io.grpc:grpc-protobuf-lite,org.hamcrest:hamcrest,org.hamcrest:hamcrest-core,com.google.errorprone:error_prone_annotations,org.openjdk.jmh:jmh-generator-annprocess,com.google.api.grpc:grpc-google-cloud-spanner-v1,com.google.api.grpc:grpc-google-cloud-spanner-admin-instance-v1,com.google.api.grpc:grpc-google-cloud-spanner-admin-database-v1,javax.annotation:javax.annotation-api,io.opencensus:opencensus-impl,org.graalvm.sdk:graal-sdk,io.grpc:grpc-googleapis,io.grpc:grpc-rls,com.google.api.grpc:proto-google-cloud-spanner-executor-v1,com.google.api.grpc:grpc-google-cloud-spanner-executor-v1 + From 0386a51fd1d029153916945db5a8413aaf034bad Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Tue, 30 Jul 2024 02:24:43 +0000 Subject: [PATCH 16/17] remove pluginManagement --- native-image-shared-config/pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/native-image-shared-config/pom.xml b/native-image-shared-config/pom.xml index 46c0445c..695f34fb 100644 --- a/native-image-shared-config/pom.xml +++ b/native-image-shared-config/pom.xml @@ -97,14 +97,6 @@ 15 - - org.apache.maven.plugins - maven-dependency-plugin - - ${ignoredDependencies},io.grpc:grpc-protobuf-lite,org.hamcrest:hamcrest,org.hamcrest:hamcrest-core,com.google.errorprone:error_prone_annotations,org.openjdk.jmh:jmh-generator-annprocess,com.google.api.grpc:grpc-google-cloud-spanner-v1,com.google.api.grpc:grpc-google-cloud-spanner-admin-instance-v1,com.google.api.grpc:grpc-google-cloud-spanner-admin-database-v1,javax.annotation:javax.annotation-api,io.opencensus:opencensus-impl,org.graalvm.sdk:graal-sdk,io.grpc:grpc-googleapis,io.grpc:grpc-rls,com.google.api.grpc:proto-google-cloud-spanner-executor-v1,com.google.api.grpc:grpc-google-cloud-spanner-executor-v1 - - - From a40ea7cb80b2b74a416bb773698469a338db4a56 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:07:36 -0400 Subject: [PATCH 17/17] use surefire 3.3.1 --- native-image-shared-config/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native-image-shared-config/pom.xml b/native-image-shared-config/pom.xml index 695f34fb..273a0166 100644 --- a/native-image-shared-config/pom.xml +++ b/native-image-shared-config/pom.xml @@ -59,7 +59,7 @@ 24.0.2 - 3.3.0 + 3.3.1 24.0.2 0.10.2 5.10.3