d-walsh / sweep

Sweep: open-source AI-powered Software Developer for small features and bug fixes.
https://sweep.dev
Other
0 stars 0 forks source link

Sweep: change dockerfile to use local files for sweepai instead of the pip package #7

Open d-walsh opened 1 week ago

d-walsh commented 1 week ago

Branch

No response

d-walsh commented 1 week ago

🚀 Here's the PR! #8

See Sweep's progress at the progress dashboard!
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: None)

[!TIP] I can email you next time I complete a pull request if you set up your email here!


Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/sweepai/dataclasses/dockerfile_config.py#L1-L14 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/sweepai/handlers/on_check_suite.py#L1-L253 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/bin/deploy.sh#L1-L50 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/bin/redeploy.sh#L1-L50 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/bin/install.sh#L1-L43 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/bin/server/install_light.sh#L1-L8 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/sweepai/core/repo_parsing_utils.py#L1-L167 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/sweepai/config/server.py#L1-L214 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/sweepai/utils/multi_query.py#L1-L103 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/sweepai/utils/convert_openai_anthropic.py#L1-L128 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/sweepai/config/client.py#L21-L330 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/sweepai/core/context_pruning.py#L1-L198 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/sweepai/core/sweep_bot.py#L366-L396 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/sweepai/handlers/create_pr.py#L1-L312 https://github.com/d-walsh/sweep/blob/732ddf0f86bc18d462d157aa105dd7e33795fd65/sweepai/agents/search_agent.py#L1-L188

Step 2: ⌨️ Coding

Replace this line:

build_command = f"docker build -t {image_name} -f {dockerfile_path} --build-arg CODE_PATH=. ."

With:

build_command = f"docker build -t {image_name} -f {dockerfile_path} --build-arg CODE_PATH={cloned_repo.repo_dir} {cloned_repo.repo_dir}"

This passes the cloned repository path as the CODE_PATH build argument and build context so the Dockerfile can access the local sweepai files.

With the following lines to copy the local sweepai files and install from requirements.txt:

COPY sweepai /app/sweepai
COPY requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt

This copies the sweepai directory from the build context (the repo) into the image, copies the requirements.txt, and installs the dependencies from it.

If the project uses Poetry and pyproject.toml instead of requirements.txt, use:

COPY sweepai /app/sweepai 
COPY pyproject.toml /app/pyproject.toml
COPY poetry.lock /app/poetry.lock
RUN pip install poetry
RUN poetry config virtualenvs.create false 
RUN poetry install --no-interaction --no-ansi


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/change_dockerfile_to_use_local_files_for.


🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.

This is an automated message generated by Sweep AI.

dw-auto[bot] commented 1 week ago
Sweeping

0%

Actions

@d-walsh, editing this issue description to include more details will automatically make me relaunch. Please join our community forum for support (tracking_id=7056a2fce8)

Report a bug.


[!TIP] To recreate the pull request, edit the issue title or description.

This is an automated message generated by Sweep AI.