File size: 2,102 Bytes
91895bb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
ARG BASE_IMAGE=python:3.11-slim
FROM ${BASE_IMAGE}

ARG DEBIAN_MIRROR=https://mirrors.tuna.tsinghua.edu.cn/debian
ARG DEBIAN_SECURITY_MIRROR=https://mirrors.tuna.tsinghua.edu.cn/debian-security
ARG PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
ARG INSTALL_FORTRAN=0
ARG INSTALL_OCTAVE=0
ENV DEBIAN_FRONTEND=noninteractive \
    PIP_DISABLE_PIP_VERSION_CHECK=1 \
    PIP_INDEX_URL=${PIP_INDEX_URL} \
    PIP_NO_CACHE_DIR=1 \
    PYTHONDONTWRITEBYTECODE=1

RUN sed -i \
        -e "s|http://deb.debian.org/debian-security|${DEBIAN_SECURITY_MIRROR}|g" \
        -e "s|http://deb.debian.org/debian|${DEBIAN_MIRROR}|g" \
        /etc/apt/sources.list.d/debian.sources

RUN apt-get -o Acquire::Retries=10 update \
    && apt-get -o Acquire::Retries=10 install -y --no-install-recommends \
        build-essential \
        ca-certificates \
        curl \
        git \
        ripgrep \
    && rm -rf /var/lib/apt/lists/*

RUN if [ "${INSTALL_FORTRAN}" = "1" ]; then \
        apt-get -o Acquire::Retries=10 update \
        && apt-get -o Acquire::Retries=10 install -y --no-install-recommends gfortran \
        && rm -rf /var/lib/apt/lists/*; \
    fi \
    && if [ "${INSTALL_OCTAVE}" = "1" ]; then \
        apt-get -o Acquire::Retries=10 update \
        && apt-get -o Acquire::Retries=10 install -y --no-install-recommends octave \
        && rm -rf /var/lib/apt/lists/*; \
    fi

WORKDIR /app/task_011
COPY repo/ /app/task_011/source/
COPY public/ /app/task_011/
COPY requirements.lock /app/task_011/requirements.lock

RUN python -m pip install --no-cache-dir --upgrade pip \
    && python -m pip install --no-cache-dir -r requirements.lock
ENV PYTHONPATH=/app/task_011:/app/task_011/source

RUN git init \
    && git checkout -b main \
    && git config user.email science-bench@example.invalid \
    && git config user.name "SWE-bench Science baseline" \
    && git add -A \
    && GIT_AUTHOR_DATE=2025-01-01T00:00:00Z \
       GIT_COMMITTER_DATE=2025-01-01T00:00:00Z \
       git commit -m baseline \
    && git reflog expire --expire=now --all \
    && git gc --prune=now

CMD ["bash"]