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 synthtool and owl-bot into library_generation docker image by diegomarquezp · Pull Request #2615 · 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 2, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Context

Milestone 7 of Hermetic Build

In this PR

  • Bake synthtool into the docker image (we won't git clone it anymore)
  • Bake the owlbot CLI into the docker image (we won't use docker inside docker anymore)
  • Create a DEVELOPMENT.md file with instructions for local setup (example: install owlbot CLI locally)

Follow ups

  • modify google-cloud-java's workflows to correct the volume mapping being used

Sorry, something went wrong.

Uh oh!

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

All reactions
diegomarquezp added 4 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
@product-auto-label product-auto-label Bot added the size: m Pull request size is medium. label Apr 2, 2024
diegomarquezp added 4 commits April 2, 2024 20:18
@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 diegomarquezp changed the title chore: bake synthtool into library_generation docker image chore: bake synthtool and owl-bot into library_generation docker image Apr 2, 2024
@diegomarquezp diegomarquezp changed the title chore: bake synthtool and owl-bot into library_generation docker image chore: [wip] bake synthtool and owl-bot into library_generation docker image Apr 2, 2024
diegomarquezp added 9 commits April 10, 2024 15:16
@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
@product-auto-label product-auto-label Bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Apr 11, 2024
@diegomarquezp
remove olwbot_cli usage
4ee1692
@JoeWang1127 JoeWang1127 mentioned this pull request Apr 16, 2024
chore: remove generated files in tests #2644
Merged
diegomarquezp added 6 commits April 17, 2024 15:22
@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
@JoeWang1127

JoeWang1127 commented Apr 22, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

[Maybe out of scope of this PR] postprocess_library.sh is ~100 lines in this PR, should we refactor it to python script?

All reactions

Sorry, something went wrong.

Uh oh!

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

JoeWang1127
JoeWang1127 reviewed Apr 23, 2024
View reviewed changes
Comment thread .cloudbuild/library_generation/library_generation.Dockerfile
RUN chmod -R a+rx /home/.nvm

WORKDIR /workspace
ENTRYPOINT [ "python", "/src/cli/entry_point.py", "generate" ]

@JoeWang1127 JoeWang1127 Apr 23, 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 the user run the image with different scripts/methods?

Sorry, something went wrong.

Uh oh!

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

All reactions

@diegomarquezp diegomarquezp Apr 29, 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, I declared this ENTRYPOINT since it's the "official" one. If we want to run a different script, we can pass the --entrypoint /src/my_script.py flag

Sorry, something went wrong.

Uh oh!

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

JoeWang1127 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
blakeli0
blakeli0 reviewed Apr 25, 2024
View reviewed changes
Comment thread .cloudbuild/library_generation/library_generation.Dockerfile

# set dummy git credentials for the empty commit used in postprocessing
# we use system so all users using the container will use this configuration
RUN git config --system user.email "[email protected]"

@blakeli0 blakeli0 Apr 25, 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 think the only reason we need git config is from the post processing here? If it is, I think we should look into not initialize a Git repo, as a follow up enhancement though.

Sorry, something went wrong.

Uh oh!

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

All reactions

@diegomarquezp diegomarquezp Apr 29, 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, but the root cause is that the owl-bot CLI assumes the source folder (the one we generate and arrange) is a git repository. Extra points to process owlbot yamls using a custom script.

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

# install synthtool
WORKDIR /tools
RUN git clone https://github.com/googleapis/synthtool

@blakeli0 blakeli0 Apr 25, 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 think the only reason we need synthtool is java.py and its dependencies?

Sorry, something went wrong.

Uh oh!

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

All reactions

@diegomarquezp diegomarquezp Apr 29, 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, mainly the common_templates function. We could in theory move java.py and that function to sdk-platform

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread library_generation/DEVELOPMENT.md Resolved

Uh oh!

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

Comment thread library_generation/DEVELOPMENT.md Resolved

Uh oh!

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

Comment thread library_generation/DEVELOPMENT.md Resolved

Uh oh!

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

blakeli0
blakeli0 reviewed Apr 26, 2024
View reviewed changes
Comment thread .cloudbuild/library_generation/library_generation.Dockerfile Outdated
# install OS tools
RUN apt-get update && apt-get install -y \
unzip openjdk-17-jdk rsync maven jq \
unzip openjdk-17-jdk rsync maven jq less vim \

@blakeli0 blakeli0 Apr 26, 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 don't see less and vim being used, I guess the reason we need them is for testing purpose?

Sorry, something went wrong.

Uh oh!

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

All reactions

@diegomarquezp diegomarquezp Apr 29, 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.

It's just for inspecting the container files in case things go wrong during local development. Do we want to only keep the production dependencies?

Sorry, something went wrong.

Uh oh!

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

All reactions

@JoeWang1127 JoeWang1127 Apr 30, 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.

For local development, I think you can mention them in the development.md. No need to install it in production.

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

@diegomarquezp diegomarquezp Apr 30, 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.

Makes sense, I removed these tools from the image and added a small section in the development guide.

Sorry, something went wrong.

Uh oh!

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

All reactions
@blakeli0
blakeli0 requested review from chingor13 and suztomo April 26, 2024 20:11
@diegomarquezp @JoeWang1127
Update library_generation/DEVELOPMENT.md
7ec0f4c
Co-authored-by: Joe Wang <[email protected]>
@diegomarquezp

diegomarquezp commented Apr 29, 2024

Copy link
Copy Markdown
Contributor Author

We also need to modify workflow files in google-cloud-java after this pull request is merged because the docker command is changed.

Yes, indeed. This is considered in the follow up section of the PR description. I will do it right after we merge this

All reactions

Sorry, something went wrong.

Uh oh!

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

@diegomarquezp

diegomarquezp commented Apr 29, 2024

Copy link
Copy Markdown
Contributor Author

[Maybe out of scope of this PR] postprocess_library.sh is ~100 lines in this PR, should we refactor it to python script?

Yes, my only concern is that xtrace is really useful for debugging the shell scripts. I may give it a try as well as including different levels of logging for some of the scripts

All reactions

Sorry, something went wrong.

Uh oh!

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

diegomarquezp added 4 commits April 29, 2024 23:28
@diegomarquezp
docker instructions, pwd blurb, unit tests instructions
4399bfe
@diegomarquezp
Merge remote-tracking branch 'origin/main' into transfer-synthtool-java
ef105e7
@diegomarquezp
Merge remote-tracking branch 'origin/transfer-synthtool-java' into tr…
b1d3fc3
…ansfer-synthtool-java
@diegomarquezp
restore generate repo
1df1aa1
@diegomarquezp diegomarquezp mentioned this pull request Apr 30, 2024
chore: bake protoc into the hermetic build docker image #2707
Merged
@diegomarquezp
move text editor installation as a readme note
bf95938
@diegomarquezp
diegomarquezp requested review from JoeWang1127 and blakeli0 April 30, 2024 19:54
@sonarqubecloud

sonarqubecloud Bot commented Apr 30, 2024

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

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.

@sonarqubecloud

sonarqubecloud Bot commented Apr 30, 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.

JoeWang1127
JoeWang1127 approved these changes Apr 30, 2024
View reviewed changes
blakeli0
blakeli0 approved these changes Apr 30, 2024
View reviewed changes
Comment thread .cloudbuild/library_generation/library_generation.Dockerfile

COPY library_generation /src

# use python 3.11 (the base image has several python versions; here we define the default one)

@blakeli0 blakeli0 Apr 30, 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.

Because the base image cloud-devrel-public-resources still uses 3.11 so we have to use 3.11? Who maintains cloud-devrel-public-resources?

Sorry, something went wrong.

Uh oh!

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

All reactions

@diegomarquezp diegomarquezp May 1, 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.

so we have to use 3.11?

We could use a higher version too, or even a lower one if it's still compatible with the dependencies

who maintains cloud-devrel-public-resources?

Judging from a documentation entry in the cloud client libraries g3doc, I think it's the Cloud Client Libraries team
Maybe we can extract the base Dockerfile and prepend it to ours to eliminate this dependency.

Sorry, something went wrong.

Uh oh!

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

All reactions
@diegomarquezp
diegomarquezp merged commit 16aec03 into main May 1, 2024
@diegomarquezp
diegomarquezp deleted the transfer-synthtool-java branch May 1, 2024 17:14
@diegomarquezp diegomarquezp mentioned this pull request May 1, 2024
chore: update hermetic build docker volume usage googleapis/google-cloud-java#10770
Closed
diegomarquezp added a commit to googleapis/google-cloud-java that referenced this pull request May 13, 2024
@diegomarquezp
chore: remove synthtool_committish and owlbot_cli_image from gen config
b52c556
This intends to adapt the config yamle to the changes made in
googleapis/sdk-platform-java#2615
@diegomarquezp diegomarquezp mentioned this pull request May 13, 2024
chore: remove synthtool_committish and owlbot_cli_image from gen config googleapis/google-cloud-java#10833
Merged
diegomarquezp added a commit to googleapis/google-cloud-java that referenced this pull request May 13, 2024
@diegomarquezp
chore: remove synthtool_committish and owlbot_cli_image from gen conf…
4c1164d
…ig (#10833)

This intends to adapt the config yamle to the changes made in
googleapis/sdk-platform-java#2615
lqiu96 pushed a commit that referenced this pull request May 22, 2024
@JoeWang1127 @lqiu96
chore: remove generated files in tests (#2644)
d799fe7
In this PR:
- Remove generated files after running tests.

Note that files generated by `docker run` have root permission, thus
can't be removed by this PR. This issue will be resolved in #2615.
lqiu96 pushed a commit that referenced this pull request May 22, 2024
@diegomarquezp @JoeWang1127 @lqiu96
chore: bake synthtool and owl-bot into library_generation docker image (
66113fe
#2615)

## Context
[Milestone 7 of Hermetic
Build](https://docs.google.com/document/d/1v-sJBmdNEVBRryL8n90XK8OIiqVphaJemXVhANw14Jk/edit?pli=1&resourcekey=0-QGUb2do-JBlDWKvptWBp_g&tab=t.0#bookmark=id.bkbj04ib2d4n)

## In this PR
- Bake synthtool into the docker image (we won't `git clone` it anymore)
- Bake the owlbot CLI into the docker image (we won't use docker inside
docker anymore)
- Create a DEVELOPMENT.md file with instructions for local setup
(example: install owlbot CLI locally)

## Follow ups
- [ ] modify google-cloud-java's workflows to correct the volume mapping
being used

---------

Co-authored-by: Joe Wang <[email protected]>
lqiu96 pushed a commit to googleapis/google-cloud-java that referenced this pull request Jul 7, 2025
@diegomarquezp @lqiu96
chore: remove synthtool_committish and owlbot_cli_image from gen conf…
1439988
…ig (#10833)

This intends to adapt the config yamle to the changes made in
googleapis/sdk-platform-java#2615
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@suztomo suztomo Awaiting requested review from suztomo
@chingor13 chingor13 Awaiting requested review from chingor13
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: l Pull request size is large.

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.