@@ -12,27 +12,14 @@ ARG TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6+PTX"
12
12
# Set the Python version
13
13
ARG PYTHON_VERSION=3.10.12
14
14
15
- # Install dependencies for building Python
15
+ # Install system dependencies
16
16
RUN apt-get update && apt-get install -y \
17
- wget \
18
- build-essential \
19
- libssl-dev \
20
- zlib1g-dev \
21
- libbz2-dev \
22
- libreadline-dev \
23
- libsqlite3-dev \
24
- libffi-dev \
25
- libncursesw5-dev \
26
- xz-utils \
27
- tk-dev \
28
- libxml2-dev \
29
- libxmlsec1-dev \
30
- liblzma-dev \
31
- git \
32
- vim \
17
+ wget build-essential libssl-dev zlib1g-dev libbz2-dev \
18
+ libreadline-dev libsqlite3-dev libffi-dev libncursesw5-dev \
19
+ xz-utils tk-dev libxml2-dev libxmlsec1-dev liblzma-dev git vim \
33
20
&& rm -rf /var/lib/apt/lists/*
34
21
35
- # Download and install Python from precompiled binaries
22
+ # Install Python
36
23
RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz && \
37
24
tar -xzf Python-$PYTHON_VERSION.tgz && \
38
25
cd Python-$PYTHON_VERSION && \
@@ -42,38 +29,24 @@ RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSIO
42
29
cd .. && \
43
30
rm -rf Python-$PYTHON_VERSION.tgz Python-$PYTHON_VERSION
44
31
45
- # Download and install pip using get-pip.py
32
+ # Install pip and core Python tools
46
33
RUN wget https://bootstrap.pypa.io/get-pip.py && \
47
34
python3.10 get-pip.py && \
48
- rm get-pip.py
35
+ rm get-pip.py && \
36
+ python3.10 -m pip install --upgrade pip setuptools wheel uv
49
37
50
- # Ensure pip for Python 3.10 is used
51
- RUN python3.10 -m pip install --upgrade pip setuptools wheel
52
-
53
- # Install Poetry using Python 3.10
54
- RUN python3.10 -m pip install poetry
55
-
56
- # Don't create venv
57
- RUN poetry config virtualenvs.create false
58
-
59
- # Set working directory
38
+ # Set up project
60
39
WORKDIR /vec-inf
61
-
62
- # Copy current directory
63
40
COPY . /vec-inf
64
41
65
- # Update Poetry lock file if necessary
66
- RUN poetry lock
67
-
68
- # Install vec-inf
69
- RUN poetry install --extras "dev"
70
-
71
- # Install Flash Attention 2 backend
42
+ # Install project dependencies with build requirements
43
+ RUN PIP_INDEX_URL="https://download.pytorch.org/whl/cu121" uv pip install --system -e .[dev]
44
+ # Install Flash Attention
72
45
RUN python3.10 -m pip install flash-attn --no-build-isolation
73
46
74
- # Move nccl to accessible location
75
- RUN mkdir -p /vec-inf/nccl
76
- RUN mv /root/.config/vllm/nccl/cu12/libnccl.so.2.18.1 /vec-inf/nccl/libnccl.so.2.18.1;
47
+ # Final configuration
48
+ RUN mkdir -p /vec-inf/nccl && \
49
+ mv /root/.config/vllm/nccl/cu12/libnccl.so.2.18.1 /vec-inf/nccl/libnccl.so.2.18.1
77
50
78
51
# Set the default command to start an interactive shell
79
52
CMD ["bash" ]
0 commit comments