plotly / Kaleido

Fast static image export for web-based visualization libraries with zero dependencies
MIT License
378 stars 38 forks source link

do not work in linux-arm64 #59

Open 1178615156 opened 4 years ago

1178615156 commented 4 years ago

dockerfile

FROM python:3.7

RUN pip install dash dash-auth kaleido
RUN pip install flask flask-caching
RUN pip install influxdb openpyxl

CMD ["python"]

log

    b = fig.to_image(engine='kaleido')
  File "/usr/local/lib/python3.7/site-packages/plotly/basedatatypes.py", line 3495, in to_image
    return pio.to_image(self, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/plotly/io/_kaleido.py", line 132, in to_image
    fig_dict, format=format, width=width, height=height, scale=scale
  File "/usr/local/lib/python3.7/site-packages/kaleido/scopes/plotly.py", line 103, in transform
    figure, format=format, width=width, height=height, scale=scale
  File "/usr/local/lib/python3.7/site-packages/kaleido/scopes/base.py", line 201, in _perform_transform
    self._ensure_kaleido()
  File "/usr/local/lib/python3.7/site-packages/kaleido/scopes/base.py", line 120, in _ensure_kaleido
    raise ValueError(message)
ValueError: Failed to start Kaleido subprocess. Error stream:

/usr/local/lib/python3.7/site-packages/kaleido/executable/kaleido: line 10:   178 Segmentation fault      ./bin/kaleido --no-sandbox --allow-file-access-from-files --disable-breakpad $@
jonmmease commented 4 years ago

Thanks for the report @1178615156. Could you also describe the hardware that your are running on? For example, the initial aarch64 support was only tested on the raspberry pi (https://github.com/plotly/Kaleido/pull/35).

I'm not very familiar with how Docker works on arm, but if I understand correctly it looks like you are using the standard (intel) version of the python:3.7 image. Do other native compiled packages like numpy, pandas, and matplotlib work fine in this setup? Have you tried using kaleido from the base operating system outside of docker?

@Bibo-Joshi, if you have a moment, could you confirm whether the latest version of kaleido is still working for you in your arm64 setup? Thanks!

Bibo-Joshi commented 4 years ago

Upgraded from 0.0.3.dev5 to 0.0.3.post1 ad it seems to run fine for my use case :)

jonmmease commented 4 years ago

@Bibo-Joshi Thanks!

1178615156 commented 4 years ago

can see that the docker image is normal docker inspect python:3.7

        "Architecture": "arm64",
        "Os": "linux",
        "Size": 821520570,
        "VirtualSize": 821520570,

pandas and numpy is work fine

[root@master ~]# docker  run -it  --rm python:3.7 bash
root@38f694159a52:/# pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Writing to /root/.config/pip/pip.conf
root@38f694159a52:/# pip install pandas
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pandas
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d2/64/4c7c4a554193dcd464511c331380088a88f86056470d136657743e919ed0/pandas-1.1.4-cp37-cp37m-manylinux2014_aarch64.whl (9.4 MB)
     |████████████████████████████████| 9.4 MB 182 kB/s 
Collecting numpy>=1.15.4
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/91/db/8090047d2468b93b6f345913d404189909aae5eea370b06aa22b4a7be656/numpy-1.19.4-cp37-cp37m-manylinux2014_aarch64.whl (12.2 MB)
     |████████████████████████████████| 12.2 MB 4.2 MB/s 
Collecting python-dateutil>=2.7.3
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
     |████████████████████████████████| 227 kB 16.6 MB/s 
Collecting pytz>=2017.2
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/12/f8/ff09af6ff61a3efaad5f61ba5facdf17e7722c4393f7d8a66674d2dbd29f/pytz-2020.4-py2.py3-none-any.whl (509 kB)
     |████████████████████████████████| 509 kB 14.8 MB/s 
Collecting six>=1.5
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: numpy, six, python-dateutil, pytz, pandas
Successfully installed numpy-1.19.4 pandas-1.1.4 python-dateutil-2.8.1 pytz-2020.4 six-1.15.0

root@38f694159a52:/# python
Python 3.7.9 (default, Oct 13 2020, 06:53:37) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd 
>>> pd.DataFrame({'a':[1,2,3]})
   a
0  1
1  2
2  3
>>> import numpy as np 
>>> np.array([1,2,3,4])
array([1, 2, 3, 4])

i have try to run it on my host machine https://github.com/plotly/Kaleido/releases/download/v0.0.3.post1/kaleido_linux_arm64.zip

get the same error

[root@master kaleido]# ll
total 32
drwxrwxrwx 3 root root 4096 Aug 22 07:39 bin
drwxrwxrwx 3 root root 4096 Aug 22 07:39 etc
drwxrwxrwx 2 root root 4096 Aug 22 07:39 js
-rwxrwxrwx 1 root root  308 Aug 22 07:39 kaleido
drwxrwxrwx 2 root root 4096 Aug 22 07:39 lib
-rwxrwxrwx 1 root root 3051 Aug 22 07:39 LICENSE.txt
-rwxrwxrwx 1 root root   11 Aug 22 07:39 version
drwxrwxrwx 3 root root 4096 Aug 22 07:39 xdg
[root@master kaleido]# ./kaleido 
./kaleido: line 10: 22357 Segmentation fault      ./bin/kaleido --no-sandbox --allow-file-access-from-files --disable-breakpad $@

the hardware is huawei service

henry-fung commented 5 months ago

Is there any update for this issue?

bedeberger commented 4 months ago

Same issue here, cannot execute Kaleido on a Raspberry Pi 5 - regardless of Kaleido's version. Error is: Segmentation fault

gvwilson commented 4 months ago

Thanks for your interest in Kaleido. We are currently working on an overhaul that might address your issue - we hope to have news in a few weeks and will post an update then. Thanks - @gvwilson