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

Sweep: modify sweepai/utils/diff_test.py to use pytest instead of unittest (✓ Sandbox Passed) #2960

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 20 additions & 24 deletions docs/pages/deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
We use the [Elastic License V2](https://www.elastic.co/licensing/elastic-license) which allows commercial usage for Sweep.
This is a guide for self-hosting Sweep. If you would like to use our hosted version, please visit https://github.com/apps/sweep-ai.

## 1. Setup
## 1. Downloading Sweep

Open [Docker Desktop](https://www.docker.com/products/docker-desktop/) and run the following code in your terminal:
```sh
git clone https://github.com/sweepai/sweep
Open [Docker Desktop](https://www.docker.com/products/docker-desktop/) and run the following code in your terminal (hover over code for copy button):

```sh filename="terminal"
git clone --depth 1 --single-branch https://github.com/sweepai/sweep
cd sweep
touch .env
docker compose pull
Expand All @@ -26,28 +27,23 @@ REPO=your-username/your-repo
We're halfway done! Pulling the image will take a few minutes, so let's complete the next steps for now.

## 2. GitHub PAT
To allow Sweep to access your repo, create a new [GitHub Personal Access Token (PAT) here](https://github.com/settings/personal-access-tokens/new). Sweep will run entirely locally, and no code will be shared outside of OpenAI's API.
To allow Sweep to access your repo, create a new [GitHub Personal Access Token (PAT) here](https://github.com/settings/tokens/new?description=Sweep%20Self-hosted&scopes=repo,workflow). Sweep will run entirely locally, and no code will be shared outside of OpenAI's API.

Add this to your `.env` which should now look like this:

```sh filename=".env"
REPO=your-username/your-repo
GITHUB_PAT=github_pat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
GITHUB_PAT=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

Set your preferred token name, and select `All Repositories` with the following permissions:

```markdown
Actions - Access: Read-only
Commit statuses - Access: Read and write
Contents - Access: Read and write
Issues - Access: Read and write
Metadata - Access: Read-only
Pull requests - Access: Read and write
```


<div align="center"><img src="/assets/tutorial/github_pat_config.gif" alt="How to configure Sweep's GitHub permissions locally." /></div>
<details>
<summary>
❓ Link not working?
</summary>
If the link doesn't work, you can go [here](https://github.com/settings/tokens/new) and manually set your preferred token name (e.g. Sweep Self-Hosted), and select the following permissions:
* repo (ALL)
* workflow
</details>

## 3. OpenAI API Token

Expand All @@ -59,17 +55,17 @@ OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
After following the above sections, your `.env` should look like this:
```sh filename=".env"
REPO=your-username/your-repo
GITHUB_PAT=github_pat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
GITHUB_PAT=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

---

## 4. Deploying Sweep Locally
## 4. Deploying Sweep Locally

Now, you can run Sweep locally with the following command:
Once `docker compose pull` from Step 1 is complete, you can run Sweep locally with the following command:

```sh
```sh filename="terminal"
docker compose up # Add -d to run in background
```

Expand All @@ -86,4 +82,4 @@ For more details on using Sweep see [how to use Sweep](https://docs.sweep.dev/#-
### Alternative Deployment via GitHub App:
If you successfully deployed Sweep, you can skip this section.

You can self-deploy Sweep as a GitHub App to serve many repos at once. This is a more complicated process, but it is more scalable and is what we use for our hosted version. You can find the instructions [here](https://docs.sweep.dev/usage/self-hosting) and contact us at team@sweep.dev if you need help getting set up.
You can self-deploy Sweep as a GitHub App to serve many repos at once. This is a more complicated process, but it is more scalable and is what we use for our hosted version. You can find the instructions [here](https://docs.sweep.dev/usage/self-hosting) or contact us at team@sweep.dev if you need help getting set up.
12 changes: 0 additions & 12 deletions self_deploy/.dockerignore

This file was deleted.

7 changes: 0 additions & 7 deletions self_deploy/.gitignore

This file was deleted.

73 changes: 0 additions & 73 deletions self_deploy/CODE_OF_CONDUCT.md

This file was deleted.

39 changes: 0 additions & 39 deletions self_deploy/CONTRIBUTING.md

This file was deleted.

8 changes: 0 additions & 8 deletions self_deploy/Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions self_deploy/LICENSE

This file was deleted.

33 changes: 0 additions & 33 deletions self_deploy/README.md

This file was deleted.

Loading
Loading