Skip to content
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

fix: remove incorrect exec_run calls #189

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
4 changes: 1 addition & 3 deletions swebench/harness/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def copy_to_container(container: Container, src: Path, dst: Path):
# temporary tar file
tar_path = src.with_suffix(".tar")
with tarfile.open(tar_path, "w") as tar:
tar.add(src, arcname=src.name)
tar.add(src, arcname=dst.name) # use destination name, so after `put_archive`, name is correct

# get bytes for put_archive cmd
with open(tar_path, "rb") as tar_file:
Expand All @@ -43,11 +43,9 @@ def copy_to_container(container: Container, src: Path, dst: Path):

# Send tar file to container and extract
container.put_archive(os.path.dirname(dst), data)
container.exec_run(f"tar -xf {dst}.tar -C {dst.parent}")

# clean up in locally and in container
tar_path.unlink()
container.exec_run(f"rm {dst}.tar")


def write_to_container(container: Container, data: str, dst: Path):
Expand Down
Loading