Skip to content

Commit cb67389

Browse files
committed
fix: update docker build dependencies and configuration
- Update Dockerfile with proper CUDA and Python dependencies - Add specific versions for torch and sglang dependencies - Update requirements.txt with necessary packages - Add test_input.json for validation
1 parent 9b901b9 commit cb67389

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

Dockerfile

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
FROM nvidia/cuda:12.1.0-base-ubuntu22.04
1+
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04
22

3-
RUN apt-get update -y \
4-
&& apt-get install -y python3-pip
3+
# Install system dependencies
4+
RUN apt-get update -y && \
5+
apt-get install -y python3-pip python3-dev build-essential git cmake && \
6+
apt-get clean && \
7+
rm -rf /var/lib/apt/lists/*
58

9+
# Configure CUDA paths
610
RUN ldconfig /usr/local/cuda-12.1/compat/
711

812
# Install Python dependencies
@@ -11,8 +15,11 @@ RUN --mount=type=cache,target=/root/.cache/pip \
1115
python3 -m pip install --upgrade pip && \
1216
python3 -m pip install --upgrade -r /requirements.txt
1317

14-
RUN python3 -m pip install "sglang[all]" && \
15-
python3 -m pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.3
18+
# Install sglang and flashinfer with specific versions and extra error handling
19+
RUN python3 -m pip install torch>=2.3.0 && \
20+
python3 -m pip install "sglang[all]" --no-build-isolation && \
21+
python3 -m pip install --upgrade pip && \
22+
python3 -m pip install flashinfer --index-url https://flashinfer.ai/whl/cu121/torch2.3
1623

1724
# Setup for Option 2: Building the Image with the Model included
1825
ARG MODEL_NAME=""
@@ -35,8 +42,11 @@ ENV MODEL_NAME=$MODEL_NAME \
3542

3643
ENV PYTHONPATH="/:/vllm-workspace"
3744

38-
45+
# Copy source code and test input
3946
COPY src /src
47+
COPY test_input.json /test_input.json
48+
49+
# Download model if specified
4050
RUN --mount=type=secret,id=HF_TOKEN,required=false \
4151
if [ -f /run/secrets/HF_TOKEN ]; then \
4252
export HF_TOKEN=$(cat /run/secrets/HF_TOKEN); \
@@ -46,4 +56,4 @@ RUN --mount=type=secret,id=HF_TOKEN,required=false \
4656
fi
4757

4858
# Start the handler
49-
CMD ["python3", "/src/handler.py"]
59+
CMD ["python3", "/src/handler.py"]

builder/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ray
22
pandas
33
pyarrow
4-
runpod~=1.7.0
4+
runpod~=1.7.13
55
huggingface-hub
66
packaging
77
typing-extensions==4.7.1

test_input.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"input": {
3+
"prompt": "What is artificial intelligence?",
4+
"max_tokens": 100,
5+
"temperature": 0.7
6+
}
7+
}

0 commit comments

Comments
 (0)