Skip to content

Commit fe93087

Browse files
fix: added option to specify platform for db in compose (LAION-AI#2725)
related to issue LAION-AI#2721 enables specifying platform for service `db` using environment variable `DB_PLATFORM`. If left unspecified (silently) defaults to current behaviour. this solves the issue where M1 users where unable to use docker-compose as the `db` service relies on `ghcr.io/laion-ai/open-assistant/oasst-postgres` (which does not support `linux/arm64/v8` as plaform). sadly (afaik) docker-compose does not offer something akin to `docker --platform` you have to set it in the compose-file.
1 parent 801c87d commit fe93087

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ if you have problems):
8383
docker compose --profile ci up --build --attach-dependencies
8484
```
8585

86+
> **Note:** when running on MacOS with an M1 chip you have to use:
87+
> `DB_PLATFORM=linux/x86_64 docker compose ...`
88+
8689
Then, navigate to `http://localhost:3000` (It may take some time to boot up) and
8790
interact with the website.
8891

backend/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ database at `localhost:5432`. (See
1111
[FAQ](https://projects.laion.ai/Open-Assistant/docs/faq#enable-dockers-buildkit-backend)
1212
if you face any docker problems).
1313

14+
> **Note:** when running on MacOS with an M1 chip you have to use:
15+
> `DB_PLATFORM=linux/x86_64 docker compose ...`
16+
1417
Python 3.10 is required. It is recommended to use `pyenv` which will recognise
1518
the `.python-version` in the project root directory.
1619

docker-compose.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ services:
99

1010
# This DB is for the FastAPI Backend.
1111
db:
12+
platform: "${DB_PLATFORM:-}"
1213
image: ghcr.io/laion-ai/open-assistant/oasst-postgres
1314
pull_policy: always
1415
restart: always

scripts/backend-development/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ In root directory, run
55
a database. The default settings are already configured to connect to the
66
database at `localhost:5432`.
77

8+
> **Note:** when running on MacOS with an M1 chip you have to use:
9+
> `DB_PLATFORM=linux/x86_64 docker compose ...`
10+
811
Make sure you have all requirements installed. You can do this by running
912
`pip install -r requirements.txt` inside the `backend` folder,
1013
`pip install -e .` inside the `oasst-shared` folder and `pip install -e .`

website/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ If you're doing active development we suggest the following workflow:
5454
1. Run `npm run dev`. Now the website is up and running locally at `http://localhost:3000`.
5555
1. To create an account, login via the user using email authentication and navigate to `http://localhost:1080`. Check
5656
the email listed and click the log in link. You're now logged in and authenticated.
57+
> **Note:** when running on MacOS with an M1 chip you have to use: `DB_PLATFORM=linux/x86_64 docker compose ...`
5758
5859
### Using debug user credentials
5960

0 commit comments

Comments
 (0)