You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get RUN_AS_DEVIN working with app sandbox (OpenHands#1426)
* get RUN_AS_DEVIN and network=host working with app sandbox
* attempt to fix the workspace base permission
* sandbox might failed in chown due to mounting, but it won't be fatal
* update sshbox instruction
* remove default user id since it will be passed in the instruction
* revert permission fix since it should be resolved by correct SANDBOX_USER_ID
* the permission issue can be fixed by simply provide correct env var
* remove log
* set sandbox user id to getuid by default
* move logging to initializer
* make the uid consistent across host, app container, and sandbox
* remove hostname as it causes sudo issue
* fix permission of entrypoint script
* make the uvicron app run as host user uid for jupyter plugin
* revert use host network
* get docker socket gid and usermod instead of chmod 777
* try to fix app build disk space issue
Copy file name to clipboardExpand all lines: opendevin/sandbox/docker/ssh_box.py
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,6 @@
41
41
elifhasattr(os, 'getuid'):
42
42
USER_ID=os.getuid()
43
43
44
-
45
44
classDockerSSHBox(Sandbox):
46
45
instance_id: str
47
46
container_image: str
@@ -62,6 +61,7 @@ def __init__(
62
61
timeout: int=120,
63
62
sid: str|None=None,
64
63
):
64
+
logger.info(f'SSHBox is running as {"opendevin"ifRUN_AS_DEVINelse"root"} user with USER_ID={USER_ID} in the sandbox')
65
65
# Initialize docker client. Throws an exception if Docker is not reachable.
66
66
try:
67
67
self.docker_client=docker.from_env()
@@ -150,8 +150,10 @@ def setup_user(self):
150
150
workdir=SANDBOX_WORKSPACE_DIR,
151
151
)
152
152
ifexit_code!=0:
153
-
raiseException(
154
-
f'Failed to chown workspace directory for opendevin in sandbox: {logs}')
153
+
# This is not a fatal error, just a warning
154
+
logger.warning(
155
+
f'Failed to chown workspace directory for opendevin in sandbox: {logs}. But this should be fine if the {SANDBOX_WORKSPACE_DIR=} is mounted by the app docker container.'
0 commit comments