Martí Umbert commited on
Commit
5121390
·
1 Parent(s): 9e694fb

Dockerfile: test with nvcr.io/nvidia/pytorch:24.07-py3 and install missing libraries

Browse files
Files changed (1) hide show
  1. Dockerfile +55 -23
Dockerfile CHANGED
@@ -1,43 +1,74 @@
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 /root/.cache /.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,10 +114,11 @@ RUN if [ -n "$HF_TKN_FILE" ]; then \
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"]
 
 
 
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
+ FROM nvcr.io/nvidia/pytorch:24.07-py3
11
 
 
12
  ENV DEBIAN_FRONTEND=noninteractive
13
+ ENV PYTHONUNBUFFERED=1
14
 
15
  WORKDIR /app
16
 
17
+ ARG EXTRAS
18
+ ARG HF_PRECACHE_DIR
19
+ ARG HF_TKN_FILE
20
+
21
  ENV HF_HOME="/app/tmp/cache/huggingface"
22
+ ENV HF_HUB_CACHE="/app/tmp/cache/huggingface/hub"
23
+ ENV XDG_CACHE_HOME="/app/tmp/cache/huggingface"
24
  ENV LIBROSA_CACHE_DIR="/app/tmp/librosa_cache"
25
  ENV NUMBA_CACHE_DIR="/app/tmp/numba_cache"
26
  ENV MPLCONFIGDIR="/app/tmp/matplotlib"
27
  ENV HF_HUB_ETAG_TIMEOUT="600"
28
  ENV HF_HUB_DOWNLOAD_TIMEOUT="600"
29
+ ENV LD_LIBRARY_PATH="/usr/local/cuda:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}"
30
 
31
+ # Install system dependencies
32
+ #RUN apt-get update && \
33
+ # apt-get install -y ffmpeg git && \
34
+ # apt-get clean && \
35
+ # rm -rf /var/lib/apt/lists/*
36
+
37
+ # 2) Install system dependencies + Python + pip
38
  RUN apt-get update && \
39
  apt-get install -y --no-install-recommends \
40
+ python3 \
41
+ python3-pip \
42
  ffmpeg \
43
  git \
44
+ libportaudio2 && \
 
 
 
45
  rm -rf /var/lib/apt/lists/*
46
 
47
+ RUN apt install -y libaio1 && apt install -y libaio-dev
48
+
49
+ # RUN apt-get install -y --no-install-recommends libportaudio2
50
+ # portaudio19-dev
51
+
52
+ RUN pip install diart sounddevice
53
+ RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
54
 
55
  COPY . .
56
 
57
+ RUN mkdir -p $HF_HOME && \
58
+ mkdir -p $HF_HUB_CACHE && \
59
+ mkdir -p $XDG_CACHE_HOME && \
60
+ mkdir -p $LIBROSA_CACHE_DIR && \
61
+ mkdir -p $NUMBA_CACHE_DIR && \
62
+ mkdir -p $MPLCONFIGDIR && \
63
+ chmod 777 $HF_HOME && \
64
+ chmod 777 $HF_HUB_CACHE && \
65
+ chmod 777 $XDG_CACHE_HOME && \
66
+ chmod 777 $LIBROSA_CACHE_DIR && \
67
+ chmod 777 $NUMBA_CACHE_DIR && \
68
+ chmod 777 $MPLCONFIGDIR && \
69
+ chmod -R 777 /app
70
+
71
+ RUN mkdir -p /.cache && chmod -R 777 /.cache
72
 
73
  # Install WhisperLiveKit directly, allowing for optional dependencies
74
  # Note: For gates modedls, need to add your HF toke. See README.md
 
114
  else \
115
  echo "No Hugging Face token file specified, skipping token setup"; \
116
  fi
117
+
118
+ # Expose port for the transcription server
119
  EXPOSE 8000
120
 
 
121
  ENTRYPOINT ["whisperlivekit-server", "--host", "0.0.0.0"]
122
+
123
+ # Default args
124
+ CMD ["--model", "tiny", "--diarization"]