nus-apr / auto-code-rover

A project structure aware autonomous software engineer aiming for autonomous program improvement. Resolved 30.67% tasks (pass@1) in SWE-bench lite with each task costs less than $0.7.
Other
2.37k stars 236 forks source link

Docker image fails to build (M1 Mac) #43

Closed JensRoland closed 1 month ago

JensRoland commented 1 month ago

I am trying to get ACR running on my local machine but the Docker image (Dockerfile.scratch since I am on Apple Silicon) will not build.

First error:

$ docker build -f Dockerfile.scratch -t acr .
(...)
2.048 E: Package 'python-tk' has no installation candidate
------
Dockerfile.scratch:10
--------------------
   9 |     
  10 | >>> RUN apt update && apt install -y \
  11 | >>>     git wget vim \
  12 | >>>     libffi-dev python3-pytest pkg-config build-essential libssl-dev \
  13 | >>>     libfreetype6-dev libqhull-dev \
  14 | >>>     texlive cm-super dvipng python-tk ffmpeg \
  15 | >>>     imagemagick fontconfig ghostscript inkscape graphviz \
  16 | >>>     optipng fonts-comic-neue  python3-pikepdf
  17 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt update && apt install -y     git wget vim     libffi-dev python3-pytest pkg-config build-essential libssl-dev     libfreetype6-dev libqhull-dev     texlive cm-super dvipng python-tk ffmpeg     imagemagick fontconfig ghostscript inkscape graphviz     optipng fonts-comic-neue  python3-pikepdf" did not complete successfully: exit code: 100

On Apple Silicon it seems tkinter is no longer installable via pip, but is bundled with Python (unless I'm misunderstanding something). I verified that I do have python-tk on my machine, so I removed the dependency from the apt install hoping that would fix the issue.

In any case, I get a different error now:

$ docker build -f Dockerfile.scratch -t acr .
(...)
=> [ 7/11] RUN conda env create -f environment.yml                                                                                               29.4s 
 => [ 8/11] RUN ln -sf /bin/bash /bin/sh                                                                                                           0.3s 
 => [ 9/11] COPY . /opt/auto-code-rover                                                                                                            6.2s 
 => [10/11] WORKDIR /opt/auto-code-rover                                                                                                           0.0s 
 => ERROR [11/11] RUN conda env create -f environment.yml                                                                                          9.6s 
------                                                                                                                                                  
 > [11/11] RUN conda env create -f environment.yml:                                                                                                     
0.663 Channels:                                                                                                                                         
0.663  - conda-forge                                                                                                                                    
0.663  - defaults                                                                                                                                       
0.663 Platform: linux-aarch64                                                                                                                           
0.663 Collecting package metadata (repodata.json): ...working... done
4.591 Solving environment: ...working... failed
5.119 Channels:
5.119  - conda-forge
5.119  - defaults
5.119 Platform: linux-aarch64
5.119 Collecting package metadata (repodata.json): ...working... done
9.014 Solving environment: ...working... failed
9.533 
9.533 LibMambaUnsatisfiableError: Encountered problems while solving:
9.533   - package unidiff-0.7.5-py38he3eb160_0 requires python >=3.8,<3.9.0a0 *_cpython, but none of the providers can be installed
9.533 
9.533 Could not solve for environment specs
9.533 The following packages are incompatible
9.533 ├─ libuuid 1.41.5**  is requested and can be installed;
9.533 ├─ python 3.11.7**  is installable with the potential options
9.533 │  ├─ python [3.10.11|3.10.12|...|3.9.19] would require
9.533 │  │  └─ libuuid >=2.38.1,<3.0a0 , which conflicts with any installable versions previously reported;
9.533 │  └─ python 3.11.7, which can be installed;
9.533 ├─ unidiff 0.7.5**  is installable with the potential options
9.533 │  ├─ unidiff 0.7.5 would require
9.533 │  │  └─ python >=3.10,<3.11.0a0 *_cpython but there are no viable options
9.533 │  │     ├─ python [3.10.0|3.10.1|...|3.9.9] would require
9.533 │  │     │  └─ libuuid >=2.32.1,<3.0a0 , which conflicts with any installable versions previously reported;
9.533 │  │     └─ python [3.10.11|3.10.12|...|3.9.19], which cannot be installed (as previously explained);
9.533 │  ├─ unidiff 0.7.5 would require
9.533 │  │  └─ python >=3.11,<3.12.0a0 *_cpython with the potential options
9.533 │  │     ├─ python [3.10.0|3.10.1|...|3.9.9], which cannot be installed (as previously explained);
9.533 │  │     ├─ python [3.10.11|3.10.12|...|3.9.19], which cannot be installed (as previously explained);
9.533 │  │     └─ python 3.11.0 would require
9.533 │  │        └─ xz >=5.2.6,<5.3.0a0 , which can be installed;
9.533 │  ├─ unidiff 0.7.5 would require
9.533 │  │  └─ python >=3.12,<3.13.0a0 *_cpython, which cannot be installed (as previously explained);
9.533 │  ├─ unidiff 0.7.5 would require
9.533 │  │  └─ python >=3.8,<3.9.0a0 *_cpython but there are no viable options
9.533 │  │     ├─ python [3.8.10|3.8.12|...|3.8.8] conflicts with any installable versions previously reported;
9.533 │  │     ├─ python [3.10.0|3.10.1|...|3.9.9], which cannot be installed (as previously explained);
9.533 │  │     └─ python [3.10.11|3.10.12|...|3.9.19], which cannot be installed (as previously explained);
9.533 │  ├─ unidiff 0.7.5 would require
9.533 │  │  └─ python_abi 3.9 *_pypy39_pp73, which requires
9.533 │  │     └─ python 3.9.* *_73_pypy, which conflicts with any installable versions previously reported;
9.533 │  └─ unidiff 0.7.5 would require
9.533 │     └─ python >=3.9,<3.10.0a0  with the potential options
9.533 │        ├─ python [3.10.0|3.10.1|...|3.9.9], which cannot be installed (as previously explained);
9.533 │        ├─ python [3.10.11|3.10.12|...|3.9.19], which cannot be installed (as previously explained);
9.533 │        ├─ python [3.9.0|3.9.1|...|3.9.7] conflicts with any installable versions previously reported;
9.533 │        └─ python 3.9.19 would require
9.533 │           └─ xz >=5.4.6,<6.0a0 , which can be installed;
9.533 └─ xz 5.4.5**  is not installable because it conflicts with any installable versions previously reported.
9.533 
------
Dockerfile.scratch:30
--------------------
  28 |     COPY . /opt/auto-code-rover
  29 |     WORKDIR /opt/auto-code-rover
  30 | >>> RUN conda env create -f environment.yml
  31 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c conda env create -f environment.yml" did not complete successfully: exit code: 1

I am not sure what the problem is. I have Python 3.12.2 installed as my default version, but the ACR README doesn't specify a requirement on a particular Python version?

Anyway, any help would be most appreciated.

yuntongzhang commented 1 month ago

Thank you for reporting this. We can reproduce the error on a Mac machine. Will create a patch soon.

yuntongzhang commented 1 month ago

@JensRoland Could you help to verify whether #46 fixes the issue? It worked on our M1 Mac machine.

JensRoland commented 1 month ago

Yes, with that change it now builds the container. Thanks!