-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docker] Add docker file for vllm (#101)
- Loading branch information
1 parent
8f03d3d
commit 65988d6
Showing
6 changed files
with
37 additions
and
52 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
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
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
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,22 @@ | ||
FROM nvcr.io/nvidia/pytorch:23.10-py3 | ||
|
||
ARG BRANCH="main" | ||
ARG COMMIT_ID="unknown" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y bc && \ | ||
wget -O /tmp/bazel.deb "https://github.com/bazelbuild/bazel/releases/download/5.1.0/bazel_5.1.0-linux-x86_64.deb" && \ | ||
dpkg -i /tmp/bazel.deb && \ | ||
rm /tmp/bazel.deb && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
RUN git clone https://github.com/AlibabaPAI/llumnix.git && \ | ||
cd llumnix && \ | ||
git fetch origin ${BRANCH} && \ | ||
git checkout ${BRANCH} && \ | ||
git checkout ${COMMIT_ID} && \ | ||
make pygloo && \ | ||
make check_pylint_installed && \ | ||
make check_pytest_installed && \ | ||
make vllm_install |
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,55 +1,18 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <NAMESPACE>" | ||
exit 1 | ||
fi | ||
|
||
NAMESPACE="$1" | ||
REPO="registry.cn-beijing.aliyuncs.com/llumnix/${NAMESPACE}" | ||
set -e | ||
|
||
REPO="registry.cn-beijing.aliyuncs.com/llumnix/llumnix-dev" | ||
DATE=$(date +%Y%m%d) | ||
BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
COMMIT_ID=$(git rev-parse --short=7 HEAD) | ||
TAG="${DATE}_${BRANCH}_${COMMIT_ID}" | ||
|
||
# Get the Git user email | ||
USER_EMAIL=$(git config user.email) | ||
|
||
if [ -z "$USER_EMAIL" ] || [ "${#USER_EMAIL}" -le 0 ]; then | ||
echo "Error: Git user email is not set or empty. Please set it using 'git config user.email'" | ||
exit 1 | ||
fi | ||
|
||
# Ask for the container ID | ||
echo "Please enter the container ID or name you want to commit:" | ||
read CONTAINER_ID | ||
|
||
if ! docker inspect -f '{{.ID}}' "$CONTAINER_ID" &> /dev/null; then | ||
echo "Error: The container '$CONTAINER_ID' does not exist." | ||
exit 1 | ||
fi | ||
|
||
# Display the details about the commit | ||
echo "Preparing to commit the following container:" | ||
echo "Container ID: $CONTAINER_ID" | ||
echo "Image TAG: ${REPO}:${TAG}" | ||
echo "Using Git user email: $USER_EMAIL" | ||
|
||
# Confirm the commit action | ||
read -p "Do you want to proceed with the commit? (y/n): " -n 1 -r | ||
echo # move to a new line | ||
if [[ $REPLY != "y" ]]; then | ||
echo "Commit aborted." | ||
exit 1 | ||
fi | ||
|
||
# Commit the container with an optional message and author | ||
docker commit -a "${USER_EMAIL}" "${CONTAINER_ID}" "${REPO}:${TAG}" | ||
echo "Building docker image ${REPO}:${TAG}" | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "Image committed successfully: ${REPO}:${TAG}" | ||
else | ||
echo "Image commit failed!" | ||
exit 1 | ||
fi | ||
export DOCKER_BUILDKIT=1 | ||
docker build . \ | ||
-f tools/docker/Dockerfile.vllm \ | ||
--build-arg BRANCH=${BRANCH} \ | ||
--build-arg COMMIT_ID=${COMMIT_ID} \ | ||
-t ${REPO}:${TAG} |
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