updated docker image name

This commit is contained in:
Paul Gauthier 2023-06-26 20:52:02 -07:00
parent a109ab1890
commit 39434289f5

View file

@ -22,6 +22,8 @@ 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
DOCKER_IMAGE = "aider-pytest"
BENCHMARK_DNAME = Path("tmp.benchmark/.") BENCHMARK_DNAME = Path("tmp.benchmark/.")
assert BENCHMARK_DNAME.exists() and BENCHMARK_DNAME.is_dir() assert BENCHMARK_DNAME.exists() and BENCHMARK_DNAME.is_dir()
@ -70,6 +72,12 @@ def main(
dump(dirname) dump(dirname)
if stats_only:
summarize_results(dirname)
return
build_docker()
if clean and dirname.exists(): if clean and dirname.exists():
print("Cleaning up and replacing", dirname) print("Cleaning up and replacing", dirname)
dir_files = set(fn.name for fn in dirname.glob("*")) dir_files = set(fn.name for fn in dirname.glob("*"))
@ -97,9 +105,6 @@ def main(
if num_tests > 0: if num_tests > 0:
test_dnames = test_dnames[:num_tests] test_dnames = test_dnames[:num_tests]
if not stats_only:
build_docker()
if threads == 1: if threads == 1:
all_results = [] all_results = []
for testname in test_dnames: for testname in test_dnames:
@ -129,10 +134,9 @@ def main(
) )
all_results = run_test_threaded.gather(tqdm=True) all_results = run_test_threaded.gather(tqdm=True)
if not stats_only: print()
print() print()
print() print()
print()
summarize_results(dirname) summarize_results(dirname)
@ -353,7 +357,7 @@ def run_unit_tests(testdir, history_fname):
"--interactive=false", "--interactive=false",
"-v", "-v",
f"{test_file.parent.absolute()}:/app", f"{test_file.parent.absolute()}:/app",
"benchmark", DOCKER_IMAGE,
"bash", "bash",
"-c", "-c",
f"pip install pytest && pytest /app/{test_file.name}", f"pip install pytest && pytest /app/{test_file.name}",
@ -386,11 +390,10 @@ def run_unit_tests(testdir, history_fname):
def build_docker(): def build_docker():
image_name = "benchmark" check_command = ["docker", "images", "-q", DOCKER_IMAGE]
check_command = ["docker", "images", "-q", image_name]
check_result = subprocess.run(check_command, stdout=subprocess.PIPE, text=True) check_result = subprocess.run(check_command, stdout=subprocess.PIPE, text=True)
if check_result.stdout.strip(): if check_result.stdout.strip():
print(f"Docker image '{image_name}' already exists, skipping build.") print(f"Docker image '{DOCKER_IMAGE}' already exists, skipping build.")
return return
command = [ command = [
@ -398,7 +401,7 @@ def build_docker():
"build", "build",
"--quiet", "--quiet",
"-t", "-t",
image_name, DOCKER_IMAGE,
"-f", "-f",
"benchmark/Dockerfile", "benchmark/Dockerfile",
"/dev/null", "/dev/null",