-
Notifications
You must be signed in to change notification settings - Fork 171
Expand file tree
/
Copy pathDockerfile.base
More file actions
89 lines (72 loc) · 2.55 KB
/
Copy pathDockerfile.base
File metadata and controls
89 lines (72 loc) · 2.55 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
FROM ubuntu:24.04
# Do not modify the following block of arg-env pairs. The evaluation infrastructure will
# periodically download the contents of these directories for logging purposes.
ENV WORKSPACE_BASE=/home
ENV SUBMISSION_DIR=/home/submission
ENV LOGS_DIR=/home/logs
ENV AGENT_DIR=/home/agent
ENV CONDA_ENV_NAME=agent
ENV REQUIREMENTS=/home/agent/requirements.txt
ENV PYTHON_VERSION=3.12
RUN mkdir -p ${LOGS_DIR} ${AGENT_DIR} ${SUBMISSION_DIR}
RUN mkdir -p ${WORKSPACE_BASE}/paper
RUN mkdir ${WORKSPACE_BASE}/.vscode
COPY paperbench/solvers/launch.json ${WORKSPACE_BASE}/.vscode/launch.json
# Avoid interactive dialog from apt-get and other packages requiring configuration
ENV DEBIAN_FRONTEND=noninteractive
# Install basic packages
RUN apt-get update && apt-get install -y \
curl \
wget \
git \
vim \
nano \
unzip \
zip \
p7zip-full \
python3 \
python3-pip \
python3-venv \
python3-dev \
python-is-python3 \
build-essential \
openssh-server \
tmux \
gettext \
sudo \
ffmpeg \
libsm6 \
libxext6 \
&& rm -rf /var/lib/apt/lists/* # removes cache
RUN apt update && apt install -y jupyter
# Install Docker
RUN curl -fsSL https://get.docker.com -o /tmp/get-docker.sh && \
chmod 700 /tmp/get-docker.sh && \
/tmp/get-docker.sh
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py313_25.5.1-0-Linux-x86_64.sh -O /tmp/miniconda.sh \
&& bash /tmp/miniconda.sh -b -p /opt/conda \
&& rm /tmp/miniconda.sh \
&& /opt/conda/bin/conda init
# Create conda environment
RUN /opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \
/opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r && \
/opt/conda/bin/conda create -n ${CONDA_ENV_NAME} python=${PYTHON_VERSION} -y
ENV PATH="/opt/conda/bin:${PATH}"
# Reset DEBIAN_FRONTEND
ENV DEBIAN_FRONTEND=
WORKDIR /home
# Initialize submission directory as git repo and set up hooks
RUN cd ${SUBMISSION_DIR} && \
git init && \
mkdir -p .git/hooks
COPY paperbench/solvers/pre-commit ${SUBMISSION_DIR}/.git/hooks/
RUN chmod +x ${SUBMISSION_DIR}/.git/hooks/pre-commit
# Set up git config
RUN git config --global user.email "agent@example.com" && \
git config --global user.name "agent"
# Set up apply_patch
COPY paperbench/solvers/apply_patch.py ${AGENT_DIR}/apply_patch.py
RUN echo "#!/bin/bash\npython ${AGENT_DIR}/apply_patch.py '$@'" > /bin/apply_patch
RUN chmod +x /bin/apply_patch
# for grading on the computer:
RUN mkdir -p /submission /output