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
119 lines
4.3 KiB
YAML
119 lines
4.3 KiB
YAML
name: Patch Docker Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
pr_numbers:
|
|
description: "Comma-separated PR numbers to apply (e.g. 18962,19010)"
|
|
required: false
|
|
default: ""
|
|
image_tag:
|
|
description: "Base image tag to patch (e.g. dev-x86, dev-x86-cu13)"
|
|
required: true
|
|
|
|
concurrency:
|
|
group: patch-docker-${{ inputs.image_tag }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
patch:
|
|
if: github.repository == 'sgl-project/sglang'
|
|
runs-on: x64-docker-build-node
|
|
steps:
|
|
- name: Cleanup workspace (remove root-owned files from prior runs)
|
|
run: sudo rm -rf "$GITHUB_WORKSPACE"/* || true
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Pull base image and extract commit
|
|
run: |
|
|
IMAGE="lmsysorg/sglang:${{ inputs.image_tag }}"
|
|
docker pull "${IMAGE}"
|
|
if BASE_SHA=$(docker run --rm "${IMAGE}" git -C /sgl-workspace/sglang rev-parse HEAD 2>/dev/null); then
|
|
echo "Image built from commit: ${BASE_SHA}"
|
|
else
|
|
BASE_SHA=""
|
|
echo "::warning::Image has no .git directory — cannot extract base commit"
|
|
fi
|
|
echo "BASE_SHA=${BASE_SHA}" >> "$GITHUB_ENV"
|
|
|
|
- name: Generate patches
|
|
run: |
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
git fetch origin main
|
|
mkdir -p /tmp/patch-ctx
|
|
|
|
if [ -n "${{ inputs.pr_numbers }}" ]; then
|
|
IFS=',' read -ra PRS <<< "${{ inputs.pr_numbers }}"
|
|
for pr in "${PRS[@]}"; do
|
|
pr=$(echo "${pr}" | xargs)
|
|
echo "Fetching PR #${pr}"
|
|
git fetch origin "pull/${pr}/head:pr-${pr}"
|
|
MERGE_BASE=$(git merge-base origin/main "pr-${pr}")
|
|
echo " PR #${pr}: merge-base=${MERGE_BASE}"
|
|
git diff "${MERGE_BASE}..pr-${pr}" > "/tmp/patch-ctx/${pr}.patch"
|
|
echo " PR #${pr}: $(wc -l < /tmp/patch-ctx/${pr}.patch) lines"
|
|
done
|
|
elif [ -n "${BASE_SHA}" ]; then
|
|
echo "Generating diff: image ${BASE_SHA} → latest main"
|
|
git fetch origin "${BASE_SHA}"
|
|
git diff "${BASE_SHA}..origin/main" > /tmp/patch-ctx/main.patch
|
|
echo " main: $(wc -l < /tmp/patch-ctx/main.patch) lines"
|
|
else
|
|
echo "::error::No PR numbers specified and image has no .git — cannot generate diff against main"
|
|
exit 1
|
|
fi
|
|
|
|
TOTAL=$(cat /tmp/patch-ctx/*.patch | wc -l)
|
|
if [ "${TOTAL}" -eq 0 ]; then
|
|
echo "::warning::All patches are empty — image is already up to date"
|
|
echo "SKIP_BUILD=true" >> "$GITHUB_ENV"
|
|
fi
|
|
|
|
- name: Build patched image
|
|
if: env.SKIP_BUILD != 'true'
|
|
run: |
|
|
IMAGE="lmsysorg/sglang:${{ inputs.image_tag }}"
|
|
|
|
cat <<'DOCKERFILE' > /tmp/patch-ctx/Dockerfile
|
|
ARG BASE_IMAGE
|
|
FROM ${BASE_IMAGE}
|
|
COPY *.patch /tmp/patches/
|
|
RUN cd /sgl-workspace/sglang \
|
|
&& for p in /tmp/patches/*.patch; do \
|
|
if [ ! -s "${p}" ]; then \
|
|
echo "Skipping ${p} (empty)"; \
|
|
else \
|
|
echo "Applying ${p}..." \
|
|
&& patch -p1 --fuzz=2 --no-backup-if-mismatch -f < "${p}" \
|
|
|| { echo "ERROR: Failed to apply ${p}"; exit 1; }; \
|
|
fi; \
|
|
done \
|
|
&& rm -rf /tmp/patches
|
|
DOCKERFILE
|
|
|
|
docker build \
|
|
--no-cache \
|
|
--build-arg BASE_IMAGE="${IMAGE}" \
|
|
-t "${IMAGE}" \
|
|
/tmp/patch-ctx/
|
|
|
|
- name: Push patched image
|
|
if: env.SKIP_BUILD != 'true'
|
|
run: |
|
|
IMAGE="lmsysorg/sglang:${{ inputs.image_tag }}"
|
|
docker push "${IMAGE}"
|
|
|
|
echo "### Patched \`${IMAGE}\`" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "- **Base commit:** \`${BASE_SHA:-unknown (no .git)}\`" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "- **Source:** ${{ inputs.pr_numbers && format('PRs: {0}', inputs.pr_numbers) || 'latest main' }}" >> "$GITHUB_STEP_SUMMARY"
|