Open Zozman opened 2 years ago
Got the following to build in linux/arm64
. Took 9000 seconds to install MindMeld but it worked:
FROM python:3.7.13
RUN pip install numpy~=1.15
RUN pip install mindmeld spacy
# Add English spacy model or else mindmeld will try to download it itself and fail
RUN python -m spacy download en_core_web_sm --default-timeout=1000
Going to see if I can put together a full example that builds.
Attempting to build a modified home_assistant container directly on an arm
system (a Raspberry Pi 3) is leading to this:
> [21/21] RUN export LC_ALL=C.UTF-8 && export LANG=C.UTF-8 && su mindmeld -c "ES_JAVA_OPTS='-Xms1g -Xmx1g' /usr/share/elasticsearch/bin/elasticsearch -d" && mindmeld num-parse --start && python3 -m home_assistant build:
#25 23.26 return callback(*args, **kwargs)
#25 23.26 File "/usr/local/lib/python3.6/dist-packages/click/decorators.py", line 21, in new_func
#25 23.26 return f(get_current_context(), *args, **kwargs)
#25 23.26 File "/usr/local/lib/python3.6/dist-packages/mindmeld/cli.py", line 816, in num_parser
#25 23.26 [exec_path, "--port", port], stderr=subprocess.STDOUT
#25 23.26 File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
#25 23.26 restore_signals, start_new_session)
#25 23.26 File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
#25 23.26 raise child_exception_type(errno_num, err_msg, err_filename)
#25 23.26 OSError: [Errno 8] Exec format error: '/usr/local/lib/python3.6/dist-packages/mindmeld/resources/duckling-x86_64-linux-ubuntu-20'
Looking here it appears that MindMeld automatically installs a version of duckling from https://binaries.mindmeld.com. Does it only have an x86
binary here?
Looking at these mappings it appears that MindMeld only checks for x86
builds of duckling so even if I were to manually install it I think MindMeld would just try to re-install it and use an x86
build and then crash.
Issue
I decided that I wanted to try to run MindMeld on a Raspberry Pi and quickly found out that attempting to run
pip install mindmeld
in anarm64
environment does not work. This appears to be because the dependencies in setup.py do not all have compiled arm64 wheels and whenpip
attempts to manually build them from source the builds fail (scikit-learn
in particular).This makes one unable to run MindMeld on devices like the M1 Mac and Raspberry Pi.
Reproduction
To easily reproduce this on any system (no matter the architecture), you can perform a
linux/arm64
build of a Docker container and attempt to install MindMeld into it and run into the issue. To do this:1) Create a
Dockerfile
with the following:2) Run
docker buildx build --progress=plain --platform linux/arm64 .
to perform anarm64
build.The following occurs when
pip
attempts to installscikit-learn
as a dependency:Possible Solutions
pip
.Going to try to play with it myself and see if I can hack together a configuration that works but not 100% sure what the best option is.