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

Minimal Docker Sandbox with GPT-3.5 Execution Example #48

Merged
merged 22 commits into from
Mar 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dd0ff16
minimal docker sandbox
xingyaoww Mar 18, 2024
b41efe1
make container_image as an argument (fall back to ubuntu);
xingyaoww Mar 18, 2024
79d1c1d
add a minimal working (imperfect) example
xingyaoww Mar 18, 2024
4f2eb53
fix typo
xingyaoww Mar 18, 2024
1dcb0b4
change default container name
xingyaoww Mar 18, 2024
415efea
attempt to fix "Bad file descriptor" error
xingyaoww Mar 18, 2024
652af30
handle ctrl+D
xingyaoww Mar 18, 2024
10f02a6
add Python gitignore
xingyaoww Mar 20, 2024
1cf3540
Merge commit '10f02a660e3c5c17bba685522d17a353974c049f' into sandbox
xingyaoww Mar 20, 2024
7754e37
push sandbox to shared dockerhub for ease of use
xingyaoww Mar 20, 2024
1747269
move codeact example into research folder
xingyaoww Mar 20, 2024
386abe3
add README for opendevin
xingyaoww Mar 20, 2024
43d4927
change container image name to opendevin dockerhub
xingyaoww Mar 20, 2024
b1551a0
Merge commit '0380070e98e8d59efa411fc74dd95aa49f0ea752' into sandbox
xingyaoww Mar 21, 2024
cea4b4b
move folder; change example to a more general agent
xingyaoww Mar 21, 2024
135f3ee
update Message and Role
xingyaoww Mar 21, 2024
f65c0b7
update docker sandbox to support mounting folder and switch to user w…
xingyaoww Mar 21, 2024
e2b4b90
make network as host
xingyaoww Mar 21, 2024
c10a2d9
handle erorrs when attrs are not set yet
xingyaoww Mar 21, 2024
45e4c6d
convert codeact agent into a compatible agent
xingyaoww Mar 21, 2024
6ebffca
add workspace to gitignore
xingyaoww Mar 21, 2024
8815aa9
make sure the agent interface adjustment works for langchain_agent
xingyaoww Mar 21, 2024
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
Next Next commit
attempt to fix "Bad file descriptor" error
  • Loading branch information
xingyaoww committed Mar 18, 2024
commit 415efeadc93b6dae7a17833b07207ea72cc7645b
21 changes: 13 additions & 8 deletions opendevin/sandbox/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,19 @@ def execute(self, cmd: str) -> str:
return output

def close(self):
os.close(self.master_fd)
self.container.terminate()
try:
self.container.wait(timeout=5)
print("Container stopped.")
except subprocess.TimeoutExpired:
self.container.kill()
print("Container killed.")
if self.master_fd is not None:
os.close(self.master_fd)
self.master_fd = None

if self.container is not None:
self.container.terminate()
try:
self.container.wait(timeout=5)
print("Container stopped.")
except subprocess.TimeoutExpired:
self.container.kill()
print("Container killed.")
self.container = None

def __del__(self):
self.close()
Expand Down