kotaemon icon indicating copy to clipboard operation
kotaemon copied to clipboard

Add linux/arm to docker-build workflow

Open RicardoMonteiroSimoes opened this issue 1 year ago • 2 comments

Now each release also builds and pushes an ARM version of the dockerfile

Description

  • Added linux/arm to the platform matrix of the Docker image build process
  • Tested it locally on my MacBook M1 with docker build --platform linux/arm64 -t taprosoft/kotaemon:arm64 .
  • Ran the built image using
docker run \
-e GRADIO_SERVER_NAME=0.0.0.0 \
-e GRADIO_SERVER_PORT=7860 \
-p 7860:7860 -it --rm \
taprosoft/kotaemon:arm64
  • I did not verify any RAG functionality

This PR is potentially, partially in conflict with the following one (https://github.com/Cinnamon/kotaemon/pull/219), due to the rust dependency being added there as well, and here.

Type of change

  • [x] New features (non-breaking change).
  • [ ] Bug fix (non-breaking change).
  • [ ] Breaking change (fix or feature that would cause existing functionality not to work as expected).

Checklist

  • [x] I have performed a self-review of my code.
  • [ ] I have added thorough tests if it is a core feature.
  • [ ] There is a reference to the original bug report and related work.
  • [ ] I have commented on my code, particularly in hard-to-understand areas.
  • [ ] The feature is well documented.

RicardoMonteiroSimoes avatar Sep 05 '24 15:09 RicardoMonteiroSimoes

When I run this on my M1 Macbook Pro running MacOS 14.6.1, it succeeds, but I don't think it's working correctly (see attachment). Screenshot 2024-09-05 at 11 07 32 AM Screenshot 2024-09-05 at 11 07 16 AM

slimandslam avatar Sep 05 '24 16:09 slimandslam

That's interesting. I will have to check out the logs tomorrow, to see for myself. Were you able to collect any additional information? Also, the question is how this behaves on other things like a RPi, which I'm not quite able to test.

RicardoMonteiroSimoes avatar Sep 05 '24 22:09 RicardoMonteiroSimoes

so from what I can see there is some problem with a library

2024-09-11 11:02:33 pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'starlette.requests.Request'>. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
2024-09-11 11:02:33 
2024-09-11 11:02:33 If you got this error by calling handler(<some type>) within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema(<some type>)` since we do not call `__get_pydantic_core_schema__` on `<some type>` otherwise to avoid infinite recursion.
2024-09-11 11:02:33 

Will further check

RicardoMonteiroSimoes avatar Sep 11 '24 09:09 RicardoMonteiroSimoes

@slimandslam I updated my branch, it appears to be fine now, my tests pass. Can you also verify? @taprosoft sorry for the ping, do you know who I can notify to get a review here?

RicardoMonteiroSimoes avatar Sep 11 '24 09:09 RicardoMonteiroSimoes

Sorry for the delay. You can tag me or @phv2312. Please fix some CI errors. Also, there is another related PR, can you support to check https://github.com/Cinnamon/kotaemon/pull/274 @RicardoMonteiroSimoes? Thanks.

taprosoft avatar Sep 11 '24 13:09 taprosoft

So, this should now have a correct title and correct commit messages.

RicardoMonteiroSimoes avatar Sep 11 '24 14:09 RicardoMonteiroSimoes

@taprosoft just gona tag you again; this should be fine now. Let me know if this should remain open, or if it's more or less obsolete. As it stands, the code here can be merged and it should run out of the box.

RicardoMonteiroSimoes avatar Sep 12 '24 11:09 RicardoMonteiroSimoes

@RicardoMonteiroSimoes thanks for your great efforts. We has included it in another PRs https://github.com/Cinnamon/kotaemon/pull/274 which is closed. Please try our prebuilt ARM64 image as mentioned in the README. Thanks again!

taprosoft avatar Sep 12 '24 14:09 taprosoft