Skip to content

Commit 30db725

Browse files
committed
rename flag to DEBUG_USE_SEED_DATA default False, update compose config
1 parent b66d05b commit 30db725

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

ansible/dev.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
env:
5252
POSTGRES_HOST: oasst-postgres
5353
DEBUG_ALLOW_ANY_API_KEY: "true"
54+
DEBUG_USE_SEED_DATA: "true"
5455
MAX_WORKERS: "1"
5556
ports:
5657
- 8080:8080

backend/main.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def alembic_upgrade():
6363
logger.exception("Alembic upgrade failed on startup")
6464

6565

66-
if settings.USE_SEED_DATA:
66+
if settings.DEBUG_USE_SEED_DATA:
6767

6868
@app.on_event("startup")
6969
def seed_data():
@@ -96,6 +96,13 @@ class DummyPost(pydantic.BaseModel):
9696
text="Hello! How can I help you?",
9797
role="assistant",
9898
),
99+
DummyPost(
100+
task_post_id="2e4e1e6",
101+
user_post_id="c886920",
102+
parent_post_id="6f1d0711",
103+
text="Hey buddy! How can I serve you?",
104+
role="assistant",
105+
),
99106
DummyPost(
100107
task_post_id="970c437d",
101108
user_post_id="cec432cf",
@@ -110,6 +117,13 @@ class DummyPost(pydantic.BaseModel):
110117
text="Sorry, I did not understand your request and it is unclear to me what you want me to do. Could you describe it in a different way?",
111118
role="assistant",
112119
),
120+
DummyPost(
121+
task_post_id="ba87780d",
122+
user_post_id="0e276b98",
123+
parent_post_id="cec432cf",
124+
text="I'm unsure how to interpret this. Is it a riddle?",
125+
role="assistant",
126+
),
113127
]
114128

115129
for p in dummy_posts:

backend/oasst_backend/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Settings(BaseSettings):
1717

1818
DEBUG_ALLOW_ANY_API_KEY: bool = False
1919
DEBUG_SKIP_API_KEY_CHECK: bool = False
20+
DEBUG_USE_SEED_DATA: bool = False
2021

2122
@validator("DATABASE_URI", pre=True)
2223
def assemble_db_connection(cls, v: Optional[str], values: Dict[str, Any]) -> Any:
@@ -33,7 +34,6 @@ def assemble_db_connection(cls, v: Optional[str], values: Dict[str, Any]) -> Any
3334

3435
BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = []
3536
UPDATE_ALEMBIC: bool = True
36-
USE_SEED_DATA: bool = True
3737

3838
@validator("BACKEND_CORS_ORIGINS", pre=True)
3939
def assemble_cors_origins(cls, v: Union[str, List[str]]) -> Union[List[str], str]:

docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ services:
7171
environment:
7272
- POSTGRES_HOST=db
7373
- DEBUG_SKIP_API_KEY_CHECK=True
74+
- DEBUG_USE_SEED_DATA=True
7475
- MAX_WORKERS=1
7576
depends_on:
7677
db:

0 commit comments

Comments
 (0)