Skip to content

Add E2B execution backend #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixtypes, maybe? cant run pyright locally
  • Loading branch information
justinchiu-cohere committed Jan 28, 2025
commit 013f7a4c7e8fbf566e19346576db7e0c16f69c86
2 changes: 1 addition & 1 deletion commit0/harness/docker_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def get_repo_configs_to_build(

"""
image_scripts = dict()
test_specs = get_specs_from_dataset(dataset, dataset_type)
test_specs = get_specs_from_dataset(dataset, dataset_type, absolute=True)

for test_spec in test_specs:
# Check if the base image exists
Expand Down
9 changes: 5 additions & 4 deletions commit0/harness/execution_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def __init__(
# prepare for eval
if files_to_copy:
for _, f in files_to_copy.items():
with open(f["src"], "r") as fp:
with open(f["src"], "r") as fp: # type: ignore
content = fp.read()
self.sb.files.write(f["dest"].name, content) # type: ignore

Expand All @@ -271,9 +271,10 @@ def exec_run_with_timeout(self, command: str) -> tuple[str, bool, float]:
# TODO: setup timeout
start_time = time.time()
result = self.sb.commands.run(command, timeout=0)
for fname in self.files_to_collect:
with (self.log_dir / fname).open("w") as f:
f.write(self.sb.files.read(f"testbed/{fname}"))
if self.files_to_collect is not None:
for fname in self.files_to_collect:
with (self.log_dir / fname).open("w") as f:
f.write(self.sb.files.read(f"testbed/{fname}"))
timed_out = self.sb.is_running()
end_time = time.time()
return result.stderr, timed_out, end_time - start_time
Expand Down
Loading