cohere-ai / cohere-toolkit

Cohere Toolkit is a collection of prebuilt components enabling users to quickly build and deploy RAG applications.
MIT License
2.8k stars 363 forks source link

Terrarium image platform prevents running on OSX M1 #800

Open skindc opened 2 weeks ago

skindc commented 2 weeks ago

What is the issue?

After installing pipx and poetry and seeting up the tavily account the command make first-run seemed to be running well. Yet after downloading all of the docker images required and building those necessary the process got stuck attempting to complete the stack startup due to Terrarium's image not matching the host.

✔ Container cohere-toolkit-frontend-1                                                                                                                      Started                                                                      6.9s
 ✔ Container cohere-toolkit-test_db-1                                                                                                                       Started                                                                      6.9s
 ✔ Container cohere-toolkit-terrarium-1                                                                                                                     Started                                                                      6.9s
 ✔ Container cohere-toolkit-db-1                                                                                                                            Running                                                                      0.0s
 ✔ Container cohere-toolkit-redis-1                                                                                                                         Running                                                                      0.0s
 ✔ Container cohere-toolkit-backend-1                                                                                                                       Started                                                                      6.8s
 ! terrarium The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Is there a workaround for this?

Additional information

No response

malexw commented 2 weeks ago

What tool are you using to run containers on your machine? Docker Desktop includes a virtualization layer that translates the x86 instructions to ARM, so while it's not ideal, everything should still work despite the warning. I'm also currently running on an M1 Mac and it's working for me.

skindc commented 2 weeks ago

Hi @malexw. Thank you for your response. First I would like to apologise for not disclosing the information about my Docker installation in my initial post, that was an oversight on my part. I am also using Docker Desktop and I understand that this has a virtualisation layer as I have dealt with cross platform images a lot in the past with various deployments so this problem was unexpected.

Suspecting that the actual initial make command did complete successfully I attempted to run both make migrate and make dev. make migrate seemed to complete. Yet as suspected, make dev failed for the same reason.

[+] Running 0/1
 ⠧ terrarium Pulling                                                                                                                                                                                                                     1.7s
image with reference ghcr.io/cohere-ai/terrarium:latest was found but does not match the specified platform: wanted linux/arm64/v8, actual: linux/amd64
make[1]: *** [up] Error 18
make[1]: *** Waiting for unfinished jobs....

Considering that the message is suggesting that it could not find the correct image to pull, and not that docker could not run the image I added an explicit instruction to the docker compose file to pull the arm64 image expecting that then the Docker Desktop virtualisation layer would handle it.

...
terrarium:
    image: ghcr.io/cohere-ai/terrarium:latest
    platform: linux/amd64 //Added this
...

This seemed to worked as expected as I know see this:

✔ Container cohere-toolkit-test_db-1    Running                                                                                                                                                                                         0.0s
 ✔ Container cohere-toolkit-redis-1      Running                                                                                                                                                                                         0.0s
 ✔ Container cohere-toolkit-db-1         Running                                                                                                                                                                                         0.0s
 ✔ Container cohere-toolkit-terrarium-1  Started                                                                                                                                                                                         1.1s
 ✔ Container cohere-toolkit-backend-1    Started                                                                                                                                                                                         1.1s
 ✔ Container cohere-toolkit-frontend-1   Started

I will keep investigating my end why docker would not consider the amd64 image as a suitable image to pull if the arm64 image does not exist and why I had to be explicit in the Docker compose file.

Yet this maybe a helpful workaround if anyone else is experiencing the same problem.

If you have any input that may assist in why this may occur it would be very well recieved.

Thanks again.

skindc commented 2 weeks ago

Thanks @unfixa1. I will take a look.