Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,16 @@ jobs:

# Fingerprint the miles-wheels releases the images install from (sgl-router +
# the other prebuilt wheels). cu13 installs cu130-x86_64 / cu130-aarch64;
# cu12-x86 installs cu129-x86_64 — both build automatically, so track all
# release tags they bake. Bumping a WHEELS_TAG is a Dockerfile change already
# caught by the push trigger; asset re-uploads keep the tag's commit fixed, so
# fingerprint the asset list, not a SHA.
# cu12-x86 installs cu129-x86_64 — both build automatically, so track all rolling
# release tags they bake. Rolling tags stay fixed while assets may be replaced,
# so fingerprint the asset list rather than a commit SHA.
wheels_fp() {
curl -s "https://api.github.com/repos/yueming-yuan/miles-wheels/releases/tags/$1" \
| python3 -c "import sys,json,hashlib; a=json.load(sys.stdin).get('assets',[]); fp=sorted([x['name'],x['id'],x['size'],x['updated_at']] for x in a); print(hashlib.sha256(repr(fp).encode()).hexdigest() if a else '')"
}
WHEELS_CU13_X86_FP=$(wheels_fp cu130-x86_64-v0.5.12)
WHEELS_CU13_ARM64_FP=$(wheels_fp cu130-aarch64-v0.5.12)
WHEELS_CU12_X86_FP=$(wheels_fp cu129-x86_64-v0.5.12)
WHEELS_CU13_X86_FP=$(wheels_fp cu130-x86_64)
WHEELS_CU13_ARM64_FP=$(wheels_fp cu130-aarch64)
WHEELS_CU12_X86_FP=$(wheels_fp cu129-x86_64)

echo "sglang HEAD: ${SGLANG_SHA}"
echo "megatron HEAD: ${MEGATRON_SHA}"
Expand Down
15 changes: 15 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,21 @@ RUN cd /sgl-workspace/sglang && \
fi && \
pip install -e "python[all]" --no-deps

# =========================== Mooncake structured object store wheel ===========================

# Miles' Mooncake backend requires the structured object store API. Install the selected
# CUDA 13 wheel as one coherent Python/native package; CUDA 12 keeps its base Mooncake.
RUN if [ "${ENABLE_CUDA_13}" = "1" ]; then \
set -- /tmp/wheels/mooncake_transfer_engine*-*.whl; \
if [ "$#" -ne 1 ] || [ ! -e "$1" ]; then \
echo "expected exactly one mooncake wheel for cu13/${TARGETARCH}" >&2; exit 1; \
fi && \
pip install --force-reinstall --no-deps "$1" && \
python3 -c "from mooncake.structured_object_store import FieldSchema, MooncakeBundleTransfer, export_ref, import_ref; MooncakeBundleTransfer.put; MooncakeBundleTransfer.get; MooncakeBundleTransfer.release_result; MooncakeBundleTransfer.cleanup_dataproto"; \
else \
echo "CUDA 12 variant: keeping the base image's mooncake"; \
fi

# ====================================== Install main package ============================================

ARG MILES_COMMIT=main
Expand Down
2 changes: 1 addition & 1 deletion docker/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"build_args": {
"ENABLE_CUDA_13": "0",
"SGLANG_IMAGE_TAG": "v0.5.15-cu129",
"WHEELS_TAG_X86": "cu129-x86_64-v0.5.12",
"WHEELS_TAG_X86": "cu129-x86_64",
},
},
"rocm700-mi35x": {
Expand Down
12 changes: 6 additions & 6 deletions docs/ci/02-docker-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ GPU CI runs inside `radixark/miles`. This doc maps which Dockerfiles exist, the

### `docker/Dockerfile` — inputs & output

The Dockerfile is the build recipe and nothing more: it knows no variants and no tags. Everything it needs arrives as build-args; it emits one image. `build.py` owns the variant → build-arg mapping (see Build script), so the boundary stays clean — e.g. the wheels-repo tag naming lives only in `build.py`, never here.
The Dockerfile is the build recipe: it provides the cu13 defaults and emits one image. `build.py` owns the variant → build-arg overrides (see Build script), including the cu12 base and wheels release.

**Inputs (build-args)**


| Arg | Meaning |
| ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SGLANG_IMAGE_TAG` | base `lmsysorg/sglang` tag (default `v0.5.14`, a multi-arch release) |
| `ENABLE_CUDA_13` | `1` = CUDA 13 (default), `0` = CUDA 12.9 |
| `SGLANG_IMAGE_TAG` | base `lmsysorg/sglang` image tag |
| `ENABLE_CUDA_13` | `1` = CUDA 13 (default) and installs the Mooncake wheel from the selected wheels release; `0` = CUDA 12.9 and keeps the base image's Mooncake |
| `WHEELS_REPO` | prebuilt-wheels GitHub repo (`yueming-yuan/miles-wheels`) |
| `WHEELS_TAG_X86` / `WHEELS_TAG_ARM64` | the two **complete** wheels release tags, the wheels repo's own names — rolling per-(CUDA, arch) sets like `cu130-x86_64` / `cu130-aarch64`, updated in place (legacy pinned tags like `cu129-x86_64-v0.5.12` still work). In a multi-arch build the Dockerfile **picks one by `TARGETARCH`** (the only per-platform value buildx varies) and installs it **verbatim** — never assembling a tag from parts; cu12-x86 overrides `WHEELS_TAG_X86` |
| `WHEELS_TAG_X86` / `WHEELS_TAG_ARM64` | the two **complete** wheels release tags selected by `TARGETARCH` and installed **verbatim**. cu13 uses the rolling `cu130-x86_64` / `cu130-aarch64` releases; cu12-x86 overrides `WHEELS_TAG_X86` with the rolling `cu129-x86_64` release |
| `SGLANG_BRANCH` / `SGLANG_COMMIT`, `MEGATRON_REPO` / `MEGATRON_BRANCH`, `MILES_COMMIT`, `SGL_ROUTER_*` | source pins for the layered repos |


Expand All @@ -51,7 +51,7 @@ The Dockerfile is the build recipe and nothing more: it knows no variants and no
| `rocm-mi350` | `rocm/sgl-dev:miles-rocm720-mi35x` | native | AMD MI35x — `docker/Dockerfile.rocm` |


The cu13 variants share one CUDA base (`lmsysorg/sglang:v0.5.14`, multi-arch) and differ only in platforms. `cu13` runs a single `buildx --platform linux/amd64,linux/arm64` — buildx builds both arches and pushes them as one manifest in a single shot, with the Dockerfile picking each layer's wheels by `TARGETARCH` (see Dockerfile inputs), so `docker pull` auto-selects by host arch.
The cu13 variants share one multi-arch CUDA base image and differ only in platforms. `cu13` runs a single `buildx --platform linux/amd64,linux/arm64` — buildx builds both arches and pushes them as one manifest in a single shot, with the Dockerfile picking each layer's wheels by `TARGETARCH` (see Dockerfile inputs), so `docker pull` auto-selects by host arch.

The **Tag** column is for `--image-tag dev`, which also pushes a timestamped `dev-<YYYYMMDDHHMM>` sibling; `latest` swaps the prefix to `latest`, `custom` uses `--custom-tag`. `cu13` / `cu13-x86` / `cu13-aarch64` intentionally share `radixark/miles:dev` — the daily build runs `cu13` (multi-arch), while a single-arch variant overwrites `dev` with one arch when run alone.

Expand All @@ -75,7 +75,7 @@ Non-docker PRs are untouched: `docker-paths` reports no change, `docker-build` s

The only automated builder of `radixark/miles`. Two jobs:

- **`check-upstream`** (schedule / `simulate_schedule` only) — polls the inputs the image bakes: the HEAD SHA of sglang `sglang-miles` (`sgl-project/sglang`) and Megatron-LM `miles-main` (`radixark/Megatron-LM`) — the source branches it builds — plus a fingerprint of the `yueming-yuan/miles-wheels` release it installs, so a rebuilt sgl-router or other wheel also triggers a build (the wheels are pinned by `WHEELS_TAG`, so re-uploads to the same tag are caught by fingerprint, not commit SHA). It compares against the values cached from the last build and sets `should_build=true` if any moved. `miles` itself is intentionally not polled. This is what stops the 12-hour cron from rebuilding an unchanged image.
- **`check-upstream`** (schedule / `simulate_schedule` only) — polls the inputs the image bakes: the HEAD SHA of sglang `sglang-miles` (`sgl-project/sglang`) and Megatron-LM `miles-main` (`radixark/Megatron-LM`) — the source branches it builds — plus a fingerprint of the selected `yueming-yuan/miles-wheels` rolling release, so a rebuilt sgl-router or other wheel also triggers a build (re-uploads to the same tag are caught by fingerprint, not commit SHA). It compares against the values cached from the last build and sets `should_build=true` if any moved. `miles` itself is intentionally not polled. This is what stops the 12-hour cron from rebuilding an unchanged image.
- **`build-and-push`** (self-hosted runner) — calls `docker/build.py` to build + push, then conditionally points `latest` at the new `dev` and prunes old timestamped tags.

`build-and-push` runs when `check-upstream` was skipped, or ran and reported `should_build=true`.
Expand Down
Loading