fix(cli): benchmark related products#158
Conversation
Summary of ChangesHello @bcfre, 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 integrates the 'genai-bench' benchmark tool into the project's build system. It establishes the necessary infrastructure to build and manage a Docker image for 'genai-bench', enabling its use within the CLI's benchmark-related products. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
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.
Code Review
This pull request introduces support for a new benchmark tool, genai-bench, by adding a new Dockerfile and updating the Makefile to build and push the corresponding image. My review focuses on improving the new Dockerfile. I've provided a suggestion to optimize the Docker image size by restructuring the RUN commands. This change ensures that build dependencies and temporary files are cleaned up within a single layer, which is a best practice for creating smaller and more efficient Docker images.
Pull Request Test Coverage Report for Build 22010296167Details
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
This pull request adds infrastructure to support building and distributing the genai-bench benchmark tool and CLI binaries. It introduces a Dockerfile for containerizing genai-bench, Makefile targets for building the benchmark tool image, and GitHub Actions workflows for automated builds and releases.
Changes:
- Added Dockerfile for genai-bench benchmark tool with Python 3.12 base image
- Added Makefile targets for building and pushing the benchtool Docker image
- Added GitHub Actions workflow for automated CLI binary releases across multiple platforms
- Added GitHub Actions workflow for building and pushing the benchmark benchtool image
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| cmd/cli/cmd/llm/benchmark/benchtool/Dockerfile-genai | New Dockerfile that builds genai-bench tool image from source |
| Makefile | Added variables and targets for building/pushing benchtool-genai Docker image |
| .github/workflows/release-cli.yml | New workflow for releasing CLI binaries for multiple OS/arch combinations |
| .github/workflows/benchmark-benchtool-build.yml | New workflow for building and pushing benchmark benchtool Docker image |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new Docker image for benchtool-genai to support benchmarking, along with the necessary Makefile targets to build and push the image. My review focuses on improving the new Dockerfile for better efficiency and security. I've suggested using a multi-stage build to create a smaller final image. Additionally, it appears the new make targets (docker-build-benchtool-genai, docker-push-benchtool-genai) have not been added to the aggregate DOCKER_BUILD and DOCKER_PUSH variables in the Makefile. You might want to add them for consistency with other images in the project, so that make docker-build and make docker-push include this new image.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: ${{ env.GO_VERSION }} | ||
|
|
||
| - name: Get version info | ||
| id: version | ||
| run: | | ||
| if [[ "${{ github.event_name }}" == "push" && "${{ github.ref_type }}" == "tag" ]]; then | ||
| TAG=${GITHUB_REF#refs/tags/} | ||
| elif [[ -n "${{ inputs.tag }}" ]]; then | ||
| TAG="${{ inputs.tag }}" | ||
| else | ||
| # Fallback to latest git tag for manual dispatch without input | ||
| TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "dev") | ||
| fi |
There was a problem hiding this comment.
The workflow_dispatch path computes a tag but the repo is always checked out at the default ref. This can produce binaries whose embedded version/tag doesn’t match the source commit (and git_commit will be for the checked-out branch, not the requested tag). Update the checkout to use the requested tag/ref (or perform a second checkout after determining the tag) so the build inputs match the release tag.
e41bdfe to
6e77449
Compare
|
/gemini review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| .PHONY: docker-build-benchtool-genai | ||
| docker-build-benchtool-genai: ## Build docker image for benchmark benchtool (genai-bench) | ||
| $(CONTAINER_TOOL) build -f ${BENCHMARK_BENCHTOOL_DOCKERFILE} -t ${BENCHMARK_BENCHTOOL_IMG}:${TAG} . |
There was a problem hiding this comment.
This Docker build command is missing the $(DOCKER_BUILD_ARGS) parameter that is used in other Docker build targets (see lines 191, 195, 199, 203). While this may be intentional since the Dockerfile doesn't use GOPROXY/GOPRIVATE/GOSUMDB build args, it's inconsistent with the pattern established for other images in this Makefile. Consider either adding $(DOCKER_BUILD_ARGS) for consistency or documenting why it's not needed.
| $(CONTAINER_TOOL) build -f ${BENCHMARK_BENCHTOOL_DOCKERFILE} -t ${BENCHMARK_BENCHTOOL_IMG}:${TAG} . | |
| $(CONTAINER_TOOL) build -f ${BENCHMARK_BENCHTOOL_DOCKERFILE} -t ${BENCHMARK_BENCHTOOL_IMG}:${TAG} $(DOCKER_BUILD_ARGS) . |
Signed-off-by: cheyang <[email protected]>
|
/gemini review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if [[ "${{ github.event_name }}" == "push" && "${{ github.ref_type }}" == "tag" ]]; then | ||
| TAG=${GITHUB_REF#refs/tags/} | ||
| elif [[ -n "${{ inputs.tag }}" ]]; then | ||
| TAG="${{ inputs.tag }}" | ||
| else | ||
| # Fallback to latest git tag for manual dispatch without input | ||
| TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "dev") | ||
| fi |
There was a problem hiding this comment.
On tag pushes, github.ref_type is not reliably set for the push event, so this condition can fail and fall back to git describe, potentially releasing with the wrong tag. A more reliable check is to test GITHUB_REF (e.g., refs/tags/*) or use ${{ startsWith(github.ref, 'refs/tags/') }} to detect tag refs.
| workflow_dispatch: # Allow manual trigger | ||
| inputs: | ||
| tag: | ||
| description: 'Release tag (e.g., v0.1.0). If not specified, uses the latest git tag.' | ||
| required: false | ||
| type: string |
There was a problem hiding this comment.
workflow_dispatch is now supported, but the workflow still creates a GitHub Release without explicitly setting tag_name. For manual dispatch, action-gh-release will default to the branch ref (e.g., main), which can fail or create an unintended release. Consider wiring the chosen tag (input/fallback) through as an output and using it as tag_name (and optionally target_commitish) in the release step, or skipping release creation for non-tag runs.
| workflow_dispatch: # Allow manual trigger | ||
| inputs: | ||
| tag: | ||
| description: 'Release tag (e.g., v0.1.0). If not specified, uses the latest git tag.' | ||
| required: false | ||
| type: string |
There was a problem hiding this comment.
The PR description still contains the placeholder fixes #XXXX, so it’s unclear what issue (if any) this change is meant to close. Please update the PR description to reference the real issue number or set it to NONE.
Signed-off-by: cheyang <[email protected]>
Ⅰ. Motivation
Ⅱ. Modifications
Ⅲ. Does this pull request fix one issue?
fixes #XXXX
Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅴ. Describe how to verify it
VI. Special notes for reviews
Checklist
make fmt.