-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
64 lines (53 loc) · 2.51 KB
/
cloudbuild.yaml
File metadata and controls
64 lines (53 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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'