From df309dec8af86440ce0a054284d6af3b607ff7fd Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Fri, 4 Apr 2025 16:07:29 -0400 Subject: [PATCH 1/8] fix: reintroduce support for GraalVM 17 --- .cloudbuild/cloudbuild-test-c.yaml | 36 ++++++++++++++++++++++ .cloudbuild/cloudbuild.yaml | 36 ++++++++++++++++------ .cloudbuild/graalvm-c.Dockerfile | 49 ++++++++++++++++++++++++++++++ .cloudbuild/graalvm-c.yaml | 29 ++++++++++++++++++ 4 files changed, 140 insertions(+), 10 deletions(-) create mode 100644 .cloudbuild/cloudbuild-test-c.yaml create mode 100644 .cloudbuild/graalvm-c.Dockerfile create mode 100644 .cloudbuild/graalvm-c.yaml diff --git a/.cloudbuild/cloudbuild-test-c.yaml b/.cloudbuild/cloudbuild-test-c.yaml new file mode 100644 index 00000000..47115b60 --- /dev/null +++ b/.cloudbuild/cloudbuild-test-c.yaml @@ -0,0 +1,36 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +timeout: 7200s # 2 hours +substitutions: + _JAVA_SHARED_CONFIG_VERSION: '1.15.1' # {x-version-update:google-cloud-shared-config:current} + +steps: + # GraalVM A build + - name: gcr.io/cloud-builders/docker + args: ["build", "-t", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_c:${_JAVA_SHARED_CONFIG_VERSION}", "--file", "graalvm-c.Dockerfile", "."] + dir: .cloudbuild + id: graalvm-c-build + waitFor: ["-"] + - name: gcr.io/gcp-runtimes/structure_test + args: + ["-i", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_c:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-c.yaml", "-v"] + waitFor: ["graalvm-c-build"] + - name: us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_c:${_JAVA_SHARED_CONFIG_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/downstream-build.sh' ] + waitFor: [ "graalvm-c-build" ] + +options: + logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/cloudbuild.yaml b/.cloudbuild/cloudbuild.yaml index 2d597637..30389dc9 100644 --- a/.cloudbuild/cloudbuild.yaml +++ b/.cloudbuild/cloudbuild.yaml @@ -15,39 +15,55 @@ timeout: 7200s # 2 hours substitutions: _JAVA_SHARED_CONFIG_VERSION: '1.15.1' # {x-version-update:google-cloud-shared-config:current} + _IMAGE_REPOSITORY: us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing + _COMMIT_HASH_TAG: infrastructure-public-image-$SHORT_SHA steps: # GraalVM A build - name: gcr.io/cloud-builders/docker args: ["build", - "-t", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", - "-t", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:infrastructure-public-image-$SHORT_SHA", + "-t", "${_IMAGE_REPOSITORY}/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", + "-t", "${_IMAGE_REPOSITORY}/graalvm_a:${_COMMIT_HASH_TAG}", "--file", "graalvm-a.Dockerfile", "."] dir: .cloudbuild id: graalvm-a-build waitFor: ["-"] - name: gcr.io/gcp-runtimes/structure_test args: - ["-i", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-a.yaml", "-v"] + ["-i", "${_IMAGE_REPOSITORY}/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-a.yaml", "-v"] waitFor: ["graalvm-a-build"] # GraalVM B build - name: gcr.io/cloud-builders/docker - args: [ "build", "-t", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", - "-t", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:infrastructure-public-image-$SHORT_SHA", + args: [ "build", "-t", "${_IMAGE_REPOSITORY}/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", + "-t", "${_IMAGE_REPOSITORY}/graalvm_b:${_COMMIT_HASH_TAG}", "--file", "graalvm-b.Dockerfile", "." ] dir: .cloudbuild id: graalvm-b-build waitFor: [ "-" ] - name: gcr.io/gcp-runtimes/structure_test args: - [ "-i", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-b.yaml", "-v" ] + [ "-i", "${_IMAGE_REPOSITORY}/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-b.yaml", "-v" ] waitFor: [ "graalvm-b-build" ] + # GraalVM C build + - name: gcr.io/cloud-builders/docker + args: [ "build", "-t", "${_IMAGE_REPOSITORY}/graalvm_c:${_JAVA_SHARED_CONFIG_VERSION}", + "-t", "${_IMAGE_REPOSITORY}/graalvm_c:${_COMMIT_HASH_TAG}", + "--file", "graalvm-c.Dockerfile", "." ] + dir: .cloudbuild + id: graalvm-c-build + waitFor: [ "-" ] + - name: gcr.io/gcp-runtimes/structure_test + args: + [ "-i", "${_IMAGE_REPOSITORY}/graalvm_c:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-c.yaml", "-v" ] + waitFor: [ "graalvm-c-build" ] options: logging: CLOUD_LOGGING_ONLY images: - - us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION} - - us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION} - - us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:infrastructure-public-image-$SHORT_SHA - - us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:infrastructure-public-image-$SHORT_SHA + - ${_IMAGE_REPOSITORY}/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION} + - ${_IMAGE_REPOSITORY}/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION} + - ${_IMAGE_REPOSITORY}/graalvm_c:${_JAVA_SHARED_CONFIG_VERSION} + - ${_IMAGE_REPOSITORY}/graalvm_a:${_COMMIT_HASH_TAG} + - ${_IMAGE_REPOSITORY}/graalvm_b:${_COMMIT_HASH_TAG} + - ${_IMAGE_REPOSITORY}/graalvm_c:${_COMMIT_HASH_TAG} diff --git a/.cloudbuild/graalvm-c.Dockerfile b/.cloudbuild/graalvm-c.Dockerfile new file mode 100644 index 00000000..f6ff7ad0 --- /dev/null +++ b/.cloudbuild/graalvm-c.Dockerfile @@ -0,0 +1,49 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM ghcr.io/graalvm/graalvm-community:17.0.9-ol9-20231024 + +# use microdnf, see https://github.com/graalvm/container/issues/10 +RUN microdnf update -y oraclelinux-release-el9 && \ + microdnf 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 && \ + unzip /tmp/maven.zip -d /tmp/maven && \ + mv /tmp/maven/apache-maven-3.9.4 /usr/local/lib/maven && \ + rm /tmp/maven.zip && \ + ln -s $JAVA_HOME/lib $JAVA_HOME/conf + +ENV PATH $PATH:/usr/local/lib/maven/bin + +# Install gcloud SDK +COPY google-cloud-sdk.repo /etc/yum.repos.d/google-cloud-sdk.repo +RUN microdnf install -y google-cloud-sdk + +# Adding the package path to local +ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin + +# Install docker +# See also https://docs.docker.com/engine/install/rhel/#set-up-the-repository +COPY docker-ce.repo /etc/yum.repos.d/docker-ce.repo +RUN microdnf install -y docker-ce docker-ce-cli + +# Install terraform +# See also https://www.hashicorp.com/official-packaging-guide +COPY hashicorp.repo /etc/yum.repos.d/hashicorp.repo +RUN microdnf -y install terraform + +# Install jq +RUN microdnf -y install jq + +WORKDIR /workspace diff --git a/.cloudbuild/graalvm-c.yaml b/.cloudbuild/graalvm-c.yaml new file mode 100644 index 00000000..06db3dcf --- /dev/null +++ b/.cloudbuild/graalvm-c.yaml @@ -0,0 +1,29 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +schemaVersion: 1.0.0 +commandTests: + - name: "version" + command: ["java", "-version"] + # java -version outputs to stderr... + expectedError: ["openjdk version \"17.0.9\"", "GraalVM CE 17.0.9"] + - name: "maven" + command: ["mvn", "-version"] + expectedOutput: ["Apache Maven 3.9.4"] + - name: "gcloud" + command: ["gcloud", "version"] + expectedOutput: ["Google Cloud SDK"] + - name: "docker" + command: ["docker", "--version"] + expectedOutput: ["Docker version *"] From ac29f81fd24cff651bfa0d82edf6211b180d83b2 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Fri, 4 Apr 2025 16:09:19 -0400 Subject: [PATCH 2/8] correct coment --- .cloudbuild/cloudbuild-test-c.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cloudbuild/cloudbuild-test-c.yaml b/.cloudbuild/cloudbuild-test-c.yaml index 47115b60..e992e24e 100644 --- a/.cloudbuild/cloudbuild-test-c.yaml +++ b/.cloudbuild/cloudbuild-test-c.yaml @@ -17,7 +17,7 @@ substitutions: _JAVA_SHARED_CONFIG_VERSION: '1.15.1' # {x-version-update:google-cloud-shared-config:current} steps: - # GraalVM A build + # GraalVM C build - name: gcr.io/cloud-builders/docker args: ["build", "-t", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_c:${_JAVA_SHARED_CONFIG_VERSION}", "--file", "graalvm-c.Dockerfile", "."] dir: .cloudbuild From 047febbabb5ad3d44caf38b59a852ec665c4c85d Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Fri, 4 Apr 2025 16:10:17 -0400 Subject: [PATCH 3/8] fix copyright year --- .cloudbuild/cloudbuild-test-c.yaml | 2 +- .cloudbuild/graalvm-c.Dockerfile | 2 +- .cloudbuild/graalvm-c.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.cloudbuild/cloudbuild-test-c.yaml b/.cloudbuild/cloudbuild-test-c.yaml index e992e24e..d97e3d6e 100644 --- a/.cloudbuild/cloudbuild-test-c.yaml +++ b/.cloudbuild/cloudbuild-test-c.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.cloudbuild/graalvm-c.Dockerfile b/.cloudbuild/graalvm-c.Dockerfile index f6ff7ad0..11686b3c 100644 --- a/.cloudbuild/graalvm-c.Dockerfile +++ b/.cloudbuild/graalvm-c.Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.cloudbuild/graalvm-c.yaml b/.cloudbuild/graalvm-c.yaml index 06db3dcf..b2081c0f 100644 --- a/.cloudbuild/graalvm-c.yaml +++ b/.cloudbuild/graalvm-c.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From a4593a60300364d26a184768395824c96d79065d Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Mon, 7 Apr 2025 12:54:26 -0400 Subject: [PATCH 4/8] non image-dependent steps to not depend on image building step --- .cloudbuild/cloudbuild-test-a.yaml | 2 +- .cloudbuild/cloudbuild-test-b.yaml | 2 +- .cloudbuild/cloudbuild-test-c.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.cloudbuild/cloudbuild-test-a.yaml b/.cloudbuild/cloudbuild-test-a.yaml index 4cc8daf1..90a352d9 100644 --- a/.cloudbuild/cloudbuild-test-a.yaml +++ b/.cloudbuild/cloudbuild-test-a.yaml @@ -30,7 +30,7 @@ steps: - name: us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION} entrypoint: bash args: [ './.kokoro/presubmit/downstream-build.sh' ] - waitFor: [ "graalvm-a-build" ] + waitFor: ["-"] options: logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/cloudbuild-test-b.yaml b/.cloudbuild/cloudbuild-test-b.yaml index ba5a6bfa..b639d119 100644 --- a/.cloudbuild/cloudbuild-test-b.yaml +++ b/.cloudbuild/cloudbuild-test-b.yaml @@ -30,7 +30,7 @@ steps: - name: us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION} entrypoint: bash args: [ './.kokoro/presubmit/downstream-build.sh' ] - waitFor: [ "graalvm-b-build" ] + waitFor: ["-"] options: logging: CLOUD_LOGGING_ONLY \ No newline at end of file diff --git a/.cloudbuild/cloudbuild-test-c.yaml b/.cloudbuild/cloudbuild-test-c.yaml index d97e3d6e..e30d3fd3 100644 --- a/.cloudbuild/cloudbuild-test-c.yaml +++ b/.cloudbuild/cloudbuild-test-c.yaml @@ -30,7 +30,7 @@ steps: - name: us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_c:${_JAVA_SHARED_CONFIG_VERSION} entrypoint: bash args: [ './.kokoro/presubmit/downstream-build.sh' ] - waitFor: [ "graalvm-c-build" ] + waitFor: ["-"] options: logging: CLOUD_LOGGING_ONLY From c1b3ce4caf0dda3371104bcd5f6ad8f2e4e381fd Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Mon, 7 Apr 2025 12:58:33 -0400 Subject: [PATCH 5/8] restore step dependency --- .cloudbuild/cloudbuild-test-a.yaml | 2 +- .cloudbuild/cloudbuild-test-b.yaml | 2 +- .cloudbuild/cloudbuild-test-c.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.cloudbuild/cloudbuild-test-a.yaml b/.cloudbuild/cloudbuild-test-a.yaml index 90a352d9..4cc8daf1 100644 --- a/.cloudbuild/cloudbuild-test-a.yaml +++ b/.cloudbuild/cloudbuild-test-a.yaml @@ -30,7 +30,7 @@ steps: - name: us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION} entrypoint: bash args: [ './.kokoro/presubmit/downstream-build.sh' ] - waitFor: ["-"] + waitFor: [ "graalvm-a-build" ] options: logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/cloudbuild-test-b.yaml b/.cloudbuild/cloudbuild-test-b.yaml index b639d119..ba5a6bfa 100644 --- a/.cloudbuild/cloudbuild-test-b.yaml +++ b/.cloudbuild/cloudbuild-test-b.yaml @@ -30,7 +30,7 @@ steps: - name: us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION} entrypoint: bash args: [ './.kokoro/presubmit/downstream-build.sh' ] - waitFor: ["-"] + waitFor: [ "graalvm-b-build" ] options: logging: CLOUD_LOGGING_ONLY \ No newline at end of file diff --git a/.cloudbuild/cloudbuild-test-c.yaml b/.cloudbuild/cloudbuild-test-c.yaml index e30d3fd3..d97e3d6e 100644 --- a/.cloudbuild/cloudbuild-test-c.yaml +++ b/.cloudbuild/cloudbuild-test-c.yaml @@ -30,7 +30,7 @@ steps: - name: us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_c:${_JAVA_SHARED_CONFIG_VERSION} entrypoint: bash args: [ './.kokoro/presubmit/downstream-build.sh' ] - waitFor: ["-"] + waitFor: [ "graalvm-c-build" ] options: logging: CLOUD_LOGGING_ONLY From 5c54119a8601e665ac4c66625ad7d5d793a44145 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Mon, 7 Apr 2025 17:24:12 -0400 Subject: [PATCH 6/8] checkout fix branch for testing --- .kokoro/presubmit/downstream-build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index 45a7b571..6ad10051 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -43,6 +43,7 @@ git clone "https://github.com/googleapis/sdk-platform-java" --depth=1 # Update the shared-config version in showcase pushd sdk-platform-java/java-showcase +git checkout prepare-showcase-graal-17 # temporary, in order to confirm fix included in that branch modify_shared_config popd From 95304940a769c3649875b8fa8a99f36e363580fb Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Mon, 7 Apr 2025 17:37:27 -0400 Subject: [PATCH 7/8] clone with branch --- .kokoro/presubmit/downstream-build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index 6ad10051..805ac01f 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -39,11 +39,11 @@ mkdir -p "${HOME}/.m2" cp settings.xml "${HOME}/.m2" ### Round 2 -git clone "https://github.com/googleapis/sdk-platform-java" --depth=1 +# temporary, in order to confirm fix included in that branch +git clone -b prepare-showcase-graal-17 "https://github.com/googleapis/sdk-platform-java" --depth=1 # Update the shared-config version in showcase pushd sdk-platform-java/java-showcase -git checkout prepare-showcase-graal-17 # temporary, in order to confirm fix included in that branch modify_shared_config popd From 0c8be2717d44f5e0018900004697b9249d3b4495 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Tue, 8 Apr 2025 15:52:37 -0400 Subject: [PATCH 8/8] use main branch of sdk-platform --- .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 805ac01f..45a7b571 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -39,8 +39,7 @@ mkdir -p "${HOME}/.m2" cp settings.xml "${HOME}/.m2" ### Round 2 -# temporary, in order to confirm fix included in that branch -git clone -b prepare-showcase-graal-17 "https://github.com/googleapis/sdk-platform-java" --depth=1 +git clone "https://github.com/googleapis/sdk-platform-java" --depth=1 # Update the shared-config version in showcase pushd sdk-platform-java/java-showcase