IBM / clai

Command Line Artificial Intelligence or CLAI is an open-sourced project from IBM Research aimed to bring the power of AI to the command line interface.
https://clai-home.mybluemix.net/
MIT License
478 stars 75 forks source link

Docker build fail on MacOS 12 on Apple Silicon (M1) #116

Open cryoff opened 2 years ago

cryoff commented 2 years ago

I have cloned the repo and just start ./BuildDockerImage.sh (does not matter if executing with or without sudo). No matter which terminal I use (zsh or fish in my case) - it fails with

#20 71.37     Traceback (most recent call last):
#20 71.37       File "<string>", line 1, in <module>
#20 71.37       File "/tmp/pip-build-5basj87q/cryptography/setup.py", line 14, in <module>
#20 71.37         from setuptools_rust import RustExtension
#20 71.37     ModuleNotFoundError: No module named 'setuptools_rust'
#20 71.37
#20 71.37     ----------------------------------------
#20 71.59 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5basj87q/cryptography/
------
executor failed running [/bin/sh -c if [ "$jenkinsbuild" = "true" ] ; then         sudo pip3 install -r requirements.txt -r requirements_test.txt ;     else         sudo pip3 install -r requirements.txt ;     fi     && sudo python3 install.py --unassisted --shell bash]: exit code: 1
image

shell

raro42 commented 2 years ago

Same here ... fails on Ubuntu Virtual Machine.

  Downloading https://files.pythonhosted.org/packages/f9/4b/1cf8e281f7ae4046a59e5e39dd7471d46db9f61bb564fddbff9084c4334f/cryptography-36.0.1.tar.gz (572kB)
    Complete output from command python setup.py egg_info:

            =============================DEBUG ASSISTANCE==========================
            If you are seeing an error here please try the following to
            successfully install cryptography:

            Upgrade to the latest pip and try again. This will fix errors for most
            users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
            =============================DEBUG ASSISTANCE==========================

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-qpcg6uuc/cryptography/setup.py", line 14, in <module>
        from setuptools_rust import RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-qpcg6uuc/cryptography/
The command '/bin/sh -c if [ "$jenkinsbuild" = "true" ] ; then         sudo pip3 install -r requirements.txt -r requirements_test.txt ;     else         sudo pip3 install -r requirements.txt ;     fi     && sudo python3 install.py --unassisted --shell bash' returned a non-zero code: 1

real    4m29.335s
user    0m0.227s
sys     0m0.291s
Failed to build CLAI Playground Container. Aborting Build.
cryoff commented 2 years ago

@raro42 is it ubuntu with aarch64?

raro42 commented 2 years ago

@cryoff - It's a Virtual Box with Ubuntu 20.04.1 LTS.

Found that adding

#############################################################################
# Update the pip install
# ########################
RUN sudo pip3 install --upgrade pip

Just before

#############################################################################
# INSTALL THE SHELL                                                         #
#############################################################################
RUN mkdir -p /opt/IBM/clai/

Fixes the problem.

in reference to this: https://github.com/MISP/misp-docker/issues/113

cryoff commented 2 years ago

@raro42 thank you for the hint! The project came out of the focus and I am also no more on M1, moved back to x86; not fan of MacBook. Anyway, hint is very helpful, thank you once again!