Skip to content

Commit

Permalink
TF, sequencing
Browse files Browse the repository at this point in the history
1. Updates terraform with correct APIs.
2. Removes more schemas
3. Aligns compose with our changes
  • Loading branch information
jadudm committed Oct 29, 2024
1 parent 9b361e9 commit bdbbe31
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 26 deletions.
3 changes: 3 additions & 0 deletions backend/dissemination/sql/fac-snapshot-db/pre/060_schemas.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ DROP SCHEMA IF EXISTS api_v2_0_0_functions CASCADE;
-------------
DROP SCHEMA IF EXISTS dissem_copy CASCADE;
DROP SCHEMA IF EXISTS public_data_v1_0_0 CASCADE;
DROP SCHEMA IF EXISTS public_data_v1_0_0_functions CASCADE;
DROP SCHEMA IF EXISTS suppressed_data_v1_0_0 CASCADE;
DROP SCHEMA IF EXISTS suppressed_data_v1_0_0_functions CASCADE;

---------------------------------
-- CREATE
Expand All @@ -41,6 +43,7 @@ CREATE SCHEMA IF NOT EXISTS api_v1_1_0_functions;
CREATE SCHEMA IF NOT EXISTS public_data_v1_0_0;
CREATE SCHEMA IF NOT EXISTS public_data_v1_0_0_functions;
CREATE SCHEMA IF NOT EXISTS suppressed_data_v1_0_0;
CREATE SCHEMA IF NOT EXISTS suppressed_data_v1_0_0_functions;
CREATE SCHEMA IF NOT EXISTS dissem_copy;

CREATE SCHEMA IF NOT EXISTS api_v2_0_0;
Expand Down
13 changes: 2 additions & 11 deletions backend/docker-compose-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ services:
interval: 10s
timeout: 5s
retries: 10

historic-data:
image: ghcr.io/gsa-tts/fac-historic-public-csvs/load-historic-public-data:20230912
depends_on:
db:
condition: service_healthy
environment:
DATABASE_URL: postgres://postgres@db/postgres

web:
image: ghcr.io/gsa-tts/fac/web-container:latest
Expand Down Expand Up @@ -94,12 +86,11 @@ services:
expose:
- "3000"
environment:
PGRST_DB_URI: postgres://postgres@db:5432/postgres
PGRST2_DB_URI: postgres://postgres@db:5431/postgres
PGRST_DB_URI: postgres://postgres@db2:5432/postgres
PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:3000
PGRST_DB_ANON_ROLE: anon
# See https://postgrest.org/en/stable/references/api/schemas.html#multiple-schemas for multiple schemas
PGRST_DB_SCHEMAS: "api_v1_0_3, api_v1_1_0, admin_api_v1_1_0"
PGRST_DB_SCHEMAS: "api_v1_1_0,api_v2_0_0"
PGRST_JWT_SECRET: ${PGRST_JWT_SECRET:-32_chars_fallback_secret_testing} # Fallback value for testing environments
depends_on:
db:
Expand Down
15 changes: 1 addition & 14 deletions backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ services:
timeout: 5s
retries: 10

#---------------------------------------------
# Historic data
#---------------------------------------------
# historic-data:
# image: ghcr.io/gsa-tts/fac-historic-public-csvs/load-historic-public-data:20230912
# depends_on:
# db:
# condition: service_healthy
# environment:
# DATABASE_URL: postgres://postgres@db/postgres

#---------------------------------------------
# Django app
#---------------------------------------------
Expand Down Expand Up @@ -142,13 +131,11 @@ services:
expose:
- "3000"
environment:
# This now requires us to `sling` data to db2 for local API testing.
PGRST_DB_URI: postgres://postgres@db2:5432/postgres
# PGRST2_DB_URI: postgres://postgres@db:5431/postgres
PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:3000
PGRST_DB_ANON_ROLE: anon
# See https://postgrest.org/en/stable/references/api/schemas.html#multiple-schemas for multiple schemas
PGRST_DB_SCHEMAS: "api_v1_0_3,api_v1_1_0,admin_api_v1_1_0,api_v2_0_0"
PGRST_DB_SCHEMAS: "api_v1_1_0,api_v2_0_0"
PGRST_JWT_SECRET: ${PGRST_JWT_SECRET:-32_chars_fallback_secret_testing} # Fallback value for testing environments
# Enable this to inspect the DB plans for queries via EXPLAIN
PGRST_DB_PLAN_ENABLED: 1
Expand Down
2 changes: 1 addition & 1 deletion terraform/shared/modules/env/postgrest.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resource "cloudfoundry_app" "postgrest" {

environment = {
PGRST_DB_URI : cloudfoundry_service_key.postgrest.credentials.uri
PGRST_DB_SCHEMAS : "api_v1_0_3,api_v1_1_0,admin_api_v1_1_0,api_v2_0_0"
PGRST_DB_SCHEMAS : "api_v1_1_0,api_v2_0_0"
PGRST_DB_ANON_ROLE : "anon"
PGRST_JWT_SECRET : var.pgrst_jwt_secret
PGRST_DB_MAX_ROWS : 20000
Expand Down

0 comments on commit bdbbe31

Please sign in to comment.