PGSCOM commited on
Commit
454606b
verified
1 Parent(s): c7981d2

CUDA + cudnn + PyTorch 2.5.1

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -20
Dockerfile CHANGED
@@ -1,29 +1,34 @@
1
- # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.11
5
- RUN apt-get update && apt-get install -y openssh-client sshpass
 
 
6
 
7
- RUN useradd -m -u 1000 user
8
- USER user
9
- ENV PATH="/home/user/.local/bin:$PATH"
10
-
11
- WORKDIR /app
12
 
13
- COPY --chown=user . /app
14
- RUN pip install -e .
15
 
16
- # Instala las dependencias de construcci贸n necesarias
17
- RUN pip install numpy torch
 
18
 
19
- # Establece la variable de entorno CUDA_HOME
20
- ENV CUDA_HOME=/usr/local/cuda
21
 
22
- # Clona el fork de vLLM de StarVector
23
- RUN git clone https://github.com/starvector/vllm.git /app/vllm
 
24
 
25
- # Instala el fork de vLLM
26
- RUN cd /app/vllm && pip install -e .
 
27
 
 
28
  RUN chmod +x ./start.sh
29
- CMD ["./start.sh"]
 
1
+ # CUDA + cudnn + PyTorch 2.5.1 (CUDA 12.4)
2
+ FROM pytorch/pytorch:2.5.1-cuda12.4-cudnn9-devel
3
 
4
+ # Sistema y build tools
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ git openssh-client sshpass build-essential cmake ninja-build kmod curl ca-certificates && \
7
+ rm -rf /var/lib/apt/lists/*
8
 
9
+ # CUDA env
10
+ ENV CUDA_HOME=/usr/local/cuda
11
+ ENV PATH=$CUDA_HOME/bin:$PATH
12
+ ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
 
13
 
14
+ # Evitar reinstall de torch/torchvision ya presentes y asegurar numpy
15
+ RUN pip install --no-cache-dir -U pip && pip install --no-cache-dir numpy
16
 
17
+ # C贸digo app
18
+ WORKDIR /app
19
+ COPY . /app
20
 
21
+ # Instalar el proyecto (usa pyproject del repo)
22
+ RUN pip install --no-cache-dir -e .
23
 
24
+ # Sustituir vLLM oficial por el fork de StarVector
25
+ RUN git clone https://github.com/starvector/vllm.git /app/vllm && \
26
+ pip install --no-cache-dir -e /app/vllm
27
 
28
+ # Crear usuario no root despu茅s de instalar dependencias
29
+ RUN useradd -m -u 1000 user && chown -R user:user /app
30
+ USER user
31
 
32
+ # Permisos y arranque
33
  RUN chmod +x ./start.sh
34
+ CMD ["./start.sh"]