seldon-core icon indicating copy to clipboard operation
seldon-core copied to clipboard

Support deployment of a Python 3 model

Open danielfrg opened this issue 8 years ago • 8 comments

I was looking at deploying one of the examples (iris) using Python 3 but I don't think its possible to do it at the moment.

I changed the base image using --base-image=python:3 but because of one of the requirements in seldon_requirements.txt more specifically grpc the image cannot be built since that library only works on python 2.

Step 14/19 : RUN cd /tmp &&     pip install --no-cache-dir -r seldon_requirements.txt &&     pip install --no-cache-dir -r requirements.txt
 ---> Running in ee334e1dbc4f
Collecting numpy==1.11.2 (from -r seldon_requirements.txt (line 1))
  Downloading numpy-1.11.2.tar.gz (4.2MB)
Collecting pandas==0.18.1 (from -r seldon_requirements.txt (line 2))
  Downloading pandas-0.18.1.tar.gz (7.3MB)
Collecting grpc==0.3.post19 (from -r seldon_requirements.txt (line 3))
  Downloading grpc-0.3-19.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-he7l6xxx/grpc/setup.py", line 7, in <module>
        version_tuple = __import__('grpc').VERSION
      File "/tmp/pip-build-he7l6xxx/grpc/grpc/__init__.py", line 6, in <module>
        from .rpc import *
      File "/tmp/pip-build-he7l6xxx/grpc/grpc/rpc.py", line 141
        except OSError, ex:
                      ^
    SyntaxError: invalid syntax

I was also wondering if this requirement might be easy to remove since this is another RPC library and not grpc.io, thats is also in the list of seldon_requirements.txt.

danielfrg avatar Feb 13 '18 18:02 danielfrg

You are right. Not sure why we need both? @Maximophone

ukclivecox avatar Feb 13 '18 18:02 ukclivecox

I'm looking into this requirement. However the wrapper is not currently compatible with python 3 and there will be other issues. I'll be working on making it compatible.

Maximophone avatar Feb 14 '18 10:02 Maximophone

I can confirm that grpc==0.3.post19 can be dropped from the requirements, it was added by mistake.

Maximophone avatar Feb 14 '18 13:02 Maximophone

I have created a pull request (#94 ) for an update that makes the wrapper python 3 compatible.

I have also pushed a new docker image for the wrapper: seldonio/core-python-wrapper:0.7

@danielfrg it would be great if you could try again using this new wrapper to see if you still run into compatibility issues.

Maximophone avatar Feb 14 '18 14:02 Maximophone

I will and report back!

Thanks for fixing this so fast :)

danielfrg avatar Feb 14 '18 16:02 danielfrg

No problem, python 3 compatibility is very important and has been overlooked, we need to get this working asap ;)

Maximophone avatar Feb 14 '18 16:02 Maximophone

I tested the new wrapper with 2 python 3 models and everything seams to be working fine 👍

danielfrg avatar Feb 14 '18 19:02 danielfrg

Great, we will merge the pull request and close this issue.

Maximophone avatar Feb 15 '18 09:02 Maximophone