From 1cd2d2b56965aff1c27744cae465ae3b49761b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20=C3=96rwall?= Date: Fri, 12 Apr 2024 09:30:53 +0200 Subject: [PATCH 1/3] Create Docker image with SWE-bench installed --- .dockerignore | 8 ++++++++ Dockerfile | 22 +++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..78e31d0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +** + +!README.md +!setup.py +!pyproject.toml +!setup.cfg +!environment.yml +!/swebench/ diff --git a/Dockerfile b/Dockerfile index 2378da1..0bd08b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM ubuntu:20.04 +FROM ubuntu:jammy # https://github.com/princeton-nlp/SWE-bench/issues/15#issuecomment-1815392192 RUN apt-get update && \ - apt-get install -y bash gcc git jq wget && \ + apt-get install -y bash gcc git jq wget g++ make libffi-dev python3.11 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* @@ -15,6 +15,7 @@ RUN apt update && apt install -y build-essential RUN useradd -ms /bin/bash swe-bench USER swe-bench WORKDIR /home/swe-bench +RUN chown -R swe-bench:swe-bench /home/swe-bench # Setup Conda ENV PATH="/home/swe-bench/miniconda3/bin:${PATH}" @@ -23,13 +24,28 @@ RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh - && mkdir ~/.conda \ && bash miniconda.sh -b \ && rm -f miniconda.sh -RUN conda --version +RUN conda --version \ + && conda init bash \ + && conda config --append channels conda-forge # Setup SWE-Bench Env COPY environment.yml . RUN conda env create -f environment.yml +RUN conda --version \ + && conda init \ + && conda config --append channels conda-forge + # Some missing packages RUN pip install datasets python-dotenv gitpython +# Install SWE-Bench +COPY . . +RUN pip install -e . + +# RUN echo "source activate swe-bench" > ~/.bashrc +# SHELL ["/bin/bash", "--login", "-c"] + +# RUN conda activate swe-bench && pip install -e . + CMD ["/bin/bash"] From 2870f603df544eb2d5d0beac7cf922aa6a7b8d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20=C3=96rwall?= Date: Sat, 13 Apr 2024 16:49:21 +0200 Subject: [PATCH 2/3] Dockerifle --- Dockerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0bd08b8..14caee3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,8 @@ RUN git config --global user.name "swebench" RUN apt update && apt install -y build-essential +RUN ln -sfn /bin/bash /bin/sh + # Create new user RUN useradd -ms /bin/bash swe-bench USER swe-bench @@ -37,15 +39,10 @@ RUN conda --version \ && conda config --append channels conda-forge # Some missing packages -RUN pip install datasets python-dotenv gitpython +RUN pip install datasets python-dotenv gitpython unidiff rich # Install SWE-Bench COPY . . RUN pip install -e . -# RUN echo "source activate swe-bench" > ~/.bashrc -# SHELL ["/bin/bash", "--login", "-c"] - -# RUN conda activate swe-bench && pip install -e . - CMD ["/bin/bash"] From e883c189d2a3c683de2217ce02da900a6901eef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20=C3=96rwall?= Date: Sun, 14 Apr 2024 17:48:27 +0200 Subject: [PATCH 3/3] Updated Dockerfile and environment.yml to make evaluation work in Docker --- Dockerfile | 6 +----- environment.yml | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14caee3..5d99862 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,12 +34,8 @@ RUN conda --version \ COPY environment.yml . RUN conda env create -f environment.yml -RUN conda --version \ - && conda init \ - && conda config --append channels conda-forge - # Some missing packages -RUN pip install datasets python-dotenv gitpython unidiff rich +RUN pip install datasets python-dotenv gitpython unidiff rich importlib # Install SWE-Bench COPY . . diff --git a/environment.yml b/environment.yml index a64aa6c..3eb4697 100644 --- a/environment.yml +++ b/environment.yml @@ -1,6 +1,6 @@ name: swe-bench dependencies: - - python=3.9 + - python=3.11 - pip - pip: - datasets