Skip to content

Commit

Permalink
chore: merge main into generate-libraries-main
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-java-bot committed Dec 3, 2024
2 parents ce32fd1 + 1baedfe commit 16e5cd1
Show file tree
Hide file tree
Showing 55 changed files with 304 additions and 1,175 deletions.
15 changes: 7 additions & 8 deletions .cloudbuild/library_generation/library_generation.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ 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
FROM docker.io/library/python@sha256:5049c050bdc68575a10bcb1885baa0689b6c15152d8a56a7e399fb49f783bf98 as final



ARG OWLBOT_CLI_COMMITTISH=38fe6f89a2339ee75c77739b31b371f601b01bb3
ARG OWLBOT_CLI_COMMITTISH=ab222d9a20bb27586433caedc70f049b7853db7e
ARG PROTOC_VERSION=25.5
ARG GRPC_VERSION=1.68.1
ARG JAVA_FORMAT_VERSION=1.7
Expand Down Expand Up @@ -90,24 +88,23 @@ WORKDIR /protoc
RUN source /src/library_generation/utils/utilities.sh \
&& download_protoc "${PROTOC_VERSION}" "${OS_ARCHITECTURE}"
# we indicate protoc is available in the container via env vars
ENV DOCKER_PROTOC_LOCATION=/protoc
ENV DOCKER_PROTOC_LOCATION=/protoc/bin
ENV DOCKER_PROTOC_VERSION="${PROTOC_VERSION}"

# install grpc
WORKDIR /grpc
RUN source /src/library_generation/utils/utilities.sh \
&& download_grpc_plugin "${GRPC_VERSION}" "${OS_ARCHITECTURE}"
# similar to protoc, we indicate grpc is available in the container via env vars
ENV DOCKER_GRPC_LOCATION="/grpc/protoc-gen-grpc-java-${GRPC_VERSION}-${OS_ARCHITECTURE}.exe"
ENV DOCKER_GRPC_VERSION="${GRPC_VERSION}"

ENV DOCKER_GRPC_LOCATION="/grpc/protoc-gen-grpc-java.exe"

# Here we transfer gapic-generator-java from the previous stage.
# Note that the destination is a well-known location that will be assumed at runtime
# We hard-code the location string to avoid making it configurable (via ARG) as
# well as to avoid it making it overridable at runtime (via ENV).
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"
ENV GAPIC_GENERATOR_LOCATION="${HOME}/.library_generation/gapic-generator-java.jar"

RUN python -m pip install --upgrade pip

Expand All @@ -126,11 +123,13 @@ RUN git checkout "${OWLBOT_CLI_COMMITTISH}"
RUN npm i && npm run compile && npm link
RUN owl-bot copy-code --version
RUN chmod o+rx $(which owl-bot)
RUN apk del -r npm && apk cache clean

# 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 \
"${HOME}"/.library_generation/google-java-format.jar
RUN chmod 755 "${HOME}"/.library_generation/google-java-format.jar
ENV JAVA_FORMATTER_LOCATION="${HOME}/.library_generation/google-java-format.jar"

# allow users to access the script folders
RUN chmod -R o+rx /src
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hermetic_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: |
GENERATOR_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout -pl gapic-generator-java)
echo "GENERATOR_VERSION=${GENERATOR_VERSION}" >> "$GITHUB_ENV"
docker build \
DOCKER_BUILDKIT=1 docker build \
-f .cloudbuild/library_generation/library_generation.Dockerfile \
-t gcr.io/cloud-devrel-public-resources/java-library-generation:"${GENERATOR_VERSION}" \
.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
cache: maven
- run: mvn -version
- name: Install
run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip -T 1C
run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip
- name: Create issue if previous step fails
if: ${{ failure() }}
env:
Expand All @@ -49,7 +49,7 @@ jobs:
cache: maven
- run: mvn -version
- name: Install with Java 11
run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip -DskipTests -T 1C
run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip -DskipTests

- uses: actions/setup-java@v3
with:
Expand All @@ -58,7 +58,7 @@ jobs:
- run: mvn -version
- name: Test with Java 8
# Direct goal invocation ("surefire:test") prevents recompiling tests
run: mvn surefire:test --errors --batch-mode --no-transfer-progress -T 1C
run: mvn surefire:test --errors --batch-mode --no-transfer-progress
- name: Create issue if previous step fails
if: ${{ failure() }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
git checkout -b "${head_ref}" fork/${head_ref}
changed_directories="$(git diff --name-only "fork/${head_ref}" "origin/${base_ref}")"
fi
if [[ ${changed_directories} =~ "hermetic_build/" ]]; then
if [[ ${changed_directories} =~ "hermetic_build/" ]] || [[ ${changed_directories} =~ ".cloudbuild/library_generation/" ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
Expand Down
1 change: 1 addition & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ maven_install(
"com.google.api:gapic-generator-java:" + _gapic_generator_java_version,
] + PROTOBUF_MAVEN_ARTIFACTS + IO_GRPC_GRPC_JAVA_ARTIFACTS,
fail_on_missing_checksum = False,
override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS,
repositories = [
"m2Local",
"https://repo.maven.apache.org/maven2/",
Expand Down
2 changes: 1 addition & 1 deletion gax-java/dependencies.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ version.io_grpc=1.68.1
# 2) Replace all characters which are neither alphabetic nor digits with the underscore ('_') character
maven.com_google_api_grpc_proto_google_common_protos=com.google.api.grpc:proto-google-common-protos:2.46.0
maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.46.0
maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.30.0
maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.29.0
maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.30.0
maven.io_opentelemetry_opentelemetry_api=io.opentelemetry:opentelemetry-api:1.42.1
maven.io_opencensus_opencensus_api=io.opencensus:opencensus-api:0.31.1
Expand Down
1 change: 0 additions & 1 deletion gax-java/gax-grpc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ _COMPILE_DEPS = [
"@io_grpc_grpc_netty_shaded//jar",
"@io_grpc_grpc_grpclb//jar",
"@io_grpc_grpc_java//alts:alts",
"@io_grpc_grpc_java//s2a:s2av2_credentials",
"@io_netty_netty_tcnative_boringssl_static//jar",
"@javax_annotation_javax_annotation_api//jar",
"//gax:gax",
Expand Down
6 changes: 6 additions & 0 deletions gax-java/gax-grpc/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@
<className>com/google/api/gax/grpc/GrpcTransportChannel</className>
<method>boolean isDirectPath()</method>
</difference>
<!-- Ignore this as this was part of s2a-grpc ExperimentalApi revert -->
<difference>
<differenceType>7002</differenceType>
<className>com/google/api/gax/grpc/InstantiatingGrpcChannelProvider</className>
<method>* withUseS2A(*)</method>
</difference>
</differences>
4 changes: 0 additions & 4 deletions gax-java/gax-grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-s2a</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
Expand Down
Loading

0 comments on commit 16e5cd1

Please sign in to comment.