Skip to content

Commit be07b9e

Browse files
fix: update env of studio backend (#1163)
1 parent 0195868 commit be07b9e

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

.github/workflows/sdk-tests.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ jobs:
142142
ports:
143143
- "8000:8000"
144144
env:
145-
DATABASE_URL: "postgres:5432"
145+
POSTGRES_HOST: "postgres"
146+
POSTGRES_PORT: "5432"
146147
POSTGRES_DB: "il_sdk"
147148
POSTGRES_USER: "il_sdk"
148149
POSTGRES_PASSWORD: "test"
@@ -189,7 +190,8 @@ jobs:
189190
ARGILLA_API_KEY: "argilla.apikey"
190191
CLIENT_URL: ${{ secrets.CLIENT_URL }}
191192
STUDIO_URL: "http://localhost:8000/"
192-
POSTGRES_HOST: "localhost:5433"
193+
POSTGRES_HOST: "localhost"
194+
POSTGRES_PORT: "5433"
193195
POSTGRES_DB: "il_sdk"
194196
POSTGRES_USER: "il_sdk"
195197
POSTGRES_PASSWORD: "test"
@@ -228,7 +230,8 @@ jobs:
228230
ports:
229231
- "8001:8000"
230232
env:
231-
DATABASE_URL: "postgres:5432"
233+
POSTGRES_HOST: "postgres"
234+
POSTGRES_PORT: "5432"
232235
POSTGRES_DB: "il_sdk"
233236
POSTGRES_USER: "il_sdk"
234237
POSTGRES_PASSWORD: "test"

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
...
1818

1919
### Breaking Changes
20-
...
20+
- The env variable `POSTGRES_HOST` is split into `POSTGRES_HOST` and `POSTGRES_PORT`. This affects all classes interacting with Studio and the `InstructionFinetuningDataRepository`.
2121

2222
## 8.0.0
2323

docker-compose.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@ services:
7070
restart: true
7171
env_file: ".env" # mainly for AA-TOKEN, DB User/PW
7272
environment:
73-
DATABASE_URL: postgres:5432
73+
POSTGRES_HOST: postgres
7474
AUTHORIZATION_SERVICE_URL: "none"
7575
API_SCHEDULER_URL: "https://api.aleph-alpha.com"
7676
postgres:
7777
image: postgres:15
7878
ports:
79-
- "5433:5432"
79+
- ${POSTGRES_PORT}:${POSTGRES_PORT}
8080
env_file: ".env"
81+
command: -p ${POSTGRES_PORT}

env.sample

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ TRACE_VIEWER_URL="http://localhost:3000"
77
STUDIO_URL="http://localhost:8000"
88

99
# DB Variables
10-
POSTGRES_HOST="localhost:5433"
10+
POSTGRES_HOST=localhost
11+
POSTGRES_PORT=5434
1112
POSTGRES_DB=il_sdk
1213
POSTGRES_USER=il_sdk
1314
POSTGRES_PASSWORD=test

tests/learning/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ def postgres_instruction_finetuning_data_repository() -> (
4747
db_user = os.getenv("POSTGRES_USER")
4848
db_pw = os.getenv("POSTGRES_PASSWORD")
4949
db_host = os.getenv("POSTGRES_HOST")
50+
db_port = os.getenv("POSTGRES_PORT")
51+
5052
db_name = os.getenv("POSTGRES_DB")
51-
db_url = f"postgresql://{db_user}:{db_pw}@{db_host}/{db_name}"
53+
db_url = f"postgresql://{db_user}:{db_pw}@{db_host}:{db_port}/{db_name}"
5254

5355
return PostgresInstructionFinetuningDataRepository(db_url)
5456

0 commit comments

Comments
 (0)