Martí Umbert commited on
Commit
286fadf
·
1 Parent(s): d9f0eec

Dockerfile: test with pytorch image

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -52
Dockerfile CHANGED
@@ -1,71 +1,43 @@
1
- # ORI --> cuDNN error: CUDNN_STATUS_SUBLIBRARY_VERSION_MISMATCH
2
- # FROM nvidia/cuda:12.8.1-cudnn-runtime-ubuntu22.04
3
- # TESTS UNTIL RIGHT PYTHON VERSION
4
- # FROM nvidia/cuda:11.6.1-devel-ubuntu20.04
5
- # FROM nvidia/cuda:12.0.0-cudnn8-devel-ubuntu18.04
6
- # FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
7
- # FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
8
- # FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04
9
- FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
10
 
11
- ENV DEBIAN_FRONTEND=noninteractive
12
  ENV PYTHONUNBUFFERED=1
 
13
 
14
  WORKDIR /app
15
 
16
- ARG EXTRAS
17
- ARG HF_PRECACHE_DIR
18
- ARG HF_TKN_FILE
19
-
20
  ENV HF_HOME="/app/tmp/cache/huggingface"
21
- ENV HF_HUB_CACHE="/app/tmp/cache/huggingface/hub"
22
- ENV XDG_CACHE_HOME="/app/tmp/cache/huggingface"
23
  ENV LIBROSA_CACHE_DIR="/app/tmp/librosa_cache"
24
  ENV NUMBA_CACHE_DIR="/app/tmp/numba_cache"
25
  ENV MPLCONFIGDIR="/app/tmp/matplotlib"
26
  ENV HF_HUB_ETAG_TIMEOUT="600"
27
  ENV HF_HUB_DOWNLOAD_TIMEOUT="600"
28
- ENV LD_LIBRARY_PATH="/usr/local/cuda:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}"
29
-
30
- # Install system dependencies
31
- #RUN apt-get update && \
32
- # apt-get install -y ffmpeg git && \
33
- # apt-get clean && \
34
- # rm -rf /var/lib/apt/lists/*
35
 
36
- # 2) Install system dependencies + Python + pip
37
  RUN apt-get update && \
38
  apt-get install -y --no-install-recommends \
39
- python3 \
40
- python3-pip \
41
  ffmpeg \
42
  git \
43
- libportaudio2 && \
 
 
 
44
  rm -rf /var/lib/apt/lists/*
45
 
46
- # RUN apt-get install -y --no-install-recommends libportaudio2
47
- # portaudio19-dev
48
-
49
- RUN pip install diart sounddevice
50
- RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
 
51
 
52
  COPY . .
53
 
54
- RUN mkdir -p $HF_HOME && \
55
- mkdir -p $HF_HUB_CACHE && \
56
- mkdir -p $XDG_CACHE_HOME && \
57
- mkdir -p $LIBROSA_CACHE_DIR && \
58
- mkdir -p $NUMBA_CACHE_DIR && \
59
- mkdir -p $MPLCONFIGDIR && \
60
- chmod 777 $HF_HOME && \
61
- chmod 777 $HF_HUB_CACHE && \
62
- chmod 777 $XDG_CACHE_HOME && \
63
- chmod 777 $LIBROSA_CACHE_DIR && \
64
- chmod 777 $NUMBA_CACHE_DIR && \
65
- chmod 777 $MPLCONFIGDIR && \
66
- chmod -R 777 /app
67
-
68
- RUN mkdir -p /.cache && chmod -R 777 /.cache
69
 
70
  # Install WhisperLiveKit directly, allowing for optional dependencies
71
  # Note: For gates modedls, need to add your HF toke. See README.md
@@ -111,11 +83,10 @@ RUN if [ -n "$HF_TKN_FILE" ]; then \
111
  else \
112
  echo "No Hugging Face token file specified, skipping token setup"; \
113
  fi
114
-
115
- # Expose port for the transcription server
116
  EXPOSE 8000
117
 
 
118
  ENTRYPOINT ["whisperlivekit-server", "--host", "0.0.0.0"]
119
-
120
- # Default args
121
- CMD ["--model", "tiny", "--diarization"]
 
1
+ # PyTorch 2.2.2 (cu121), Python 3.10, cuDNN 9.5.1+
2
+ FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
 
 
 
 
 
 
 
3
 
 
4
  ENV PYTHONUNBUFFERED=1
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
 
7
  WORKDIR /app
8
 
9
+ # Optional: add caching envs (like HF cache) if needed
 
 
 
10
  ENV HF_HOME="/app/tmp/cache/huggingface"
11
+ ENV XDG_CACHE_HOME="/app/tmp/cache"
 
12
  ENV LIBROSA_CACHE_DIR="/app/tmp/librosa_cache"
13
  ENV NUMBA_CACHE_DIR="/app/tmp/numba_cache"
14
  ENV MPLCONFIGDIR="/app/tmp/matplotlib"
15
  ENV HF_HUB_ETAG_TIMEOUT="600"
16
  ENV HF_HUB_DOWNLOAD_TIMEOUT="600"
 
 
 
 
 
 
 
17
 
18
+ # 🧰 System dependencies
19
  RUN apt-get update && \
20
  apt-get install -y --no-install-recommends \
 
 
21
  ffmpeg \
22
  git \
23
+ libportaudio2 \
24
+ python3-dev \
25
+ portaudio19-dev && \
26
+ apt-get clean && \
27
  rm -rf /var/lib/apt/lists/*
28
 
29
+ # 📦 Python packages
30
+ # Prefer installing torch packages already bundled, to avoid conflicts
31
+ RUN pip install --upgrade pip && \
32
+ pip install \
33
+ diart \
34
+ sounddevice
35
 
36
  COPY . .
37
 
38
+ # 🧼 Set permissions for Hugging Face cache
39
+ RUN mkdir -p $HF_HOME $XDG_CACHE_HOME $LIBROSA_CACHE_DIR $NUMBA_CACHE_DIR /.cache && \
40
+ chmod -R 777 /app /root/.cache /.cache
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
  # Install WhisperLiveKit directly, allowing for optional dependencies
43
  # Note: For gates modedls, need to add your HF toke. See README.md
 
83
  else \
84
  echo "No Hugging Face token file specified, skipping token setup"; \
85
  fi
86
+
87
+ # Expose server port
88
  EXPOSE 8000
89
 
90
+ # 🚀 Start the app
91
  ENTRYPOINT ["whisperlivekit-server", "--host", "0.0.0.0"]
92
+ CMD ["--model", "tiny", "--diarization"]