cap-ntu / ML-Model-CI

MLModelCI is a complete MLOps platform for managing, converting, profiling, and deploying MLaaS (Machine Learning-as-a-Service), bridging the gap between current ML training and serving systems.
https://mlmodelci.com
Apache License 2.0
187 stars 33 forks source link

Failed to install pip package #162

Closed univerone closed 3 years ago

univerone commented 3 years ago

Software and Hardware Versions

ModelCI v1.x.x, CUDA Version vx.x.x, GPU device used...

Problem description

Failed to install pip package of ML-Model-CI Here is the output

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://pypi.ngc.nvidia.com
Collecting git+https://github.com/cap-ntu/ML-Model-CI.git@master
  Cloning https://github.com/cap-ntu/ML-Model-CI.git (to revision master) to /tmp/pip-req-build-kz7ui669
    ERROR: Command errored out with exit status 1:
     command: ~/miniconda3/envs/modelci/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-kz7ui669/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-kz7ui669/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-lj6ykhe5
         cwd: /tmp/pip-req-build-kz7ui669/
    Complete output (11 lines):
    When trying to extract ~/tmp/tensorrtserver/tritonis.client.tar.gz, an exception raised: file could not be opened successfully
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-kz7ui669/setup.py", line 98, in <module>
        triton_client_package = install_triton_client()
      File "/tmp/pip-req-build-kz7ui669/setup.py", line 81, in install_triton_client
        tar_file = tarfile.open(save_name, mode='r')
      File "~/miniconda3/envs/modelci/lib/python3.7/tarfile.py", line 1578, in open
        raise ReadError("file could not be opened successfully")
    tarfile.ReadError: file could not be opened successfully
    Re-download from https://github.com/triton-inference-server/server/releases/download/v1.8.0/v1.8.0_ubuntu2012.clients.tar.gz
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Steps to Reproduce the Problem

# need to install requests package first
pip install setuptools requests==2.23.0
# then install modelci
pip install git+https://github.com/cap-ntu/ML-Model-CI.git@master

Expected Behavior

Other Information

Things you tried, stack traces, related issues, suggestions on how to fix it...

It seems like this link https://github.com/triton-inference-server/server/releases/download/v1.8.0/v1.8.0_ubuntu2012.clients.tar.gz has no file to download, I think this maybe the main cause

YuanmingLeee commented 3 years ago

It seems that you are not running on a machine with Ubuntu, this package should not be installed. Can you tell me your machine details? Platform: OS and version:

univerone commented 3 years ago

It seems that you are not running on a machine with Ubuntu, this package should not be installed. Can you tell me your machine details? Platform: OS and version:

That's true, My OS is Manjaro Linux 20.1.2, should I switch to Ubuntu environment?

YuanmingLeee commented 3 years ago

Triton client only supports ubuntu distribution. If you do not need to test triton client, you don't need to worry about this package.

You can manually suppress the package installation by https://github.com/cap-ntu/ML-Model-CI/blob/59de196345c75044f5137e5532844b443312b27f/setup.py#L30

TRITON_CLIENT_INSTALL = False

See how we can prevent this error by differentiating different Linux distributions.

univerone commented 3 years ago

TRITON_CLIENT_INSTALL = True

Thanks, This did help!

univerone commented 3 years ago

It seems that you are not running on a machine with Ubuntu, this package should not be installed. Can you tell me your machine details? Platform: OS and version:

https://github.com/cap-ntu/ML-Model-CI/blob/59de196345c75044f5137e5532844b443312b27f/setup.py#L47

Actually, I cannot find 1.8.0 version download link in https://github.com/triton-inference-server/server/releases, even though I switch to Ubuntu system in google colab, the same problem still exists, here is the system info

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:    18.04
Codename:   bionic

Maybe this version is deprecated ? @YuanmingLeee

YuanmingLeee commented 3 years ago

can you print the download link via colab? https://github.com/cap-ntu/ML-Model-CI/blob/59de196345c75044f5137e5532844b443312b27f/setup.py#L64 Add print(url) at the next line, see if the printed url is the same as the following:

https://github.com/triton-inference-server/server/releases/download/v1.8.0/v1.8.0_ubuntu1804.clients.tar.gz
univerone commented 3 years ago

can you print the download link via colab?

https://github.com/cap-ntu/ML-Model-CI/blob/59de196345c75044f5137e5532844b443312b27f/setup.py#L64

Add print(url) at the next line, see if the printed url is the same as the following:

https://github.com/triton-inference-server/server/releases/download/v1.8.0/v1.8.0_ubuntu1804.clients.tar.gz

This link is just as same, maybe it's the problem of tar process, I'll check it again, here is the detailed output

Requirement already satisfied: setuptools in /usr/local/envs/modelci/lib/python3.7/site-packages (50.3.0.post20201103)
Requirement already satisfied: requests==2.23.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (2.23.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/envs/modelci/lib/python3.7/site-packages (from requests==2.23.0) (2020.6.20)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/envs/modelci/lib/python3.7/site-packages (from requests==2.23.0) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/envs/modelci/lib/python3.7/site-packages (from requests==2.23.0) (2.10)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/envs/modelci/lib/python3.7/site-packages (from requests==2.23.0) (1.25.11)
Collecting git+https://github.com/cap-ntu/ML-Model-CI.git@master
  Cloning https://github.com/cap-ntu/ML-Model-CI.git (to revision master) to /tmp/pip-req-build-p83qp6nj
Requirement already satisfied: betterproto>=1.2.3 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (1.2.5)
Requirement already satisfied: click==7.1.2 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (7.1.2)
Collecting docker>=4.2.0
  Using cached docker-4.4.0-py2.py3-none-any.whl (146 kB)
Requirement already satisfied: fastapi<=0.61.2,>=0.58.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (0.61.1)
Requirement already satisfied: GPUtil==1.4.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (1.4.0)
Requirement already satisfied: grpcio>=1.27.2 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (1.31.0)
Requirement already satisfied: humanize>=3.0.1 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (3.1.0)
Requirement already satisfied: hummingbird-ml>=0.0.6 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (0.1.0)
Requirement already satisfied: lightgbm==2.3.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (2.3.0)
Requirement already satisfied: mongoengine>=0.19.1 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (0.19.1)
Collecting numpy<1.19.0,>=1.16.0
  Using cached numpy-1.18.5-cp37-cp37m-manylinux1_x86_64.whl (20.1 MB)
Requirement already satisfied: onnx==1.6.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (1.6.0)
Collecting opencv-python>=3.1.0
  Using cached opencv_python-4.4.0.46-cp37-cp37m-manylinux2014_x86_64.whl (49.5 MB)
Requirement already satisfied: onnxconverter-common>=1.6.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (1.7.0)
Requirement already satisfied: onnxmltools>=1.6.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (1.7.0)
Requirement already satisfied: onnxruntime==1.2.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (1.2.0)
Requirement already satisfied: py-cpuinfo>=6.0.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (7.0.0)
Requirement already satisfied: pydantic<2.0.0,>=0.32.2 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (1.7.1)
Requirement already satisfied: pytest>=5.4.1 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (6.1.2)
Requirement already satisfied: pytest-env==0.6.2 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (0.6.2)
Requirement already satisfied: PyYAML==5.3.1 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (5.3.1)
Requirement already satisfied: requests>=2.23.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (2.23.0)
Requirement already satisfied: rich==9.1.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (9.1.0)
Requirement already satisfied: setuptools>=46.4.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (50.3.0.post20201103)
Requirement already satisfied: scikit-learn==0.23.2 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (0.23.2)
Requirement already satisfied: starlette<=0.13.6,>=0.13.4 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (0.13.6)
Collecting tensorflow>=2.1.2
  Using cached tensorflow-2.3.1-cp37-cp37m-manylinux2010_x86_64.whl (320.4 MB)
Collecting torchvision>=0.6.0
  Using cached torchvision-0.8.1-cp37-cp37m-manylinux1_x86_64.whl (12.7 MB)
Requirement already satisfied: tensorflow-serving-api>=2.1.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (2.1.0)
Collecting toolz==0.10.0
  Using cached toolz-0.10.0.tar.gz (49 kB)
Requirement already satisfied: torch>=1.5.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (1.5.0)
Requirement already satisfied: uvicorn>=0.11.5 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (0.12.2)
Requirement already satisfied: xgboost==1.2.0 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (1.2.0)
Requirement already satisfied: Jinja2==2.11.2 in /usr/local/envs/modelci/lib/python3.7/site-packages (from modelci==1.0.0) (2.11.2)
Processing /root/tmp/tensorrtserver/python/tensorrtserver-1.8.0-py2.py3-none-linux_x86_64.whl

ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/root/tmp/tensorrtserver/python/tensorrtserver-1.8.0-py2.py3-none-linux_x86_64.whl'
YuanmingLeee commented 3 years ago

No, it seems that the download just not working for some reason. Can you cd to the dir to see what happened?

cd /root/tmp/
ls -l

And you may try manually download:

cd ~/tmp
wget https://github.com/triton-inference-server/server/releases/download/v1.8.0/v1.8.0_ubuntu1804.clients.tar.gz
tar xzf v1.8.0_ubuntu1804.clients.tar.gz
univerone commented 3 years ago

No, it seems that the download just not working for some reason. Can you cd to the dir to see what happened?

cd /root/tmp/
ls -l

And you may try manually download:

cd ~/tmp
wget https://github.com/triton-inference-server/server/releases/download/v1.8.0/v1.8.0_ubuntu1804.clients.tar.gz
tar xzf v1.8.0_ubuntu1804.clients.tar.gz

This tar.gz file exists, after manually decompress it, the problem gone.

YuanmingLeee commented 3 years ago

seems like the python tar problem? how can we reproduce this?

univerone commented 3 years ago

seems like the python tar problem? how can we reproduce this?

Maybe it's a colab realted problem, here is the colab link :

https://colab.research.google.com/drive/1MYhUPIzmAvob1uELCfHPwhOYEGzEmeSX?usp=sharing

Since colab cannot start modelci environment due to lack of docker support, we could ignore this problem maybe.