59 lines
2.1 KiB
Docker
59 lines
2.1 KiB
Docker
# bigcodebench-sandbox
|
|
# Minimal sandbox for running BigCodeBench/HumanEval code inside evalscope.
|
|
# Based on https://github.com/bigcode-project/bigcodebench/blob/main/Docker/Evaluate.Dockerfile
|
|
# but stripped to only the runtime dependencies needed to execute benchmark tests.
|
|
# Uses python:3.9-slim because some pinned packages (e.g. numba==0.55.0) do not have
|
|
# wheels for newer Python versions.
|
|
# Uses Chinese mirrors for apt/pip to speed up builds inside mainland network.
|
|
|
|
FROM python:3.9-slim
|
|
|
|
# Use Chinese Debian mirror
|
|
RUN sed -i 's|http://deb.debian.org/debian|http://mirrors.tuna.tsinghua.edu.cn/debian|g' /etc/apt/sources.list.d/debian.sources && \
|
|
sed -i 's|http://deb.debian.org/debian-security|http://mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list.d/debian.sources && \
|
|
sed -i 's|http://deb.debian.org/debian|http://mirrors.tuna.tsinghua.edu.cn/debian|g' /etc/apt/sources.list || true
|
|
|
|
# Configure Chinese PyPI mirror
|
|
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
|
|
pip config set global.timeout 2000
|
|
|
|
# Install system dependencies needed by the scientific/Python packages
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
g++ \
|
|
python3-tk \
|
|
zip \
|
|
unzip \
|
|
procps \
|
|
r-base \
|
|
libgdal-dev \
|
|
libfreetype6-dev \
|
|
libpng-dev \
|
|
pkg-config \
|
|
python3-dev \
|
|
python3-matplotlib \
|
|
libgl1 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Upgrade pip
|
|
RUN pip install --upgrade pip
|
|
|
|
# Add a non-root user (matches upstream image conventions)
|
|
RUN adduser --disabled-password --gecos "" bigcodebenchuser
|
|
|
|
# Copy and install the BigCodeBench evaluation requirements.
|
|
# These are the 70+ Python libraries referenced by the benchmark test cases.
|
|
COPY requirements-eval.txt /tmp/requirements-eval.txt
|
|
RUN pip install -I --timeout 2000 -r /tmp/requirements-eval.txt
|
|
|
|
# Ensure a compatible datasets version
|
|
RUN pip install datasets==2.17.0
|
|
|
|
WORKDIR /app
|
|
RUN chown -R bigcodebenchuser:bigcodebenchuser /app && \
|
|
chmod -R 777 /app
|
|
|
|
# For evalscope sandbox: keep container alive
|
|
ENTRYPOINT []
|
|
CMD ["tail", "-f", "/dev/null"]
|