Unverified Commit 8628ab9c authored by Yineng Zhang's avatar Yineng Zhang Committed by GitHub
Browse files

feat: add docker workflow (#751)

parent 1b77670f
name: publish docker
on:
push:
branches:
- main
paths:
- "python/sglang/version.py"
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
environment: 'prod'
strategy:
matrix:
cuda_version: ['12.1.1', '12.4.1']
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push
run: |
version=$(cat python/sglang/version.py | cut -d'"' -f2)
if [ "${{ matrix.cuda_version }}" = "12.1.1" ]; then
cuda_tag="cu121"
elif [ "${{ matrix.cuda_version }}" = "12.4.1" ]; then
cuda_tag="cu124"
else
echo "Unsupported CUDA version"
exit 1
fi
tag=v${version}-${cuda_tag}
docker build . -f docker/Dockerfile --build-arg CUDA_VERSION=${{ matrix.cuda_version }} -t lmsysorg/sglang:${tag} --no-cache
docker push lmsysorg/sglang:${tag}
if [ "${{ matrix.cuda_version }}" = "12.1.1" ]; then
docker tag lmsysorg/sglang:${tag} lmsysorg/sglang:latest
docker push lmsysorg/sglang:latest
fi
......@@ -20,12 +20,14 @@ RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
&& apt-get clean
RUN apt-get update -y \
&& apt-get install -y python3-pip git curl sudo
&& apt-get install -y git curl sudo
WORKDIR /sgl-workspace
RUN pip3 --no-cache-dir install --upgrade pip \
&& pip3 --no-cache-dir install "sglang[all]" \
&& git clone --depth=1 https://github.com/sgl-project/sglang.git \
&& cd sglang \
&& pip3 --no-cache-dir install -e "python[all]" \
&& pip3 --no-cache-dir install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.3/
ENV DEBIAN_FRONTEND=interactive
......@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "sglang"
version = "0.2.1"
version = "0.2.2"
description = "SGLang is yet another fast serving framework for large language models and vision language models."
readme = "README.md"
requires-python = ">=3.8"
......
__version__ = "0.2.1"
__version__ = "0.2.2"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment