|
| 1 | +# Copyright 2025 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +options: |
| 16 | + logging: CLOUD_LOGGING_ONLY |
| 17 | + |
| 18 | +steps: |
| 19 | + |
| 20 | + # --- Evaluation Step --- |
| 21 | + - name: 'us-central1-docker.pkg.dev/cloud-db-nl2sql/evalbench/eval_server:latest' |
| 22 | + entrypoint: 'bash' |
| 23 | + # Decrypts the secret from Secret Manager into the DB_PASSWORD environment variable |
| 24 | + secretEnv: ['DB_PASSWORD'] |
| 25 | + args: |
| 26 | + - '-c' |
| 27 | + - | |
| 28 | + set -e |
| 29 | + # Workaround for evalbench bug: settings are only applied if path basename matches extension ID |
| 30 | + ln -s /workspace /workspace/cloud-sql-postgresql |
| 31 | + cd /evalbench |
| 32 | +
|
| 33 | + export EVAL_GCP_PROJECT_ID=$PROJECT_ID |
| 34 | + export EVAL_GCP_PROJECT_REGION=us-central1 |
| 35 | + export GOOGLE_CLOUD_PROJECT=$PROJECT_ID |
| 36 | + export CLOUD_SQL_POSTGRES_PROJECT=$PROJECT_ID |
| 37 | + export CLOUD_SQL_POSTGRES_INSTANCE=$_CLOUD_SQL_INSTANCE |
| 38 | + export CLOUD_SQL_POSTGRES_REGION=$_CLOUD_SQL_REGION |
| 39 | + export CLOUD_SQL_POSTGRES_DATABASE=$_CLOUD_SQL_DATABASE |
| 40 | + export CLOUD_SQL_POSTGRES_USER=$_CLOUD_SQL_USER |
| 41 | + export CLOUD_SQL_POSTGRES_IP_TYPE=$_CLOUD_SQL_IP_TYPE |
| 42 | +
|
| 43 | + # Maps the decrypted DB_PASSWORD to the exact variable expected by gemini_cli and extension skills |
| 44 | + export CLOUD_SQL_POSTGRES_PASSWORD=$$DB_PASSWORD |
| 45 | +
|
| 46 | + # Substitute environment variables in model_config.yaml |
| 47 | + python3 /workspace/evals/substitute_env.py |
| 48 | +
|
| 49 | + cd /evalbench |
| 50 | + export PYTHONPATH=./evalbench:./evalbench/evalproto |
| 51 | + export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python |
| 52 | +
|
| 53 | + echo "Launching Standalone Evaluation..." |
| 54 | + python3 evalbench/evalbench.py --experiment_config=/workspace/evals/run_config.yaml |
| 55 | +
|
| 56 | +
|
| 57 | +availableSecrets: |
| 58 | + secretManager: |
| 59 | + - versionName: projects/$PROJECT_ID/secrets/daily-ci-evals-db-password/versions/latest |
| 60 | + env: 'DB_PASSWORD' |
0 commit comments