From 1314a09ce97812f69b359deb0d19be6f79cb5faa Mon Sep 17 00:00:00 2001 From: "Xida Ren (Cedar)" Date: Mon, 3 Jun 2024 23:28:50 -0700 Subject: [PATCH] One-step launch instructions (#2189) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: மனோஜ்குமார் பழனிச்சாமி Co-authored-by: Robert Brennan --- README.md | 19 ++++++++----------- docs/modules/usage/intro.mdx | 20 +++++++++----------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index c3b59af393..18409083a5 100644 --- a/README.md +++ b/README.md @@ -49,25 +49,20 @@ OpenDevin agents collaborate with human developers to write code, fix bugs, and The easiest way to run OpenDevin is inside a Docker container. It works best with the most recent version of Docker, `26.0.0`. You must be using Linux, Mac OS, or WSL on Windows. -To start the app, run these commands, replacing `$(pwd)/workspace` with the directory you want OpenDevin to work with. +To start OpenDevin in a docker container, run the following commands in your terminal: > [!WARNING] -> OpenDevin runs bash commands within a Docker sandbox, so it should not affect your machine. -> But your workspace directory will be attached to that sandbox, and files in the directory may be modified or deleted. - -```bash -# The directory you want OpenDevin to work with. MUST be an absolute path! -export WORKSPACE_BASE=$(pwd)/workspace; -``` +> When you run the following command, files in `./workspace` may be modified or deleted. ```bash +OPENDEVIN_WORKSPACE=$(pwd)/workspace docker run -it \ --pull=always \ -e SANDBOX_USER_ID=$(id -u) \ -e PERSIST_SANDBOX="true" \ -e SSH_PASSWORD="make something up here" \ - -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \ - -v $WORKSPACE_BASE:/opt/workspace_base \ + -e WORKSPACE_MOUNT_PATH=$OPENDEVIN_WORKSPACE \ + -v $OPENDEVIN_WORKSPACE:/opt/workspace_base \ -v /var/run/docker.sock:/var/run/docker.sock \ -p 3000:3000 \ --add-host host.docker.internal:host-gateway \ @@ -75,7 +70,9 @@ docker run -it \ ghcr.io/opendevin/opendevin:0.6 ``` -You'll find OpenDevin running at [http://localhost:3000](http://localhost:3000). +You'll find OpenDevin running at [http://localhost:3000](http://localhost:3000) with access to `./workspace`. To have OpenDevin operate on your code, place it in `./workspace`. + +OpenDevin will only have access to this workspace folder. The rest of your system will not be affected as it runs in a secured docker sandbox. ## 🚀 Documentation diff --git a/docs/modules/usage/intro.mdx b/docs/modules/usage/intro.mdx index 130088ee6b..fefa05c9c1 100644 --- a/docs/modules/usage/intro.mdx +++ b/docs/modules/usage/intro.mdx @@ -61,25 +61,21 @@ Explore the codebase of OpenDevin on [GitHub](https://github.com/OpenDevin/OpenD The easiest way to run OpenDevin is inside a Docker container. It works best with the most recent version of Docker, `26.0.0`. You must be using Linux, Mac OS, or WSL on Windows. -To start the app, run these commands, replacing `$(pwd)/workspace` with the directory you want OpenDevin to work with. - -``` -# The directory you want OpenDevin to work with. It MUST be an absolute path! -export WORKSPACE_BASE=$(pwd)/workspace -``` +To start OpenDevin in a docker container, run the following commands in your terminal: :::warning -OpenDevin runs bash commands within a Docker sandbox, so it should not affect your machine. But your workspace directory will be attached to that sandbox, and files in the directory may be modified or deleted. +When you run the following command, files in `./workspace` may be modified or deleted. ::: -``` +```bash +OPENDEVIN_WORKSPACE=$(pwd)/workspace docker run -it \ --pull=always \ -e SANDBOX_USER_ID=$(id -u) \ -e PERSIST_SANDBOX="true" \ -e SSH_PASSWORD="make something up here" \ - -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \ - -v $WORKSPACE_BASE:/opt/workspace_base \ + -e WORKSPACE_MOUNT_PATH=$OPENDEVIN_WORKSPACE \ + -v $OPENDEVIN_WORKSPACE:/opt/workspace_base \ -v /var/run/docker.sock:/var/run/docker.sock \ -p 3000:3000 \ --add-host host.docker.internal:host-gateway \ @@ -87,7 +83,9 @@ docker run -it \ ghcr.io/opendevin/opendevin:0.6 ``` -You'll find OpenDevin running at [http://localhost:3000](http://localhost:3000). +You'll find OpenDevin running at [http://localhost:3000](http://localhost:3000) with access to `./workspace`. Place your code in `./workspace` to have Devin operate on them. + +OpenDevin will only have access to this workspace folder. The rest of your system will not be affected as it runs in a secured docker sandbox. :::tip If you want to use the **(unstable!)** bleeding edge, you can use `ghcr.io/opendevin/opendevin:main` as the image (last line).