princeton-nlp / SWE-agent

SWE-agent takes a GitHub issue and tries to automatically fix it, using GPT-4, or your LM of choice. It solves 12.47% of bugs in the SWE-bench evaluation set and takes just 1 minute to run.
https://princeton-nlp.github.io/SWE-agent/
MIT License
11.9k stars 1.19k forks source link

Is container necessary to run SWE-agent? #521

Closed icoding1010 closed 1 month ago

icoding1010 commented 1 month ago

Describe the issue

I am trying to run SWE-agent on GitHub Actions workflow without containers. There is an error that pops up regd. the SWEEnv container setup. Hence, the question : How is it possible to run SWE-agent without containers?

This is the error that I see on GitHub Actions workflow:

INFO     Base commit reference None resolved to commit hash                     
         a3d7505b453ee5a2dd464761cc9a28f5fa0ad858                               
INFO     💽 Loaded dataset from https://github.com/SWE-agent/test-repo/issues/1 
Traceback (most recent call last):
  File "/home/runner/work/my-private-test-project/my-private-test-project/scripts/run.py", line 516, in <module>
    main(get_args())
  File "/home/runner/work/my-private-test-project/my-private-test-project/scripts/run.py", line 512, in main
    Main(args).main()
    ^^^^^^^^^^
  File "/home/runner/work/my-private-test-project/my-private-test-project/scripts/run.py", line 313, in __init__
    self.env = SWEEnv(args.environment)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/my-private-test-project/my-private-test-project/scripts/sweagent/environment/swe_env.py", line 177, in __init__
    self._reset_container()
  File "/home/runner/work/my-private-test-project/my-private-test-project/scripts/sweagent/environment/swe_env.py", line 531, in _reset_container
    self._init_container()
  File "/home/runner/work/my-private-test-project/my-private-test-project/scripts/sweagent/environment/swe_env.py", line 566, in _init_container
    self.container, self.parent_pids = get_container(self.container_name, image_name, persistent=self.persistent)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/my-private-test-project/my-private-test-project/scripts/sweagent/environment/utils.py", line 383, in get_container

    raise RuntimeError(msg)
RuntimeError: Image sweagent/swe-agent:latest not found. Please ensure it is built and available. Please double-check that you followed all installation/setup instructions from the readme.
Error: Process completed with exit code 1.

Optional: Relevant documentation page

No response

klieret commented 1 month ago

It is not possible. The agent executes LM generated code in a Docker container as a sandbox. However: You can run SWE-agent in GHA. Just check our workflow that we use for testing :)

klieret commented 1 month ago

The concrete error that you're getting is that you have to either ./setup.sh or docker pull ... the image. See our docs for info.

BalestraPatrick commented 3 weeks ago

@klieret I have somewhat of a similar question: my use-case is that I'd like to run SWE-agent on a platform where Docker isn't fully supported and the project actually requires running on macOS (due to various compiler requirements). Looking through the codebase I couldn't find any way to bypass the sandbox, so it seems like that's a strong requirement by SWE-agent?