Skip to content

Commit 0be9204

Browse files
authored
fix(ci): nightly 10 TPS bench GCP auth and checkout (#23586)
## Summary - Run `gcp_auth` before `setup_gcp_secrets` in `source_network_env` so EC2 benchmark jobs can read Secret Manager (e.g. `otel-collector-url`). - Improve `setup_gcp_secrets.sh` diagnostics and activate the CI service account before secret fetches. - Install Terraform on Linux in `install_deps.sh`; add `setup-terraform` on nightly wait jobs. - Fix `deploy-network` checkout for pinned submodules (`fetch-depth: 0`, `lfs: true`). - Checkout `github.sha` on the benchmark job so workflow_dispatch from a feature branch runs that branch on EC2 (not `next`). Validated manually via Nightly Bench 10 TPS workflow_dispatch on this branch (run succeeded). ## Test plan - [x] Nightly Bench 10 TPS workflow_dispatch from `spy/10tps-bench-terraform` (deploy, wait, benchmark)
1 parent d31c7a5 commit 0be9204

5 files changed

Lines changed: 28 additions & 4 deletions

File tree

.github/workflows/deploy-network.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ jobs:
111111
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
112112
with:
113113
ref: ${{ steps.checkout-ref.outputs.ref }}
114-
fetch-depth: 1
114+
# Full history so recursive submodules can checkout pinned commits (not only branch tips).
115+
fetch-depth: 0
116+
lfs: true
115117
persist-credentials: false
116118
submodules: recursive # Initialize git submodules for l1-contracts dependencies
117119

.github/workflows/nightly-bench-10tps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- name: Checkout
8181
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
8282
with:
83-
ref: next
83+
ref: ${{ github.sha }}
8484

8585
- name: Authenticate to Google Cloud
8686
uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f
@@ -108,7 +108,7 @@ jobs:
108108
- name: Checkout
109109
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
110110
with:
111-
ref: next
111+
ref: ${{ github.sha }}
112112

113113
- name: Run 10 TPS benchmark
114114
timeout-minutes: 240

.github/workflows/weekly-proving-bench.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- name: Checkout
7272
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
7373
with:
74-
ref: next
74+
ref: ${{ github.sha }}
7575

7676
- name: Authenticate to Google Cloud
7777
uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f

spartan/scripts/install_deps.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,19 @@ if ! command -v cast &> /dev/null; then
134134
sudo chmod +x /usr/local/bin/cast
135135
fi
136136

137+
TERRAFORM_VERSION="1.7.5"
138+
if ! command -v terraform &> /dev/null; then
139+
log "Installing terraform ${TERRAFORM_VERSION}..."
140+
tf_os="$(os)"
141+
if [ "$tf_os" = "macos" ]; then
142+
tf_os="darwin"
143+
fi
144+
curl -fsSL "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${tf_os}_$(arch).zip" -o terraform.zip
145+
unzip -qo terraform.zip
146+
sudo mv terraform /usr/local/bin/terraform
147+
rm terraform.zip
148+
fi
149+
137150
require_cmd git
138151
require_cmd kubectl
139152
require_cmd terraform

spartan/scripts/source_network_env.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ function source_network_env {
2424
if grep -q "REPLACE_WITH_GCP_SECRET" "$env_file" && command -v gcloud &> /dev/null; then
2525
echo "Environment file contains GCP secret placeholders. Processing secrets..."
2626

27+
# Activate GCP credentials before Secret Manager reads (same order as network_deploy.sh).
28+
if declare -f gcp_auth >/dev/null 2>&1; then
29+
gcp_auth
30+
else
31+
# shellcheck source=scripts/gcp_auth.sh
32+
source "$spartan/scripts/gcp_auth.sh"
33+
gcp_auth
34+
fi
35+
2736
# Process GCP secrets
2837
source $spartan/scripts/setup_gcp_secrets.sh "$env_file"
2938

0 commit comments

Comments
 (0)