-
Notifications
You must be signed in to change notification settings - Fork 4
ci: daily Evals CI for Extensions/Skills on github using Evalbench #152
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
Merged
Merged
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
b6305c2
feat: add Dockerfile and Cloud Build pipeline for automated Evalbench…
omkargaikwad23 01bc25b
feat: integrate full evaluation pipeline in cloudbuild and update mod…
omkargaikwad23 663d2aa
chore: update Dockerfile to fetch binary, and parameterize Cloud Buil…
omkargaikwad23 a83c79e
chore: enable BigQuery reporting in eval configuration
omkargaikwad23 c221c21
chore: update model config path, disable unauthenticated cloud run ac…
omkargaikwad23 a8401a2
chore: remove debug logging from cloudbuild configuration
omkargaikwad23 e360740
feat: migrate database password from environment variable to Secret M…
omkargaikwad23 73bb202
refactor: remove unnecessary comment from docker build step in cloudb…
omkargaikwad23 c88e6f7
chore: add Apache 2.0 license headers to configuration and build files
omkargaikwad23 d7168ea
chore: update cloudbuild configuration and model environment settings…
omkargaikwad23 d38f261
chore: update evaluation project ID and gemini-cli dependency version
omkargaikwad23 aa6ab94
chore: configure service account for Cloud Run step and simplify eval…
omkargaikwad23 6b1d22b
feat: add GEMINI_MODEL configuration to model_config.yaml, ortherwise…
omkargaikwad23 8b9462c
chore: standardize model evaluation configuration settings
omkargaikwad23 ae11bdf
feat: inject CLOUD_SQL_POSTGRES_PASSWORD into build step and update e…
omkargaikwad23 5a6d865
remove Dockerfile, cloudbuild deployment steps, and configurations
omkargaikwad23 35f1c78
feat: integrate environment substitution, add port polling utility, u…
omkargaikwad23 d4f796a
chore: update configuration settings
omkargaikwad23 1722276
feat: update evaluation scenarios and add performance and qualitative…
omkargaikwad23 602da9f
refactor: parameterize evaluation configuration variables and remove …
omkargaikwad23 65a84d9
refactor: switch to standalone evaluation execution
omkargaikwad23 a130f3d
refactor: update eval_server image to latest
omkargaikwad23 42ce176
refactor: remove unused port check utility
omkargaikwad23 941693b
refactor: standardize max_turns to 3 across all evaluation datasets a…
omkargaikwad23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| options: | ||
| logging: CLOUD_LOGGING_ONLY | ||
|
|
||
| steps: | ||
|
|
||
| # --- Evaluation Step --- | ||
| - name: 'us-central1-docker.pkg.dev/cloud-db-nl2sql/evalbench/eval_server:89aa9fefd4b247610a95ef0896ba55d468563f50' | ||
| entrypoint: 'bash' | ||
| # Decrypts the secret from Secret Manager into the DB_PASSWORD environment variable | ||
| secretEnv: ['DB_PASSWORD'] | ||
| args: | ||
| - '-c' | ||
| - | | ||
| set -e | ||
| # Workaround for evalbench bug: settings are only applied if path basename matches extension ID | ||
| ln -s /workspace /workspace/cloud-sql-postgresql | ||
| cd /evalbench | ||
|
|
||
| export EVAL_GCP_PROJECT_ID=$PROJECT_ID | ||
| export EVAL_GCP_PROJECT_REGION=us-central1 | ||
| # Maps the decrypted DB_PASSWORD to the exact variable expected by gemini_cli and extension skills | ||
| export CLOUD_SQL_POSTGRES_PASSWORD=$$DB_PASSWORD | ||
|
|
||
| # Substitute environment variables in model_config.yaml | ||
| python3 /workspace/evals/substitute_env.py | ||
|
|
||
| export EVALBENCH_INSECURE=True | ||
| export EVALBENCH_HOST=0.0.0.0 | ||
| cd evalbench | ||
| export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python | ||
| export PYTHONPATH=./evalproto:. | ||
| export CLOUD_RUN=True | ||
| export PORT=50051 | ||
|
|
||
| echo "Starting Evaluation Server in background..." | ||
| python3 -u ./eval_server.py --localhost </dev/null 2>&1 | tee server.log & | ||
|
|
||
| echo "Waiting for port 50051 to open..." | ||
| python3 /workspace/evals/wait_for_port.py || { echo "Server failed to bind port."; exit 1; } | ||
|
|
||
| echo "Server is running. Launching Evaluation Client..." | ||
| cd /evalbench | ||
| export PYTHONPATH=./evalbench:./evalbench/evalproto | ||
|
|
||
| python3 evalbench/client/eval_client.py --experiment=/workspace/evals/run_config.yaml --endpoint=local || { echo "Client failed! Server logs:"; cat /evalbench/evalbench/server.log; exit 1; } | ||
|
|
||
| availableSecrets: | ||
| secretManager: | ||
| - versionName: projects/$PROJECT_ID/secrets/daily-ci-evals-db-password/versions/latest | ||
| env: 'DB_PASSWORD' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| { | ||
| "scenarios": [ | ||
| { | ||
| "id": "cloud-sql-list-instances", | ||
| "starting_prompt": "Show me all the Cloud SQL instances in this project.", | ||
| "conversation_plan": "Ask the agent to list the Cloud SQL instances in the current project.", | ||
| "expected_trajectory": [ | ||
| "list_instances" | ||
| ], | ||
| "kind": "tool", | ||
| "max_turns": 5 | ||
| }, | ||
| { | ||
| "id": "cloud-sql-data-explore", | ||
| "starting_prompt": "What schemas and tables do we have in this database? Please list them.", | ||
| "conversation_plan": "Ask the agent to list the schemas in the database. Then ask to list the tables.", | ||
| "expected_trajectory": [ | ||
| "list_schemas", | ||
| "list_tables" | ||
| ], | ||
| "kind": "tool", | ||
| "max_turns": 5 | ||
| }, | ||
| { | ||
| "id": "cloud-sql-perf-troubleshoot", | ||
| "starting_prompt": "The database is running slow. Are there any active queries running for more than 10 seconds or any locks?", | ||
| "conversation_plan": "Ask the agent to check for active queries running longer than 10 seconds. Then ask to check for locks.", | ||
| "expected_trajectory": [ | ||
| "list_active_queries", | ||
| "list_locks" | ||
| ], | ||
| "kind": "tool", | ||
| "max_turns": 5 | ||
| }, | ||
| { | ||
| "id": "cloud-sql-metrics-cpu", | ||
| "starting_prompt": "Can you show me the CPU utilization for instance 'daily-ci-evals-db' in project 'ext-test-cloud-sql-postgres' for the last 5 minutes?", | ||
| "conversation_plan": "Ask the agent to query the CPU utilization metric for the specified instance and project using PromQL.", | ||
| "expected_trajectory": [ | ||
| "get_system_metrics" | ||
| ], | ||
| "kind": "tool", | ||
| "max_turns": 4 | ||
| }, | ||
| { | ||
| "id": "cloud-sql-unused-indexes", | ||
| "starting_prompt": "Are there any unused indexes in the database that we can clean up?", | ||
| "conversation_plan": "Ask the agent to list unused indexes in the database.", | ||
| "expected_trajectory": [ | ||
| "list_indexes" | ||
| ], | ||
| "kind": "tool", | ||
| "max_turns": 4 | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| generator: gcp_vertex_gemini | ||
| vertex_model: gemini-2.5-pro | ||
| base_prompt: "" | ||
| execs_per_minute: 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| gemini_cli_version: "@google/gemini-cli@0.38.1" | ||
| generator: gemini_cli | ||
| env: | ||
| GOOGLE_CLOUD_PROJECT: "ext-test-cloud-sql-postgres" | ||
| GOOGLE_CLOUD_LOCATION: "global" | ||
| GOOGLE_GENAI_USE_VERTEXAI: "true" | ||
| setup: | ||
| extensions: | ||
| # Points to the symlink created in cloudbuild.yaml to match the extension ID | ||
| "/workspace/cloud-sql-postgresql": | ||
| settings: | ||
| CLOUD_SQL_POSTGRES_PROJECT: "ext-test-cloud-sql-postgres" | ||
| CLOUD_SQL_POSTGRES_INSTANCE: "daily-ci-evals-db" | ||
| CLOUD_SQL_POSTGRES_REGION: "us-central1" | ||
| CLOUD_SQL_POSTGRES_DATABASE: "postgres" | ||
| CLOUD_SQL_POSTGRES_USER: "postgres" | ||
| CLOUD_SQL_POSTGRES_PASSWORD: '${CLOUD_SQL_POSTGRES_PASSWORD}' | ||
| CLOUD_SQL_POSTGRES_IP_TYPE: "PUBLIC" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| extension_id: cloud-sql-postgresql | ||
|
|
||
| dataset_config: /workspace/evals/dataset.json | ||
| dataset_format: gemini-cli-format | ||
|
|
||
| orchestrator: geminicli | ||
| model_config: /workspace/evals/model_config.yaml | ||
| # You can reference default simulated user models provided by the evalbench repo: | ||
| simulated_user_model_config: /workspace/evals/gemini_2.5_pro_model.yaml | ||
|
|
||
| scorers: | ||
| trajectory_matcher: {} | ||
|
omkargaikwad23 marked this conversation as resolved.
Outdated
|
||
| goal_completion: | ||
| model_config: /workspace/evals/gemini_2.5_pro_model.yaml | ||
|
omkargaikwad23 marked this conversation as resolved.
|
||
|
|
||
| reporting: | ||
| bigquery: | ||
| gcp_project_id: cloud-db-nl2sql | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import os | ||
| import re | ||
|
|
||
| def main(): | ||
| yaml_path = '/workspace/evals/model_config.yaml' | ||
| if os.path.exists(yaml_path): | ||
| with open(yaml_path, 'r') as f: | ||
| content = f.read() | ||
| content = re.sub(r'\${(\w+)}', lambda m: os.environ.get(m.group(1), m.group(0)), content) | ||
| with open(yaml_path, 'w') as f: | ||
| f.write(content) | ||
| print(f"Successfully substituted environment variables in {yaml_path}") | ||
| else: | ||
| print(f"File not found: {yaml_path}") | ||
|
|
||
| if __name__ == '__main__': | ||
| main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import socket | ||
| import time | ||
| import sys | ||
|
|
||
| def main(): | ||
| for i in range(20): | ||
| try: | ||
| s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
| s.settimeout(1) | ||
| s.connect(('127.0.0.1', 50051)) | ||
| print('Port 50051 is open!') | ||
| sys.exit(0) | ||
| except Exception: | ||
| print('Port not open yet, retrying...') | ||
| time.sleep(1) | ||
| print('Port failed to open') | ||
| sys.exit(1) | ||
|
|
||
| if __name__ == '__main__': | ||
| main() |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.