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

Get RUN_AS_DEVIN working with app sandbox #1426

Merged
merged 19 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2f2e3d4
get RUN_AS_DEVIN and network=host working with app sandbox
xingyaoww Apr 28, 2024
ce6426d
attempt to fix the workspace base permission
xingyaoww Apr 28, 2024
ac341fe
sandbox might failed in chown due to mounting, but it won't be fatal
xingyaoww Apr 28, 2024
e3157ae
update sshbox instruction
xingyaoww Apr 28, 2024
a92b889
remove default user id since it will be passed in the instruction
xingyaoww Apr 28, 2024
b6e179e
revert permission fix since it should be resolved by correct SANDBOX_…
xingyaoww Apr 28, 2024
96996e5
the permission issue can be fixed by simply provide correct env var
xingyaoww Apr 28, 2024
a564e0f
remove log
xingyaoww Apr 28, 2024
199e9ca
set sandbox user id to getuid by default
xingyaoww Apr 28, 2024
ee36c82
move logging to initializer
xingyaoww Apr 28, 2024
7282e21
make the uid consistent across host, app container, and sandbox
xingyaoww Apr 28, 2024
680d2c0
remove hostname as it causes sudo issue
xingyaoww Apr 28, 2024
f3a252e
fix permission of entrypoint script
xingyaoww Apr 28, 2024
2e6d759
make the uvicron app run as host user uid for jupyter plugin
xingyaoww Apr 28, 2024
313c16f
Merge branch 'main' into run-as-devin-and-network-host
xingyaoww Apr 28, 2024
fcc5897
Merge commit '31c1a2d748f1b0f286f5fce678e7b9311a288fa9' into run-as-d…
xingyaoww Apr 30, 2024
1ce8d5d
revert use host network
xingyaoww Apr 30, 2024
cac18c7
get docker socket gid and usermod instead of chmod 777
xingyaoww Apr 30, 2024
ec8e5ca
try to fix app build disk space issue
xingyaoww Apr 30, 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
Next Next commit
get RUN_AS_DEVIN and network=host working with app sandbox
  • Loading branch information
xingyaoww committed Apr 28, 2024
commit 2f2e3d4b94e46456d24b336bd97fde366635e0ba
6 changes: 4 additions & 2 deletions containers/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ FROM python:3.12-slim as runtime

WORKDIR /app

ENV RUN_AS_DEVIN=false
ENV USE_HOST_NETWORK=false
ENV RUN_AS_DEVIN=true
# Default user id for the sandbox 'opendevin' user
ENV SANDBOX_USER_ID=1000
ENV USE_HOST_NETWORK=true
xingyaoww marked this conversation as resolved.
Show resolved Hide resolved
ENV SSH_HOSTNAME=host.docker.internal
ENV WORKSPACE_BASE=/opt/workspace_base
ENV OPEN_DEVIN_BUILD_VERSION=$OPEN_DEVIN_BUILD_VERSION
Expand Down
1 change: 1 addition & 0 deletions opendevin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
ConfigType.USE_HOST_NETWORK: 'false',
ConfigType.SSH_HOSTNAME: 'localhost',
ConfigType.DISABLE_COLOR: 'false',
ConfigType.SANDBOX_USER_ID: 1000,
}

config_str = ''
Expand Down
2 changes: 1 addition & 1 deletion opendevin/sandbox/docker/ssh_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
USER_ID = int(SANDBOX_USER_ID)
elif hasattr(os, 'getuid'):
USER_ID = os.getuid()

logger.info(f'Will wunning as {"opendevin" if RUN_AS_DEVIN else "root"} with USER_ID={USER_ID} in the sandbox')

class DockerSSHBox(Sandbox):
instance_id: str
Expand Down