Skip to content

Commit

Permalink
[FIX] Update SWEBenchSSHBox after global config was removed from sand…
Browse files Browse the repository at this point in the history
…box in #2961 (#3014)

Co-authored-by: Xingyao Wang <[email protected]>
  • Loading branch information
RajWorking and xingyaoww authored Jul 19, 2024
1 parent 3a21198 commit 9cf2b5b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions evaluation/swe_bench/swe_env_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from swebench.harness.constants import MAP_REPO_TO_TEST_FRAMEWORK
from swebench.harness.utils import get_test_directives

from opendevin.core.config import config
from opendevin.core.config import SandboxConfig, config
from opendevin.core.logger import opendevin_logger as logger
from opendevin.runtime.docker.ssh_box import DockerSSHBox
from opendevin.runtime.plugins import (
Expand Down Expand Up @@ -50,7 +50,19 @@ def __init__(
# Need to run as root to use SWEBench container
sid = f'swe_bench_{swe_instance_id}_' + str(uuid.uuid4())
logger.info(f'===Using container image: {container_image}')
super().__init__(container_image, timeout, sid)
super().__init__(
config=SandboxConfig(container_image=container_image, timeout=timeout),
persist_sandbox=config.persist_sandbox,
workspace_mount_path=config.workspace_mount_path,
sandbox_workspace_dir=config.workspace_mount_path_in_sandbox,
cache_dir=config.cache_dir,
use_host_network=config.use_host_network,
run_as_devin=config.run_as_devin,
ssh_hostname=config.ssh_hostname,
ssh_password=config.ssh_password,
ssh_port=config.ssh_port,
sid=sid,
)
self.init_plugins(sandbox_plugins)

exit_code, output = self.execute('mv ~/.bashrc ~/.bashrc.bak')
Expand Down

0 comments on commit 9cf2b5b

Please sign in to comment.