From 1367d61181c93439b7fad6e8c65a8f32ec0df34f Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Wed, 28 May 2025 14:08:52 -0700 Subject: [PATCH] fix: Update base dockerfile to include py and js software (#38) --- apps/open-swe/e2b.Dockerfile | 20 +++++++++++++++++--- apps/open-swe/src/nodes/generate-message.ts | 3 ++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/open-swe/e2b.Dockerfile b/apps/open-swe/e2b.Dockerfile index d3dde88c..c1c66da9 100644 --- a/apps/open-swe/e2b.Dockerfile +++ b/apps/open-swe/e2b.Dockerfile @@ -1,8 +1,22 @@ # Always start from the base E2B image FROM e2bdev/code-interpreter:latest -# Ensure git is installed -RUN apt-get update && apt-get install -y git curl ripgrep +# Install dependencies in a single layer +RUN apt-get update && apt-get install -y \ + git \ + curl \ + ripgrep \ + python3 \ + python3-pip \ + && rm -rf /var/lib/apt/lists/* + +# Install Node.js (LTS version) via NodeSource +RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \ + && apt-get install -y nodejs \ + && rm -rf /var/lib/apt/lists/* + +# Install yarn and pnpm globally +RUN npm install -g yarn pnpm # Set the working directory -WORKDIR /app +WORKDIR /app \ No newline at end of file diff --git a/apps/open-swe/src/nodes/generate-message.ts b/apps/open-swe/src/nodes/generate-message.ts index 385cf9a3..d666981b 100644 --- a/apps/open-swe/src/nodes/generate-message.ts +++ b/apps/open-swe/src/nodes/generate-message.ts @@ -50,7 +50,8 @@ You MUST adhere to the following criteria when executing the task: - Use \`apply_patch\` to edit files. This tool accepts diffs and file paths. It will then apply the given diff to the file. - You should NOT try to create empty files with \`apply_patch\`. If you need to create a file, use the \`shell\` tool, and pass \`touch \` to create the file. - When using the \`shell\` tool, always take advantage of the \`workdir\` parameter to run commands inside the repo directory. You should not try to generate a command with \`cd \` as passing that path to \`workdir\` is much more efficient. -- Do not try to install dependencies, or run a server, compile the code, etc., unless you are explicitly asked to. +- Always use the correct package manager to install dependencies. If the package manager is not already installed in the sandbox, use the \`shell\` tool to install it. + - If the package manager fails to install, or you have issues installing dependencies, do not try to use a different package manager. Instead, skip installing dependencies. - If completing the user's task requires writing or modifying files: - Your code and final answer should follow these *CODING GUIDELINES*: - Avoid writing to files which you have not already read.