bmoscon / cryptostore

A scalable storage service for cryptocurrency data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

arm64 build for docker

KamranBiglari opened this issue · comments

There is an issue while I try to build it for ARM64

docker build --platform=linux/arm64
=> ERROR [ 5/11] RUN pip install --no-cache-dir cryptofeed                                                      305.5s
------
 > [ 5/11] RUN pip install --no-cache-dir cryptofeed:
#8 5.712 Collecting cryptofeed
#8 5.909   Downloading cryptofeed-2.3.0.tar.gz (391 kB)
#8 6.088      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 391.2/391.2 KB 3.1 MB/s eta 0:00:00
#8 7.881   Installing build dependencies: started
#8 50.14   Installing build dependencies: finished with status 'done'
#8 50.17   Getting requirements to build wheel: started
#8 65.08   Getting requirements to build wheel: finished with status 'done'
#8 65.10   Preparing metadata (pyproject.toml): started
#8 79.74   Preparing metadata (pyproject.toml): finished with status 'done'
#8 80.86 Collecting uvloop
#8 80.92   Downloading uvloop-0.17.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.2 MB)
#8 82.83      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.2/4.2 MB 2.2 MB/s eta 0:00:00
#8 83.87 Collecting websockets>=10.0
#8 83.91   Downloading websockets-10.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (106 kB)
#8 83.96      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106.6/106.6 KB 5.2 MB/s eta 0:00:00
#8 84.24 Collecting order-book>=0.5.0
#8 84.28   Downloading order_book-0.5.0.tar.gz (27 kB)
#8 84.35   Preparing metadata (setup.py): started
#8 88.23   Preparing metadata (setup.py): finished with status 'done'
#8 88.94 Collecting pyyaml
#8 88.98   Downloading PyYAML-6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (731 kB)
#8 89.25      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 731.1/731.1 KB 3.1 MB/s eta 0:00:00
#8 89.74 Collecting yapic.json>=1.6.3
#8 89.79   Downloading yapic.json-1.7.3.tar.gz (103 kB)
#8 89.84      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.5/103.5 KB 5.9 MB/s eta 0:00:00
#8 90.01   Preparing metadata (setup.py): started
#8 92.63   Preparing metadata (setup.py): finished with status 'done'
#8 93.21 Collecting requests>=2.18.4
#8 93.25   Downloading requests-2.28.1-py3-none-any.whl (62 kB)
#8 93.30      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 KB 2.3 MB/s eta 0:00:00
#8 93.47 Collecting aiodns>=1.1
#8 93.51   Downloading aiodns-3.0.0-py3-none-any.whl (5.0 kB)
#8 93.94 Collecting aiofile>=2.0.0
#8 93.98   Downloading aiofile-3.8.1.tar.gz (18 kB)
#8 94.05   Preparing metadata (setup.py): started
#8 96.13   Preparing metadata (setup.py): finished with status 'done'
#8 96.74 Collecting cchardet
#8 96.78   Downloading cchardet-2.1.7.tar.gz (653 kB)
#8 96.99      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 653.6/653.6 KB 3.9 MB/s eta 0:00:00
#8 98.39   Preparing metadata (setup.py): started
#8 103.5   Preparing metadata (setup.py): finished with status 'done'
#8 107.9 Collecting aiohttp==3.8.1
#8 107.9   Downloading aiohttp-3.8.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB)
#8 108.8      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 1.5 MB/s eta 0:00:00
#8 109.8 Collecting frozenlist>=1.1.1
#8 109.9   Downloading frozenlist-1.3.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (159 kB)
#8 110.0      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 159.2/159.2 KB 1.7 MB/s eta 0:00:00
#8 110.2 Collecting async-timeout<5.0,>=4.0.0a3
#8 110.2   Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
#8 112.6 Collecting yarl<2.0,>=1.0
#8 112.6   Downloading yarl-1.8.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (261 kB)
#8 112.8      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 261.1/261.1 KB 2.3 MB/s eta 0:00:00
#8 116.9 Collecting multidict<7.0,>=4.5
#8 116.9   Downloading multidict-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (116 kB)
#8 117.0      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 116.3/116.3 KB 3.8 MB/s eta 0:00:00
#8 117.5 Collecting charset-normalizer<3.0,>=2.0
#8 117.6   Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
#8 117.9 Collecting attrs>=17.3.0
#8 117.9   Downloading attrs-22.1.0-py2.py3-none-any.whl (58 kB)
#8 117.9      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.8/58.8 KB 4.6 MB/s eta 0:00:00
#8 118.1 Collecting aiosignal>=1.1.2
#8 118.1   Downloading aiosignal-1.2.0-py3-none-any.whl (8.2 kB)
#8 119.1 Collecting pycares>=4.0.0
#8 119.2   Downloading pycares-4.2.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (290 kB)
#8 119.3      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 290.6/290.6 KB 3.2 MB/s eta 0:00:00
#8 119.9 Collecting caio~=0.9.0
#8 119.9   Downloading caio-0.9.8-py3-none-any.whl (18 kB)
#8 120.7 Collecting urllib3<1.27,>=1.21.1
#8 120.7   Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
#8 120.8      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.4/140.4 KB 3.3 MB/s eta 0:00:00
#8 121.0 Collecting idna<4,>=2.5
#8 121.0   Downloading idna-3.4-py3-none-any.whl (61 kB)
#8 121.1      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 KB 6.2 MB/s eta 0:00:00
#8 121.4 Collecting certifi>=2017.4.17
#8 121.5   Downloading certifi-2022.6.15.2-py3-none-any.whl (160 kB)
#8 121.5      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.4/160.4 KB 5.1 MB/s eta 0:00:00
#8 124.9 Collecting cffi>=1.5.0
#8 125.0   Downloading cffi-1.15.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (448 kB)
#8 125.3      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 448.8/448.8 KB 1.9 MB/s eta 0:00:00
#8 125.9 Collecting pycparser
#8 125.9   Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
#8 126.0      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 KB 2.8 MB/s eta 0:00:00
#8 126.1 Building wheels for collected packages: cryptofeed, aiofile, order-book, yapic.json, cchardet
#8 126.1   Building wheel for cryptofeed (pyproject.toml): started
#8 265.4   Building wheel for cryptofeed (pyproject.toml): still running...
#8 267.3   Building wheel for cryptofeed (pyproject.toml): finished with status 'done'
#8 267.4   Created wheel for cryptofeed: filename=cryptofeed-2.3.0-cp39-cp39-linux_aarch64.whl size=405350 sha256=70ac19a612a7840debfd00a2028a0abb6f2456cffd88aa9f4a797a403c9c67ea
#8 267.4   Stored in directory: /tmp/pip-ephem-wheel-cache-98e0coyt/wheels/de/91/9b/f782f4c90a30719f81dcbae4f85b883476067c9f3159c65920
#8 267.4   Building wheel for aiofile (setup.py): started
#8 271.1   Building wheel for aiofile (setup.py): finished with status 'done'
#8 271.1   Created wheel for aiofile: filename=aiofile-3.8.1-py3-none-any.whl size=19450 sha256=24cd52280a68806f50442ae981e71d9e42d4ea9a81568f24389370cebc07ab9f
#8 271.1   Stored in directory: /tmp/pip-ephem-wheel-cache-98e0coyt/wheels/5c/b4/3f/17623369762a0f125158ea9c4f5932106637ef92ac4d016786
#8 271.1   Building wheel for order-book (setup.py): started
#8 283.0   Building wheel for order-book (setup.py): finished with status 'done'
#8 283.0   Created wheel for order-book: filename=order_book-0.5.0-cp39-cp39-linux_aarch64.whl size=28670 sha256=b2a0d72d3a9e3b32134bf9e4cfb5bb00cb7fb398e5b6f1840052aa32dc70a932
#8 283.0   Stored in directory: /tmp/pip-ephem-wheel-cache-98e0coyt/wheels/b1/14/0a/4c86d1b03f1d772026103e34351cf3de09f5c84378f268a738
#8 283.1   Building wheel for yapic.json (setup.py): started
#8 285.7   Building wheel for yapic.json (setup.py): finished with status 'error'
#8 285.7   error: subprocess-exited-with-error
#8 285.7
#8 285.7   × python setup.py bdist_wheel did not run successfully.
#8 285.7   │ exit code: 1
#8 285.7   ╰─> [20 lines of output]
#8 285.7       running bdist_wheel
#8 285.7       running build
#8 285.7       running build_py
#8 285.7       creating build
#8 285.7       creating build/lib.linux-aarch64-3.9
#8 285.7       creating build/lib.linux-aarch64-3.9/yapic
#8 285.7       creating build/lib.linux-aarch64-3.9/yapic/json
#8 285.7       copying src/__init__.py -> build/lib.linux-aarch64-3.9/yapic/json
#8 285.7       copying src/_json.pyi -> build/lib.linux-aarch64-3.9/yapic/json
#8 285.7       running build_ext
#8 285.7       building 'yapic.json._json' extension
#8 285.7       creating build/temp.linux-aarch64-3.9
#8 285.7       creating build/temp.linux-aarch64-3.9/libs
#8 285.7       creating build/temp.linux-aarch64-3.9/libs/double-conversion
#8 285.7       creating build/temp.linux-aarch64-3.9/libs/double-conversion/double-conversion
#8 285.7       creating build/temp.linux-aarch64-3.9/src
#8 285.7       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DYAPIC_JSON_VERSION_MAJOR=1 -DYAPIC_JSON_VERSION_MINOR=7 -DYAPIC_JSON_VERSION_PATCH=3 -Ilibs/double-conversion -Ilibs/yapic.core/src/yapic/core/include -I/usr/local/include/python3.9 -c libs/double-conversion/double-conversion/bignum-dtoa.cc -o build/temp.linux-aarch64-3.9/libs/double-conversion/double-conversion/bignum-dtoa.o -std=c++11 -Wno-unknown-pragmas -Wno-write-strings -O3
#8 285.7       gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
#8 285.7       compilation terminated.
#8 285.7       error: command '/usr/bin/gcc' failed with exit code 1
#8 285.7       [end of output]
#8 285.7
#8 285.7   note: This error originates from a subprocess, and is likely not a problem with pip.
#8 285.8   ERROR: Failed building wheel for yapic.json
#8 285.8   Running setup.py clean for yapic.json
#8 287.7   Building wheel for cchardet (setup.py): started
#8 292.4   Building wheel for cchardet (setup.py): finished with status 'error'
#8 292.5   error: subprocess-exited-with-error
#8 292.5
#8 292.5   × python setup.py bdist_wheel did not run successfully.
#8 292.5   │ exit code: 1
#8 292.5   ╰─> [22 lines of output]
#8 292.5       cythonize: ['src/cchardet/_cchardet.pyx']
#8 292.5       running bdist_wheel
#8 292.5       running build
#8 292.5       running build_py
#8 292.5       creating build
#8 292.5       creating build/lib.linux-aarch64-3.9
#8 292.5       creating build/lib.linux-aarch64-3.9/cchardet
#8 292.5       copying src/cchardet/version.py -> build/lib.linux-aarch64-3.9/cchardet
#8 292.5       copying src/cchardet/__init__.py -> build/lib.linux-aarch64-3.9/cchardet
#8 292.5       running build_ext
#8 292.5       building 'cchardet._cchardet' extension
#8 292.5       creating build/temp.linux-aarch64-3.9
#8 292.5       creating build/temp.linux-aarch64-3.9/src
#8 292.5       creating build/temp.linux-aarch64-3.9/src/cchardet
#8 292.5       creating build/temp.linux-aarch64-3.9/src/ext
#8 292.5       creating build/temp.linux-aarch64-3.9/src/ext/uchardet
#8 292.5       creating build/temp.linux-aarch64-3.9/src/ext/uchardet/src
#8 292.5       creating build/temp.linux-aarch64-3.9/src/ext/uchardet/src/LangModels
#8 292.5       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Isrc/ext/uchardet/src -I/usr/local/include/python3.9 -c src/cchardet/_cchardet.cpp -o build/temp.linux-aarch64-3.9/src/cchardet/_cchardet.o
#8 292.5       gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
#8 292.5       compilation terminated.
#8 292.5       error: command '/usr/bin/gcc' failed with exit code 1
#8 292.5       [end of output]
#8 292.5
#8 292.5   note: This error originates from a subprocess, and is likely not a problem with pip.
#8 292.5   ERROR: Failed building wheel for cchardet
#8 292.5   Running setup.py clean for cchardet
#8 297.0 Successfully built cryptofeed aiofile order-book
#8 297.0 Failed to build yapic.json cchardet
#8 298.9 Installing collected packages: order-book, cchardet, yapic.json, websockets, uvloop, urllib3, pyyaml, pycparser, multidict, idna, frozenlist, charset-normalizer, certifi, caio, attrs, async-timeout, yarl, requests, cffi, aiosignal, aiofile, pycares, aiohttp, aiodns, cryptofeed
#8 299.0   Running setup.py install for cchardet: started
#8 303.6   Running setup.py install for cchardet: finished with status 'error'
#8 303.6   error: subprocess-exited-with-error
#8 303.6
#8 303.6   × Running setup.py install for cchardet did not run successfully.
#8 303.6   │ exit code: 1
#8 303.6   ╰─> [22 lines of output]
#8 303.6       cythonize: ['src/cchardet/_cchardet.pyx']
#8 303.6       running install
#8 303.6       running build
#8 303.6       running build_py
#8 303.6       creating build
#8 303.6       creating build/lib.linux-aarch64-3.9
#8 303.6       creating build/lib.linux-aarch64-3.9/cchardet
#8 303.6       copying src/cchardet/version.py -> build/lib.linux-aarch64-3.9/cchardet
#8 303.6       copying src/cchardet/__init__.py -> build/lib.linux-aarch64-3.9/cchardet
#8 303.6       running build_ext
#8 303.6       building 'cchardet._cchardet' extension
#8 303.6       creating build/temp.linux-aarch64-3.9
#8 303.6       creating build/temp.linux-aarch64-3.9/src
#8 303.6       creating build/temp.linux-aarch64-3.9/src/cchardet
#8 303.6       creating build/temp.linux-aarch64-3.9/src/ext
#8 303.6       creating build/temp.linux-aarch64-3.9/src/ext/uchardet
#8 303.6       creating build/temp.linux-aarch64-3.9/src/ext/uchardet/src
#8 303.6       creating build/temp.linux-aarch64-3.9/src/ext/uchardet/src/LangModels
#8 303.6       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Isrc/ext/uchardet/src -I/usr/local/include/python3.9 -c src/cchardet/_cchardet.cpp -o build/temp.linux-aarch64-3.9/src/cchardet/_cchardet.o
#8 303.6       gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
#8 303.6       compilation terminated.
#8 303.6       error: command '/usr/bin/gcc' failed with exit code 1
#8 303.6       [end of output]
#8 303.6
#8 303.6   note: This error originates from a subprocess, and is likely not a problem with pip.
#8 303.6 error: legacy-install-failure
#8 303.6
#8 303.6 × Encountered error while trying to install package.
#8 303.6 ╰─> cchardet
#8 303.6
#8 303.6 note: This is an issue with the package mentioned above, not pip.
#8 303.6 hint: See above for output from the failure.
#8 304.7 WARNING: You are using pip version 22.0.4; however, version 22.2.2 is available.
#8 304.7 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
------
executor failed running [/bin/sh -c pip install --no-cache-dir cryptofeed]: exit code: 1

looks like you dont have a c++ Compiler installed, this is not a bug in cryptostore

@KamranBiglari: Adding g++ after apt install gcc in the Dockerfile solves this problem.

@bmoscon: On a side note, it is recommended to use apt-get over apt in Dockerfile, as the latter is designed for interactive use only. It is also good practice to use python3 -m pip instead of pip. Here's an updated version of the Dockerfile:

FROM python:3.9-slim-bullseye

RUN apt-get update
RUN apt-get install -y gcc g++ git

RUN python3 -m pip install --no-cache-dir cython
RUN python3 -m pip install --no-cache-dir cryptofeed
RUN python3 -m pip install --no-cache-dir redis
RUN python3 -m pip install --no-cache-dir pymongo[srv]
RUN python3 -m pip install --no-cache-dir motor
RUN python3 -m pip install --no-cache-dir asyncpg

COPY cryptostore.py /cryptostore.py

CMD ["/cryptostore.py"]
ENTRYPOINT ["python"]

It would be great if you could offer a linux/arm64/v8 docker image in addition to the amd64 image that is already available. I am sure many people would love to run this excellent tool on their Raspberry Pi.