Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +34 -14
Dockerfile
CHANGED
@@ -1,19 +1,39 @@
|
|
1 |
-
# Use
|
2 |
-
FROM
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
-
python3 \
|
7 |
-
python3-pip
|
8 |
|
9 |
-
#
|
10 |
-
|
|
|
|
|
|
|
|
|
11 |
|
12 |
-
#
|
13 |
-
RUN
|
14 |
|
15 |
-
#
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
#
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a base image with Python and necessary tools
|
2 |
+
FROM python:3.10-slim
|
3 |
|
4 |
+
# Set environment variables for non-interactive installations
|
5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
6 |
|
7 |
+
# Update and install system dependencies
|
8 |
+
RUN apt-get update -y && \
|
9 |
+
apt-get install -y --no-install-recommends \
|
10 |
+
gcc-12 g++-12 libnuma-dev libtcmalloc-minimal4 && \
|
11 |
+
apt-get clean && \
|
12 |
+
rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
+
# Configure gcc and g++ alternatives
|
15 |
+
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10 --slave /usr/bin/g++ g++ /usr/bin/g++-12
|
16 |
|
17 |
+
# Upgrade pip and install Python dependencies
|
18 |
+
RUN pip install --upgrade pip && \
|
19 |
+
pip install "cmake>=3.26" wheel packaging ninja "setuptools-scm>=8" numpy && \
|
20 |
+
pip install vllm && \
|
21 |
+
pip install --upgrade numba scipy "huggingface-hub[cli]" && \
|
22 |
+
pip install "numpy<2" && \
|
23 |
+
pip uninstall torch -y && \
|
24 |
+
pip install --no-cache-dir --pre torch==2.6.0.dev20241122 --index-url https://download.pytorch.org/whl/nightly/rocm6.2
|
25 |
|
26 |
+
# Find the dynamic link library path and set LD_PRELOAD
|
27 |
+
RUN LD_PATH=$(find / -name "*libtcmalloc*.so.4" 2>/dev/null | head -n 1) && \
|
28 |
+
echo "export LD_PRELOAD=$LD_PATH:\$LD_PRELOAD" >> /etc/profile && \
|
29 |
+
export LD_PRELOAD=$LD_PATH:$LD_PRELOAD
|
30 |
+
|
31 |
+
# Set additional environment variables
|
32 |
+
ENV VLLM_CPU_KVCACHE_SPACE=40
|
33 |
+
ENV VLLM_CPU_OMP_THREADS_BIND=0-29
|
34 |
+
|
35 |
+
# Expose the port for the model server
|
36 |
+
EXPOSE 8007
|
37 |
+
|
38 |
+
# Command to run the model server
|
39 |
+
CMD ["vllm", "serve", "--device", "cpu", "--port", "8007", "Hjgugugjhuhjggg/mergekit-ties-tzamfyy", "--max-model-len", "100"]
|