-
Notifications
You must be signed in to change notification settings - Fork 863
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
55 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build Development Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
build-dev: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Free disk space | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
docker-images: false | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
large-packages: true | ||
swap-storage: false | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and Push Dev Image | ||
run: | | ||
docker build . -f docker/Dockerfile.dev -t lmsys/sglang:dev --no-cache | ||
docker push lmsys/sglang:dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,35 @@ | ||
name: Release Docker Images | ||
name: Build Development Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "python/sglang/version.py" | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
publish: | ||
if: github.repository == 'sgl-project/sglang' | ||
runs-on: ubuntu-latest | ||
environment: 'prod' | ||
strategy: | ||
matrix: | ||
cuda_version: ['11.8.0', '12.1.1', '12.4.1'] | ||
build_type: ['all', 'srt'] | ||
build-dev: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Delete huge unnecessary tools folder | ||
run: rm -rf /opt/hostedtoolcache | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Free disk space | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
docker-images: false | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
large-packages: true | ||
swap-storage: false | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and Push | ||
- name: Build and Push Dev Image | ||
run: | | ||
version=$(cat python/sglang/version.py | cut -d'"' -f2) | ||
if [ "${{ matrix.cuda_version }}" = "11.8.0" ]; then | ||
cuda_tag="cu118" | ||
elif [ "${{ 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} | ||
if [ "${{ matrix.build_type }}" = "all" ]; then | ||
tag_suffix="" | ||
elif [ "${{ matrix.build_type }}" = "srt" ]; then | ||
tag_suffix="-srt" | ||
else | ||
echo "Unsupported build type" | ||
exit 1 | ||
fi | ||
docker build . -f docker/Dockerfile --build-arg CUDA_VERSION=${{ matrix.cuda_version }} --build-arg BUILD_TYPE=${{ matrix.build_type }} -t lmsysorg/sglang:${tag}${tag_suffix} --no-cache | ||
docker push lmsysorg/sglang:${tag}${tag_suffix} | ||
if [ "${{ matrix.cuda_version }}" = "12.1.1" ]; then | ||
docker tag lmsysorg/sglang:${tag}${tag_suffix} lmsysorg/sglang:latest${tag_suffix} | ||
docker push lmsysorg/sglang:latest${tag_suffix} | ||
fi | ||
docker build . -f docker/Dockerfile.dev -t lmsys/sglang:dev --no-cache | ||
docker push lmsys/sglang:dev |