From dc3b9a69f64b6189996e84e74ae2283fb4a3f383 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Mon, 14 Apr 2025 16:38:51 +0000 Subject: [PATCH 1/2] chore: demo of changes from sdk-platform-java#3737 See [sdk-platform-java#3737](https://github.com/googleapis/sdk-platform-java/pull/3737) for more context. TL;DR: we are introducing an additional Kokoro job to run native tests against GraalVM for JDK 17.0.9 --- .github/generated-files-bot.yml | 1 + .github/scripts/update_generation_config.sh | 11 +++++- .github/trusted-contribution.yml | 6 +++ .github/workflows/renovate_config_check.yaml | 4 +- .../workflows/update_generation_config.yaml | 4 +- .kokoro/presubmit/graalvm-a.cfg | 38 +++++++++++++++++++ .kokoro/presubmit/graalvm-b.cfg | 38 +++++++++++++++++++ .kokoro/presubmit/graalvm-c.cfg | 38 +++++++++++++++++++ CONTRIBUTING.md | 2 +- .../spanner/benchmark/LatencyBenchmark.java | 14 +++++-- renovate.json | 1 - 11 files changed, 146 insertions(+), 11 deletions(-) create mode 100644 .kokoro/presubmit/graalvm-a.cfg create mode 100644 .kokoro/presubmit/graalvm-b.cfg create mode 100644 .kokoro/presubmit/graalvm-c.cfg diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml index c644a24e11..e58cdcbad6 100644 --- a/.github/generated-files-bot.yml +++ b/.github/generated-files-bot.yml @@ -6,6 +6,7 @@ externalManifests: file: '.github/readme/synth.metadata/synth.metadata' jsonpath: '$.generatedFiles[*]' ignoreAuthors: +- 'cloud-java-bot' - 'renovate-bot' - 'yoshi-automation' - 'release-please[bot]' diff --git a/.github/scripts/update_generation_config.sh b/.github/scripts/update_generation_config.sh index 91434688cc..fff56bf5dd 100644 --- a/.github/scripts/update_generation_config.sh +++ b/.github/scripts/update_generation_config.sh @@ -15,8 +15,15 @@ set -e function get_latest_released_version() { local group_id=$1 local artifact_id=$2 - latest=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json" | jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' | sort -V | tail -n 1) - echo "${latest}" + json_content=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json") + latest=$(jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' <<< "${json_content}" | sort -V | tail -n 1) + if [[ -z "${latest}" ]]; then + echo "The latest version of ${group_id}:${artifact_id} is empty." + echo "The returned json from maven.org is invalid: ${json_content}" + exit 1 + else + echo "${latest}" + fi } # Update a key to a new value in the generation config. diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml index a0ba1f7d90..88d3ac9bf1 100644 --- a/.github/trusted-contribution.yml +++ b/.github/trusted-contribution.yml @@ -1,3 +1,9 @@ trustedContributors: - renovate-bot - gcf-owl-bot[bot] + +annotations: +- type: comment + text: "/gcbrun" +- type: label + text: "kokoro:force-run" diff --git a/.github/workflows/renovate_config_check.yaml b/.github/workflows/renovate_config_check.yaml index 7c5ec7865e..47b9e87c98 100644 --- a/.github/workflows/renovate_config_check.yaml +++ b/.github/workflows/renovate_config_check.yaml @@ -7,7 +7,7 @@ on: jobs: renovate_bot_config_validation: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout code @@ -16,7 +16,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '22' - name: Install Renovate and Config Validator run: | diff --git a/.github/workflows/update_generation_config.yaml b/.github/workflows/update_generation_config.yaml index f15c807853..cd2d5fd5a8 100644 --- a/.github/workflows/update_generation_config.yaml +++ b/.github/workflows/update_generation_config.yaml @@ -28,6 +28,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + fetch-depth: 0 token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} - name: Update params in generation config to latest shell: bash @@ -36,7 +37,8 @@ jobs: [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com" [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" bash .github/scripts/update_generation_config.sh \ - --base_branch "${base_branch}"\ + --base_branch "${base_branch}" \ --repo ${{ github.repository }} env: GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + diff --git a/.kokoro/presubmit/graalvm-a.cfg b/.kokoro/presubmit/graalvm-a.cfg new file mode 100644 index 0000000000..24accde475 --- /dev/null +++ b/.kokoro/presubmit/graalvm-a.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.45.1" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "IT_SERVICE_ACCOUNT_EMAIL" + value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" +} \ No newline at end of file diff --git a/.kokoro/presubmit/graalvm-b.cfg b/.kokoro/presubmit/graalvm-b.cfg new file mode 100644 index 0000000000..24accde475 --- /dev/null +++ b/.kokoro/presubmit/graalvm-b.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.45.1" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "IT_SERVICE_ACCOUNT_EMAIL" + value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" +} \ No newline at end of file diff --git a/.kokoro/presubmit/graalvm-c.cfg b/.kokoro/presubmit/graalvm-c.cfg new file mode 100644 index 0000000000..24accde475 --- /dev/null +++ b/.kokoro/presubmit/graalvm-c.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.45.1" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "IT_SERVICE_ACCOUNT_EMAIL" + value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b65dd279c9..ff092b68e3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,7 +84,7 @@ Code in this repo is formatted with [google-java-format](https://github.com/google/google-java-format). To run formatting on your project, you can run: ``` -mvn com.coveo:fmt-maven-plugin:format +mvn com.spotify.fmt:fmt-maven-plugin:format ``` [1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account diff --git a/benchmarks/src/main/java/com/google/cloud/spanner/benchmark/LatencyBenchmark.java b/benchmarks/src/main/java/com/google/cloud/spanner/benchmark/LatencyBenchmark.java index 73683932de..46083f1fee 100644 --- a/benchmarks/src/main/java/com/google/cloud/spanner/benchmark/LatencyBenchmark.java +++ b/benchmarks/src/main/java/com/google/cloud/spanner/benchmark/LatencyBenchmark.java @@ -48,7 +48,11 @@ public static void main(String[] args) throws ParseException { String.format("projects/%s/instances/%s/databases/%s", project, instance, database); } else { throw new IllegalArgumentException( - "You must either set all the environment variables SPANNER_CLIENT_BENCHMARK_GOOGLE_CLOUD_PROJECT, SPANNER_CLIENT_BENCHMARK_SPANNER_INSTANCE and SPANNER_CLIENT_BENCHMARK_SPANNER_DATABASE, or specify a value for the command line argument --database"); + "You must either set all the environment variables" + + " SPANNER_CLIENT_BENCHMARK_GOOGLE_CLOUD_PROJECT," + + " SPANNER_CLIENT_BENCHMARK_SPANNER_INSTANCE and" + + " SPANNER_CLIENT_BENCHMARK_SPANNER_DATABASE, or specify a value for the command" + + " line argument --database"); } LatencyBenchmark benchmark = new LatencyBenchmark(DatabaseId.of(fullyQualifiedDatabase)); @@ -69,13 +73,15 @@ private static CommandLine parseCommandLine(String[] args) throws ParseException "w", "wait", true, - "The wait time in milliseconds between each query that is executed by each client. Defaults to 0. " - + "Set this to for example 1000 to have each client execute 1 query per second."); + "The wait time in milliseconds between each query that is executed by each client. Defaults" + + " to 0. Set this to for example 1000 to have each client execute 1 query per" + + " second."); options.addOption( "t", "transaction", true, - "The type of transaction to execute. Must be either READ_ONLY or READ_WRITE. Defaults to READ_ONLY."); + "The type of transaction to execute. Must be either READ_ONLY or READ_WRITE. Defaults to" + + " READ_ONLY."); options.addOption("m", "multiplexed", true, "Use multiplexed sessions. Defaults to false."); options.addOption("w", "wait", true, "Wait time in millis. Defaults to zero."); options.addOption("name", true, "Name of this test run"); diff --git a/renovate.json b/renovate.json index 3ad0aae27d..0fe0b5f774 100644 --- a/renovate.json +++ b/renovate.json @@ -63,7 +63,6 @@ "^org.jacoco:", "^org.codehaus.mojo:", "^org.sonatype.plugins:", - "^com.coveo:", "^com.google.cloud:google-cloud-shared-config" ], "semanticCommitType": "build", From 2eaa488c4b7f963f2a87045a951db72eadef517b Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Mon, 21 Apr 2025 06:16:32 +0000 Subject: [PATCH 2/2] chore: generate libraries at Mon Apr 21 06:14:19 UTC 2025 --- CONTRIBUTING.md | 2 +- renovate.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ff092b68e3..b65dd279c9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,7 +84,7 @@ Code in this repo is formatted with [google-java-format](https://github.com/google/google-java-format). To run formatting on your project, you can run: ``` -mvn com.spotify.fmt:fmt-maven-plugin:format +mvn com.coveo:fmt-maven-plugin:format ``` [1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account diff --git a/renovate.json b/renovate.json index 0fe0b5f774..3ad0aae27d 100644 --- a/renovate.json +++ b/renovate.json @@ -63,6 +63,7 @@ "^org.jacoco:", "^org.codehaus.mojo:", "^org.sonatype.plugins:", + "^com.coveo:", "^com.google.cloud:google-cloud-shared-config" ], "semanticCommitType": "build",