Repository navigation
ci(release): add versioned release workflows and the release lockfile - #369
Merged
Merged
Conversation
A release branch carries release-lock.json naming the sglang commit and the CI image tag the release was frozen with. Both resolve steps in _run-ci.yml and resolve-ci-image in pr-test.yml now read it when no explicit input or PR-body directive names a value, before falling back to the moving defaults. The dispatch defaults of ci_sglang_pr / ci_sglang_repo / ci_image_tag become empty so the lockfile can apply on a release branch; on main the same defaults are re-applied after the lock check.
pr-test.yml gains a workflow_call trigger (ref, image_tag, nightly, continue_on_error) and _run-ci.yml a ref input, so release CI tests the commit the release-ci status is stamped on, inside the frozen release image, instead of github.sha (the main tip the cut was dispatched on). The caller is always a workflow_dispatch, which the called run inherits, so every job keeps its trusted full-scope path.
bump_version.py rewrites the single version= assignment in setup.py (ported from miles). pick_ci_image.py chooses the newest dev-cu129-sglang-main-<date> tag and proves it was pushed by the newest successful docker-build.yml run on main, so the cut can diff that run's image layers against the cut point. write_release_lock.py writes release-lock.json with miles_diffusion's inputs: the sglang commit, the frozen CI image tag and digest, the base image tag and digest, and the FA3 wheels fingerprint as an audit record.
Creates release/vX.Y.Z from main, proves the newest dated CI image matches the cut point's Dockerfile and requirements.txt, retags it by digest as release-vX.Y.Z-ci, commits release-lock.json, runs pr-test.yml on the lock commit inside that image, and stamps a release-ci commit status on the tested SHA. Re-dispatching an existing branch keeps its lock and image and re-runs CI on the tip; a re-dispatch cancels the stale run.
Validates the version grammar (X.Y.Z, X.Y.ZrcN, X.Y.Z.postN), requires setup.py to carry the base version and release-ci=success on the exact commit, pushes the annotated v<exact> tag and dispatches release-docker.yml explicitly, since a GITHUB_TOKEN tag push does not trigger it.
Builds radixark/miles_diffusion:v<exact> from the tagged commit with the lockfile's inputs: the sglang commit and the base image pinned by digest, plus the checked-out miles_diffusion SHA. Same build body as docker-build.yml (self-hosted, --no-cache --pull, chown before checkout, prune after), but it never moves latest.
Picks one merged main PR or commit onto a release branch. Rejects commits touching docker/Dockerfile or requirements.txt: the frozen CI image bakes both and the GPU suites do not reinstall requirements at run time, so such a fix ships as a new release instead.
docs/developer/release.md is the maintainer procedure for the release workflows (bump, image preflight and cut, hotfix, tag, image, notes) and the table of what a version freezes. docker/README.md's release rule names the tag families a release publishes and never touches; installation.md mentions the versioned image tags.
The attribute names were fixed, so the getattr loop only hid which field each assert reads.
pr-test.yml now reads the same input name on both triggers, as it already does for continue_on_error.
FA3_FP, MD_COMMIT and the dated/newest/pushed locals in pick_ci_image.py now carry the names their lock fields and build args use.
One comment on the restored-versus-audit split instead of four inside the json.dump call.
The runbook lists what a release does not freeze (apt, pip resolution, kernels lock), so installation.md must not promise more.
release-branch-cut.yml called it SGLANG_SHA while the lock field it fills is sglang_commit and release-docker.yml reads it back as SGLANG_COMMIT.
Drop the sentences that restate the guard they sit above or the error line they precede (override precedence, the latest fallback, the preflight's own ::error text, the cherry-pick's ship-as-a-new-release advice) and keep the one fact the code cannot show: the lock's repo and commit apply as a pair, github.sha is the main tip the cut was dispatched on, and the GPU suites never reinstall requirements.txt.
The guard matched docker/Dockerfile and requirements.txt while the listing printed under the error used a looser ^docker/ pattern, so the two had to be proved equivalent by the reader; one IMAGE_LAYER_PATHS serves both and the listing now names exactly the files that tripped the guard.
…outputs echo "key=$(cmd)" exits 0 when cmd fails under bash -e, so a hand-created release branch without release-lock.json would have been re-tested on latest and the sglang-miles tip and stamped release-ci=success. Assign first, echo second; an existing branch without a lockfile is refused.
release-tag.yml greps setup.py for the base version, so a merged rc or post bump would block every tag on the branch.
shell: bash adds pipefail to the two piped steps; the retag moves after write_release_lock.py so a cut that fails on a missing input leaves no release-vX.Y.Z-ci tag behind.
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Versioned releases for miles_diffusion, ported from the radixark/miles release workflows. The first release will be 0.2.0; the version bump is a separate PR that follows this one.
What
release-branch-cut.ymlcreatesrelease/vX.Y.Zfrom main, freezes the release inputs intorelease-lock.jsonon that branch, freezes the CI image asradixark/miles_diffusion:release-vX.Y.Z-ci, runs every CI suite on the lock commit inside that image, and stamps arelease-cicommit status on the tested SHA. Re-dispatching on an existing branch keeps the lockfile and the image and re-runs CI on the tip.release-tag.ymlchecks the version grammar (X.Y.Z,X.Y.ZrcN,X.Y.Z.postN), thatsetup.pycarries the base version, and that the exact commit hasrelease-ci=success, then pushes the annotated tagv<version>and dispatchesrelease-docker.yml.release-docker.ymlbuildsradixark/miles_diffusion:v<version>from the tag with the lockfile's inputs and never moveslatest.bot-cherry-pick.ymlpicks one merged main PR or commit onto a release branch.pr-test.ymlgains aworkflow_calltrigger, and_run-ci.ymlarefinput, so release CI tests an exact commit. Both readrelease-lock.jsonwhen no explicit input or PR-body directive names a value.Why
latestand the sglang-miles tip both move. Today no image can say which sglang commit it carries, and nothing can rebuild it. A release needs every input it consumes pinned in one file that both CI and the image build read.sgl-project/sglangsglang-miles)sglang_commit: CI re-installs it, the release build bakes itci_image_tag=release-vX.Y.Z-ci, retagged by digest from the newest dated imagelmsysorg/sglang:<tag>sglang_image_tag+sglang_image_digest: the release build usesFROM <tag>@<digest>fa3_wheels_*fingerprint, audit only (a rolling release cannot be pinned by name)Differences from miles, each on purpose:
.github/scripts/release/bump_version.py.docker-build.ymlrun on main. That run'sdocker/Dockerfileandrequirements.txtmust equal the cut point's. A same-day rebuild overwrites a dated tag, and a cancelled push build leaveslatestbehind.requirements.txtas well asdocker/Dockerfile. The GPU suites here run the image's installed requirements and do not reinstall them.Effect on main
Five existing files change (+109/−20). On main, where no
release-lock.jsonexists, every PR, nightly and manual run resolves exactly as before. The visible differences:resolve-ci-imageruns one more step, a sparse checkout ofrelease-lock.json. It finds nothing on main and the image stayslatest.pr-test.ymldispatch inputs (ci_sglang_pr,ci_sglang_repo,ci_image_tag) now default to empty. Off a release branch they still resolve tosglang-miles,sgl-project/sglangandlatest.setup.py,docker/Dockerfile,docker-build.ymlandtests/ci/*are unchanged.Validation
No workflow has been dispatched yet. The
workflow_callchain,docker buildx imagetoolsonubuntu-latestand the release build on the self-hosted runner were reviewed by reading only. They run for the first time at the 0.2.0 cut.actionlint: no findings beyond the nineSC2086info lines already on main.pre-commit runon every changed file: passes.gh run listand Docker Hub snapshot, plus failure inputs.pick_ci_image.pypicksdev-cu129-sglang-main-20261018, built by run795cc06c. It rejects a run on a non-main branch, a tag pushed outside the run's window, a missing tag or run, and a malformed digest or SHA.write_release_lock.pyrejects an empty fingerprint or a malformed digest.bump_version.pyaccepts0.2.0and rejects0.2.0rc1.docker/Dockerfile, but its push build was cancelled. Dispatchdocker-build.ymlon main before the first cut.Files
.github/workflows/release-branch-cut.yml,release-tag.yml,release-docker.yml,bot-cherry-pick.yml: the four release workflows..github/scripts/release/bump_version.py,pick_ci_image.py,write_release_lock.py: the version bump, the CI image pick and preflight, the lockfile writer..github/workflows/pr-test.yml,_run-ci.yml: theworkflow_calltrigger, therefinput, the lockfile fallback..github/workflows/record-e2e-standards.yml: input description only.docs/developer/release.md: the maintainer runbook.docker/README.md: the release rule.docs/getting-started/installation.md: one sentence onv<version>tags.Checklist
pre-commit runpasses on every changed filepytest -xis green: not run; no Python package code changedpython3 train.py --helpstill parses: n/a, no launch flags changed