mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
docker environment for the whole benchmark
This commit is contained in:
parent
0ab19aa97c
commit
5ee455a05b
5 changed files with 37 additions and 5 deletions
9
.dockerignore
Normal file
9
.dockerignore
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
.BC.*
|
||||||
|
tmp*
|
||||||
|
*~
|
||||||
|
OLD*
|
||||||
|
*.pyc
|
||||||
|
.DS_Store
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
.aider.*
|
7
benchmark/Dockerfile
Normal file
7
benchmark/Dockerfile
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
FROM python:3.8-slim
|
||||||
|
RUN apt-get update && apt-get install -y less git
|
||||||
|
COPY requirements.txt /aider/requirements.txt
|
||||||
|
RUN pip install --upgrade pip && pip install -r /aider/requirements.txt
|
||||||
|
RUN pip install lox typer
|
||||||
|
WORKDIR /aider
|
||||||
|
|
|
@ -23,9 +23,9 @@ from aider.coders import Coder
|
||||||
from aider.dump import dump # noqa: F401
|
from aider.dump import dump # noqa: F401
|
||||||
from aider.io import InputOutput
|
from aider.io import InputOutput
|
||||||
|
|
||||||
BENCHMARK_DNAME = Path("tmp.benchmark/.")
|
BENCHMARK_DNAME = Path("/benchmarks")
|
||||||
|
|
||||||
ORIGINAL_DNAME = BENCHMARK_DNAME / "practice/."
|
ORIGINAL_DNAME = BENCHMARK_DNAME / "exercism-python"
|
||||||
|
|
||||||
app = typer.Typer(add_completion=False, pretty_exceptions_enable=False)
|
app = typer.Typer(add_completion=False, pretty_exceptions_enable=False)
|
||||||
|
|
||||||
|
@ -52,8 +52,8 @@ def main(
|
||||||
threads: int = typer.Option(1, "--threads", "-t", help="Number of threads to run in parallel"),
|
threads: int = typer.Option(1, "--threads", "-t", help="Number of threads to run in parallel"),
|
||||||
num_tests: int = typer.Option(-1, "--num-tests", "-n", help="Number of tests to run"),
|
num_tests: int = typer.Option(-1, "--num-tests", "-n", help="Number of tests to run"),
|
||||||
):
|
):
|
||||||
assert BENCHMARK_DNAME.exists() and BENCHMARK_DNAME.is_dir()
|
assert BENCHMARK_DNAME.exists() and BENCHMARK_DNAME.is_dir(), BENCHMARK_DNAME
|
||||||
assert ORIGINAL_DNAME.exists() and ORIGINAL_DNAME.is_dir()
|
assert ORIGINAL_DNAME.exists() and ORIGINAL_DNAME.is_dir(), ORIGINAL_DNAME
|
||||||
|
|
||||||
repo = git.Repo(search_parent_directories=True)
|
repo = git.Repo(search_parent_directories=True)
|
||||||
commit_hash = repo.head.object.hexsha[:7]
|
commit_hash = repo.head.object.hexsha[:7]
|
||||||
|
|
10
benchmark/docker.sh
Normal file → Executable file
10
benchmark/docker.sh
Normal file → Executable file
|
@ -1,2 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
docker run -it --rm python:3.8 bash
|
|
||||||
|
docker run \
|
||||||
|
-it --rm \
|
||||||
|
-v `pwd`:/aider \
|
||||||
|
-v `pwd`/tmp.benchmarks/.:/benchmarks \
|
||||||
|
-e OPENAI_API_KEY=$OPENAI_API_KEY \
|
||||||
|
-e HISTFILE=/aider/.bash_history \
|
||||||
|
aider-benchmark \
|
||||||
|
bash
|
||||||
|
|
8
benchmark/docker_build.sh
Executable file
8
benchmark/docker_build.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
docker build \
|
||||||
|
--file benchmark/Dockerfile \
|
||||||
|
-t aider-benchmark \
|
||||||
|
.
|
Loading…
Add table
Add a link
Reference in a new issue