Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
8628ab9c
Unverified
Commit
8628ab9c
authored
Jul 27, 2024
by
Yineng Zhang
Committed by
GitHub
Jul 27, 2024
Browse files
feat: add docker workflow (#751)
parent
1b77670f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
4 deletions
+54
-4
.github/workflows/docker.yml
.github/workflows/docker.yml
+48
-0
docker/Dockerfile
docker/Dockerfile
+4
-2
python/pyproject.toml
python/pyproject.toml
+1
-1
python/sglang/version.py
python/sglang/version.py
+1
-1
No files found.
.github/workflows/docker.yml
0 → 100644
View file @
8628ab9c
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
docker/Dockerfile
View file @
8628ab9c
...
...
@@ -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
python/pyproject.toml
View file @
8628ab9c
...
...
@@ -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"
...
...
python/sglang/version.py
View file @
8628ab9c
__version__
=
"0.2.
1
"
__version__
=
"0.2.
2
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment