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: Fix the documentation in docs/pages/deployment.mdx #3723

Open
1 task done
wwzeng1 opened this issue May 13, 2024 · 1 comment · May be fixed by #3724 or #3725
Open
1 task done

Sweep: Fix the documentation in docs/pages/deployment.mdx #3723

wwzeng1 opened this issue May 13, 2024 · 1 comment · May be fixed by #3724 or #3725
Labels
sweep Assigns Sweep to an issue or pull request.

Comments

@wwzeng1
Copy link
Contributor

wwzeng1 commented May 13, 2024

Details

Step 4 of the cloud development "update webhook URL" needs to be step 5 for the local instructions, updated with the ngrok URL

Branch

No response

Checklist
@wwzeng1 wwzeng1 added the sweep Assigns Sweep to an issue or pull request. label May 13, 2024
@sweep-nightly sweep-nightly bot linked a pull request May 13, 2024 that will close this issue
@wwzeng1 wwzeng1 changed the title Sweep: Fix the documentation Sweep: Fix the documentation in docs/pages/deployment.mdx May 13, 2024
Copy link
Contributor

sweep-nightly bot commented May 13, 2024

🚀 Here's the PR! #3725

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

Tip

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


Actions (click)

  • ↻ Restart Sweep

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.

import { Callout, Tabs, Steps } from 'nextra/components'
import { FaInfoCircle, FaExclamationCircle } from 'react-icons/fa'
import YouTube from 'react-youtube';
# Self-Hosting Sweep via Docker
<Callout type="info">This is a guide for self-hosting Sweep. If you are interested in our hosted version please visit https://github.com/apps/sweep-ai.</Callout>
Sweep GitHub App is an air-gapped, self-hostable version of Sweep which serves many repositories at once.<br/>
Setting up the Sweep GitHub App involves:
1. Creating the GitHub App and getting a trial license key.
2. Hosting the Sweep backend on a cloud provider like DigitalOcean.
**The trial license key is valid for 14 days.** To upgrade to an enterprise license key, contact us at [email protected]. Feel free to reach out to us for any help or questions.
<Steps>
### Create GitHub App
Create a [GitHub App here](https://deploy.sweep.dev/) (1 minute). This tool will guide you through the process of creating a GitHub App, create a license key, and provide you with the necessary `.env` file.
It will be named `.env.txt` and you will need to rename it to `.env` (browser security reasons). It should look something like this.
```sh filename=".env"
GITHUB_APP_ID=123456
GITHUB_APP_PEM=-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----\n
GITHUB_BOT_USER=sweepai-self-hosted
LICENSE_KEY=ABCDE-FGHIJ-KLMNO-PQRST-UVWXY
```
---
### Anthropic and OpenAI API keys
Create an [OpenAI API key](https://platform.openai.com/account/api-keys) and an [Anthropic API key](https://console.anthropic.com/settings/keys) add it to your `.env`:
```sh filename=".env"
...
ANTHROPIC_API_KEY=sk-ant-api03-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```
---
### Hosting Sweep
To host Sweep you need to run the Sweep webhook on a publicly accessible server. We recommend using a cloud provider (DigitalOcean, AWS, or Azure) but you can also run it locally and use a reverse proxy like Ngrok.
*If you encounter issues please reach out to us through [Email]([email protected]), [Discourse](https://community.sweep.dev/) or open a [GitHub issue](https://github.com/sweepai/sweep/issues). We are online, please ping us @kevin, @william, and @martin.*
<Tabs items={["Cloud (recommended)", "Local"]}>
<Tabs.Tab>
We recommend deploying on the cloud for most users as the networking setup is easier. For this guide, we will use DigitalOcean.
##### 1. Create Instance
Recommended specs:
- OS: Ubuntu
- RAM: 32 GB
- CPU: 4 vCPUs
- Storage: 100 GB
<details>
<summary>If you do not have Docker/Docker Compose setup</summary>
```sh filename="terminal"
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update -y
sudo apt install docker-ce -y
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker ${USER}
```
</details>
Start the docker client if you are on Mac/Windows.
##### 2. Configure `.env` and pull Sweep
```sh filename="terminal"
git clone https://github.com/sweepai/sweep
cd sweep
vim .env
```
Copy the following from your local `.env` to your remote `.env`:
```sh filename=".env"
# Step 1
GITHUB_APP_ID=123456
GITHUB_APP_PEM=-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----\n
GITHUB_BOT_USER=sweepai-self-hosted
LICENSE_KEY=ABCDE-FGHIJ-KLMNO-PQRST-UVWXY
# Step 2
ANTHROPIC_API_KEY=sk-ant-api03-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```
##### 3. Deploy the Sweep backend
```sh filename="terminal"
docker compose up --build hosted
# To run in background, docker compose up --build -d hosted
```
##### 4. Update the GitHub Webhook URL
Get the IP address of your instance and add the port Sweep is deployed to (in this case, 8080):
```sh
http://YOUR_IP:8080
```
Navigating to this link should look like this:
{/* <img src="/deployment/digitalocean_step7.png" alt="Skip Resources Page" /> */}
Go to your GitHub app and update `Webhook URL` to the link above.
For user accounts:
```txt /GITHUB_BOT_USERNAME/
https://github.com/settings/apps/GITHUB_BOT_USERNAME
```
For organizations:
```txt /GITHUB_BOT_USERNAME/, /YOUR_ORGANIZATION/
https://github.com/YOUR_ORGANIZATION/sweepai/settings/apps/GITHUB_BOT_USERNAME
```
{/* <img src="/deployment/digitalocean_step9.png" alt="Skip Resources Page" /> */}
</Tabs.Tab>
<Tabs.Tab>
If prefer to deploy on your local machine, you can do so by following the steps below.
#### Prerequisites
You need to install [Docker](https://docs.docker.com/engine/install/) to host Sweep.
#### 1. Download the Docker Image
Pull our image from Docker Hub:
```sh filename="terminal"
git clone https://github.com/sweepai/sweep
cd sweep
docker compose pull hosted
```
It may take 5-10 minutes to download the image and you can move on to the next step while it's downloading.
#### 2. Set up the environment
Create a `.env` file with the contents from steps 1 and 2.
#### 3. Run the Docker Image
Then in the same directory, run:
```bash filename="terminal"
docker compose up hosted # Add -d to run in background
```
#### 4. Set up the Reverse Proxy
We're going to use [Ngrok](https://ngrok.com/) for a reverse proxy.
Sign up for an Ngrok account and install the CLI from https://dashboard.ngrok.com/signup. Your terminal must be in the same directory as your ngrok installation. Start the reverse proxy with `ngrok http 8080`. The second last line should say something like
```sh filename="terminal"
Forwarding https://4d8d8bf053be.ngrok.app -> http://localhost:8080
```
Then proceed with step 4.
</Tabs.Tab>
</Tabs>
</Steps>
---
### You have successfully deployed Sweep!
*For enterprise support such as fine-tuning (20% performance gain), search index caching, usage tracking, and progress dashboards please contact [email protected].*
**Creating a Pull Request with Sweep**
Use Sweep by creating a new issue on the repository with a title prefixed with `Sweep:` like `Sweep: add type hints to BaseIndex.tsx`.
For more details see [how to use Sweep](https://docs.sweep.dev/#-how-to-use-sweep).


Step 2: ⌨️ Coding

Modify docs/pages/deployment.mdx with contents:

Update the <original_code> and <new_code> blocks to match the actual code in the file and include the necessary changes.

<original_code>

4. Set up the Reverse Proxy

We're going to use Ngrok for a reverse proxy.

Sign up for an Ngrok account and install the CLI from https://dashboard.ngrok.com/signup. Your terminal must be in the same directory as your ngrok installation. Start the reverse proxy with ngrok http 8080. The second last line should say something like

Forwarding  https://4d8d8bf053be.ngrok.app -> http://localhost:8080

Then proceed with step 4.
</Tabs.Tab>


You have successfully deployed Sweep!

For enterprise support such as fine-tuning (20% performance gain), search index caching, usage tracking, and progress dashboards please contact [email protected].

Creating a Pull Request with Sweep

Use Sweep by creating a new issue on the repository with a title prefixed with Sweep: like Sweep: add type hints to BaseIndex.tsx.
For more details see how to use Sweep.
</original_code>

<new_code>

4. Set up the Reverse Proxy

We're going to use Ngrok for a reverse proxy.

Sign up for an Ngrok account and install the CLI from https://dashboard.ngrok.com/signup. Your terminal must be in the same directory as your ngrok installation. Start the reverse proxy with ngrok http 8080. The second last line should say something like

Forwarding  https://4d8d8bf053be.ngrok.app -> http://localhost:8080

5. Update the GitHub Webhook URL

Copy the forwarding URL from the ngrok output in step 4, for example:

https://4d8d8bf053be.ngrok.app

Go to your GitHub app and update the Webhook URL to the ngrok forwarding URL.

For user accounts:

https://github.com/settings/apps/GITHUB_BOT_USERNAME

For organizations:

https://github.com/YOUR_ORGANIZATION/sweepai/settings/apps/GITHUB_BOT_USERNAME

</Tabs.Tab>


You have successfully deployed Sweep!

For enterprise support such as fine-tuning (20% performance gain), search index caching, usage tracking, and progress dashboards please contact [email protected].

Creating a Pull Request with Sweep

Use Sweep by creating a new issue on the repository with a title prefixed with Sweep: like Sweep: add type hints to BaseIndex.tsx.
For more details see how to use Sweep.
</new_code>


Step 3: 🔁 Code Review

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


🎉 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.

@sweepai sweepai deleted a comment from sweep-nightly bot Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
1 participant