Skip to content

Commit

Permalink
add test compose override
Browse files Browse the repository at this point in the history
  • Loading branch information
vbarda committed Jul 29, 2024
1 parent d249a26 commit 0819c05
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Start the service
run: |
echo "OPENAI_API_KEY=placeholder" >> ../.env
poetry run langgraph up -c ../langgraph.json -d ../compose.override.yml --postgres-uri 'postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable' --verbose --wait
poetry run langgraph up -c ../langgraph.json -d ../compose.override.test.yml --postgres-uri 'postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable' --verbose --wait
- name: Run tests
env:
POSTGRES_HOST: localhost
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

start:
cd backend && poetry run langgraph up -c ../langgraph.json -d ../compose.override.yml --postgres-uri 'postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable' --verbose

start-test:
cd backend && poetry run langgraph up -c ../langgraph.json -d ../compose.override.test.yml --postgres-uri 'postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable' --verbose
39 changes: 39 additions & 0 deletions compose.override.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
volumes:
langgraph-data:
driver: local
services:
langgraph-postgres:
image: pgvector/pgvector:pg16
restart: on-failure
ports:
- "5433:5432"
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- langgraph-data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U postgres
start_period: 10s
timeout: 1s
retries: 5
backend:
container_name: opengpts-backend
pull_policy: build
build:
context: backend
ports:
- "8100:8000" # Backend is accessible on localhost:8100
depends_on:
langgraph-postgres:
condition: service_healthy
env_file:
- .env
volumes:
- ./backend:/backend
environment:
POSTGRES_URI: "postgresql+psycopg2://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable"
LANGGRAPH_URL: "http://langgraph-api:8000"
command:
- --reload
3 changes: 0 additions & 3 deletions compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ volumes:
langgraph-data:
driver: local
services:
langgraph-api:
environment:
PGVECTOR_URI: "postgresql+psycopg2://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable"
langgraph-postgres:
image: pgvector/pgvector:pg16
restart: on-failure
Expand Down

0 comments on commit 0819c05

Please sign in to comment.