Repository navigation
Conversation
Summary of ChangesHello @ru-aish, 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 enhances the compatibility of the sandbox environment by enabling multi-architecture Docker builds. It directly addresses runtime errors encountered on ARM64 hosts, ensuring that users on these platforms can seamlessly run the sandbox without issues related to emulation or incorrect architecture. The change streamlines the build and publishing process within the CI/CD pipeline, making the sandbox more robust and accessible across diverse hardware. Highlights
Changelog
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.
Code Review
This pull request correctly addresses the issue of single-architecture Docker builds for the sandbox by enabling multi-arch builds for linux/amd64 and linux/arm64. The approach of using docker buildx with the --platform and --push flags is the standard way to achieve this. The change to the GitHub Actions workflow is concise and effective. I have one suggestion to improve the readability and robustness of the conditional expression used to add the --push flag.
|
/gemini review |
There was a problem hiding this comment.
Code Review
The pull request correctly implements multi-architecture Docker builds for the sandbox, which is a significant improvement for ARM64 compatibility. However, there are two issues that need to be addressed: an invalid expression syntax in the GitHub Actions workflow and the accidental inclusion of a temporary file (pr_body.txt).
bf4187c to
811febf
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request correctly enables multi-architecture Docker builds for the sandbox image by updating the GitHub Actions workflow. The change properly uses docker buildx with the --platform flag to build for both linux/amd64 and linux/arm64. The logic to conditionally push the image using the --push flag based on the dry-run input is also sound, and the removal of the now-redundant docker push step is appropriate. The implementation looks solid and should resolve the reported issues on ARM64 hosts.
|
@gemini-cli-maintainers pls review |
scidomino
left a comment
There was a problem hiding this comment.
Thanks for this PR! However, there is an issue with how docker buildx build behaves that will cause the GitHub Actions workflow to fail during a dry run (dry-run: true).
When you use docker buildx build with multiple platforms (like --platform linux/amd64,linux/arm64), Docker cannot load the resulting multi-architecture image into the local Docker daemon.
If dry-run is true, the --push flag is omitted. The build will succeed, but the image will not be pushed to the registry and cannot be loaded locally. As a result, the immediate next step in the action (verify), which attempts to run a docker run command using the newly built image, will fail with an "image not found" error because the image exists neither locally nor remotely.
To fix this, we need to handle the dry-run case differently. For example, during a dry-run, we should build only for a single architecture (e.g., linux/amd64) and use the --load flag so the image is available locally for the verify step. For non-dry runs, we can use the multi-platform flags with --push.
Could you please update the PR to handle the dry-run scenario? Something like this should work:
env:
GEMINI_SANDBOX_IMAGE_TAG: '${{ steps.image_tag.outputs.FINAL_TAG }}'
GEMINI_SANDBOX: 'docker'
BUILD_SANDBOX_FLAGS: "${{ inputs.dry-run != 'true' && '--platform linux/amd64,linux/arm64 --push' || '--platform linux/amd64 --load' }}"|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request correctly enables multi-architecture Docker builds for the sandbox environment by updating the GitHub Actions workflow. The change correctly uses docker buildx with the --platform and --push flags for multi-arch builds, and removes the now-redundant docker push step. My feedback includes a suggestion to improve the readability of the conditional logic in the workflow file for better long-term maintainability.
|
@scidomino I have change as suggested. gemini review is Hallucinating GitHub Actions expressions do NOT support an if() function. |
|
Also, rebase to main and resolve the merge conflicts. |
6160c70 to
e275b5d
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request correctly enables multi-architecture Docker builds for the sandbox environment. The changes, which include adding QEMU setup and updating the Docker build flags to build and push for both amd64 and arm64 architectures, are logical and well-implemented. The related workflow steps for verification and publishing are also correctly adjusted. I have one suggestion to improve the clarity of the conditional logic in the GitHub Actions workflow.
| echo "uri=$(cat final_image_uri.txt)" >> $GITHUB_OUTPUT | ||
| - name: 'verify' | ||
| shell: 'bash' | ||
| if: "${{ inputs.dry-run == 'true' }}" |
There was a problem hiding this comment.
The more I think about it the less I like the idea of skipping verification when not doing a dry run.
Can we change it to do this instead:
Keep build and verify exactly as it is now (where it only builds amd64), but in the publish step, build both and publish them.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the sandbox release pipeline to support multi-architecture Docker builds for linux/amd64 and linux/arm64 using setup-qemu-action and docker buildx. However, a critical command injection vulnerability was identified due to an unquoted environment variable in a shell command. Additionally, the Docker image name in the publish step is incorrectly configured to push to Docker Hub instead of the authenticated GitHub Container Registry, which will cause the workflow to fail.
f753a56 to
6ecb3e0
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
The pull request successfully enables multi-architecture Docker builds for the sandbox, addressing the exec format error on ARM64 hosts. The addition of QEMU setup and the use of buildx with multi-platform flags are key to this fix. However, the current implementation introduces a redundancy where the amd64 Docker image is built twice within the workflow, once for local loading and again as part of the multi-architecture push, which could be optimized.
…19821) Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
…19821) Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
…19821) Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
…19821) Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
…19821) Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
…19821) Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
…19821) Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
…19821) Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
…19821) Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
Summary
Fixes the
exec format errorandfailed to map segment from shared objectcrashes that occur when running the sandbox on ARM64 hosts (like the Raspberry Pi 5). This enables multi-architecture Docker builds in the sandbox release pipeline.Details
The GitHub Actions workflow building the sandbox image currently defaults to only
linux/amd64. When anarm64host pulls the image, Docker attempts to run it using QEMU emulation, resulting in low-level memory mapping failures (specifically when executinggroupadd).This change passes
--platform linux/amd64,linux/arm64and--pushto the buildx executor within the Actions pipeline. Docker automatically publishes the multi-arch manifest.Related Issues
Fixes #15778
How to Validate
Release Sandboxworkflow (or wait for the nightly).docker buildx.gemini -s.Pre-Merge Checklist