GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: bake protoc into the hermetic build docker image by diegomarquezp · Pull Request #2707 · googleapis/sdk-platform-java

This repository was archived by the owner on Oct 29, 2026. It is now read-only.

Conversation

@diegomarquezp

@diegomarquezp diegomarquezp commented Apr 30, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Does the config work with renovate bot?

Yes. After a local run using LOG_LEVEL=debug npx --yes --package renovate -- renovate --platform=local &> renovate.out, we obtained a dependency update in the logs:

           {
             "deps": [
               {     
                 "depName": "protocolbuffers/protobuf",
                 "currentValue": "25.2",
                 "datasource": "github-releases",
                 "extractVersion": "^v(?<version>.*)$",
                 "replaceString": "ARG PROTOC_VERSION=25.2\n",
                 "updates": [
                   {     
                     "bucket": "non-major",
                     "newVersion": "25.3",
                     "newValue": "25.3",
                     "releaseTimestamp": "2024-02-15T23:20:43.000Z",
                     "newMajor": 25,
                     "newMinor": 3,
                     "updateType": "minor",
                     "branchName": "renovate/protocolbuffers-protobuf-25.x"
                   },    
                   {     
                     "bucket": "major",
                     "newVersion": "26.1",
                     "newValue": "26.1",
                     "releaseTimestamp": "2024-03-27T20:28:47.000Z",
                     "newMajor": 26,
                     "newMinor": 1,
                     "updateType": "major",
                     "branchName": "renovate/protocolbuffers-protobuf-26.x"
                   }
                 ],
                 "packageName": "protocolbuffers/protobuf",
                 "versioning": "semver-coerced",
                 "warnings": [],
                 "sourceUrl": "https://github.com/protocolbuffers/protobuf",
                 "registryUrl": "https://github.com",
                 "currentVersion": "25.2",
                 "currentVersionTimestamp": "2024-01-09T23:52:55.000Z",
                 "isSingleVersion": true, 
                 "fixedVersion": "25.2"
               }
             ],

However, we disabled the setting for now. This log entry confirms it.
DEBUG: Dependency: protocolbuffers/protobuf, is disabled (repository=local)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
diegomarquezp added 30 commits April 2, 2024 18:24
@diegomarquezp
chore: bake synthtool into library_generation docker image
0b65f15
@diegomarquezp
remove synthtool usage
a6bb064
@diegomarquezp
do not use config file
d4f27e2
@diegomarquezp
bake synthtool in dockerfile
19a0b04
@diegomarquezp
bake copy-code into the image
bc693b5
@diegomarquezp
remove unnecessary SHELL statement
f335cbb
@diegomarquezp
add info for installing synthtool
aab50ef
@diegomarquezp
modify owl-bot usage in postprocess_library
f97cdca
@diegomarquezp
Merge remote-tracking branch 'origin/main' into transfer-synthtool-java
d68c14a
@diegomarquezp
fix synthtool installation
eca0d92
@diegomarquezp
change permissions to script folder
6aa8533
@diegomarquezp
assume location of generation_config.yaml
53c5dea
@diegomarquezp
fix permissions
cc4309b
@diegomarquezp
fix path to config yaml
7a4b6b8
@diegomarquezp
use entrypoint for docker image
4838d5b
@diegomarquezp
format
1b01713
@diegomarquezp
finish development guide
c149461
@diegomarquezp
remove olwbot_cli usage
4ee1692
@diegomarquezp
add entrypoint for docker image
e77bacc
@diegomarquezp
manually set HOME var in owlbot
9120c94
@diegomarquezp
Merge remote-tracking branch 'origin/main' into transfer-synthtool-java
3d18426
@diegomarquezp
post-merge cleanup
427c564
@diegomarquezp
fix parameters
7b79763
@diegomarquezp
fix synthtool sha
240742a
@diegomarquezp
fix entrypoint
8498f2c
@diegomarquezp
Merge remote-tracking branch 'origin/main' into transfer-synthtool-java
f893e5c
@diegomarquezp
lint
2faf45d
@diegomarquezp
remove unused entrypoint file
7ce9548
@diegomarquezp
remove owlbot CLI from readmne
8474452
@diegomarquezp
restore xtrace
b58e990
JoeWang1127
JoeWang1127 reviewed May 15, 2024
View reviewed changes
Comment thread library_generation/test/resources/output/gapic-generator-java-pom-parent-2.24.0.pom Outdated
@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="UTF-8"?>

@JoeWang1127 JoeWang1127 May 15, 2024

Copy link
Copy Markdown
Contributor

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.

Since this is a test resource, could you remove all unused part?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

blakeli0 and diegomarquezp reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

@diegomarquezp diegomarquezp May 16, 2024

Copy link
Copy Markdown
Contributor Author

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.

My bad, it slipped into my commits!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@diegomarquezp diegomarquezp May 22, 2024

Copy link
Copy Markdown
Contributor Author

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.

Removed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
JoeWang1127
JoeWang1127 reviewed May 15, 2024
View reviewed changes
Comment thread library_generation/utils/utilities.sh Outdated
local os_architecture=$2
if [ ! -d "protoc-${protoc_version}" ]; then

protoc_dirname="protoc-${protoc_version}"

@JoeWang1127 JoeWang1127 May 15, 2024

Copy link
Copy Markdown
Contributor

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.

Could you add a comment specifying the the protoc version priority?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
JoeWang1127
JoeWang1127 reviewed May 15, 2024
View reviewed changes
Comment thread .cloudbuild/library_generation/library_generation.Dockerfile Resolved

Uh oh!

There was an error while loading. Please reload this page.

blakeli0
blakeli0 reviewed May 15, 2024
View reviewed changes
Comment thread renovate.json
{
"customType": "regex",
"fileMatch": [
"^\\.cloudbuild/library_generation/library_generation\\.Dockerfile$"

@blakeli0 blakeli0 May 15, 2024

Copy link
Copy Markdown
Contributor

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.

Actually we probably don't want to let renovate bot to automatically update protoc. Not before we can update the whole repo(java-comon-protos, java-iam, test files in gapic-generator-java) along side the protoc update. Because the new protoc version may not work with the current protos or the newly generated code may not work with the generator.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .cloudbuild/library_generation/library_generation.Dockerfile Outdated

# install protobuf
WORKDIR /protoc
RUN ls /src

@blakeli0 blakeli0 May 15, 2024

Copy link
Copy Markdown
Contributor

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.

Is this just for troubleshooting purposes?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@diegomarquezp diegomarquezp May 22, 2024

Copy link
Copy Markdown
Contributor Author

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.

Indeed. I removed it

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread library_generation/utils/utilities.sh Outdated
# if the specified protoc_version matches the one baked in the docker
# container, we just copy it into the output folder
mkdir -p "${output_folder}/${protoc_dirname}"
cp -r "${DOCKER_PROTOC_LOCATION}/${protoc_dirname}" \

@blakeli0 blakeli0 May 15, 2024

Copy link
Copy Markdown
Contributor

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.

Can we use the protoc location specified in Dockerfile?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@diegomarquezp diegomarquezp May 22, 2024

Copy link
Copy Markdown
Contributor Author

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.

Yes. We now explicitly export the protoc_path variable to simply point to this location instead of copying it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread library_generation/utils/utilities.sh
@@ -157,7 +161,22 @@ download_generator_artifact() {
download_protoc() {

@blakeli0 blakeli0 May 15, 2024

Copy link
Copy Markdown
Contributor

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.

In general, I feel like we may not need any changes in download_protoc. Ideally this function can stay as it is and we can add logics before calling it, for example

if [[ "${protoc_version}" != "${DOCKER_PROTOC_VERSION}" ]]; then
  download_protoc "${protoc_version}" "${os_architecture}"
fi

But I think this requires us to reuse the proto location specified in Dockerfile.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@diegomarquezp diegomarquezp May 22, 2024

Copy link
Copy Markdown
Contributor Author

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 left download_protoc almost untouched and left the DOCKER_PROTOC_VERSION handling in download_tools (one level up in the call hierarchy).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

blakeli0 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread library_generation/utils/utilities.sh
if [[ -n "${DOCKER_PROTOC_VERSION}" ]]; then
>&2 echo "Using protoc version baked into the container: ${DOCKER_PROTOC_VERSION}"
echo "${DOCKER_PROTOC_VERSION}"
fi

@blakeli0 blakeli0 May 15, 2024

Copy link
Copy Markdown
Contributor

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 guess we can return this function early?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@diegomarquezp diegomarquezp May 22, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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.

This became obsolete as we moved this if statement outside of download_protoc

Removed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
diegomarquezp and others added 6 commits May 16, 2024 11:33
@diegomarquezp @JoeWang1127
Update .cloudbuild/library_generation/library_generation.Dockerfile
eb48f45
Co-authored-by: Joe Wang <[email protected]>
@diegomarquezp
remove debug dockerfile directive
706d095
@diegomarquezp
move docker embedded protoc logic outside of download_protoc
868a1bf
@diegomarquezp
Merge remote-tracking branch 'origin/main' into bake-protoc-hermetic-…
5d9beb5
…build
@diegomarquezp
return from function early
6d76843
@diegomarquezp
remove test file from commit history
8a57737
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: l Pull request size is large. labels May 22, 2024
diegomarquezp added 3 commits May 22, 2024 01:11
@diegomarquezp
fix unit tests
550f162
@diegomarquezp
fix python units
340622c
@diegomarquezp
fix IT
5e71efa
diegomarquezp
diegomarquezp commented May 22, 2024
View reviewed changes
Comment thread library_generation/test/integration_tests.py
)

@classmethod
def __remove_docker_image(cls):

@diegomarquezp diegomarquezp May 22, 2024

Copy link
Copy Markdown
Contributor Author

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.

Since the GitHub runner cleans itself up after running the ITs and we usually want to troubleshoot locally via this integration test, it may be more convenient to not have to build the image from scratch every time when debugging.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@blakeli0 blakeli0 mentioned this pull request May 22, 2024
chore: add generation config #2792
Merged
JoeWang1127
JoeWang1127 approved these changes May 22, 2024
View reviewed changes
blakeli0
blakeli0 approved these changes May 22, 2024
View reviewed changes
Comment thread .cloudbuild/library_generation/library_generation.Dockerfile
FROM gcr.io/cloud-devrel-public-resources/python

ARG SYNTHTOOL_COMMITTISH=a2c9b4a5da2d7f583c8a1869fd2843c206145834
SHELL [ "/bin/bash", "-c" ]

@blakeli0 blakeli0 May 22, 2024

Copy link
Copy Markdown
Contributor

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.

Anything requires us to change the default shell to bash?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@diegomarquezp diegomarquezp May 23, 2024

Copy link
Copy Markdown
Contributor Author

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.

The nvm installation script assumes the environment is bash based. Using sh makes the following line to have no effects.

sdk-platform-java/.cloudbuild/library_generation/library_generation.Dockerfile

Line 63 in 5e71efa

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
diegomarquezp added 2 commits May 23, 2024 14:09
@diegomarquezp
lint
c4b7f72
@diegomarquezp
Merge branch 'main' into bake-protoc-hermetic-build
df0d23c
@diegomarquezp
diegomarquezp enabled auto-merge (squash) May 23, 2024 14:10
@sonarqubecloud

sonarqubecloud Bot commented May 23, 2024

Copy link
Copy Markdown

Please retry analysis of this Pull-Request directly on SonarCloud

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sonarqubecloud

sonarqubecloud Bot commented May 23, 2024

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@diegomarquezp
diegomarquezp merged commit cf44b07 into main May 23, 2024
@diegomarquezp
diegomarquezp deleted the bake-protoc-hermetic-build branch May 23, 2024 14:23
lqiu96 pushed a commit that referenced this pull request May 23, 2024
@diegomarquezp @JoeWang1127 @lqiu96
chore: bake protoc into the hermetic build docker image (#2707)
79d120e
### Does the config work with renovate bot?
Yes. After a local run using `LOG_LEVEL=debug npx --yes --package
renovate -- renovate --platform=local &> renovate.out`, we obtained a
dependency update in the logs:
```
           {
             "deps": [
               {     
                 "depName": "protocolbuffers/protobuf",
                 "currentValue": "25.2",
                 "datasource": "github-releases",
                 "extractVersion": "^v(?<version>.*)$",
                 "replaceString": "ARG PROTOC_VERSION=25.2\n",
                 "updates": [
                   {     
                     "bucket": "non-major",
                     "newVersion": "25.3",
                     "newValue": "25.3",
                     "releaseTimestamp": "2024-02-15T23:20:43.000Z",
                     "newMajor": 25,
                     "newMinor": 3,
                     "updateType": "minor",
                     "branchName": "renovate/protocolbuffers-protobuf-25.x"
                   },    
                   {     
                     "bucket": "major",
                     "newVersion": "26.1",
                     "newValue": "26.1",
                     "releaseTimestamp": "2024-03-27T20:28:47.000Z",
                     "newMajor": 26,
                     "newMinor": 1,
                     "updateType": "major",
                     "branchName": "renovate/protocolbuffers-protobuf-26.x"
                   }
                 ],
                 "packageName": "protocolbuffers/protobuf",
                 "versioning": "semver-coerced",
                 "warnings": [],
                 "sourceUrl": "https://github.com/protocolbuffers/protobuf",
                 "registryUrl": "https://github.com",
                 "currentVersion": "25.2",
                 "currentVersionTimestamp": "2024-01-09T23:52:55.000Z",
                 "isSingleVersion": true, 
                 "fixedVersion": "25.2"
               }
             ],

```

However, we disabled the setting for now. This log entry confirms it.
`DEBUG: Dependency: protocolbuffers/protobuf, is disabled
(repository=local)`

---------

Co-authored-by: Joe Wang <[email protected]>
@diegomarquezp diegomarquezp mentioned this pull request Jul 11, 2024
chore: bake the grpc plugin in the hermetic library generation image #3045
Merged
diegomarquezp added a commit that referenced this pull request Jul 25, 2024
@diegomarquezp @blakeli0
chore: bake the grpc plugin in the hermetic library generation image (#…
4bbb8ac
…3045)

This PR bakes the gRPC plugin in the hermetic library generation image.
The approach is very similar to
#2707
 * The docker image will have a configurable `ARG` for the gRPC plugin
* The docker image will download the gRPC plugin at the version
specified in the previous point
* The docker image will set the variables DOCKER_GRPC_VERSION and
DOCKER_GRPC_LOCATION
* `generate_library.sh` will now be able to avoid downloading the gRPC
plugin if the computed plugin version is the same as DOCKER_GRPC_VERSION
(all this via `utilities.sh`).

---------

Co-authored-by: Blake Li <[email protected]>
chingor13 pushed a commit to googleapis/google-cloud-java that referenced this pull request Mar 24, 2026
@diegomarquezp @blakeli0
chore: bake the grpc plugin in the hermetic library generation image (#…
0f00c19
…3045)

This PR bakes the gRPC plugin in the hermetic library generation image.
The approach is very similar to
googleapis/sdk-platform-java#2707
 * The docker image will have a configurable `ARG` for the gRPC plugin
* The docker image will download the gRPC plugin at the version
specified in the previous point
* The docker image will set the variables DOCKER_GRPC_VERSION and
DOCKER_GRPC_LOCATION
* `generate_library.sh` will now be able to avoid downloading the gRPC
plugin if the computed plugin version is the same as DOCKER_GRPC_VERSION
(all this via `utilities.sh`).

---------

Co-authored-by: Blake Li <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@blakeli0 blakeli0 blakeli0 approved these changes
@JoeWang1127 JoeWang1127 JoeWang1127 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size: m Pull request size is medium.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@diegomarquezp @JoeWang1127 @blakeli0
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.