Skip to content

Commit 9ba413b

Browse files
authored
update orion build retry and log handling (#2111)
* remove gcp in action * update retry ui * update orion build retry and log handling Consolidate build retry behavior around the latest finished build, improve queued/failed build UI states, and add retry actions in the checks tab. Make queued build timeout handling resilient by marking stale builds interrupted from both memory queue and DB fallback paths, while improving log persistence and avoiding duplicate/partial log reads.
1 parent 2a0b5fa commit 9ba413b

40 files changed

Lines changed: 2201 additions & 1393 deletions

.github/workflows/mono-engine-deploy.yml

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ on:
1919
env:
2020
REGISTRY_ALIAS: m8q5m4u3
2121
REPOSITORY: mega/mono-engine
22-
GCP_PROJECT_ID: infra-20250121-20260121-0235
2322
IMAGE_TAG_BASE: latest
2423

2524
# Using AWS access key for authentication
@@ -59,21 +58,9 @@ jobs:
5958
registry-type: public
6059

6160
# -----------------------------
62-
# GCP / Artifact Registry
61+
# Build & push to ECR
6362
# -----------------------------
64-
- name: Auth to GCP
65-
uses: google-github-actions/auth@v2
66-
with:
67-
credentials_json: ${{ secrets.GCP_SA_KEY }}
68-
69-
- name: Configure docker for GCP
70-
run: |
71-
gcloud auth configure-docker us-central1-docker.pkg.dev
72-
73-
# -----------------------------
74-
# Build once, push to both
75-
# -----------------------------
76-
- name: Build & push image to ECR + GCP (amd64)
63+
- name: Build & push image to ECR (amd64)
7764
env:
7865
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
7966
IMAGE_TAG_BASE: ${{ env.IMAGE_TAG_BASE }}
@@ -84,12 +71,10 @@ jobs:
8471
IMAGE_TAG="${IMAGE_TAG_BASE}-${ARCH_SUFFIX}"
8572
8673
ECR_IMAGE="$ECR_REGISTRY/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}:$IMAGE_TAG"
87-
GCP_IMAGE="us-central1-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.REPOSITORY }}:$IMAGE_TAG"
8874
ECR_CACHE_IMAGE="$ECR_REGISTRY/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}:buildcache-${ARCH_SUFFIX}"
8975
CACHE_SCOPE="mono-engine-${ARCH_SUFFIX}"
9076
9177
echo "ECR_IMAGE=$ECR_IMAGE"
92-
echo "GCP_IMAGE=$GCP_IMAGE"
9378
echo "ECR_CACHE_IMAGE=$ECR_CACHE_IMAGE"
9479
echo "CACHE_SCOPE=$CACHE_SCOPE"
9580
@@ -100,7 +85,6 @@ jobs:
10085
--sbom=false \
10186
-f ./mono/Dockerfile \
10287
-t "$ECR_IMAGE" \
103-
-t "$GCP_IMAGE" \
10488
--push .
10589
10690
manifest:
@@ -126,12 +110,22 @@ jobs:
126110
env:
127111
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
128112
run: |
113+
set -euo pipefail
129114
IMAGE_BASE="$REGISTRY/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}"
115+
SHORT_SHA="${GITHUB_SHA:0:7}"
116+
117+
# latest manifest
130118
docker manifest create "$IMAGE_BASE:${{ env.IMAGE_TAG_BASE }}" \
131119
"$IMAGE_BASE:${{ env.IMAGE_TAG_BASE }}-amd64" \
132120
"$IMAGE_BASE:${{ env.IMAGE_TAG_BASE }}-arm64"
133121
docker manifest push "$IMAGE_BASE:${{ env.IMAGE_TAG_BASE }}"
134122
123+
# commit-hash manifest (same digests as latest for this commit)
124+
docker manifest create "$IMAGE_BASE:$SHORT_SHA" \
125+
"$IMAGE_BASE:${{ env.IMAGE_TAG_BASE }}-amd64" \
126+
"$IMAGE_BASE:${{ env.IMAGE_TAG_BASE }}-arm64"
127+
docker manifest push "$IMAGE_BASE:$SHORT_SHA"
128+
135129
deploy-aws:
136130
needs: manifest
137131
if: ${{ github.repository == 'web3infra-foundation/mega' }}
@@ -156,33 +150,3 @@ jobs:
156150
AWS_REGION: ap-southeast-2
157151
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
158152
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
159-
160-
deploy-gcp:
161-
needs: manifest
162-
if: ${{ github.repository == 'web3infra-foundation/mega' }}
163-
runs-on: ubuntu-latest
164-
steps:
165-
- name: Auth to GCP
166-
uses: google-github-actions/auth@v2
167-
with:
168-
credentials_json: ${{ secrets.GCP_SA_KEY }}
169-
170-
- name: Deploy to Cloud Run (force new revision)
171-
env:
172-
REGION: asia-east1
173-
SERVICE_NAME: buck2hub-mono
174-
run: |
175-
set -euo pipefail
176-
177-
IMAGE=$(gcloud run services describe $SERVICE_NAME \
178-
--project "$GCP_PROJECT_ID" \
179-
--region "$REGION" \
180-
--format="value(spec.template.spec.containers[0].image)")
181-
182-
echo "Current image: $IMAGE"
183-
184-
gcloud run deploy $SERVICE_NAME \
185-
--image "$IMAGE" \
186-
--region "$REGION" \
187-
--project "$GCP_PROJECT_ID" \
188-
--quiet

0 commit comments

Comments
 (0)