ci: drop staging deploy; prod pins on main + refresh testnet metadata - #270
Conversation
Co-authored-by: Mathis <echobt@users.noreply.github.com>
Co-authored-by: Mathis <echobt@users.noreply.github.com>
Co-authored-by: Mathis <echobt@users.noreply.github.com>
Co-authored-by: Mathis <echobt@users.noreply.github.com>
Co-authored-by: Mathis <echobt@users.noreply.github.com>
|
@greptileai review |
Co-authored-by: Mathis <echobt@users.noreply.github.com>
|
@greptileai review Pushed |
Greptile SummaryThis update keeps production deployments digest-pinned while allowing a manually dispatched image workflow to recreate the production pin artifact for an older main commit. No new blocking issues were identified. Confidence Score: 5/5Safe to merge. The two earlier manual artifact-recovery findings were resolved by echobt without explanation. Current workflow behavior creates production pin artifacts for manually dispatched image runs, which addresses the documented recovery path. Files Needing Attention: None. Reviews (5): Last reviewed commit: "Merge branch 'main' into cursor/drop-sta..." | Re-trigger Greptile |
Co-authored-by: Mathis <echobt@users.noreply.github.com>
|
@greptileai review Pushed That does not widen what can reach prod: The other findings in your summary — Harbor evaluation accepting failed runs, omitting completed trials, checklist rules, agent loading outside the staged artifact — are in code this PR does not touch (#266/#267). This PR is workflows, docs, and |
|
@greptileai review |
|
@greptileai please re-review after branch update with main (merge commit); prior summary was 5/5 on ab8ba57 |
|
@greptileai review Re-ping: required Greptile Review check still IN_PROGRESS on head |
Summary
Fixes the three red workflows on
main(41b51ac) by removing the DigitalOcean staging lane instead of repairing it, moving the digest→pin ladder onto prod, and refreshing the testnet metadata lock.A) Staging auto-deploy is gone. The
deploy-stagingmatrix (master/validator) is deleted fromci.yml, anddeploy-staging.ymlis deleted — nothing else referenced it.ci.ymlis now fmt · clippy · test · deny · xtask only and touches no infrastructure, so the DO firewall 422 (must have no more than 50 rulesonbase-hosts) can no longer fail CI. The staging droplets anddeploy/compose/env-staging.ymlstay: that overlay is the testnet configlocal-e2e.shbuilds on, and staging is now operator-driven viaremote-deploy.sh. No firewall prune was invented.B) Prod pins on every main update.
images.yml: theupdate · commit staging pinsjob becomesrecord prod pins. It runspromote.sh --env prod --confirm-prod --force-prodover the freshly built GHCR digests and uploadsdeploy/pins/prod.json+deploy/digests/<sha>.jsonas the artifactprod-pins-<sha>. It no longer runsgit push origin HEAD:main, which is what GH013 was rejecting (mainrequires a PR + Greptile review, so CI can never push a pin commit).--force-prodskips the staging-digest ladder check because no workflow writesdeploy/pins/staging.jsonany more; without it prod would be pinned to a dead lane. The job also runs onworkflow_dispatch, so an expired pin artifact can be rebuilt (see Rollback below).deploy-prod.yml: the "staging pins on origin/main match this SHA" gate is deleted. It now also triggers on a successfulimagesrun onmain(plus the existingv*.*.*tags andworkflow_dispatch), so merging tomaindeploys prod. Preflight is still fail-closed and got stricter in one place: the SHA must be an ancestor oforigin/main, CI must be green for it (it polls, becauseciandimagesrun in parallel on a main push), and theimagesrun for that SHA must still have a liveprod-pins-<sha>artifact. The Spaces backup, firewall open/close,--build-from registrydeploy, and/healthzsmoke are unchanged. The oldgit push origin mainof prod pins is replaced by an artifact — same GH013 problem.deploy-proddispatch on the previous good commit SHA. If that commit's pin artifact has expired, preflight refuses rather than deploying something unpinned; re-run that commit'simagesrun, or dispatchimages.ymlon a ref pointing at it, and the pins are rebuilt from the same GHCR digests.ghcr-publicpublicized hardcodedbase/<svc>package names, which have 404'd since the repo rename (the packages arecortex/<svc>). Both copies now derive the segment from$GITHUB_REPOSITORY. This matters more now that prod pulls digests on every main update —remote-deploy.shnever logs in to GHCR, so a private package is a broken prod deploy.C) Metadata drift.
metadata/testnet.lockregenerated withcargo run -p xtask -- metadata-snapshot. The whole diff isspec_version445 → 455 and the matchingmetadata_digest: a Finney testnet runtime upgrade. Every structural field we depend on is byte-identical — all five tracked call indices (set_weights7/0,commit_timelocked_weights7/113,commit_timelocked_mechanism_weights7/118,set_subnet_identity,serve_axon), theWeightsTlockPayloadshape,commit_reveal_version4, all seven epoch-schedule sources, and theCommitmentspallet. Nothing was blanked. Only the testnet lock exists; there is no mainnet lock to touch.Ops follow-ups (not code)
deploy staging master/deploy staging validatorare required status checks onmain, remove them — those jobs no longer exist and would block every PR as pending.base-hostsis at the 50-rule cap from leaked ephemeral/32CI holes. Prod deploys use the samedo-firewallaction, so someone should prune the stale rules by hand; this PR deliberately does not auto-prune, because a leaked CI rule and the operator's own SSH rule are bothtcp/22on a single/32and are indistinguishable via the API.imagesrun with the corrected package names, confirmghcr.io/cortexlm/cortex/<svc>pulls anonymously. If the packages stay private, prod hosts need a one-timedocker login ghcr.io.deploy-prod. No metal SSH deploy was invented — the repo has none.Greptile
Every PR is reviewed by Greptile before merge. Config:
.greptile/.imagesdispatch skippedprod-pins, so the documented artifact-expiry recovery produced nothing and leftdeploy-prodblocked for that SHA), fixed inab8ba57; latest review is 5/5, no outstanding issues@greptileai reviewTest plan
cargo run -p xtask -- metadata-snapshot --check→OK (matches metadata/testnet.lock)against livewss://test.finney.opentensor.ai:443cargo run -p xtask -- loc-cap · consensus-lint · spec-check · design-check · external-docs-checkall passcargo fmt --all -- --checkfmt · clippy · test · deny · xtask), plus CodeQL andAnalyze (actions)run:block passesbash -nprod-pinsjob logic locally on a clean tree with a synthetic digest manifest: fivepromote.sh --env prod --confirm-prod --force-prodcalls produce aprod.jsonwhosecommit_shaand fivesha256:service digests match, which is exactly what the job then assertsgh api repos/CortexLM/cortex/actions/runs/<images-run>/artifactswith theselect(.name == "…" and .expired == false) | lengthfilter returns1for the digest artifact of41b51acdeploy/scripts/assert-compose-matrix.sh— needs Docker, unavailable in this environment; unaffected by these changes and covered by thecijob.workflow_runtrigger cannot be exercised from a branch: GitHub only honours it from the default branch, so the first real proof is the first main push after merge.Risk
Deploy path, no consensus/emission/signature surface; no Rust changed (
git diff --statagainstmainis workflows, docs, and one JSON lock). Prod now deploys automatically on every greenimagesrun onmainwith no human approval step — that is the requested behaviour, and the fail-closed gates (SHA on main, CI green, pins artifact present, Spaces backup,/healthzsmoke) all stay.deploy/pins/prod.jsonin git is now a template rather than the deployed state: CI derives the deployed pins per commit and keeps them in the run artifact, sopromote.sh --rollbackon the committed file is no longer the prod rollback path.Naming
I did not rename
BASE_*environment variables, deployed host paths, orbase-*-v1cryptographic domain tags. One clarification on GHCR package names: nothing about the pushed images changes (images.ymlalready derivesghcr.io/${GITHUB_REPOSITORY,,}/<svc>); only the visibility API call is fixed to name the packages that actually exist (cortex/<svc>) instead of the pre-renamebase/<svc>ones, which return 404 today.