Skip to content

Commit

Permalink
chore: fix tests and param for db name
Browse files Browse the repository at this point in the history
  • Loading branch information
v-rocheleau committed Jan 16, 2025
1 parent 5c92d69 commit 58e536d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dev_db_password.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
very_secret_password_for_pg_db
tds_password
1 change: 1 addition & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
- DB_HOST=tds-db
- DB_PORT=5432
- DB_USER=tds_user
- DB_NAME=tds_db
- DB_PASSWORD=tds_password
- CORS_ORIGINS="*"
- BENTO_AUTHZ_SERVICE_URL=""
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.secrets.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ services:
- DB_HOST=tds-db
- DB_PORT=5432
- DB_USER=tds_user
- DB_PASSWORD_FILE=/run/secrets/db_password
- DB_NAME=tds_db
- DB_PASSWORD_FILE=/run/secrets/db_password # DOCKER SECRET
- CORS_ORIGINS="*"
- BENTO_AUTHZ_SERVICE_URL=""
secrets:
Expand All @@ -29,7 +30,7 @@ services:
environment:
- POSTGRES_USER=tds_user
- POSTGRES_DB=tds_db
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password # DOCKER SECRET
secrets:
- db_password
expose:
Expand Down
7 changes: 6 additions & 1 deletion docker-compose.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ services:
- tds-db
environment:
- BENTO_UID=${UID}
- DATABASE_URI=postgres://tds_user:tds_password@tds-db:5432/tds_db
# - DATABASE_URI=postgres://tds_user:tds_password@tds-db:5432/tds_db
- DB_HOST=tds-db
- DB_PORT=5432
- DB_USER=tds_user
- DB_NAME=tds_db
- DB_PASSWORD=tds_password
- CORS_ORIGINS="*"
- BENTO_AUTHZ_SERVICE_URL=""
volumes:
Expand Down
6 changes: 5 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ services:
depends_on:
- tds-db
environment:
- DATABASE_URI=postgres://tds_user:tds_password@tds-db:5432/tds_db
- DB_HOST=tds-db
- DB_PORT=5432
- DB_USER=tds_user
- DB_NAME=tds_db
- DB_PASSWORD=tds_password
- CORS_ORIGINS="*"
- BENTO_AUTHZ_SERVICE_URL=""
volumes:
Expand Down
1 change: 1 addition & 0 deletions transcriptomics_data_service/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Config(BentoFastAPIBaseConfig):
db_host: str = "tds-db"
db_port: int = 5432
db_user: str = "tds_user"
db_name: str = "tds"
db_password: str # Populated from secrets OR env variable

# Allow extra configs from /tds/lib/.env for custom authz configuration
Expand Down
2 changes: 1 addition & 1 deletion transcriptomics_data_service/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


def get_db_uri(config: Config) -> str:
return f"postgres://{config.db_user}:{config.db_password}@{config.db_host}:{config.db_port}/{config.db_port}"
return f"postgres://{config.db_user}:{config.db_password}@{config.db_host}:{config.db_port}/{config.db_name}"


class Database(PgAsyncDatabase):
Expand Down

0 comments on commit 58e536d

Please sign in to comment.