Skip to content

Commit f121122

Browse files
Pigbibicodex
andcommitted
fix: reconcile cloud runtime drift
Co-Authored-By: Codex <noreply@openai.com>
1 parent 89f4539 commit f121122

4 files changed

Lines changed: 658 additions & 30 deletions

File tree

.github/workflows/sync-cloud-run-env.yml

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,18 @@ jobs:
957957
gcloud "${gcloud_args[@]}"
958958
done
959959
960+
- name: Reconcile Cloud Run traffic
961+
if: steps.config.outputs.env_sync_enabled == 'true'
962+
env:
963+
SYNC_PLAN_JSON: ${{ steps.strategy_requirements.outputs.sync_plan_json }}
964+
run: |
965+
set -euo pipefail
966+
python3 scripts/reconcile_cloud_runtime.py \
967+
--platform=ibkr \
968+
--project="${GCP_PROJECT_ID}" \
969+
--region="${CLOUD_RUN_REGION}" \
970+
--ensure-latest-traffic
971+
960972
- name: Verify strategy plugin mounts
961973
if: steps.config.outputs.env_sync_enabled == 'true'
962974
env:
@@ -1149,32 +1161,12 @@ jobs:
11491161
--quiet
11501162
fi
11511163
1152-
for update in "${scheduler_updates[@]}"; do
1153-
IFS=$'\t' read -r cloud_run_service _market_timezone _main_time <<< "${update}"
1154-
legacy_candidates=()
1155-
if [[ "${cloud_run_service}" == *-service ]]; then
1156-
legacy_candidates+=("${cloud_run_service%-service}-probe-scheduler")
1157-
legacy_candidates+=("${cloud_run_service%-service}-precheck-scheduler")
1158-
fi
1159-
legacy_candidates+=("${cloud_run_service}-probe-scheduler")
1160-
legacy_candidates+=("${cloud_run_service}-precheck-scheduler")
1161-
account_suffix="${cloud_run_service#interactive-brokers-quant-live-}"
1162-
account_suffix="${account_suffix%-service}"
1163-
if [[ "${account_suffix}" == u* ]]; then
1164-
legacy_candidates+=("ibkr-${account_suffix}-backup-execution")
1165-
fi
1166-
for legacy_job in "${legacy_candidates[@]}"; do
1167-
if gcloud scheduler jobs describe "${legacy_job}" \
1168-
--project="${GCP_PROJECT_ID}" \
1169-
--location="${scheduler_location}" >/dev/null 2>&1; then
1170-
echo "Deleting legacy Cloud Scheduler job ${legacy_job}; monitor dispatcher now owns probe/precheck."
1171-
gcloud scheduler jobs delete "${legacy_job}" \
1172-
--project="${GCP_PROJECT_ID}" \
1173-
--location="${scheduler_location}" \
1174-
--quiet
1175-
fi
1176-
done
1177-
done
1164+
python3 scripts/reconcile_cloud_runtime.py \
1165+
--platform=ibkr \
1166+
--project="${GCP_PROJECT_ID}" \
1167+
--region="${CLOUD_RUN_REGION}" \
1168+
--scheduler-location="${scheduler_location}" \
1169+
--delete-legacy-schedulers
11781170
11791171
- name: Prune old Cloud Run revisions
11801172
if: steps.config.outputs.enabled == 'true'

0 commit comments

Comments
 (0)