Skip to content

Commit

Permalink
postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmoffet committed Sep 22, 2024
1 parent caa9712 commit 5f531ba
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
7 changes: 3 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# TODOs

- Integrate cloud SSO
- Use postgres for db
- Build step during CI.
- Consider checking for state and code in front-end auth route and then redirecting to /auth (and clearing params) on any auth failures. This will allow us to avoid flashing the sign in screen before showing "signing into ai sandbox..."
- Workspace > documents needs a spinner when processing docs
- existing tags should be selectable when adding to docs
- Chroma is kept in ram... need to swap for redis
- Save and retrieve valves.json data from env instead of json
- Remove pipeline add from admin settings > pipelines
- Investigation RAG set up
11 changes: 9 additions & 2 deletions backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def __getattr__(self, key):
"cloud-gov-identity-provider"
][0]["credentials"]["client_secret"]


OAUTH2_PROVIDERS = {
# Example provider configuration
"github": {
Expand Down Expand Up @@ -1169,5 +1170,11 @@ class BannerModel(BaseModel):
####################################
# Database
####################################

DATABASE_URL = os.environ.get("DATABASE_URL", f"sqlite:///{DATA_DIR}/webui.db")
if os.environ.get("VCAP_SERVICES"):
vcap_services = json.loads(os.getenv("VCAP_SERVICES"))
if (vcap_services and "aws-rds" in vcap_services) and not os.getenv(
"DATABASE_URL", None
):
os.environ["DATABASE_URL"] = vcap_services["aws-rds"][0]["credentials"]["uri"]
else:
DATABASE_URL = os.environ.get("DATABASE_URL", f"sqlite:///{DATA_DIR}/webui.db")
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.1'

services:
db:
image: postgres:latest
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ai_sandbox
ports:
- "5432:5432"

0 comments on commit 5f531ba

Please sign in to comment.