|
|
|
FROM python:3.10-slim |
|
|
|
|
|
RUN apt-get update && apt-get install -y git g++ python3-tk zip unzip procps r-base |
|
|
|
|
|
RUN pip install --upgrade pip |
|
|
|
RUN pip install gradio==4.31.0 gradio[oauth] |
|
|
|
RUN adduser --disabled-password --gecos "" bigcodebenchuser |
|
|
|
RUN rm -rf /bigcodebench |
|
|
|
|
|
ADD "https://api.github.com/repos/bigcode-project/bigcodebench/commits?per_page=1" latest_commit |
|
RUN git clone https://github.com/bigcode-project/bigcodebench.git /bigcodebench |
|
|
|
RUN cd /bigcodebench && pip install . |
|
|
|
|
|
RUN python3 -c "from bigcodebench.data import get_bigcodebench; get_bigcodebench()" |
|
|
|
RUN pip install -I --timeout 2000 -r https://github.com/bigcode-project/bigcodebench-annotation/releases/download/v0.1.0/requirements.txt |
|
|
|
WORKDIR /app |
|
|
|
RUN chown -R bigcodebenchuser:bigcodebenchuser /app |
|
|
|
RUN chmod -R 777 /app |
|
|
|
USER bigcodebenchuser |
|
|
|
ENTRYPOINT ["python", "app.py"] |
|
|
|
CMD ["sh", "-c", "pids=$(ps -u $(id -u) -o pid,comm | grep 'bigcodebench' | awk '{print $1}'); if [ -n \"$pids\" ]; then echo $pids | xargs -r kill; fi; rm -rf /tmp/*"] |