defenseunicorns / leapfrogai

Production-ready Generative AI for local, cloud native, airgap, and edge deployments.
https://leapfrog.ai
Apache License 2.0
251 stars 28 forks source link

chore: Add support to build on Mac silicon #491

Closed alekst23 closed 1 month ago

alekst23 commented 4 months ago

Issue

Currently the project cannot be built on Mac silicon. The problem displays itself as missing dependency files during the build process.

Analysis

The issue happens because the build process builds all dependency wheels on the local machine, which builds wheels for the host system architecture.

Example:

0.689 INFO: pip is looking at multiple versions of leapfrogai-api to determine which version is compatible with other requirements. This could take a while.
0.690 ERROR: Could not find a version that satisfies the requirement watchfiles>=0.21.0 (from leapfrogai-api) (from versions: none)
0.690 ERROR: No matching distribution found for watchfiles>=0.21.0

Solution

The solution involves adjusting our build process to build specifically for the linux Docker containers. The way to do this is by moving all wheel creation functions to inside the docker container setup, into the Dockerfiles for each package and out of the Makefile.

justinthelaw commented 3 months ago

@vanakema is working on this issue's branch now. We will likely need to transfer changes/findings to my machine and contribute directly to the branch as forking/committing is prohibitive (GH actions don't have access to all the right secrets and repositories) for non-maintainers.

vanakema commented 1 month ago

Completed in #659 and released in #712