AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(rnd): Add support for supabase locally (#8077)
Aarushidc72ec97bcee
diff --git a/.gitmodules b/.gitmodulesindex aea59a8452..dd68da1d45 100644--- a/.gitmodules+++ b/.gitmodules@@ -1,3 +1,6 @@[submodule "forge/tests/vcr_cassettes"]path = forge/tests/vcr_cassettesurl = https://github.com/Significant-Gravitas/Auto-GPT-test-cassettes+[submodule "rnd/supabase"]+ path = rnd/supabase+ url = https://github.com/supabase/supabase.gitdiff --git a/docs/content/server/setup.md b/docs/content/server/setup.mdindex 2e624c05f2..3a0ca5be2a 100644--- a/docs/content/server/setup.md+++ b/docs/content/server/setup.md@@ -102,21 +102,14 @@ poetry run prisma generateWithout running this command, the necessary Python modules (prisma.models) won't be available, leading to a `ModuleNotFoundError`.-### Running the server without Docker+### Running the serverTo run the server, you can run the following commands in the same terminal you ran the `poetry install` command:```bash-poetry run app-```--### Running the server within Docker--To run the server, you can run the following commands in the same terminal you ran the `poetry install` command:--```bash-docker compose build-docker compose up+cp supabase/docker/.env.example .env+docker compose -f docker-compose.combined.yml build+docker compose -f docker-compose.combined.yml up -d```In the other terminal from autogpt_builder, you can run the following command to start the frontend:diff --git a/rnd/README.md b/rnd/README.mdindex 607d1415c2..62cda7a26b 100644--- a/rnd/README.md+++ b/rnd/README.md@@ -16,19 +16,33 @@ To run the AutoGPT Platform, follow these steps:1. Clone this repository to your local machine.2. Navigate to the project directory.3. Run the following command:+ ```+ cp supabase/docker/.env.example .env+ ```+4. Run the following command:```- docker compose up -d+ docker compose -f docker-compose.combined.yml up -d+```- This command will start all the necessary services defined in the `docker-compose.yml` file in detached mode.+ This command will start all the necessary backend services defined in the `docker-compose.combined.yml` file in detached mode.+5. Navigate to rnd/autogpt_builder.+6. Run the following command:+ ```+ cp .env.example .env.local+ ```+7. Run the following command:+ ```+ yarn dev+ ```### Docker Compose CommandsHere are some useful Docker Compose commands for managing your AutoGPT Platform:-- `docker compose up -d`: Start the services in detached mode.-- `docker compose stop`: Stop the running services without removing them.+- `docker compose -f docker-compose.combined.yml up -d`: Start the services in detached mode.+- `docker compose -f docker-compose.combined.yml stop`: Stop the running services without removing them.- `docker compose rm`: Remove stopped service containers.- `docker compose build`: Build or rebuild services.- `docker compose down`: Stop and remove containers, networks, and volumes.diff --git a/rnd/docker-compose.combined.yml b/rnd/docker-compose.combined.ymlnew file mode 100644index 0000000000..be9d9cdcdb--- /dev/null+++ b/rnd/docker-compose.combined.yml@@ -0,0 +1,145 @@+version: '3.8'++networks:+ app-network:+ name: app-network+ shared-network:+ name: shared-network++volumes:+ db-config:++x-agpt-services:+ &agpt-services+ networks:+ - app-network+ - shared-network++x-supabase-services:+ &supabase-services+ networks:+ - app-network+ - shared-network++services:+ # AGPT services+ postgres:+ <<: *agpt-services+ extends:+ file: ./docker-compose.yml+ service: postgres++ migrate:+ <<: *agpt-services+ extends:+ file: ./docker-compose.yml+ service: migrate++ redis:+ <<: *agpt-services+ extends:+ file: ./docker-compose.yml+ service: redis++ rest_server:+ <<: *agpt-services+ extends:+ file: ./docker-compose.yml+ service: rest_server++ executor:+ <<: *agpt-services+ extends:+ file: ./docker-compose.yml+ service: executor++ websocket_server:+ <<: *agpt-services+ extends:+ file: ./docker-compose.yml+ service: websocket_server++ market:+ <<: *agpt-services+ extends:+ file: ./docker-compose.yml+ service: market++# frontend:+# <<: *agpt-services+# extends:+# file: ./docker-compose.yml+# service: frontend++ # Supabase services+ studio:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: studio++ kong:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: kong++ auth:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: auth++ rest:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: rest++ realtime:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: realtime++ storage:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: storage++ imgproxy:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: imgproxy++ meta:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: meta++ functions:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: functions++ analytics:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: analytics++ db:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: db++ vector:+ <<: *supabase-services+ extends:+ file: ./supabase/docker/docker-compose.yml+ service: vectordiff --git a/rnd/docker-compose.yml b/rnd/docker-compose.ymlindex 1a10048b8a..0e628a0e95 100644--- a/rnd/docker-compose.yml+++ b/rnd/docker-compose.yml@@ -11,21 +11,18 @@ services:timeout: 5sretries: 5ports:- - "5432:5432"+ - "5433:5432"networks:- app-network-+migrate:- build:- context: ../- dockerfile: rnd/autogpt_server/Dockerfile- target: server+ image: autogpt_server:latest+ command: ["sh", "-c", "poetry run prisma migrate deploy"]develop:watch:- path: ./target: rnd/autogpt_server/migrateaction: rebuild- command: ["poetry", "run", "prisma", "migrate", "deploy"]depends_on:postgres:condition: service_healthy@@ -72,15 +69,18 @@ services:migrate:condition: service_completed_successfullyenvironment:+ - SUPABASE_URL=http://kong:8000+ - SUPABASE_JWT_SECRET=your-super-secret-jwt-token-with-at-least-32-characters-long+ - SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE- DATABASE_URL=postgresql://agpt_user:pass123@postgres:5432/agpt_local?connect_timeout=60- REDIS_HOST=redis- REDIS_PORT=6379- REDIS_PASSWORD=password- - AUTH_ENABLED=false+ - ENABLE_AUTH=true- PYRO_HOST=0.0.0.0- EXECUTIONMANAGER_HOST=executorports:- - "8000:8000"+ - "8006:8000"- "8003:8003" # execution schedulernetworks:- app-network@@ -104,11 +104,14 @@ services:migrate:condition: service_completed_successfullyenvironment:+ - NEXT_PUBLIC_SUPABASE_URL=http://kong:8000+ - SUPABASE_JWT_SECRET=your-super-secret-jwt-token-with-at-least-32-characters-long+ - SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE- DATABASE_URL=postgresql://agpt_user:pass123@postgres:5432/agpt_local?connect_timeout=60- REDIS_HOST=redis- REDIS_PORT=6379- REDIS_PASSWORD=password- - AUTH_ENABLED=false+ - ENABLE_AUTH=true- PYRO_HOST=0.0.0.0- AGENTSERVER_HOST=rest_serverports:@@ -135,11 +138,14 @@ services:migrate:condition: service_completed_successfullyenvironment:+ - SUPABASE_URL=http://kong:8000+ - SUPABASE_JWT_SECRET=your-super-secret-jwt-token-with-at-least-32-characters-long+ - SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE- DATABASE_URL=postgresql://agpt_user:pass123@postgres:5432/agpt_local?connect_timeout=60- REDIS_HOST=redis- REDIS_PORT=6379- REDIS_PASSWORD=password- - AUTH_ENABLED=false+ - ENABLE_AUTH=true- PYRO_HOST=0.0.0.0ports:- "8001:8001"@@ -161,41 +167,41 @@ services:migrate:condition: service_completed_successfullyenvironment:- - DATABASE_URL=postgresql://agpt_user:pass123@postgres:5432/agpt_local?connect_timeout=60&schema=market- ports:- - "8015:8015"- networks:- - app-network-- frontend:- build:- context: ../- dockerfile: rnd/autogpt_builder/Dockerfile- target: dev- develop:- watch:- - path: ./- target: rnd/autogpt_builder/- action: rebuild- depends_on:- postgres:- condition: service_healthy- rest_server:- condition: service_started- websocket_server:- condition: service_started- migrate:- condition: service_completed_successfully- environment:+ - SUPABASE_URL=http://kong:8000+ - SUPABASE_JWT_SECRET=your-super-secret-jwt-token-with-at-least-32-characters-long+ - SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE- DATABASE_URL=postgresql://agpt_user:pass123@postgres:5432/agpt_local?connect_timeout=60- - NEXT_PUBLIC_AGPT_SERVER_URL=http://localhost:8000/api- - NEXT_PUBLIC_AGPT_WS_SERVER_URL=ws://localhost:8001/ws- - NEXT_PUBLIC_AGPT_MARKETPLACE_URL=http://localhost:8015/api/v1/marketports:- - "3000:3000"+ - "8015:8015"networks:- app-network+# frontend:+# build:+# context: ../+# dockerfile: rnd/autogpt_builder/Dockerfile+# target: dev+# depends_on:+# postgres:+# condition: service_healthy+# rest_server:+# condition: service_started+# websocket_server:+# condition: service_started+# migrate:+# condition: service_completed_successfully+# environment:+# - NEXT_PUBLIC_SUPABASE_URL=http://kong:8000+# - NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE+# - DATABASE_URL=postgresql://agpt_user:pass123@postgres:5432/agpt_local?connect_timeout=60+# - NEXT_PUBLIC_AGPT_SERVER_URL=http://localhost:8006/api+# - NEXT_PUBLIC_AGPT_WS_SERVER_URL=ws://localhost:8001/ws+# - NEXT_PUBLIC_AGPT_MARKETPLACE_URL=http://localhost:8015/api/v1/market+# ports:+# - "3000:3000"+# networks:+# - app-network+networks:app-network:driver: bridgediff --git a/rnd/supabase b/rnd/supabasenew file mode 160000index 0000000000..5e4e7d521b--- /dev/null+++ b/rnd/supabase@@ -0,0 +1 @@+Subproject commit 5e4e7d521b4cec05a5cde83f51348a0e5f68e6a9