Files
wehub-resource-sync 94057c3d3e
CI Model Inventory / build-inventory (push) Waiting to run
Lint / lint (push) Waiting to run
PR Benchmark (SMG Components) / Benchmark Compilation Check (push) Waiting to run
PR Benchmark (SMG Components) / Benchmark - Manual Policy (push) Waiting to run
PR Benchmark (SMG Components) / Benchmark - Request Processing (push) Waiting to run
PR Benchmark (SMG Components) / Benchmark Summary (push) Blocked by required conditions
Release SGLang Model Gateway Docker Image / publish (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on macos (aarch64 - auto) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on windows (x86_64 - auto) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on macos (x86_64 - auto) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on linux (aarch64 - auto) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on linux (x86_64 - auto) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on linux (aarch64 - musllinux_1_1) (push) Waiting to run
Release SGLang Model Gateway to PyPI / build on linux (x86_64 - musllinux_1_1) (push) Waiting to run
Release SGLang Model Gateway to PyPI / Build SDist (push) Waiting to run
Release SGLang Model Gateway to PyPI / Upload to PyPI (push) Blocked by required conditions
Release SGLang Kernels / build-cu129-matrix (aarch64, 12.9, 3.10, arm-kernel-build-node) (push) Waiting to run
Release SGLang Kernels / build-cu129-matrix (x86_64, 12.9, 3.10, x64-kernel-build-node) (push) Waiting to run
Release SGLang Kernels / release-cu129 (push) Blocked by required conditions
Release SGLang Kernels / build-cu130-matrix (aarch64, 13.0, 3.10, arm-kernel-build-node) (push) Waiting to run
Release SGLang Kernels / build-cu130-matrix (x86_64, 13.0, 3.10, x64-kernel-build-node) (push) Waiting to run
Release SGLang Kernels / release-cu130 (push) Blocked by required conditions
Release SGLang Kernels / build-rocm-matrix (3.10, 700) (push) Waiting to run
PR Test (SMG) / build-wheel (push) Waiting to run
PR Test (SMG) / python-unit-tests (push) Blocked by required conditions
PR Test (SMG) / unit-tests (push) Waiting to run
PR Test (SMG) / benchmarks (push) Blocked by required conditions
PR Test (SMG) / chat-completions (push) Blocked by required conditions
PR Test (SMG) / chat-completions-4gpu (push) Blocked by required conditions
PR Test (SMG) / e2e (push) Blocked by required conditions
PR Test (SMG) / docker-build-test (push) Waiting to run
PR Test (SMG) / k8s-integration (push) Waiting to run
PR Test (SMG) / finish (push) Blocked by required conditions
PR Test (SMG) / summarize-benchmarks (push) Blocked by required conditions
Release SGLang Kernels / build-rocm-matrix (3.10, 720) (push) Waiting to run
Release SGLang Kernels / release-rocm700 (push) Blocked by required conditions
Release SGLang Kernels / release-rocm720 (push) Blocked by required conditions
Release SGLang Kernels / build-musa43 (43, 3.10) (push) Waiting to run
Release SGLang Kernels / release-musa43 (push) Blocked by required conditions
PR Test (NPU) / check-changes (push) Has been cancelled
PR Test (NPU) / pr-gate (push) Has been cancelled
PR Test (NPU) / set-image-config (push) Has been cancelled
PR Test (NPU) / stage-b-test-1-npu-a2 (0) (push) Has been cancelled
PR Test (NPU) / stage-b-test-1-npu-a2 (1) (push) Has been cancelled
PR Test (NPU) / stage-b-test-2-npu-a2 (0) (push) Has been cancelled
PR Test (NPU) / stage-b-test-2-npu-a2 (1) (push) Has been cancelled
PR Test (NPU) / stage-b-test-4-npu-a3 (push) Has been cancelled
PR Test (NPU) / stage-b-test-16-npu-a3 (push) Has been cancelled
PR Test (NPU) / multimodal-gen-test-1-npu-a3 (push) Has been cancelled
PR Test (NPU) / multimodal-gen-test-2-npu-a3 (push) Has been cancelled
PR Test (Arm64) / pr-gate (push) Has been cancelled
PR Test (Arm64) / check-changes (push) Has been cancelled
PR Test (Arm64) / build-test (push) Has been cancelled
PR Test (sgl-router) / gate (push) Has been cancelled
PR Test (sgl-router) / tier-1 — lint (push) Has been cancelled
PR Test (sgl-router) / tier-2 — build + test (push) Has been cancelled
PR Test (sgl-router) / tier-3 — docker (placeholder) (push) Has been cancelled
PR Test (sgl-router) / tier-3 — k8s integration (push) Has been cancelled
PR Test (sgl-router) / tier-3 — e2e (push) Has been cancelled
PR Test (sgl-router) / finish (push) Has been cancelled
PR Test (NPU) / single-node-poc (map[name:qwen3_6_27b_w8a8_1p_in64k_out1k_50ms runner:linux-aarch64-a3-2 test_case:test/registered/ascend/performance/qwen3_6_27b/test_npu_qwen3_6_27b_w8a8_1p_in64k_out1k_50ms.py test_type:perf]) (push) Has been cancelled
PR Test (NPU) / pr-test-npu-finish (push) Has been cancelled
PR Test (Xeon) / pr-gate (push) Has been cancelled
PR Test (Xeon) / check-changes (push) Has been cancelled
PR Test (Xeon) / build-test (, xeon-gnr, base-b-test-cpu) (push) Has been cancelled
PR Test (XPU) / check-changes (push) Has been cancelled
PR Test (XPU) / pr-gate (push) Has been cancelled
PR Test (XPU) / stage-a-test-1-gpu-xpu (push) Has been cancelled
PR Test (XPU) / wait-for-stage-a (push) Has been cancelled
PR Test (XPU) / stage-b-test-1-gpu-xpu (push) Has been cancelled
PR Test (XPU) / finish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:16 +08:00

201 lines
8.9 KiB
YAML

name: Build and Push Development Docker Images
on:
workflow_dispatch:
inputs:
pr_number:
description: "PR number to build from (leave empty to use current branch)"
required: false
default: ""
tag:
description: "Custom tag suffix (overrides pr_number in tag). E.g. 'my-test' → dev-my-test, dev-cu13-my-test, etc."
required: false
default: ""
image_repo:
description: "Docker Hub repo to push to. Use lmsysorg/sglang-staging for testing."
required: false
default: "lmsysorg/sglang"
overlay_dockerfile:
description: "Optional extra Dockerfile lines appended after FROM <base> to build a layered image (e.g. 'RUN pip install ...'). Note: this job has no repo checkout, so only FROM + RUN work — you cannot COPY files from this repo. Leave empty to skip overlay."
required: false
default: ""
overlay_cudas:
description: "Comma-separated cuda variants to overlay onto (cu12, cu13). Default 'cu13'."
required: false
default: "cu13"
overlay_tag_suffix:
description: "Overlay output suffix appended to the base tag. EMPTY = overwrite the base tag(s); non-empty = append (e.g. 'msa')."
required: false
default: ""
schedule:
- cron: "0 0 * * *"
concurrency:
group: release-docker-dev-${{ inputs.tag || inputs.pr_number || 'nightly' }}
cancel-in-progress: true
jobs:
prepare:
if: github.repository == 'sgl-project/sglang'
runs-on: ubuntu-latest
outputs:
checkout_ref: ${{ steps.config.outputs.checkout_ref }}
extra_build_args: ${{ steps.config.outputs.extra_build_args }}
tag_config: ${{ steps.config.outputs.tag_config }}
overlay_cudas_json: ${{ steps.config.outputs.overlay_cudas_json }}
overlay_tags_json: ${{ steps.config.outputs.overlay_tags_json }}
steps:
- name: Compute build configuration
id: config
env:
# Inject multi-line/free-text inputs via env to avoid ${{ }} injection
# breaking the bash script on quotes or $ in the Dockerfile snippet.
OVERLAY_DOCKERFILE_INPUT: ${{ inputs.overlay_dockerfile }}
OVERLAY_CUDAS_INPUT: ${{ inputs.overlay_cudas }}
OVERLAY_SUFFIX_INPUT: ${{ inputs.overlay_tag_suffix }}
run: |
# Determine checkout ref
if [ -n "${{ inputs.pr_number }}" ]; then
echo "checkout_ref=refs/pull/${{ inputs.pr_number }}/head" >> $GITHUB_OUTPUT
else
echo "checkout_ref=" >> $GITHUB_OUTPUT
fi
# Determine extra build args. INSTALL_DYNAMO=1 installs the ai-dynamo
# nightly here only; release-docker.yml / release-docker-runtime.yml
# leave it at the Dockerfile default (0), keeping it out of releases.
if [ "${{ github.event_name }}" = "schedule" ]; then
echo "extra_build_args=--build-arg USE_LATEST_SGLANG=1 --build-arg INSTALL_DYNAMO=1 --build-arg CMAKE_BUILD_PARALLEL_LEVEL=\$(nproc)" >> $GITHUB_OUTPUT
else
echo "extra_build_args=--build-arg BRANCH_TYPE=local --build-arg INSTALL_DYNAMO=1 --build-arg CMAKE_BUILD_PARALLEL_LEVEL=\$(nproc)" >> $GITHUB_OUTPUT
fi
# Determine tag suffix
SUFFIX=""
if [ -n "${{ inputs.tag }}" ]; then
SUFFIX="-${{ inputs.tag }}"
elif [ -n "${{ inputs.pr_number }}" ]; then
SUFFIX="-pr-${{ inputs.pr_number }}"
fi
# Build tag config. dev-cu13 / nightly-dev-cu13 are published as
# aliases on the cu130 image for backwards compatibility with
# consumers pinned to the pre-flip names.
if [ -z "${SUFFIX}" ]; then
# Nightly: include dated tags
TAG_CONFIG='[{"cuda":"cu129","tags":["dev-cu12","nightly-dev-cu12-{date}-{short_sha}"]},{"cuda":"cu130","tags":["dev","dev-cu13","nightly-dev-{date}-{short_sha}","nightly-dev-cu13-{date}-{short_sha}"]}]'
else
TAG_CONFIG="[{\"cuda\":\"cu129\",\"tags\":[\"dev-cu12${SUFFIX}\"]},{\"cuda\":\"cu130\",\"tags\":[\"dev${SUFFIX}\",\"dev-cu13${SUFFIX}\"]}]"
fi
echo "tag_config=${TAG_CONFIG}" >> $GITHUB_OUTPUT
# Overlay configuration (optional). When overlay_dockerfile is set,
# build one or more layered images on top of the just-built base.
# SUFFIX was computed above from inputs.tag / inputs.pr_number.
if [ -n "${OVERLAY_DOCKERFILE_INPUT}" ]; then
# Refuse to overlay without a tag/pr_number: SUFFIX would be empty,
# so base would point at the moving 'dev'/'dev-cu12'/'dev-cu13'
# latest tags and overwrite mode would clobber them.
if [ -z "${SUFFIX}" ]; then
echo "overlay_dockerfile is set but neither 'tag' nor 'pr_number' was given." >&2
echo "Set one so the overlay targets a specific tag, not the moving 'dev' latest." >&2
exit 1
fi
CUDAS_INPUT="${OVERLAY_CUDAS_INPUT}"
[ -z "${CUDAS_INPUT}" ] && CUDAS_INPUT="cu13"
OVERLAY_TAGS='{}'
IFS=',' read -ra CUDAS <<< "${CUDAS_INPUT}"
for C in "${CUDAS[@]}"; do
C="$(echo "${C}" | xargs)"
if [ "${C}" = "cu13" ]; then
BASES='["dev'"${SUFFIX}"'","dev-cu13'"${SUFFIX}"'"]'
elif [ "${C}" = "cu12" ]; then
BASES='["dev-cu12'"${SUFFIX}"'"]'
else
echo "Unknown overlay cuda variant: ${C} (expected cu12 or cu13)" >&2
exit 1
fi
if [ -n "${OVERLAY_SUFFIX_INPUT}" ]; then
# Append mode: primary base tag + suffix.
PRIMARY="$(echo "${BASES}" | jq -r '.[0]')"
OUTS='["'"${PRIMARY}-${OVERLAY_SUFFIX_INPUT}"'"]'
else
# Overwrite mode: replace every base alias.
OUTS="${BASES}"
fi
OVERLAY_TAGS="$(echo "${OVERLAY_TAGS}" | jq -c \
--arg c "${C}" --argjson b "${BASES}" --argjson o "${OUTS}" \
'.[$c] = {bases:$b, outs:$o}')"
done
CUDAS_JSON="$(echo "${CUDAS_INPUT}" | jq -c -R 'split(",") | map(gsub("^\\s+|\\s+$";""))')"
echo "overlay_cudas_json=${CUDAS_JSON}" >> $GITHUB_OUTPUT
echo "overlay_tags_json=${OVERLAY_TAGS}" >> $GITHUB_OUTPUT
else
echo "overlay_cudas_json=[]" >> $GITHUB_OUTPUT
echo "overlay_tags_json={}" >> $GITHUB_OUTPUT
fi
build-and-publish:
needs: prepare
uses: ./.github/workflows/_docker-build-and-publish.yml
with:
docker_target: framework_final
checkout_ref: ${{ needs.prepare.outputs.checkout_ref }}
extra_build_args: ${{ needs.prepare.outputs.extra_build_args }}
tag_config: ${{ needs.prepare.outputs.tag_config }}
image_repo: ${{ inputs.image_repo || 'lmsysorg/sglang' }}
secrets: inherit
cleanup-nightly:
needs: build-and-publish
if: ${{ !inputs.tag && !inputs.pr_number }}
uses: ./.github/workflows/_docker-cleanup-nightly.yml
with:
tag_prefixes: '["nightly-dev", "nightly-dev-cu12", "nightly-dev-cu13"]'
image_repo: ${{ inputs.image_repo || 'lmsysorg/sglang' }}
secrets: inherit
build-overlay:
needs: [prepare, build-and-publish]
if: ${{ inputs.overlay_dockerfile != '' && github.repository == 'sgl-project/sglang' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cuda: ${{ fromJson(needs.prepare.outputs.overlay_cudas_json) }}
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push overlay image (amd64 + arm64)
env:
REPO: ${{ inputs.image_repo || 'lmsysorg/sglang' }}
TAGS: ${{ needs.prepare.outputs.overlay_tags_json }}
CUDA: ${{ matrix.cuda }}
# Injected via env to keep Dockerfile quotes/$ verbatim.
SNIPPET: ${{ inputs.overlay_dockerfile }}
run: |
set -euo pipefail
BASE="$(printf '%s' "$TAGS" | jq -r --arg c "$CUDA" '.[$c].bases[0]')"
mapfile -t OUTS < <(printf '%s' "$TAGS" | jq -r --arg c "$CUDA" '.[$c].outs[]')
{
printf 'FROM %s:%s\n' "$REPO" "$BASE"
printf '%s\n' "$SNIPPET"
} > Dockerfile.overlay
echo "::group::overlay Dockerfile ($CUDA)"
cat Dockerfile.overlay
echo "::endgroup::"
OUT_ARGS=""
for o in "${OUTS[@]}"; do OUT_ARGS="$OUT_ARGS -t $REPO:$o"; done
docker buildx build \
--platform linux/amd64,linux/arm64 \
-f Dockerfile.overlay \
$OUT_ARGS \
--push .