[CI] Eliminate per-arch Docker tags by using push-by-digest (#20793)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
b9dba851a0
commit
39e83d1401
@@ -4,11 +4,11 @@ name: Release Docker Images
|
||||
#
|
||||
# Framework images (full development environment):
|
||||
# - lmsysorg/sglang:v{version}, lmsysorg/sglang:latest
|
||||
# - lmsysorg/sglang:v{version}-cu129-{amd64,arm64}
|
||||
# - lmsysorg/sglang:v{version}-cu130, lmsysorg/sglang:latest-cu130
|
||||
#
|
||||
# Runtime images (production-optimized, ~50% smaller):
|
||||
# - lmsysorg/sglang:v{version}-runtime, lmsysorg/sglang:latest-runtime
|
||||
# - lmsysorg/sglang:v{version}-cu129-{amd64,arm64}-runtime
|
||||
# - lmsysorg/sglang:v{version}-cu130-runtime, lmsysorg/sglang:latest-cu130-runtime
|
||||
#
|
||||
on:
|
||||
push:
|
||||
@@ -83,79 +83,98 @@ jobs:
|
||||
- name: Build AMD64 Framework
|
||||
run: |
|
||||
version=${{ steps.version.outputs.version }}
|
||||
tag=v${version}-cu129-amd64
|
||||
|
||||
docker buildx build \
|
||||
--target framework \
|
||||
--platform linux/amd64 \
|
||||
--push \
|
||||
--output type=image,name=lmsysorg/sglang,push-by-digest=true,name-canonical=true,push=true \
|
||||
-f docker/Dockerfile \
|
||||
--build-arg CUDA_VERSION=${{ matrix.variant.cuda_version }} \
|
||||
--build-arg BUILD_TYPE=${{ matrix.variant.build_type }} \
|
||||
--build-arg GRACE_BLACKWELL=${{ matrix.variant.grace_blackwell }} \
|
||||
--build-arg INSTALL_FLASHINFER_JIT_CACHE=1 \
|
||||
--build-arg SGL_VERSION=${version} \
|
||||
-t lmsysorg/sglang:${tag} \
|
||||
--metadata-file /tmp/metadata-cu129-framework.json \
|
||||
--no-cache \
|
||||
.
|
||||
|
||||
DIGEST=$(python3 -c "import json; print(json.load(open('/tmp/metadata-cu129-framework.json'))['containerimage.digest'])")
|
||||
echo "Pushed digest: ${DIGEST}"
|
||||
echo "${DIGEST}" > /tmp/digest-cu129-amd64-framework.txt
|
||||
|
||||
- name: Build and Push AMD64 Runtime
|
||||
run: |
|
||||
version=${{ steps.version.outputs.version }}
|
||||
tag=v${version}-cu129-amd64-runtime
|
||||
|
||||
docker buildx build \
|
||||
--target runtime \
|
||||
--platform linux/amd64 \
|
||||
--push \
|
||||
--output type=image,name=lmsysorg/sglang,push-by-digest=true,name-canonical=true,push=true \
|
||||
-f docker/Dockerfile \
|
||||
--build-arg CUDA_VERSION=${{ matrix.variant.cuda_version }} \
|
||||
--build-arg BUILD_TYPE=${{ matrix.variant.build_type }} \
|
||||
--build-arg GRACE_BLACKWELL=${{ matrix.variant.grace_blackwell }} \
|
||||
--build-arg INSTALL_FLASHINFER_JIT_CACHE=1 \
|
||||
--build-arg SGL_VERSION=${version} \
|
||||
-t lmsysorg/sglang:${tag} \
|
||||
--metadata-file /tmp/metadata-cu129-runtime.json \
|
||||
--no-cache \
|
||||
.
|
||||
|
||||
DIGEST=$(python3 -c "import json; print(json.load(open('/tmp/metadata-cu129-runtime.json'))['containerimage.digest'])")
|
||||
echo "Pushed digest: ${DIGEST}"
|
||||
echo "${DIGEST}" > /tmp/digest-cu129-amd64-runtime.txt
|
||||
|
||||
- name: Build and Push AMD64 Framework (CUDA 13)
|
||||
run: |
|
||||
version=${{ steps.version.outputs.version }}
|
||||
tag=v${version}-cu130-amd64
|
||||
|
||||
docker buildx build \
|
||||
--target framework \
|
||||
--platform linux/amd64 \
|
||||
--push \
|
||||
--output type=image,name=lmsysorg/sglang,push-by-digest=true,name-canonical=true,push=true \
|
||||
-f docker/Dockerfile \
|
||||
--build-arg CUDA_VERSION=13.0.1 \
|
||||
--build-arg BUILD_TYPE=${{ matrix.variant.build_type }} \
|
||||
--build-arg INSTALL_FLASHINFER_JIT_CACHE=1 \
|
||||
--build-arg GRACE_BLACKWELL=0 \
|
||||
--build-arg SGL_VERSION=${version} \
|
||||
-t lmsysorg/sglang:${tag} \
|
||||
--metadata-file /tmp/metadata-cu130-framework.json \
|
||||
--no-cache \
|
||||
.
|
||||
|
||||
DIGEST=$(python3 -c "import json; print(json.load(open('/tmp/metadata-cu130-framework.json'))['containerimage.digest'])")
|
||||
echo "Pushed digest: ${DIGEST}"
|
||||
echo "${DIGEST}" > /tmp/digest-cu130-amd64-framework.txt
|
||||
|
||||
- name: Build and Push AMD64 Runtime (CUDA 13)
|
||||
run: |
|
||||
version=${{ steps.version.outputs.version }}
|
||||
tag=v${version}-cu130-amd64-runtime
|
||||
|
||||
docker buildx build \
|
||||
--target runtime \
|
||||
--platform linux/amd64 \
|
||||
--push \
|
||||
--output type=image,name=lmsysorg/sglang,push-by-digest=true,name-canonical=true,push=true \
|
||||
-f docker/Dockerfile \
|
||||
--build-arg CUDA_VERSION=13.0.1 \
|
||||
--build-arg BUILD_TYPE=${{ matrix.variant.build_type }} \
|
||||
--build-arg INSTALL_FLASHINFER_JIT_CACHE=1 \
|
||||
--build-arg GRACE_BLACKWELL=0 \
|
||||
--build-arg SGL_VERSION=${version} \
|
||||
-t lmsysorg/sglang:${tag} \
|
||||
--metadata-file /tmp/metadata-cu130-runtime.json \
|
||||
--no-cache \
|
||||
.
|
||||
|
||||
DIGEST=$(python3 -c "import json; print(json.load(open('/tmp/metadata-cu130-runtime.json'))['containerimage.digest'])")
|
||||
echo "Pushed digest: ${DIGEST}"
|
||||
echo "${DIGEST}" > /tmp/digest-cu130-amd64-runtime.txt
|
||||
|
||||
- name: Upload digests
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: digests-amd64
|
||||
path: /tmp/digest-*.txt
|
||||
retention-days: 1
|
||||
|
||||
publish-arm64:
|
||||
if: github.repository == 'sgl-project/sglang'
|
||||
environment: "prod"
|
||||
@@ -207,78 +226,97 @@ jobs:
|
||||
- name: Build ARM64 Framework
|
||||
run: |
|
||||
version=${{ steps.version.outputs.version }}
|
||||
tag=v${version}-cu129-arm64
|
||||
|
||||
docker buildx build \
|
||||
--target framework \
|
||||
--platform linux/arm64 \
|
||||
--push \
|
||||
--output type=image,name=lmsysorg/sglang,push-by-digest=true,name-canonical=true,push=true \
|
||||
-f docker/Dockerfile \
|
||||
--build-arg CUDA_VERSION=${{ matrix.variant.cuda_version }} \
|
||||
--build-arg BUILD_TYPE=${{ matrix.variant.build_type }} \
|
||||
--build-arg GRACE_BLACKWELL=${{ matrix.variant.grace_blackwell }} \
|
||||
--build-arg INSTALL_FLASHINFER_JIT_CACHE=1 \
|
||||
--build-arg SGL_VERSION=${version} \
|
||||
-t lmsysorg/sglang:${tag} \
|
||||
--metadata-file /tmp/metadata-cu129-framework.json \
|
||||
--no-cache \
|
||||
.
|
||||
|
||||
DIGEST=$(python3 -c "import json; print(json.load(open('/tmp/metadata-cu129-framework.json'))['containerimage.digest'])")
|
||||
echo "Pushed digest: ${DIGEST}"
|
||||
echo "${DIGEST}" > /tmp/digest-cu129-arm64-framework.txt
|
||||
|
||||
- name: Build and Push ARM64 Runtime
|
||||
run: |
|
||||
version=${{ steps.version.outputs.version }}
|
||||
tag=v${version}-cu129-arm64-runtime
|
||||
|
||||
docker buildx build \
|
||||
--target runtime \
|
||||
--platform linux/arm64 \
|
||||
--push \
|
||||
--output type=image,name=lmsysorg/sglang,push-by-digest=true,name-canonical=true,push=true \
|
||||
-f docker/Dockerfile \
|
||||
--build-arg CUDA_VERSION=${{ matrix.variant.cuda_version }} \
|
||||
--build-arg BUILD_TYPE=${{ matrix.variant.build_type }} \
|
||||
--build-arg GRACE_BLACKWELL=${{ matrix.variant.grace_blackwell }} \
|
||||
--build-arg INSTALL_FLASHINFER_JIT_CACHE=1 \
|
||||
--build-arg SGL_VERSION=${version} \
|
||||
-t lmsysorg/sglang:${tag} \
|
||||
--metadata-file /tmp/metadata-cu129-runtime.json \
|
||||
--no-cache \
|
||||
.
|
||||
|
||||
DIGEST=$(python3 -c "import json; print(json.load(open('/tmp/metadata-cu129-runtime.json'))['containerimage.digest'])")
|
||||
echo "Pushed digest: ${DIGEST}"
|
||||
echo "${DIGEST}" > /tmp/digest-cu129-arm64-runtime.txt
|
||||
|
||||
- name: Build and Push ARM64 Framework (CUDA 13)
|
||||
run: |
|
||||
version=${{ steps.version.outputs.version }}
|
||||
tag=v${version}-cu130-arm64
|
||||
|
||||
docker buildx build \
|
||||
--target framework \
|
||||
--platform linux/arm64 \
|
||||
--push \
|
||||
--output type=image,name=lmsysorg/sglang,push-by-digest=true,name-canonical=true,push=true \
|
||||
-f docker/Dockerfile \
|
||||
--build-arg CUDA_VERSION=13.0.1 \
|
||||
--build-arg BUILD_TYPE=${{ matrix.variant.build_type }} \
|
||||
--build-arg INSTALL_FLASHINFER_JIT_CACHE=1 \
|
||||
--build-arg GRACE_BLACKWELL=1 \
|
||||
--build-arg SGL_VERSION=${version} \
|
||||
-t lmsysorg/sglang:${tag} \
|
||||
--metadata-file /tmp/metadata-cu130-framework.json \
|
||||
--no-cache \
|
||||
.
|
||||
|
||||
DIGEST=$(python3 -c "import json; print(json.load(open('/tmp/metadata-cu130-framework.json'))['containerimage.digest'])")
|
||||
echo "Pushed digest: ${DIGEST}"
|
||||
echo "${DIGEST}" > /tmp/digest-cu130-arm64-framework.txt
|
||||
|
||||
- name: Build and Push ARM64 Runtime (CUDA 13)
|
||||
run: |
|
||||
version=${{ steps.version.outputs.version }}
|
||||
tag=v${version}-cu130-arm64-runtime
|
||||
|
||||
docker buildx build \
|
||||
--target runtime \
|
||||
--platform linux/arm64 \
|
||||
--push \
|
||||
--output type=image,name=lmsysorg/sglang,push-by-digest=true,name-canonical=true,push=true \
|
||||
-f docker/Dockerfile \
|
||||
--build-arg CUDA_VERSION=13.0.1 \
|
||||
--build-arg BUILD_TYPE=${{ matrix.variant.build_type }} \
|
||||
--build-arg GRACE_BLACKWELL=1 \
|
||||
--build-arg SGL_VERSION=${version} \
|
||||
-t lmsysorg/sglang:${tag} \
|
||||
--metadata-file /tmp/metadata-cu130-runtime.json \
|
||||
--no-cache \
|
||||
.
|
||||
|
||||
DIGEST=$(python3 -c "import json; print(json.load(open('/tmp/metadata-cu130-runtime.json'))['containerimage.digest'])")
|
||||
echo "Pushed digest: ${DIGEST}"
|
||||
echo "${DIGEST}" > /tmp/digest-cu130-arm64-runtime.txt
|
||||
|
||||
- name: Upload digests
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: digests-arm64
|
||||
path: /tmp/digest-*.txt
|
||||
retention-days: 1
|
||||
|
||||
create-manifests:
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [publish-x86, publish-arm64]
|
||||
@@ -319,54 +357,76 @@ jobs:
|
||||
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Download amd64 digests
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: digests-amd64
|
||||
path: /tmp/digests/amd64
|
||||
|
||||
- name: Download arm64 digests
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: digests-arm64
|
||||
path: /tmp/digests/arm64
|
||||
|
||||
- name: Create multi-arch manifests
|
||||
run: |
|
||||
version=${{ steps.version.outputs.version }}
|
||||
|
||||
# Load all digests
|
||||
CU129_AMD64_FW=$(cat /tmp/digests/amd64/digest-cu129-amd64-framework.txt)
|
||||
CU129_AMD64_RT=$(cat /tmp/digests/amd64/digest-cu129-amd64-runtime.txt)
|
||||
CU130_AMD64_FW=$(cat /tmp/digests/amd64/digest-cu130-amd64-framework.txt)
|
||||
CU130_AMD64_RT=$(cat /tmp/digests/amd64/digest-cu130-amd64-runtime.txt)
|
||||
CU129_ARM64_FW=$(cat /tmp/digests/arm64/digest-cu129-arm64-framework.txt)
|
||||
CU129_ARM64_RT=$(cat /tmp/digests/arm64/digest-cu129-arm64-runtime.txt)
|
||||
CU130_ARM64_FW=$(cat /tmp/digests/arm64/digest-cu130-arm64-framework.txt)
|
||||
CU130_ARM64_RT=$(cat /tmp/digests/arm64/digest-cu130-arm64-runtime.txt)
|
||||
|
||||
# Create versioned framework manifest (default)
|
||||
docker buildx imagetools create \
|
||||
-t lmsysorg/sglang:v${version} \
|
||||
lmsysorg/sglang:v${version}-cu129-amd64 \
|
||||
lmsysorg/sglang:v${version}-cu129-arm64
|
||||
lmsysorg/sglang@${CU129_AMD64_FW} \
|
||||
lmsysorg/sglang@${CU129_ARM64_FW}
|
||||
|
||||
# Create latest framework manifest (default)
|
||||
docker buildx imagetools create \
|
||||
-t lmsysorg/sglang:latest \
|
||||
lmsysorg/sglang:v${version}-cu129-amd64 \
|
||||
lmsysorg/sglang:v${version}-cu129-arm64
|
||||
lmsysorg/sglang@${CU129_AMD64_FW} \
|
||||
lmsysorg/sglang@${CU129_ARM64_FW}
|
||||
|
||||
# Create versioned runtime manifest
|
||||
docker buildx imagetools create \
|
||||
-t lmsysorg/sglang:v${version}-runtime \
|
||||
lmsysorg/sglang:v${version}-cu129-amd64-runtime \
|
||||
lmsysorg/sglang:v${version}-cu129-arm64-runtime
|
||||
lmsysorg/sglang@${CU129_AMD64_RT} \
|
||||
lmsysorg/sglang@${CU129_ARM64_RT}
|
||||
|
||||
# Create latest runtime manifest
|
||||
docker buildx imagetools create \
|
||||
-t lmsysorg/sglang:latest-runtime \
|
||||
lmsysorg/sglang:v${version}-cu129-amd64-runtime \
|
||||
lmsysorg/sglang:v${version}-cu129-arm64-runtime
|
||||
lmsysorg/sglang@${CU129_AMD64_RT} \
|
||||
lmsysorg/sglang@${CU129_ARM64_RT}
|
||||
|
||||
# Create versioned CUDA 13 framework manifest
|
||||
docker buildx imagetools create \
|
||||
-t lmsysorg/sglang:v${version}-cu130 \
|
||||
lmsysorg/sglang:v${version}-cu130-amd64 \
|
||||
lmsysorg/sglang:v${version}-cu130-arm64
|
||||
lmsysorg/sglang@${CU130_AMD64_FW} \
|
||||
lmsysorg/sglang@${CU130_ARM64_FW}
|
||||
|
||||
# Create latest CUDA 13 framework manifest
|
||||
docker buildx imagetools create \
|
||||
-t lmsysorg/sglang:latest-cu130 \
|
||||
lmsysorg/sglang:v${version}-cu130-amd64 \
|
||||
lmsysorg/sglang:v${version}-cu130-arm64
|
||||
lmsysorg/sglang@${CU130_AMD64_FW} \
|
||||
lmsysorg/sglang@${CU130_ARM64_FW}
|
||||
|
||||
# Create versioned CUDA 13 runtime manifest
|
||||
docker buildx imagetools create \
|
||||
-t lmsysorg/sglang:v${version}-cu130-runtime \
|
||||
lmsysorg/sglang:v${version}-cu130-amd64-runtime \
|
||||
lmsysorg/sglang:v${version}-cu130-arm64-runtime
|
||||
lmsysorg/sglang@${CU130_AMD64_RT} \
|
||||
lmsysorg/sglang@${CU130_ARM64_RT}
|
||||
|
||||
# Create latest CUDA 13 runtime manifest
|
||||
docker buildx imagetools create \
|
||||
-t lmsysorg/sglang:latest-cu130-runtime \
|
||||
lmsysorg/sglang:v${version}-cu130-amd64-runtime \
|
||||
lmsysorg/sglang:v${version}-cu130-arm64-runtime
|
||||
lmsysorg/sglang@${CU130_AMD64_RT} \
|
||||
lmsysorg/sglang@${CU130_ARM64_RT}
|
||||
|
||||
Reference in New Issue
Block a user