Skip to content

ci(release): add versioned release workflows and the release lockfile - #369

Merged
Rockdu merged 24 commits into
mainfrom
rockdu/release-infra
Nov 11, 2026
Merged

Rockdu merged 24 commits into
mainfrom
rockdu/release-infra

Conversation

@Rockdu

@Rockdu Rockdu commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

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.yml creates release/vX.Y.Z from main, freezes the release inputs into release-lock.json on that branch, freezes the CI image as radixark/miles_diffusion:release-vX.Y.Z-ci, runs every CI suite on the lock commit inside that image, and stamps a release-ci commit 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.yml checks the version grammar (X.Y.Z, X.Y.ZrcN, X.Y.Z.postN), that setup.py carries the base version, and that the exact commit has release-ci=success, then pushes the annotated tag v<version> and dispatches release-docker.yml.
  • release-docker.yml builds radixark/miles_diffusion:v<version> from the tag with the lockfile's inputs and never moves latest. bot-cherry-pick.yml picks one merged main PR or commit onto a release branch.
  • pr-test.yml gains a workflow_call trigger, and _run-ci.yml a ref input, so release CI tests an exact commit. Both read release-lock.json when no explicit input or PR-body directive names a value.

Why

latest and 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.

Input Pinned as
sglang (sgl-project/sglang sglang-miles) sglang_commit: CI re-installs it, the release build bakes it
CI image ci_image_tag = release-vX.Y.Z-ci, retagged by digest from the newest dated image
base image lmsysorg/sglang:<tag> sglang_image_tag + sglang_image_digest: the release build uses FROM <tag>@<digest>
FA3 wheels release fa3_wheels_* fingerprint, audit only (a rolling release cannot be pinned by name)
miles_diffusion the tagged commit

Differences from miles, each on purpose:

  • No bump workflow. Actions in this repository cannot open pull requests. The bump is a hand-opened PR using .github/scripts/release/bump_version.py.
  • The cut proves the frozen image matches the cut point. The newest dated tag must have been pushed by the newest successful docker-build.yml run on main. That run's docker/Dockerfile and requirements.txt must equal the cut point's. A same-day rebuild overwrites a dated tag, and a cancelled push build leaves latest behind.
  • The cherry-pick refuses requirements.txt as well as docker/Dockerfile. The GPU suites here run the image's installed requirements and do not reinstall them.
  • The called suites check out the tested SHA, not the branch name. A push during the run cannot change what the status vouches for.

Effect on main

Five existing files change (+109/−20). On main, where no release-lock.json exists, every PR, nightly and manual run resolves exactly as before. The visible differences:

  • resolve-ci-image runs one more step, a sparse checkout of release-lock.json. It finds nothing on main and the image stays latest.
  • The three pr-test.yml dispatch inputs (ci_sglang_pr, ci_sglang_repo, ci_image_tag) now default to empty. Off a release branch they still resolve to sglang-miles, sgl-project/sglang and latest.

setup.py, docker/Dockerfile, docker-build.yml and tests/ci/* are unchanged.

Validation

No workflow has been dispatched yet. The workflow_call chain, docker buildx imagetools on ubuntu-latest and 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 nine SC2086 info lines already on main.
  • pre-commit run on every changed file: passes.
  • The three scripts were run locally against a real gh run list and Docker Hub snapshot, plus failure inputs. pick_ci_image.py picks dev-cu129-sglang-main-20261018, built by run 795cc06c. 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.py rejects an empty fingerprint or a malformed digest. bump_version.py accepts 0.2.0 and rejects 0.2.0rc1.
  • The cut's preflight rejects today's main, as intended: build: install sglang's radix_transfer_plugins in the image #363 changed docker/Dockerfile, but its push build was cancelled. Dispatch docker-build.yml on 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: the workflow_call trigger, the ref input, 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 on v<version> tags.

Checklist

  • pre-commit run passes on every changed file
  • Added/updated tests for new behaviour: no tests added. The scripts were exercised locally with fixtures; there is no CPU test registered for them.
  • pytest -x is green: not run; no Python package code changed
  • If launch flags changed, python3 train.py --help still parses: n/a, no launch flags changed
  • If a public flag was added, it appears in the CLI reference docs: n/a
  • If an example was added, it has a real walkthrough: n/a; the runbook covers the release procedure end to end

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.
@Rockdu Rockdu added the run-ci-basic Authorize and run only basic unlabeled CI tests label Nov 11, 2026
@Rockdu
Rockdu merged commit 226dfcd into main Nov 11, 2026
23 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci-basic Authorize and run only basic unlabeled CI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant