feat(platform): Simplify running of core docker services (#11113)

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
This commit is contained in:
Swifty
2025-10-10 11:32:46 +02:00
committed by GitHub
parent a446c1acc9
commit c5b90f7b09
3 changed files with 136 additions and 5 deletions

47
autogpt_platform/Makefile Normal file
View File

@@ -0,0 +1,47 @@
.PHONY: start-core stop-core logs-core format lint migrate run-backend run-frontend
# Run just Supabase + Redis + RabbitMQ
start-core:
docker compose up -d deps
# Stop core services
stop-core:
docker compose stop deps
# View logs for core services
logs-core:
docker compose logs -f deps
# Run formatting and linting for backend and frontend
format:
cd backend && poetry run format
cd frontend && pnpm format
cd frontend && pnpm lint
init-env:
cp -n .env.default .env || true
cd backend && cp -n .env.default .env || true
cd frontend && cp -n .env.default .env || true
# Run migrations for backend
migrate:
cd backend && poetry run prisma migrate deploy
cd backend && poetry run prisma generate
run-backend:
cd backend && poetry run app
run-frontend:
cd frontend && pnpm dev
help:
@echo "Usage: make <target>"
@echo "Targets:"
@echo " start-core - Start just the core services (Supabase, Redis, RabbitMQ) in background"
@echo " stop-core - Stop the core services"
@echo " logs-core - Tail the logs for core services"
@echo " format - Format & lint backend (Python) and frontend (TypeScript) code"
@echo " migrate - Run backend database migrations"
@echo " run-backend - Run the backend FastAPI server"
@echo " run-frontend - Run the frontend Next.js development server"

View File

@@ -38,6 +38,37 @@ To run the AutoGPT Platform, follow these steps:
4. After all the services are in ready state, open your browser and navigate to `http://localhost:3000` to access the AutoGPT Platform frontend.
### Running Just Core services
You can now run the following to enable just the core services.
```
# For help
make help
# Run just Supabase + Redis + RabbitMQ
make start-core
# Stop core services
make stop-core
# View logs from core services
make logs-core
# Run formatting and linting for backend and frontend
make format
# Run migrations for backend database
make migrate
# Run backend server
make run-backend
# Run frontend development server
make run-frontend
```
### Docker Compose Commands
Here are some useful Docker Compose commands for managing your AutoGPT Platform:

View File

@@ -23,7 +23,7 @@ To setup the server, you need to have the following installed:
We use Node.js to run our frontend application.
If you need assistance installing Node.js:
If you need assistance installing Node.js:
https://nodejs.org/en/download/
NPM is included with Node.js, but if you need assistance installing NPM:
@@ -79,7 +79,7 @@ Once you have Docker and Docker Compose installed, you can proceed to the next s
See <a href="https://github.com/supabase/supabase/issues/33816">supabase/supabase #33816</a> for additional context.
</details>
## Quick Setup with Auto Setup Script (Recommended)
## Quick Setup with Auto Setup Script (Recommended)
If you're self-hosting AutoGPT locally, we recommend using our official setup script to simplify the process. This will install dependencies (like Docker), pull the latest code, and launch the app with minimal effort.
For macOS/Linux:
@@ -130,6 +130,41 @@ To run the platform, follow these steps:
```
This command will start all the necessary backend services defined in the `docker-compose.yml` file in detached mode.
---
### 🛠️ Using the Makefile for Common Tasks
The repository includes a `Makefile` with helpful commands to streamline setup and development. You may use `make` commands as an alternative to calling Docker or scripts directly.
#### Most-used Makefile commands
Inside the `autogpt_platform` directory, you can use:
| Command | What it Does |
|------------------------|-------------------------------------------------------------------------------|
| `make start-core` | Start just the core services (Supabase, Redis, RabbitMQ) in background |
| `make stop-core` | Stop the core services |
| `make logs-core` | Tail the logs for core services |
| `make format` | Format & lint backend (Python) and frontend (TypeScript) code |
| `make migrate` | Run backend database migrations |
| `make run-backend` | Run the backend FastAPI server |
| `make run-frontend` | Run the frontend Next.js development server |
*Example usage:*
```sh
make start-core
make run-backend
make run-frontend
```
You can always check available Makefile recipes by running:
```sh
make help
```
(or just inspecting the `Makefile` in the repo root).
---
### Checking if the application is running
You can check if the server is running by visiting [http://localhost:3000](http://localhost:3000) in your browser.
@@ -167,9 +202,9 @@ When installing Docker on Windows, it is **highly recommended** to select **WSL
#### **Steps to enable WSL 2 for Docker:**
1. Install [WSL 2](https://learn.microsoft.com/en-us/windows/wsl/install).
2. Ensure that your Docker settings use WSL 2 as the default backend:
- Open **Docker Desktop**.
- Navigate to **Settings > General**.
- Check **Use the WSL 2 based engine**.
- Open **Docker Desktop**.
- Navigate to **Settings > General**.
- Check **Use the WSL 2 based engine**.
3. Restart **Docker Desktop**.
#### **Already Installed Docker with Hyper-V?**
@@ -224,6 +259,7 @@ pnpm dev
#### Formatting & Linting
Auto formatter and linter are set up in the project. To run them:
Format the code:
```sh
pnpm format
@@ -233,6 +269,10 @@ Lint the code:
```sh
pnpm lint
```
*Or for both frontend and backend, from the root:*
```sh
make format
```
#### Testing
@@ -253,6 +293,10 @@ Run the backend dependencies (database, message queues, etc.):
```sh
docker compose --profile local up deps --build --detach
```
*Or equivalently with Makefile:*
```sh
make start-core
```
Go to the `autogpt_platform/backend` directory:
```sh
@@ -268,8 +312,13 @@ Run the backend server:
```sh
poetry run app
```
*Or from within `autogpt_platform`:*
```sh
make run-backend
```
#### Formatting & Linting
Auto formatter and linter are set up in the project. To run them:
Format the code:
@@ -281,6 +330,10 @@ Lint the code:
```sh
poetry run lint
```
*Or format both frontend and backend at once:*
```sh
make format
```
#### Testing