@@ -12,27 +12,14 @@ ARG TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6+PTX"
1212# Set the Python version
1313ARG PYTHON_VERSION=3.10.12
1414
15- # Install dependencies for building Python
15+ # Install system dependencies
1616RUN 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 \
3320 && rm -rf /var/lib/apt/lists/*
3421
35- # Download and install Python from precompiled binaries
22+ # Install Python
3623RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz && \
3724 tar -xzf Python-$PYTHON_VERSION.tgz && \
3825 cd Python-$PYTHON_VERSION && \
@@ -42,38 +29,24 @@ RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSIO
4229 cd .. && \
4330 rm -rf Python-$PYTHON_VERSION.tgz Python-$PYTHON_VERSION
4431
45- # Download and install pip using get-pip.py
32+ # Install pip and core Python tools
4633RUN wget https://bootstrap.pypa.io/get-pip.py && \
4734 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
4937
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
6039WORKDIR /vec-inf
61-
62- # Copy current directory
6340COPY . /vec-inf
6441
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
7245RUN python3.10 -m pip install flash-attn --no-build-isolation
7346
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
7750
7851# Set the default command to start an interactive shell
7952CMD ["bash" ]
0 commit comments