-
Notifications
You must be signed in to change notification settings - Fork 39
Use caching to speed up image build validation #1412
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
Conversation
Summary of ChangesHello @linsword13, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly optimizes the image build validation process within Cloud Build by implementing Docker layer caching. By configuring the build steps to utilize previously built images as cache sources, the time required for both APT and YUM-based image builds will be substantially reduced. This enhancement aims to accelerate the feedback loop for developers and improve the overall efficiency of the CI/CD pipeline. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces caching for Docker image builds to speed up the process, which is a great enhancement. The changes add --cache-from flags to the build steps. My review includes suggestions to make this configuration more robust by explicitly passing the base image and version as build arguments. This avoids relying on default values within the Dockerfiles and prevents potential mismatches between the build environment and the cache source, improving maintainability.
| - '-f' | ||
| - 'share/ramble/cloud-build/Dockerfile-apt' | ||
| - '--cache-from' | ||
| - 'us-central1-docker.pkg.dev/$PROJECT_ID/ramble-repo/ramble-${_BASE_IMG_APT}-${_BASE_VER_APT}-spack${_SPACK_REF}-python${_PYTHON_VER}:latest' |
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.
To improve maintainability and prevent potential inconsistencies, it's better to explicitly pass BASE_IMG and BASE_VER as build arguments rather than relying on the defaults in the Dockerfile. This ensures that the image is built with the same base image and version that are used to tag the cache.
- 'us-central1-docker.pkg.dev/$PROJECT_ID/ramble-repo/ramble-${_BASE_IMG_APT}-${_BASE_VER_APT}-spack${_SPACK_REF}-python${_PYTHON_VER}:latest'
- '--build-arg'
- 'BASE_IMG=${_BASE_IMG_APT}'
- '--build-arg'
- 'BASE_VER=${_BASE_VER_APT}'| - '-f' | ||
| - 'share/ramble/cloud-build/Dockerfile-yum' | ||
| - '--cache-from' | ||
| - 'us-central1-docker.pkg.dev/$PROJECT_ID/ramble-repo/ramble-${_BASE_IMG_YUM}-${_BASE_VER_YUM}-spack${_SPACK_REF}-python${_PYTHON_VER}:latest' |
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.
To improve maintainability and prevent potential inconsistencies, it's better to explicitly pass BASE_IMG and BASE_VER as build arguments rather than relying on the defaults in the Dockerfile. This ensures that the image is built with the same base image and version that are used to tag the cache.
- 'us-central1-docker.pkg.dev/$PROJECT_ID/ramble-repo/ramble-${_BASE_IMG_YUM}-${_BASE_VER_YUM}-spack${_SPACK_REF}-python${_PYTHON_VER}:latest'
- '--build-arg'
- 'BASE_IMG=${_BASE_IMG_YUM}'
- '--build-arg'
- 'BASE_VER=${_BASE_VER_YUM}'700df89 to
f4f9ada
Compare
No description provided.