From fc140f7ecd5c15b0478e1c4829dca8f80dcdb361 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Fri, 15 Dec 2023 15:35:00 +0000 Subject: [PATCH] chore: add cloudbuild setup to publish docker images (#2298) * chore: add cloudbuild setup to publish docker images --- .cloudbuild/cloudbuild-test-a.yaml | 33 ++++++++++++++++++++++++++ .cloudbuild/cloudbuild-test-b.yaml | 33 ++++++++++++++++++++++++++ .cloudbuild/cloudbuild.yaml | 37 ++++++++++++++++++++++++++++++ .cloudbuild/google-cloud-sdk.repo | 8 +++++++ .cloudbuild/graalvm_a.Dockerfile | 19 +++++++++++++++ .cloudbuild/graalvm_b.Dockerfile | 18 +++++++++++++++ renovate.json | 11 +++++++++ 7 files changed, 159 insertions(+) create mode 100644 .cloudbuild/cloudbuild-test-a.yaml create mode 100644 .cloudbuild/cloudbuild-test-b.yaml create mode 100644 .cloudbuild/cloudbuild.yaml create mode 100644 .cloudbuild/google-cloud-sdk.repo create mode 100644 .cloudbuild/graalvm_a.Dockerfile create mode 100644 .cloudbuild/graalvm_b.Dockerfile diff --git a/.cloudbuild/cloudbuild-test-a.yaml b/.cloudbuild/cloudbuild-test-a.yaml new file mode 100644 index 0000000000..0e4bb33f66 --- /dev/null +++ b/.cloudbuild/cloudbuild-test-a.yaml @@ -0,0 +1,33 @@ +# 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: + _SHARED_DEPENDENCIES_VERSION: '3.20.0' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.7.1' + +steps: + # GraalVM A build + - name: gcr.io/cloud-builders/docker + args: ["build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_a.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "."] + dir: .cloudbuild + id: graalvm-a-build + waitFor: ["-"] + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/downstream-build.sh' ] + waitFor: [ "graalvm-a-build" ] + env: + - 'MODULES_UNDER_TEST=java-kms' + - 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test' \ No newline at end of file diff --git a/.cloudbuild/cloudbuild-test-b.yaml b/.cloudbuild/cloudbuild-test-b.yaml new file mode 100644 index 0000000000..cea1feb6b1 --- /dev/null +++ b/.cloudbuild/cloudbuild-test-b.yaml @@ -0,0 +1,33 @@ +# 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: + _SHARED_DEPENDENCIES_VERSION: '3.20.0' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.7.1' + +steps: + # GraalVM A build + - name: gcr.io/cloud-builders/docker + args: ["build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_b.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "."] + dir: .cloudbuild + id: graalvm-b-build + waitFor: ["-"] + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/downstream-build.sh' ] + waitFor: [ "graalvm-b-build" ] + env: + - 'MODULES_UNDER_TEST=java-kms' + - 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test' \ No newline at end of file diff --git a/.cloudbuild/cloudbuild.yaml b/.cloudbuild/cloudbuild.yaml new file mode 100644 index 0000000000..34a7720c71 --- /dev/null +++ b/.cloudbuild/cloudbuild.yaml @@ -0,0 +1,37 @@ +# 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: + _SHARED_DEPENDENCIES_VERSION: '3.20.0' # {x-version-update:google-cloud-shared-dependencies:released} + _JAVA_SHARED_CONFIG_VERSION: '1.7.1' +steps: + # GraalVM A build + - name: gcr.io/cloud-builders/docker + args: ["build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_a.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "."] + dir: .cloudbuild + id: graalvm-a-build + waitFor: ["-"] + + # GraalVM B build + - name: gcr.io/cloud-builders/docker + args: [ "build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_b.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "." ] + dir: .cloudbuild + id: graalvm-b-build + waitFor: [ "-" ] + + +images: + - gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION} + - gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION} diff --git a/.cloudbuild/google-cloud-sdk.repo b/.cloudbuild/google-cloud-sdk.repo new file mode 100644 index 0000000000..8c654dc317 --- /dev/null +++ b/.cloudbuild/google-cloud-sdk.repo @@ -0,0 +1,8 @@ +[google-cloud-sdk] +name=Google Cloud SDK +baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64 +enabled=1 +gpgcheck=1 +repo_gpgcheck=0 +gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg + https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg diff --git a/.cloudbuild/graalvm_a.Dockerfile b/.cloudbuild/graalvm_a.Dockerfile new file mode 100644 index 0000000000..40fa809aa8 --- /dev/null +++ b/.cloudbuild/graalvm_a.Dockerfile @@ -0,0 +1,19 @@ +# 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. + + +ARG JAVA_SHARED_CONFIG_VERSION + +FROM gcr.io/cloud-devrel-public-resources/graalvm_a:$JAVA_SHARED_CONFIG_VERSION + diff --git a/.cloudbuild/graalvm_b.Dockerfile b/.cloudbuild/graalvm_b.Dockerfile new file mode 100644 index 0000000000..8bd84e53ed --- /dev/null +++ b/.cloudbuild/graalvm_b.Dockerfile @@ -0,0 +1,18 @@ +# 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. + + +ARG JAVA_SHARED_CONFIG_VERSION + +FROM gcr.io/cloud-devrel-public-resources/graalvm_b:$JAVA_SHARED_CONFIG_VERSION \ No newline at end of file diff --git a/renovate.json b/renovate.json index 2a04434e6d..6aa17de4da 100644 --- a/renovate.json +++ b/renovate.json @@ -57,6 +57,17 @@ "value: \"gcr.io/cloud-devrel-kokoro-resources/graalvm17:(?.*?)\""], "depNameTemplate": "ghcr.io/graalvm/graalvm-ce", "datasourceTemplate": "docker" + }, + { + "customType": "regex", + "fileMatch": [ + "^.cloudbuild/**" + ], + "matchStrings": [ + "_JAVA_SHARED_CONFIG_VERSION: \"(?.+?)\"" + ], + "depNameTemplate": "com.google.cloud:google-cloud-shared-config", + "datasourceTemplate": "maven" } ], "packageRules": [