-
Notifications
You must be signed in to change notification settings - Fork 17
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
chore: publish native image docker images from java-shared-config #660
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a46a460
chore: publish native image docker images from java-shared-config
mpeddada1 3487a8e
update yaml to define version in fewer locations
mpeddada1 ad83072
uncomment COPY
mpeddada1 9435bbc
update comments and cloud build steps to be version agnostic
mpeddada1 5c67485
add graalvm version test; rename Dockerfile
mpeddada1 369a252
relocate cloudbuild files to .cloudbuild dir
mpeddada1 d105b23
add comment for publishing
mpeddada1 0e91880
publish only to cloud-devrel-public-resources
mpeddada1 a417e80
Merge branch 'main' of github.com:googleapis/java-shared-config into …
mpeddada1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# 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.5.7' | ||
_GRAALVM_A: 'graalvm22_3_jdk11' | ||
_GRAALVM_B: 'graalvm22_3_jdk17' | ||
steps: | ||
# GraalVM A build | ||
- name: gcr.io/cloud-builders/docker | ||
args: ["build", "-t", "gcr.io/$PROJECT_ID/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--file", "${_GRAALVM_A}.Dockerfile", "."] | ||
dir: .kokoro/docker | ||
id: graalvm-a-build | ||
waitFor: ["-"] | ||
- name: gcr.io/gcp-runtimes/structure_test | ||
args: | ||
["-i", "gcr.io/$PROJECT_ID/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".kokoro/docker/${_GRAALVM_A}.yaml", "-v"] | ||
waitFor: ["graalvm-a-build"] | ||
- name: gcr.io/cloud-builders/docker | ||
args: | ||
[ | ||
"tag", | ||
"gcr.io/$PROJECT_ID/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", | ||
"gcr.io/cloud-devrel-public-resources/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", | ||
] | ||
waitFor: ["graalvm-a-build"] | ||
|
||
# GraalVM B build | ||
- name: gcr.io/cloud-builders/docker | ||
args: ["build", "-t", "gcr.io/$PROJECT_ID/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--file", "${_GRAALVM_B}.Dockerfile", "."] | ||
dir: .kokoro/docker | ||
id: graalvm-b-build | ||
waitFor: ["-"] | ||
- name: gcr.io/gcp-runtimes/structure_test | ||
args: | ||
["-i", "gcr.io/$PROJECT_ID/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".kokoro/docker/${_GRAALVM_B}.yaml", "-v"] | ||
waitFor: ["graalvm-b-build"] | ||
- name: gcr.io/cloud-builders/docker | ||
args: | ||
[ | ||
"tag", | ||
"gcr.io/$PROJECT_ID/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", | ||
"gcr.io/cloud-devrel-public-resources/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", | ||
] | ||
waitFor: ["graalvm-b-build"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# 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.5.7' | ||
_GRAALVM_A: 'graalvm22_3_jdk11' | ||
_GRAALVM_B: 'graalvm22_3_jdk17' | ||
steps: | ||
# GraalVM A build | ||
- name: gcr.io/cloud-builders/docker | ||
args: ["build", "-t", "gcr.io/$PROJECT_ID/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--file", "${_GRAALVM_A}.Dockerfile", "."] | ||
env: | ||
dir: .kokoro/docker | ||
id: graalvm-a-build | ||
waitFor: ["-"] | ||
- name: gcr.io/gcp-runtimes/structure_test | ||
args: | ||
["-i", "gcr.io/$PROJECT_ID/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".kokoro/docker/${_GRAALVM_A}.yaml", "-v"] | ||
waitFor: ["graalvm-a-build"] | ||
- name: gcr.io/cloud-builders/docker | ||
args: | ||
[ | ||
"tag", | ||
"gcr.io/$PROJECT_ID/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", | ||
"gcr.io/cloud-devrel-public-resources/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", | ||
] | ||
waitFor: ["graalvm-a-build"] | ||
|
||
# GraalVM B build | ||
- name: gcr.io/cloud-builders/docker | ||
args: [ "build", "-t", "gcr.io/$PROJECT_ID/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--file", "${_GRAALVM_B}.Dockerfile", "." ] | ||
dir: .kokoro/docker | ||
id: graalvm-b-build | ||
waitFor: [ "-" ] | ||
- name: gcr.io/gcp-runtimes/structure_test | ||
args: | ||
[ "-i", "gcr.io/$PROJECT_ID/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".kokoro/docker/${_GRAALVM_B}.yaml", "-v" ] | ||
waitFor: [ "graalvm-b-build" ] | ||
- name: gcr.io/cloud-builders/docker | ||
args: | ||
[ | ||
"tag", | ||
"gcr.io/$PROJECT_ID/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", | ||
"gcr.io/cloud-devrel-public-resources/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", | ||
] | ||
waitFor: [ "graalvm-b-build" ] | ||
images: | ||
- gcr.io/$PROJECT_ID/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION} | ||
- gcr.io/cloud-devrel-public-resources/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION} | ||
- gcr.io/$PROJECT_ID/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION} | ||
- gcr.io/cloud-devrel-public-resources/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# 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-ce:ol7-java11-22.3.2-b1 | ||
|
||
RUN gu install native-image && \ | ||
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 && \ | ||
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 yum install -y google-cloud-sdk | ||
|
||
# Adding the package path to local | ||
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin | ||
|
||
# Install docker | ||
RUN yum install -y docker-engine docker-cli | ||
|
||
# Install terraform | ||
RUN yum -y install terraform | ||
|
||
# Install jq | ||
RUN yum -y install jq | ||
|
||
WORKDIR /workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 \"11.0.19\"", "GraalVM CE 22.3.2"] | ||
- 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 *"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# 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-ce:ol7-java17-22.3.2-b1 | ||
|
||
RUN gu install native-image && \ | ||
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 && \ | ||
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 yum install -y google-cloud-sdk | ||
|
||
# Adding the package path to local | ||
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin | ||
|
||
# Install docker | ||
RUN yum install -y docker-engine docker-cli | ||
|
||
# Install terraform | ||
RUN yum -y install terraform | ||
|
||
# Install jq | ||
RUN yum -y install jq | ||
|
||
WORKDIR /workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.7\"", "GraalVM CE 22.3.2"] | ||
- 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 *"] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@suztomo Wanted to call out these publishing destinations. We're publishing to
gcr.io/cloud-devrel-kokoro-resources/
which will be used by our kokoro jobs downstream andgcr.io/cloud-devrel-public-resources
which is a public repository of images for client library testing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need both? Can you write down rationale in source code comments in this YAML file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
gcr.io/cloud-devrel-kokoro-resources
is used by Kokoro jobs whereasgcr.io/cloud-devrel-public-resources/
is used for making our testing images public to allow non-Googlers to run tests against the same image as us. I've added this in here following convention in https://github.com/googleapis/testing-infra-docker. We seem to publish images to both locations for several other languages as well (nodejs, python). Example: https://github.com/googleapis/testing-infra-docker/blob/f3a27546b3a9fedef75a78f22c8fde23d5c013d3/python/cloudbuild.yaml#L61-L69