-
Notifications
You must be signed in to change notification settings - Fork 55
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: bake synthtool and owl-bot into library_generation docker image #2615
Conversation
We also need to modify workflow files in google-cloud-java after this pull request is merged because the docker command is changed. |
[Maybe out of scope of this PR] |
RUN chmod -R a+rx /home/.nvm | ||
|
||
WORKDIR /workspace | ||
ENTRYPOINT [ "python", "/src/cli/entry_point.py", "generate" ] |
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?
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
|
||
# 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]" |
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.
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.
|
||
# install synthtool | ||
WORKDIR /tools | ||
RUN git clone https://github.com/googleapis/synthtool |
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?
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
RUN apt-get update && apt-get install -y \ | ||
unzip openjdk-17-jdk rsync maven jq \ | ||
unzip openjdk-17-jdk rsync maven jq less vim \ |
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?
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?
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.
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.
Co-authored-by: Joe Wang <[email protected]>
Yes, indeed. This is considered in the follow up section of the PR description. I will do it right after we merge this |
Yes, my only concern is that |
Quality Gate passed for 'gapic-generator-java-root'Issues Measures |
Quality Gate passed for 'java_showcase_integration_tests'Issues Measures |
RUN apt-get update && apt-get install -y \ | ||
unzip openjdk-17-jdk rsync maven jq \ | ||
&& apt-get clean | ||
|
||
COPY library_generation /src | ||
|
||
# use python 3.11 (the base image has several python versions; here we define the default one) |
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
?
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.
This intends to adapt the config yamle to the changes made in googleapis/sdk-platform-java#2615
…ig (#10833) This intends to adapt the config yamle to the changes made in googleapis/sdk-platform-java#2615
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.
#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]>
Context
Milestone 7 of Hermetic Build
In this PR
git clone
it anymore)Follow ups