Skip to content

Commit 8d276a1

Browse files
authored
Merge branch 'main' into 310-feat-add-per-user-performance-to-indexer
2 parents 158eb6a + 765c662 commit 8d276a1

5 files changed

Lines changed: 48 additions & 34 deletions

File tree

.github/workflows/deploy-prod.yaml

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Deploy Production Environments
22

3-
# Amends the open release-please PR: copy `sha-*` image tags from staging (`*-s`) into
3+
# Amends the open release-please PR: copy `sha-*` image tags from staging (`*-s`, `*-us-s`) into
44
# production yamls on whatever is currently on that branch, then disable staging indexers
55
# when prod matches (always true after a verbatim promote).
66
#
@@ -36,20 +36,25 @@ jobs:
3636
token: ${{ steps.app-token.outputs.token }}
3737
ref: ${{ github.ref }}
3838

39-
- name: Promote mainnet (main-s → main)
39+
- name: Promote mainnet (main-s → main, main-us-s → main-us)
4040
run: |
4141
set -euo pipefail
42-
staging="environments/main-s.yaml"
43-
prod="environments/main.yaml"
44-
idx="$(yq '.indexer.image.tag' "$staging")"
45-
qry="$(yq '.query.image.tag' "$staging")"
46-
export IDX_TAG="$idx" QRY_TAG="$qry"
47-
yq -i '.indexer.image.tag = strenv(IDX_TAG)' "$prod"
48-
yq -i '.query.image.tag = strenv(QRY_TAG)' "$prod"
49-
prod_idx="$(yq '.indexer.image.tag' "$prod")"
50-
if [ "$idx" = "$prod_idx" ]; then
51-
yq -i '.indexer.enabled = false' "$staging"
52-
fi
42+
promote() {
43+
local staging="$1"
44+
local prod="$2"
45+
local idx qry prod_idx
46+
idx="$(yq '.indexer.image.tag' "$staging")"
47+
qry="$(yq '.query.image.tag' "$staging")"
48+
export IDX_TAG="$idx" QRY_TAG="$qry"
49+
yq -i '.indexer.image.tag = strenv(IDX_TAG)' "$prod"
50+
yq -i '.query.image.tag = strenv(QRY_TAG)' "$prod"
51+
prod_idx="$(yq '.indexer.image.tag' "$prod")"
52+
if [ "$idx" = "$prod_idx" ]; then
53+
yq -i '.indexer.enabled = false' "$staging"
54+
fi
55+
}
56+
promote environments/main-s.yaml environments/main.yaml
57+
promote environments/main-us-s.yaml environments/main-us.yaml
5358
5459
- name: Commit and push (mainnet)
5560
env:
@@ -59,7 +64,7 @@ jobs:
5964
GIT_COMMITTER_EMAIL: ${{ secrets.DEPLOYMENT_APP_ID }}+api-gitops[bot]@users.noreply.github.com
6065
run: |
6166
set -euo pipefail
62-
git add environments/main.yaml environments/main-s.yaml
67+
git add environments/main.yaml environments/main-s.yaml environments/main-us.yaml environments/main-us-s.yaml
6368
if git diff --staged --quiet; then
6469
echo "No mainnet env changes to commit."
6570
exit 0
@@ -87,20 +92,25 @@ jobs:
8792
- name: Pull latest (includes mainnet promotion commit)
8893
run: git pull origin "${{ github.ref_name }}"
8994

90-
- name: Promote testnet (test-s → test)
95+
- name: Promote testnet (test-s → test, test-us-s → test-us)
9196
run: |
9297
set -euo pipefail
93-
staging="environments/test-s.yaml"
94-
prod="environments/test.yaml"
95-
idx="$(yq '.indexer.image.tag' "$staging")"
96-
qry="$(yq '.query.image.tag' "$staging")"
97-
export IDX_TAG="$idx" QRY_TAG="$qry"
98-
yq -i '.indexer.image.tag = strenv(IDX_TAG)' "$prod"
99-
yq -i '.query.image.tag = strenv(QRY_TAG)' "$prod"
100-
prod_idx="$(yq '.indexer.image.tag' "$prod")"
101-
if [ "$idx" = "$prod_idx" ]; then
102-
yq -i '.indexer.enabled = false' "$staging"
103-
fi
98+
promote() {
99+
local staging="$1"
100+
local prod="$2"
101+
local idx qry prod_idx
102+
idx="$(yq '.indexer.image.tag' "$staging")"
103+
qry="$(yq '.query.image.tag' "$staging")"
104+
export IDX_TAG="$idx" QRY_TAG="$qry"
105+
yq -i '.indexer.image.tag = strenv(IDX_TAG)' "$prod"
106+
yq -i '.query.image.tag = strenv(QRY_TAG)' "$prod"
107+
prod_idx="$(yq '.indexer.image.tag' "$prod")"
108+
if [ "$idx" = "$prod_idx" ]; then
109+
yq -i '.indexer.enabled = false' "$staging"
110+
fi
111+
}
112+
promote environments/test-s.yaml environments/test.yaml
113+
promote environments/test-us-s.yaml environments/test-us.yaml
104114
105115
- name: Commit and push (testnet)
106116
env:
@@ -110,7 +120,7 @@ jobs:
110120
GIT_COMMITTER_EMAIL: ${{ secrets.DEPLOYMENT_APP_ID }}+api-gitops[bot]@users.noreply.github.com
111121
run: |
112122
set -euo pipefail
113-
git add environments/test.yaml environments/test-s.yaml
123+
git add environments/test.yaml environments/test-s.yaml environments/test-us.yaml environments/test-us-s.yaml
114124
if git diff --staged --quiet; then
115125
echo "No testnet env changes to commit."
116126
exit 0

.github/workflows/deploy-staging.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ jobs:
9898
}
9999
sync_staging environments/main-s.yaml environments/main.yaml
100100
sync_staging environments/test-s.yaml environments/test.yaml
101+
sync_staging environments/main-us-s.yaml environments/main-us.yaml
102+
sync_staging environments/test-us-s.yaml environments/test-us.yaml
101103
102104
- name: Open staging deployment PR
103105
id: cpr
@@ -109,20 +111,22 @@ jobs:
109111
delete-branch: true
110112
base: main
111113
commit-message: "chore(cd): update staging env tags to ${{ steps.vars.outputs.image_tag }}"
112-
title: "chore(cd): update staging (main-s / test-s) image tags"
114+
title: "chore(cd): update staging (main-s / test-s / main-us-s / test-us-s) image tags"
113115
body: |
114-
Automated **staging** image tag update (`main-s.yaml`, `test-s.yaml`) for the latest Docker build.
116+
Automated **staging** image tag update (`main-s.yaml`, `test-s.yaml`, `main-us-s.yaml`, `test-us-s.yaml`) for the latest Docker build.
115117
116118
- Tag: `${{ steps.vars.outputs.image_tag }}`
117119
- Triggering workflow run: ${{ github.event.workflow_run.html_url }}
118120
119-
If this tag matched production (`main.yaml` / `test.yaml`) for an environment, **indexer** was set to `enabled: false` on that staging file to avoid duplicate indexers on the same version.
121+
If this tag matched production (`main.yaml` / `test.yaml` / `main-us.yaml` / `test-us.yaml`) for an environment, **indexer** was set to `enabled: false` on that staging file to avoid duplicate indexers on the same version.
120122
labels: |
121123
deployment
122124
staging
123125
add-paths: |
124126
environments/main-s.yaml
125127
environments/test-s.yaml
128+
environments/main-us-s.yaml
129+
environments/test-us-s.yaml
126130
127131
- name: Enable auto-merge (squash)
128132
if: ${{ steps.cpr.outputs.pull-request-number != '' }}

environments/test-s.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ global:
99
apiSecretName: cfg-api-v3-rpc-keys
1010
dbSecretName: cfg-api-v3-test-postgres-app
1111
indexer:
12-
enabled: true
12+
enabled: false
1313
image:
1414
tag: sha-97fd3ec
1515
query:

environments/test-us-s.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ global:
99
apiSecretName: cfg-api-v3-rpc-keys
1010
dbSecretName: cfg-api-v3-test-us-postgres-app
1111
indexer:
12-
enabled: true
12+
enabled: false
1313
image:
1414
tag: sha-97fd3ec
1515
query:

environments/test-us.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ global:
88
PONDER_RPC_URL_421614: "http://cfg-api-erpc-us:4000/main/evm/421614"
99
apiSecretName: cfg-api-v3-rpc-keys
1010
indexer:
11-
enabled: false
11+
enabled: true
1212
image:
1313
tag: sha-97fd3ec
1414
query:
15-
enabled: false
15+
enabled: true
1616
image:
1717
tag: sha-97fd3ec
1818
replicaCount: 1

0 commit comments

Comments
 (0)