Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Armv7 docker image #2427

Closed
wants to merge 3 commits into from
Closed

Fix Armv7 docker image #2427

wants to merge 3 commits into from

Conversation

foxfire52
Copy link
Contributor

#2349 @hlohaus

Current armv7 image fails build of critical components. My image should work.

You can test a local build on ubuntu x64 with these commands from gpt4free folder

#qemu setup
docker run --privileged --rm tonistiigi/binfmt --install all

docker buildx build --platform linux/arm/v7 . -f docker/Dockerfile-slim 2>&1 | tee docker_build.log

Check the log file for ERRORs.

I removed duckduckgo-search because primp can't compile. If rust is installed it fails building boring-sys. These bugs could be related link1 link2. I recommend waiting for the PR.

If you want to test the boring-sys bug add these lines at line 50 and build again.

USER root
RUN apt install -qqy curl

USER $G4F_USER_ID
ENV PATH "${HOME}/.local/bin:${HOME}/.cargo/bin:${PATH}"
RUN curl https://sh.rustup.rs/ -sSf | bash -s -- -y
RUN pip install primp duckduckgo-search>=5.0

@hlohaus
Copy link
Collaborator

hlohaus commented Nov 26, 2024

I added a Dockerfile-armv7 in my pull request. I think that is better.

@foxfire52
Copy link
Contributor Author

foxfire52 commented Nov 26, 2024

Instead of splitting the Dockerfile we could do something like

ARG TARGETPLATFORM
...
RUN if [ "$TARGETPLATFORM" != "linux/arm/v7" ]; then \
    pip install --no-cache-dir duckduckgo-search>=5.0
...

I haven't tested your file yet, does it compile duckduckgo-search correctly? We don't need to install rust on amd64, right?

@hlohaus
Copy link
Collaborator

hlohaus commented Nov 26, 2024

We don’t need any build tools for amd64/arm64. It’s better to avoid installing unnecessary tools, as that eliminates the need to uninstall them later.

For web search functionality, the GUI only requires DuckDuckGo Search. The API, however, does not depend on it.

@foxfire52
Copy link
Contributor Author

foxfire52 commented Nov 26, 2024

We don’t need any build tools for amd64/arm64. It’s better to avoid installing unnecessary tools, as that eliminates the need to uninstall them later.

Good

For web search functionality, the GUI only requires DuckDuckGo Search. The API, however, does not depend on it.

Understood. My only concern was avoiding Dockerfile duplication, but a different Dockerfile might be better.

@hlohaus
Copy link
Collaborator

hlohaus commented Nov 26, 2024

Hello @foxfire52,

The build process is complete. However, the Pillow package is missing. This may prevent you from uploading images, but all other functions should work as expected.

Please let me know if you have any questions or concerns.

@deedy5
Copy link

deedy5 commented Nov 26, 2024

duckduckgo_search v6.3.7 is compatible with armv7

@hlohaus
Copy link
Collaborator

hlohaus commented Nov 26, 2024

I added duckduckgo_search again.

@hlohaus hlohaus closed this Nov 26, 2024
@foxfire52
Copy link
Contributor Author

@deedy5 Thank you for adding primp armv7 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants