Skip to content

Commit

Permalink
Merge branch 'main' into renovate/org.apache.maven.plugins-maven-proj…
Browse files Browse the repository at this point in the history
…ect-info-reports-plugin-3.x
  • Loading branch information
jinseopkim0 authored Nov 13, 2024
2 parents def4b19 + a31c682 commit 8751f18
Show file tree
Hide file tree
Showing 141 changed files with 1,830 additions and 1,242 deletions.
1 change: 1 addition & 0 deletions .cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ substitutions:
_JAVA_SHARED_CONFIG_VERSION: '1.11.3'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
steps:
- name: gcr.io/cloud-builders/docker
args: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ substitutions:
_JAVA_SHARED_CONFIG_VERSION: '1.11.3'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
steps:
- name: gcr.io/cloud-builders/docker
args: [
Expand Down
6 changes: 4 additions & 2 deletions .cloudbuild/graalvm/cloudbuild-test-a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.39.0' # {x-version-update:google-cloud-shared-dependencies:current}
_SHARED_DEPENDENCIES_VERSION: '3.39.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.11.3'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
steps:
- name: gcr.io/cloud-builders/docker
args: [
Expand All @@ -41,4 +42,5 @@ steps:
entrypoint: bash
args: [ './.kokoro/presubmit/showcase-native.sh' ]
waitFor: [ "graalvm-a-build" ]
id: native-showcase
id: native-showcase

1 change: 1 addition & 0 deletions .cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ substitutions:
_JAVA_SHARED_CONFIG_VERSION: '1.11.3'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
steps:
- name: gcr.io/cloud-builders/docker
args: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ substitutions:
_JAVA_SHARED_CONFIG_VERSION: '1.11.3'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
steps:
- name: gcr.io/cloud-builders/docker
args: [
Expand Down
3 changes: 2 additions & 1 deletion .cloudbuild/graalvm/cloudbuild-test-b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.39.0' # {x-version-update:google-cloud-shared-dependencies:current}
_SHARED_DEPENDENCIES_VERSION: '3.39.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.11.3'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
steps:
- name: gcr.io/cloud-builders/docker
args: [
Expand Down
4 changes: 3 additions & 1 deletion .cloudbuild/graalvm/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.39.0' # {x-version-update:google-cloud-shared-dependencies:current}
_SHARED_DEPENDENCIES_VERSION: '3.39.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.11.3'
steps:
# GraalVM A build
Expand Down Expand Up @@ -45,6 +45,8 @@ steps:
id: graalvm-b-build
waitFor: [ "-" ]

options:
logging: CLOUD_LOGGING_ONLY

images:
- gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
timeout: 7200s # 2 hours
substitutions:
_IMAGE_NAME: "us-docker.pkg.dev/java-hermetic-build-prod/private-resources/java-library-generation"
_GAPIC_GENERATOR_JAVA_VERSION: '2.46.2-SNAPSHOT' # {x-version-update:gapic-generator-java:current}
_GAPIC_GENERATOR_JAVA_VERSION: '2.49.1-SNAPSHOT' # {x-version-update:gapic-generator-java:current}
_SHA_IMAGE_ID: "${_IMAGE_NAME}:${COMMIT_SHA}"
_LATEST_IMAGE_ID: "${_IMAGE_NAME}:latest"
_VERSIONED_IMAGE_ID: "${_IMAGE_NAME}:${_GAPIC_GENERATOR_JAVA_VERSION}"
Expand All @@ -30,6 +30,8 @@ steps:
"--file", ".cloudbuild/library_generation/library_generation.Dockerfile", "."]
id: library-generation-build
waitFor: ["-"]
env:
- 'DOCKER_BUILDKIT=1'

options:
logging: CLOUD_LOGGING_ONLY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
timeout: 7200s # 2 hours
substitutions:
_IMAGE_NAME: "gcr.io/cloud-devrel-public-resources/java-library-generation"
_GAPIC_GENERATOR_JAVA_VERSION: '2.49.0' # {x-version-update:gapic-generator-java:current}
_GAPIC_GENERATOR_JAVA_VERSION: '2.49.1-SNAPSHOT' # {x-version-update:gapic-generator-java:current}
_SHA_IMAGE_ID: "${_IMAGE_NAME}:${COMMIT_SHA}"
_LATEST_IMAGE_ID: "${_IMAGE_NAME}:latest"
_VERSIONED_IMAGE_ID: "${_IMAGE_NAME}:${_GAPIC_GENERATOR_JAVA_VERSION}"
Expand All @@ -30,6 +30,8 @@ steps:
"--file", ".cloudbuild/library_generation/library_generation.Dockerfile", "."]
id: library-generation-build
waitFor: ["-"]
env:
- 'DOCKER_BUILDKIT=1'

options:
logging: CLOUD_LOGGING_ONLY
Expand Down
73 changes: 47 additions & 26 deletions .cloudbuild/library_generation/library_generation.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,72 @@

# install gapic-generator-java in a separate layer so we don't overload the image
# with the transferred source code and jars
FROM gcr.io/cloud-devrel-public-resources/java21@sha256:2ceff5eeea72260258df56d42e44ed413e52ee421c1b77393c5f2c9c4d7c41da AS ggj-build

# 3.9.9-eclipse-temurin-11-alpine
FROM docker.io/library/maven@sha256:006d25558f9d5244ed55b5d2bd8eaf34d883e447d0c4b940e67b9f44d21167bf AS ggj-build

WORKDIR /sdk-platform-java
COPY . .
# {x-version-update-start:gapic-generator-java:current}
ENV DOCKER_GAPIC_GENERATOR_VERSION="2.49.0"
ENV DOCKER_GAPIC_GENERATOR_VERSION="2.49.1-SNAPSHOT"
# {x-version-update-end}

RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
RUN cp "/root/.m2/repository/com/google/api/gapic-generator-java/${DOCKER_GAPIC_GENERATOR_VERSION}/gapic-generator-java-${DOCKER_GAPIC_GENERATOR_VERSION}.jar" \
"./gapic-generator-java.jar"

# build from the root of this repo:
FROM gcr.io/cloud-devrel-public-resources/python@sha256:9c5ea427632f195ad164054831968389d86fdde4a15abca651f3fcb2a71268cb
# alpine:3.20.3
FROM docker.io/library/alpine@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d as glibc-compat

RUN apk add git sudo
# This SHA is the latest known-to-work version of this binary compatibility tool
ARG GLIB_MUS_SHA=7717dd4dc26377dd9cedcc92b72ebf35f9e68a2d
WORKDIR /home

# Install compatibility layer to run glibc-based programs (such as the
# grpc plugin).
# Alpine, by default, only supports musl-based binaries, and there is no public
# downloadable distribution of the grpc plugin that is Alpine (musl) compatible.
# This is one of the recommended approaches to ensure glibc-compatibility
# as per https://wiki.alpinelinux.org/wiki/Running_glibc_programs
RUN git clone https://gitlab.com/manoel-linux1/GlibMus-HQ.git
WORKDIR /home/GlibMus-HQ
# We lock the tool to the latest known-to-work version
RUN git checkout "${GLIB_MUS_SHA}"
RUN chmod a+x compile-x86_64-alpine-linux.sh
RUN sh compile-x86_64-alpine-linux.sh

# python:3.12.7-alpine3.20
FROM docker.io/library/python@sha256:38e179a0f0436c97ecc76bcd378d7293ab3ee79e4b8c440fdc7113670cb6e204 as final

SHELL [ "/bin/bash", "-c" ]


ARG OWLBOT_CLI_COMMITTISH=38fe6f89a2339ee75c77739b31b371f601b01bb3
ARG PROTOC_VERSION=25.5
ARG GRPC_VERSION=1.67.1
ARG GRPC_VERSION=1.68.1
ARG JAVA_FORMAT_VERSION=1.7
ENV HOME=/home
ENV OS_ARCHITECTURE="linux-x86_64"

# install OS tools
RUN apt-get update && apt-get install -y \
unzip openjdk-17-jdk rsync maven jq \
&& apt-get clean
RUN apk update && apk add unzip curl rsync openjdk11 jq bash nodejs npm git

SHELL [ "/bin/bash", "-c" ]

# Copy glibc shared objects to enable execution of the grpc plugin.
# This list was obtained via `libtree -pvvv /grpc/*` in the final container as
# well as inspecting the modifications done by compile-x86_64-alpine-linux.sh
# in the glibc-compat stage using the `dive` command.
COPY --from=glibc-compat /etc/libgcc* /etc/
COPY --from=glibc-compat /lib64/ld-linux-x86-64.so.2 /lib64/
COPY --from=glibc-compat /lib/GLIBCFAKE.so.0 /lib/
COPY --from=glibc-compat /lib/ld-linux-x86-64.so.2 /lib/
COPY --from=glibc-compat /lib/libpthread* /lib/
COPY --from=glibc-compat /lib/libucontext* /lib/
COPY --from=glibc-compat /lib/libc.* /lib/
COPY --from=glibc-compat /usr/lib/libgcc* /usr/lib/
COPY --from=glibc-compat /usr/lib/libstdc* /usr/lib/
COPY --from=glibc-compat /usr/lib/libobstack* /usr/lib/

# copy source code
COPY hermetic_build/common /src/common
Expand Down Expand Up @@ -72,10 +109,6 @@ ENV DOCKER_GRPC_VERSION="${GRPC_VERSION}"
COPY --from=ggj-build "/sdk-platform-java/gapic-generator-java.jar" "${HOME}/.library_generation/gapic-generator-java.jar"
RUN chmod 755 "${HOME}/.library_generation/gapic-generator-java.jar"

# use python 3.12 (the base image has several python versions; here we define the default one)
RUN rm $(which python3)
RUN ln -s $(which python3.12) /usr/local/bin/python
RUN ln -s $(which python3.12) /usr/local/bin/python3
RUN python -m pip install --upgrade pip

# install main scripts as a python package
Expand All @@ -85,25 +118,14 @@ RUN python -m pip install src/common
RUN python -m pip install --require-hashes -r src/library_generation/requirements.txt
RUN python -m pip install src/library_generation

# Install nvm with node and npm
ENV NODE_VERSION 20.12.0
WORKDIR /home
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
RUN chmod o+rx /home/.nvm
ENV NODE_PATH=/home/.nvm/versions/node/v${NODE_VERSION}/bin
ENV PATH=${PATH}:${NODE_PATH}
RUN node --version
RUN npm --version

# install the owl-bot CLI
WORKDIR /tools
RUN git clone https://github.com/googleapis/repo-automation-bots
WORKDIR /tools/repo-automation-bots/packages/owl-bot
RUN git checkout "${OWLBOT_CLI_COMMITTISH}"
RUN npm i && npm run compile && npm link
RUN owl-bot copy-code --version
RUN chmod -R o+rx ${NODE_PATH}
RUN ln -sf ${NODE_PATH}/* /usr/local/bin
RUN chmod o+rx $(which owl-bot)

# download the Java formatter
ADD https://maven-central.storage-download.googleapis.com/maven2/com/google/googlejavaformat/google-java-format/${JAVA_FORMAT_VERSION}/google-java-format-${JAVA_FORMAT_VERSION}-all-deps.jar \
Expand All @@ -120,7 +142,6 @@ RUN git config --system user.name "Cloud Java Bot"

# allow read-write for /home and execution for binaries in /home/.nvm
RUN chmod -R a+rw /home
RUN chmod -R a+rx /home/.nvm

WORKDIR /workspace
ENTRYPOINT [ "python", "/src/library_generation/cli/entry_point.py", "generate" ]
2 changes: 0 additions & 2 deletions .github/scripts/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ runs:
cd "${GITHUB_WORKSPACE}"
pip install --require-hashes -r hermetic_build/common/requirements.txt
pip install hermetic_build/common
pip install --require-hashes -r hermetic_build/library_generation/requirements.txt
pip install hermetic_build/library_generation
pip install --require-hashes -r hermetic_build/release_note_generation/requirements.txt
pip install hermetic_build/release_note_generation
- name: Generate changed libraries
Expand Down
14 changes: 8 additions & 6 deletions .github/scripts/hermetic_library_generation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ git checkout "${current_branch}"
# copy generation configuration from target branch to current branch.
git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}"

# get .m2 folder so it's mapped into the docker container
m2_folder=$(dirname "$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout)")

# download api definitions from googleapis repository
googleapis_commitish=$(grep googleapis_commitish "${generation_config}" | cut -d ":" -f 2 | xargs)
api_def_dir=$(mktemp -d)
Expand All @@ -92,18 +89,23 @@ pushd "${api_def_dir}"
git checkout "${googleapis_commitish}"
popd

# get changed library list.
changed_libraries=$(python hermetic_build/common/cli/get_changed_libraries.py create \
--baseline-generation-config-path="${baseline_generation_config}" \
--current-generation-config-path="${generation_config}")
echo "Changed libraries are: ${changed_libraries:-"No changed library"}."

# run hermetic code generation docker image.
docker run \
--rm \
--quiet \
-u "$(id -u):$(id -g)" \
-v "$(pwd):${workspace_name}" \
-v "${m2_folder}":/home/.m2 \
-v "${api_def_dir}:${workspace_name}/googleapis" \
-e GENERATOR_VERSION="${image_tag}" \
gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \
--baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \
--current-generation-config-path="${workspace_name}/${generation_config}" \
--generation-config-path="${workspace_name}/${generation_config}" \
--library-names="${changed_libraries}" \
--api-definitions-path="${workspace_name}/googleapis"

python hermetic_build/release_note_generation/cli/generate_release_note.py generate \
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ target/
**/build/
**/dist/
library_generation/**/*.jar

**/google-java-format.jar
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ load("@rules_jvm_external//:defs.bzl", "maven_install")
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS")
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS")

_gapic_generator_java_version = "2.49.0" # {x-version-update:gapic-generator-java:current}
_gapic_generator_java_version = "2.49.1-SNAPSHOT" # {x-version-update:gapic-generator-java:current}

maven_install(
artifacts = [
Expand Down
4 changes: 2 additions & 2 deletions api-common-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<groupId>com.google.api</groupId>
<artifactId>api-common</artifactId>
<packaging>jar</packaging>
<version>2.40.0</version><!-- {x-version-update:api-common:current} -->
<version>2.40.1-SNAPSHOT</version><!-- {x-version-update:api-common:current} -->
<name>API Common</name>
<description>Common utilities for Google APIs in Java</description>

<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.49.0</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand Down
8 changes: 4 additions & 4 deletions coverage-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>2.57.0</version> <!-- {x-version-update:gax:current} -->
<version>2.57.1-SNAPSHOT</version> <!-- {x-version-update:gax:current} -->
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<version>2.57.0</version> <!-- {x-version-update:gax-grpc:current} -->
<version>2.57.1-SNAPSHOT</version> <!-- {x-version-update:gax-grpc:current} -->
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
<version>2.57.0</version> <!-- {x-version-update:gax:current} -->
<version>2.57.1-SNAPSHOT</version> <!-- {x-version-update:gax:current} -->
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>api-common</artifactId>
<version>2.40.0</version> <!-- {x-version-update:api-common:current} -->
<version>2.40.1-SNAPSHOT</version> <!-- {x-version-update:api-common:current} -->
</dependency>
</dependencies>

Expand Down
Loading

0 comments on commit 8751f18

Please sign in to comment.