docker: add manifest to versioned docker releases (#11268)
This commit is contained in:
86
.github/workflows/release-docker.yml
vendored
86
.github/workflows/release-docker.yml
vendored
@@ -47,32 +47,17 @@ jobs:
|
|||||||
- name: Build and Push AMD64
|
- name: Build and Push AMD64
|
||||||
run: |
|
run: |
|
||||||
version=$(cat python/sglang/version.py | cut -d'"' -f2)
|
version=$(cat python/sglang/version.py | cut -d'"' -f2)
|
||||||
|
tag=v${version}-cu129-amd64
|
||||||
|
|
||||||
if [ "${{ matrix.variant.cuda_version }}" = "12.6.1" ]; then
|
docker buildx build \
|
||||||
cuda_tag="cu126"
|
--platform linux/amd64 \
|
||||||
elif [ "${{ matrix.variant.cuda_version }}" = "12.8.1" ]; then
|
--push \
|
||||||
cuda_tag="cu128"
|
-f docker/Dockerfile \
|
||||||
elif [ "${{ matrix.variant.cuda_version }}" = "12.9.1" ]; then
|
--build-arg CUDA_VERSION=${{ matrix.variant.cuda_version }} \
|
||||||
cuda_tag="cu129"
|
--build-arg BUILD_TYPE=${{ matrix.variant.build_type }} \
|
||||||
else
|
-t lmsysorg/sglang:${tag} \
|
||||||
echo "Unsupported CUDA version"
|
--no-cache \
|
||||||
exit 1
|
.
|
||||||
fi
|
|
||||||
|
|
||||||
tag=v${version}-${cuda_tag}
|
|
||||||
|
|
||||||
if [ "${{ matrix.variant.build_type }}" = "all" ]; then
|
|
||||||
tag_suffix=""
|
|
||||||
else
|
|
||||||
echo "Unsupported build type"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${{ matrix.variant.cuda_version }}" = "12.9.1" ]; then
|
|
||||||
docker buildx build --platform linux/amd64 --push -f docker/Dockerfile --build-arg CUDA_VERSION=${{ matrix.variant.cuda_version }} --build-arg BUILD_TYPE=${{ matrix.variant.build_type }} -t lmsysorg/sglang:${tag}${tag_suffix} -t lmsysorg/sglang:latest --no-cache .
|
|
||||||
else
|
|
||||||
docker buildx build --platform linux/amd64 --push -f docker/Dockerfile --build-arg CUDA_VERSION=${{ matrix.variant.cuda_version }} --build-arg BUILD_TYPE=${{ matrix.variant.build_type }} -t lmsysorg/sglang:${tag}${tag_suffix} --no-cache .
|
|
||||||
fi
|
|
||||||
|
|
||||||
publish-arm64:
|
publish-arm64:
|
||||||
if: github.repository == 'sgl-project/sglang'
|
if: github.repository == 'sgl-project/sglang'
|
||||||
@@ -102,15 +87,48 @@ jobs:
|
|||||||
- name: Build and Push ARM64
|
- name: Build and Push ARM64
|
||||||
run: |
|
run: |
|
||||||
version=$(cat python/sglang/version.py | cut -d'"' -f2)
|
version=$(cat python/sglang/version.py | cut -d'"' -f2)
|
||||||
|
tag=v${version}-cu129-arm64
|
||||||
|
|
||||||
if [ "${{ matrix.variant.cuda_version }}" = "12.9.1" ]; then
|
docker buildx build \
|
||||||
cuda_tag="cu129"
|
--platform linux/arm64 \
|
||||||
else
|
--push \
|
||||||
echo "Unsupported CUDA version"
|
-f docker/Dockerfile \
|
||||||
exit 1
|
--build-arg CUDA_VERSION=${{ matrix.variant.cuda_version }} \
|
||||||
fi
|
--build-arg BUILD_TYPE=${{ matrix.variant.build_type }} \
|
||||||
|
-t lmsysorg/sglang:${tag} \
|
||||||
|
--no-cache \
|
||||||
|
.
|
||||||
|
|
||||||
tag=v${version}-${cuda_tag}
|
create-manifests:
|
||||||
tag_suffix="-gb200"
|
runs-on: ubuntu-22.04
|
||||||
|
needs: [publish-x86, publish-arm64]
|
||||||
|
if: github.repository == 'sgl-project/sglang'
|
||||||
|
environment: "prod"
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
docker buildx build --platform linux/arm64 --push -f docker/Dockerfile --build-arg CUDA_VERSION=${{ matrix.variant.cuda_version }} --build-arg BUILD_TYPE=${{ matrix.variant.build_type }} -t lmsysorg/sglang:${tag}${tag_suffix} --no-cache .
|
- 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: Create multi-arch manifests
|
||||||
|
run: |
|
||||||
|
version=$(cat python/sglang/version.py | cut -d'"' -f2)
|
||||||
|
|
||||||
|
# Create versioned manifest
|
||||||
|
docker buildx imagetools create \
|
||||||
|
-t lmsysorg/sglang:v${version} \
|
||||||
|
lmsysorg/sglang:v${version}-cu129-amd64 \
|
||||||
|
lmsysorg/sglang:v${version}-cu129-arm64
|
||||||
|
|
||||||
|
# Create latest manifest
|
||||||
|
docker buildx imagetools create \
|
||||||
|
-t lmsysorg/sglang:latest \
|
||||||
|
lmsysorg/sglang:v${version}-cu129-amd64 \
|
||||||
|
lmsysorg/sglang:v${version}-cu129-arm64
|
||||||
|
|||||||
Reference in New Issue
Block a user