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

refactor: remove supabase, add postgres, fix tests #3807

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
node-version: [16.x, 18.x]
env:
# Whichever Docker containers are needed to pass e2e tests, define them here
DOCKER_CONTAINERS: 'sso feed-discovery auth login kong rest meta elasticsearch redis posts traefik'
DOCKER_CONTAINERS: 'sso feed-discovery login elasticsearch redis posts traefik'
# Postgres database connection string to run db migration
DATABASE_URL: 'postgresql://postgres:your-super-secret-and-long-postgres-password@localhost/postgres'

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ certs/
# Redis data storage
redis-data/

# Postgres
db

.pnpm-debug.log

# Turborepo
Expand Down
6 changes: 3 additions & 3 deletions config/env.development
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DOCKER_BUILDKIT=1
# so it will work on Windows and Unix, see
# https://docs.docker.com/compose/reference/envvars/#compose_file
COMPOSE_PATH_SEPARATOR=;
COMPOSE_FILE=docker/docker-compose.yml;docker/development.yml;docker/supabase/docker-compose.yml;docker/supabase/supabase-development.yml
COMPOSE_FILE=docker/docker-compose.yml;docker/development.yml


# The host where the Telescope 1.0 front-end and back-end are run.
Expand Down Expand Up @@ -262,7 +262,7 @@ MAX_POSTS_PER_PAGE=5
# Supabase Services
################################################################################

SUPABASE_URL=http://localhost/v1/supabase
SUPABASE_URL=postgresql://postgres:your-super-secret-and-long-postgres-password@db/postgres


# Auth
Expand Down Expand Up @@ -303,4 +303,4 @@ KONG_HTTPS_PORT=8912
POSTGRES_PORT=8913

## DB connection string
DATABASE_URL=postgresql://postgres:your-super-secret-and-long-postgres-password@localhost/postgres
DATABASE_URL=postgresql://postgres:your-super-secret-and-long-postgres-password@db/postgres
2 changes: 1 addition & 1 deletion config/env.production
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DOCKER_BUILDKIT=1
# so it will work on Windows and Unix, see
# https://docs.docker.com/compose/reference/envvars/#compose_file
COMPOSE_PATH_SEPARATOR=;
COMPOSE_FILE=docker/docker-compose.yml;docker/production.yml;docker/supabase/docker-compose.yml;docker/supabase/supabase-production.yml
COMPOSE_FILE=docker/docker-compose.yml;docker/production.yml


# The host where the Telescope 1.0 front-end and back-end are run.
Expand Down
2 changes: 1 addition & 1 deletion config/env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DOCKER_BUILDKIT=1
# so it will work on Windows and Unix, see
# https://docs.docker.com/compose/reference/envvars/#compose_file
COMPOSE_PATH_SEPARATOR=;
COMPOSE_FILE=docker/docker-compose.yml;docker/production.yml;docker/supabase/docker-compose.yml;docker/supabase/supabase-production.yml
COMPOSE_FILE=docker/docker-compose.yml;docker/production.yml


# The host where the Telescope 1.0 front-end and back-end are run.
Expand Down
14 changes: 6 additions & 8 deletions docker/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ services:
context: ../src/api/parser
cache_from:
- docker.cdot.systems/parser:buildcache
environment:
# In development and testing, the Parser service needs to contact the Supabase
# service directly via Docker vs through the http://localhost/v1/supabase domain.
- SUPABASE_URL=http://kong:8000
depends_on:
- elasticsearch
- traefik
Expand Down Expand Up @@ -108,10 +104,6 @@ services:
context: ../src/api/sso
cache_from:
- docker.cdot.systems/sso:buildcache
environment:
# In development and testing, the SSO service needs to contact the Supabase
# service directly via Docker vs through the http://localhost/v1/supabase domain.
- SUPABASE_URL=http://kong:8000
depends_on:
- test-web-content
- traefik
Expand Down Expand Up @@ -140,3 +132,9 @@ services:
context: ../src/api/dependency-discovery
cache_from:
- docker.cdot.systems/dependency-discovery:buildcache

db:
ports:
- '5432:5432'
volumes:
- ../db:/var/lib/postgresql/data
7 changes: 7 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,10 @@ services:
- 'traefik.http.middlewares.rss_bridge_prefix.stripprefix.prefixes=/${API_VERSION}/rss-bridge'
# Add our middleware to the router
- 'traefik.http.routers.rss_bridge.middlewares=rss_bridge_redirect,rss_bridge_prefix'

db:
image: postgres:15-alpine
container_name: 'db'
restart: unless-stopped
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
5 changes: 5 additions & 0 deletions docker/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,8 @@ services:
]
depends_on:
- studio

db:
volumes:
# We keep the actual data in a volume outside of git, so it survives restarts
- ../../supabase/volumes/db/data:/var/lib/postgresql/data
5 changes: 0 additions & 5 deletions docker/supabase/.gitignore

This file was deleted.

13 changes: 0 additions & 13 deletions docker/supabase/backup/Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions docker/supabase/backup/cron-tasks/create-backup

This file was deleted.

27 changes: 0 additions & 27 deletions docker/supabase/backup/restore-backup.sh

This file was deleted.

48 changes: 0 additions & 48 deletions docker/supabase/dev/data.sql

This file was deleted.

20 changes: 0 additions & 20 deletions docker/supabase/dev/docker-compose.dev.yml

This file was deleted.

Loading