kotaemon icon indicating copy to clipboard operation
kotaemon copied to clipboard

Unable to run in docker on ARM Mac

Open adeffur opened this issue 1 year ago • 21 comments

When using the following to run kotaemon in docker, the container exits. (Host is M2 Mac with Rosetta)

docker run --platform linux/amd64 -e GRADIO_SERVER_NAME=0.0.0.0 -e GRADIO_SERVER_PORT=7860 -p 7860:7860 -it taprosoft/kotaemon:v1.0

The following output is printed to the screen:

Warning: Cannot statically find a gradio demo called demo. Reload work may fail. Watching: '/app' '/app' [nltk_data] Downloading package punkt_tab to [nltk_data] /usr/local/lib/python3.10/site- [nltk_data] packages/llama_index/core/_static/nltk_cache... [nltk_data] Unzipping tokenizers/punkt_tab.zip.

Not sure what I'm missing.

adeffur avatar Aug 27 '24 14:08 adeffur

Same on my end

smshapiro85 avatar Aug 27 '24 14:08 smshapiro85

image

I tried to run it on my synology NAS with the same error, so it may not be related to ARM Mac only

smshapiro85 avatar Aug 27 '24 14:08 smshapiro85

Should be able to do this on Mac ARM. Let us work on this issue to check if is reproducible.

taprosoft avatar Aug 27 '24 15:08 taprosoft

same error here windows x64 using docker desktop

sturdan avatar Aug 27 '24 16:08 sturdan

Can you use docker logs to check out what might be the possible issue.

taprosoft avatar Aug 27 '24 23:08 taprosoft

I see this too on MacMini M2 Pro, OSX 14.6.1. Docker Desktop v4.33.0. Same error as others in this thread:

Warning: Cannot statically find a gradio demo called demo. Reload work may fail. Watching: '/app' '/app'

docker logs -f <container> shows the same error, no other messages. /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check passes all tests.

kintopp avatar Aug 28 '24 08:08 kintopp

same docker logs message on windows x64 and docker desktop (having an old CPU without AVX, x5650)

Warning: Cannot statically find a gradio demo called demo. Reload work may fail. Watching: '/app' '/app' [nltk_data] Downloading package punkt_tab to [nltk_data] /usr/local/lib/python3.10/site- [nltk_data] packages/llama_index/core/_static/nltk_cache... [nltk_data] Unzipping tokenizers/punkt_tab.zip.

sturdan avatar Aug 28 '24 08:08 sturdan

Same here on M3 Macbook Pro in Docker in Terminal as well as Docker Desktop (freshly installed). Never used Docker on this machine.

RobTranquillo avatar Aug 29 '24 13:08 RobTranquillo

Same results; M1 MacBook Pro + Orbstack 1.7.0

byronbowerman avatar Aug 29 '24 17:08 byronbowerman

Noted. Seem this a common issues. Please wait why we investigate this issue.

taprosoft avatar Aug 30 '24 03:08 taprosoft

would guess it is AVX relatead, all CPU's listed here missing it

sturdan avatar Aug 30 '24 11:08 sturdan

That's my output on a M2 MacBook:

$ docker run -e GRADIO_SERVER_NAME=0.0.0.0 -e GRADIO_SERVER_PORT=7860 -p 7860:7860 -it --rm taprosoft/kotaemon:v1.0

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Warning: Cannot statically find a gradio demo called demo. Reload work may fail.
Watching: '/app' '/app'

[nltk_data] Downloading package punkt_tab to
[nltk_data]     /usr/local/lib/python3.10/site-
[nltk_data]     packages/llama_index/core/_static/nltk_cache...
[nltk_data]   Unzipping tokenizers/punkt_tab.zip.

I managed to resolve the first warning by explicitly specifying the platform but the docker container still closes immediately and the website is not available:

$ docker run --platform linux/amd64  -e GRADIO_SERVER_NAME=0.0.0.0 -e GRADIO_SERVER_PORT=7860 -p 7860:7860 -it --rm taprosoft/kotaemon:v1.0


Warning: Cannot statically find a gradio demo called demo. Reload work may fail.
Watching: '/app' '/app'

[nltk_data] Downloading package punkt_tab to
[nltk_data]     /usr/local/lib/python3.10/site-
[nltk_data]     packages/llama_index/core/_static/nltk_cache...
[nltk_data]   Unzipping tokenizers/punkt_tab.zip.

jborbik avatar Aug 30 '24 13:08 jborbik

Same here. On MacOS apple silicon, i get the following error:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

when trying:

docker run -e GRADIO_SERVER_NAME=0.0.0.0 -e GRADIO_SERVER_PORT=7860 -p 7860:7860 -it --rm taprosoft/kotaemon:v1.0

Any ideas to fix it ad make it work?

complete output:

> docker run -e GRADIO_SERVER_NAME=0.0.0.0 -e GRADIO_SERVER_PORT=7860 -p 7860:7860 -it --rm taprosoft/kotaemon:v1.0
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Warning: Cannot statically find a gradio demo called demo. Reload work may fail.
Watching: '/app' '/app'

[nltk_data] Downloading package punkt_tab to
[nltk_data]     /usr/local/lib/python3.10/site-
[nltk_data]     packages/llama_index/core/_static/nltk_cache...
[nltk_data]   Unzipping tokenizers/punkt_tab.zip.

moreover:

docker: image with reference docker.io/taprosoft/kotaemon:v1.0 was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64.

pathros avatar Aug 31 '24 00:08 pathros

Same issues -- M1 MacBook Pro running MacOS Sonoma 14.6.1

slimandslam avatar Sep 01 '24 02:09 slimandslam

Same issue here on my M2 Max mac, MacOS 13.0 Ventura

MarcCG0 avatar Sep 01 '24 10:09 MarcCG0

FYI Used the same command on a Ryzen-based system running Win10, started as expected. So probably a CPU compatibility issue. Apparently macOS Sonoma will bring AVX support to Apple Silicon machines.

adeffur avatar Sep 01 '24 10:09 adeffur

Same issue. Cannot run on Mac M2 Max.

bookandlover avatar Sep 01 '24 13:09 bookandlover

FYI Used the same command on a Ryzen-based system running Win10, started as expected. So probably a CPU compatibility issue. Apparently macOS Sonoma will bring AVX support to Apple Silicon machines.

Correction: macOS Sequoia is bringing support for AVX2 (source) (currently available in the beta). Not sure which level is required for the kotaemon container to run. Also found no mention of AVX512 support in macOS Sequoia.

adeffur avatar Sep 02 '24 07:09 adeffur

Same issue. Cannot run on Mac M2 Ultra.

yby2003 avatar Sep 05 '24 01:09 yby2003

They added the github action to auto build docker images, I have a PR open to add ARM image support https://github.com/Cinnamon/kotaemon/pull/226

RicardoMonteiroSimoes avatar Sep 05 '24 15:09 RicardoMonteiroSimoes

Same for Synology NAS (Intel Celeron J4125, no AVX support)

trahloff avatar Sep 08 '24 14:09 trahloff

Resolved in the new version. Please check the latest docker full for amd64.

cin-niko avatar Sep 13 '24 08:09 cin-niko