xfcxcxcdfdfd commited on
Commit
d774023
·
verified ·
1 Parent(s): 61e1204

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -14
Dockerfile CHANGED
@@ -1,19 +1,39 @@
1
- # Use the latest Ubuntu image
2
- FROM ubuntu:latest
3
 
4
- # Update and install required packages
5
- RUN apt-get update && apt-get install -y \
6
- python3 \
7
- python3-pip
8
 
9
- # Set the working directory
10
- WORKDIR /app
 
 
 
 
11
 
12
- # Install JupyterLab
13
- RUN pip3 install jupyterlab
14
 
15
- # Expose port 8080
16
- EXPOSE 7860
 
 
 
 
 
 
17
 
18
- # Start JupyterLab on port 8080 without authentication
19
- CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=7860", "--no-browser", "--allow-root", "--NotebookApp.token=''"]
 
 
 
 
 
 
 
 
 
 
 
 
 
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"]