Aloukik21 commited on
Commit
f322631
·
verified ·
1 Parent(s): 4994fd0

Add Dockerfile for RunPod

Browse files
Files changed (1) hide show
  1. Dockerfile.runpod +45 -0
Dockerfile.runpod ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:12.4.1-devel-ubuntu22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV TORCH_CUDA_ARCH_LIST="7.5 8.0 8.6 8.9 9.0"
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ # HuggingFace settings
8
+ ENV HF_HUB_ENABLE_HF_TRANSFER=1
9
+ ENV HF_HOME=/runpod-volume/huggingface-cache
10
+ ENV HUGGINGFACE_HUB_CACHE=/runpod-volume/huggingface-cache/hub
11
+ ENV TRANSFORMERS_CACHE=/runpod-volume/huggingface-cache/hub
12
+
13
+ # Disable telemetry
14
+ ENV NO_ALBUMENTATIONS_UPDATE=1
15
+ ENV DISABLE_TELEMETRY=YES
16
+
17
+ # Install system deps
18
+ RUN apt-get update && apt-get install -y --no-install-recommends \
19
+ git git-lfs curl wget python3.10 python3.10-dev python3-pip \
20
+ ffmpeg libgl1-mesa-glx libglib2.0-0 aria2 \
21
+ && rm -rf /var/lib/apt/lists/*
22
+
23
+ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
24
+ RUN pip install --upgrade pip
25
+
26
+ # Install PyTorch
27
+ RUN pip install --no-cache-dir torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 \
28
+ --index-url https://download.pytorch.org/whl/cu124
29
+
30
+ # Install RunPod and HF transfer
31
+ RUN pip install --no-cache-dir runpod hf_transfer huggingface_hub
32
+
33
+ # Copy project
34
+ WORKDIR /app
35
+ COPY ai-toolkit /app/ai-toolkit
36
+ COPY rp_handler.py /app/rp_handler.py
37
+
38
+ # Install ai-toolkit requirements
39
+ RUN pip install --no-cache-dir -r /app/ai-toolkit/requirements.txt
40
+
41
+ # Create workspace directories
42
+ RUN mkdir -p /workspace/dataset /workspace/output
43
+
44
+ WORKDIR /app
45
+ CMD ["python", "-u", "rp_handler.py"]