Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +8 -12
Dockerfile
CHANGED
|
@@ -4,8 +4,6 @@ FROM python:3.9-slim
|
|
| 4 |
# Set environment variables for Python and Numba
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 6 |
PYTHONUNBUFFERED=1 \
|
| 7 |
-
# Remove NUMBA_DISABLE_JIT=1 here. We want Numba to work if versions are compatible.
|
| 8 |
-
# NUMBA_DISABLE_JIT=1 \
|
| 9 |
NUMBA_CACHE_DIR=/tmp/numba_cache
|
| 10 |
|
| 11 |
# Set the working directory
|
|
@@ -15,7 +13,6 @@ WORKDIR /app
|
|
| 15 |
COPY requirements.txt /app/
|
| 16 |
|
| 17 |
# Install build dependencies
|
| 18 |
-
# Keep these as they are essential for various Python packages including those with C extensions
|
| 19 |
RUN apt-get update && \
|
| 20 |
apt-get install -y --no-install-recommends \
|
| 21 |
llvm \
|
|
@@ -29,28 +26,27 @@ RUN apt-get update && \
|
|
| 29 |
libxrender1 \
|
| 30 |
libglib2.0-0 \
|
| 31 |
ffmpeg \
|
| 32 |
-
# Ensure you have these for audio processing if they are not covered by librosa's dependencies
|
| 33 |
libsndfile1 \
|
| 34 |
libsndfile1-dev \
|
| 35 |
&& rm -rf /var/lib/apt/lists/*
|
| 36 |
|
| 37 |
-
# Set LLVM_CONFIG before building llvmlite (if needed)
|
| 38 |
-
# For numba 0.48.0, often llvm-config-8 or llvm-config-9 is
|
| 39 |
-
#
|
| 40 |
-
#
|
| 41 |
-
|
|
|
|
| 42 |
|
| 43 |
# Explicitly install compatible versions of core audio/Numba stack
|
| 44 |
# Order matters: numpy -> llvmlite -> numba -> resampy -> librosa
|
| 45 |
RUN pip install --no-cache-dir \
|
| 46 |
numpy==1.22.4 \
|
| 47 |
-
llvmlite==0.
|
| 48 |
numba==0.48.0 \
|
| 49 |
resampy==0.2.2 \
|
| 50 |
-
librosa==0.8.1
|
| 51 |
|
| 52 |
# Install other Python dependencies from requirements.txt
|
| 53 |
-
# This will pick up all other packages, assuming they don't conflict with the explicitly installed ones.
|
| 54 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 55 |
|
| 56 |
# Copy the rest of the application
|
|
|
|
| 4 |
# Set environment variables for Python and Numba
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 6 |
PYTHONUNBUFFERED=1 \
|
|
|
|
|
|
|
| 7 |
NUMBA_CACHE_DIR=/tmp/numba_cache
|
| 8 |
|
| 9 |
# Set the working directory
|
|
|
|
| 13 |
COPY requirements.txt /app/
|
| 14 |
|
| 15 |
# Install build dependencies
|
|
|
|
| 16 |
RUN apt-get update && \
|
| 17 |
apt-get install -y --no-install-recommends \
|
| 18 |
llvm \
|
|
|
|
| 26 |
libxrender1 \
|
| 27 |
libglib2.0-0 \
|
| 28 |
ffmpeg \
|
|
|
|
| 29 |
libsndfile1 \
|
| 30 |
libsndfile1-dev \
|
| 31 |
&& rm -rf /var/lib/apt/lists/*
|
| 32 |
|
| 33 |
+
# Set LLVM_CONFIG before building llvmlite (if needed)
|
| 34 |
+
# For numba 0.48.0 and llvmlite 0.31.0, often llvm-config-8 or llvm-config-9 is relevant.
|
| 35 |
+
# Python 3.9 is newer, so you might need to ensure a compatible LLVM is installed.
|
| 36 |
+
# Let's try to be specific for older LLVM needed by llvmlite 0.31.0
|
| 37 |
+
RUN apt-get update && apt-get install -y llvm-9-dev && rm -rf /var/lib/apt/lists/*
|
| 38 |
+
ENV LLVM_CONFIG=/usr/bin/llvm-config-9
|
| 39 |
|
| 40 |
# Explicitly install compatible versions of core audio/Numba stack
|
| 41 |
# Order matters: numpy -> llvmlite -> numba -> resampy -> librosa
|
| 42 |
RUN pip install --no-cache-dir \
|
| 43 |
numpy==1.22.4 \
|
| 44 |
+
llvmlite==0.31.0 \
|
| 45 |
numba==0.48.0 \
|
| 46 |
resampy==0.2.2 \
|
| 47 |
+
librosa==0.8.1
|
| 48 |
|
| 49 |
# Install other Python dependencies from requirements.txt
|
|
|
|
| 50 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 51 |
|
| 52 |
# Copy the rest of the application
|