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: HEXA-1152 Install polars for Apple Chips #891

Conversation

YolanFery
Copy link
Contributor

When running the project on Apple Chip (M4), I get the following warning :

/usr/local/lib/python3.12/site-packages/polars/_cpu_check.py:258: RuntimeWarning: Missing required CPU features.

The following required CPU features were not detected:
    avx, avx2, fma, bmi1, bmi2, lzcnt, movbe
Continuing to use this version of Polars on this processor will likely result in a crash.
Install the `polars-lts-cpu` package instead of `polars` to run Polars with better compatibility.

Hint: If you are on an Apple ARM machine (e.g. M1) this is likely due to running Python under Rosetta.
It is recommended to install a native version of Python that does not run under Rosetta x86-64 emulation.

If you believe this warning to be a false positive, you can set the `POLARS_SKIP_CPU_CHECK` environment variable to bypass this check.

  warnings.warn(
/code/docker-entrypoint.sh: line 33:    19 Illegal instruction     python manage.py migrate

Changes

  • Conditionally install polars-lts-cpu

How/what to test

The project can be run on Apple Chips

@YolanFery YolanFery requested review from qgerome and nazarfil January 2, 2025 14:06
Copy link
Member

@qgerome qgerome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of passing a variable to the build, have you investigated the TARGETPLATFORM variable that should be passed ?

@YolanFery
Copy link
Contributor Author

Instead of passing a variable to the build, have you investigated the TARGETPLATFORM variable that should be passed ?

Indeed it's better to use built-in args, used the BUILDARCH to detect the developper platform

@YolanFery YolanFery requested a review from qgerome January 3, 2025 11:47
@qgerome
Copy link
Member

qgerome commented Jan 3, 2025

If we remove the platform: linux/amd64 line in the docker-compose.yaml do we still need this fix for openhexa-app ?

@qgerome qgerome marked this pull request as draft January 6, 2025 09:25
@YolanFery
Copy link
Contributor Author

Closing in favor of #894

@YolanFery YolanFery closed this Jan 13, 2025
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.

2 participants