Skip to content

Commit f6238a8

Browse files
committed
switch default option to modal
1 parent d84f96b commit f6238a8

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

commit0/cli.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def test(
216216
branch: Union[str, None] = typer.Option(
217217
None, help="Branch to test (branch MUST be provided or use --reference)"
218218
),
219-
backend: str = typer.Option("local", help="Backend to use for testing"),
219+
backend: str = typer.Option("modal", help="Backend to use for testing"),
220220
timeout: int = typer.Option(1800, help="Timeout for tests in seconds"),
221221
num_cpus: int = typer.Option(1, help="Number of CPUs to use"),
222222
reference: Annotated[
@@ -251,9 +251,10 @@ def test(
251251
branch = "reference"
252252
assert branch is not None, "branch is not specified"
253253

254-
typer.echo(f"Running tests for repository: {repo_or_repo_path}")
255-
typer.echo(f"Branch: {branch}")
256-
typer.echo(f"Test IDs: {test_ids}")
254+
if verbose == 2:
255+
typer.echo(f"Running tests for repository: {repo_or_repo_path}")
256+
typer.echo(f"Branch: {branch}")
257+
typer.echo(f"Test IDs: {test_ids}")
257258

258259
commit0.harness.run_pytest_ids.main(
259260
commit0_config["dataset_name"],
@@ -274,7 +275,7 @@ def evaluate(
274275
branch: Union[str, None] = typer.Option(
275276
None, help="Branch to evaluate (branch MUST be provided or use --reference)"
276277
),
277-
backend: str = typer.Option("local", help="Backend to use for evaluation"),
278+
backend: str = typer.Option("modal", help="Backend to use for evaluation"),
278279
timeout: int = typer.Option(1800, help="Timeout for evaluation in seconds"),
279280
num_cpus: int = typer.Option(1, help="Number of CPUs to use"),
280281
num_workers: int = typer.Option(8, help="Number of workers to use"),

commit0/harness/execution_context.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,13 @@ def exec_run_with_timeout(self, command: str) -> tuple[str, bool, float]:
171171
"""Execute command on modal sandbox"""
172172
start_time = time.time()
173173
with modal.Volume.ephemeral() as vol:
174-
cp_cmd = ""
175174
if self.files_to_collect:
175+
command += " && "
176176
for fname in self.files_to_collect:
177177
remote_file = Path(self.spec.repo_directory) / fname
178-
curr_cp_cmd = f" && cp {str(remote_file)} /vol/{fname} 2>/dev/null"
179-
cp_cmd += curr_cp_cmd
178+
cp_cmd = f"cp {str(remote_file)} /vol/{fname} 2>/dev/null; "
179+
command += cp_cmd
180180

181-
command += cp_cmd
182181
self.sandbox = modal.Sandbox.create(
183182
"bash",
184183
"-c",

0 commit comments

Comments
 (0)