New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Python 3 support #416
Add Python 3 support #416
Conversation
Test FAILed. |
@jwirjo Can you delete all the extra files you added in |
Sorry meant to say in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good. I'm going to play around with this on my machine as well, but I added a first round of comments.
@@ -42,6 +42,7 @@ def save_python_function(name, func): | |||
c.dump(func) | |||
serialized_prediction_function = s.getvalue() | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this change
num_replicas=1): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete extra line
@@ -72,6 +74,7 @@ def create_endpoint( | |||
:py:meth:`clipper.ClipperConnection.set_num_replicas`. | |||
""" | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete extra line
lf.write(c.logs(stdout=True, stderr=True)) | ||
except TypeError: | ||
with open(log_file, "wb") as lf: | ||
lf.write(c.logs(stdout=True, stderr=True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a Python 2 vs 3 thing? If so, instead of trying one way and catching an exception, let's explicitly check for sys.version
like you do in the python deployer.
containers/python/rpc.py
Outdated
try: | ||
socket.send("", zmq.SNDMORE) | ||
except: | ||
socket.send("".encode('utf-8'), zmq.SNDMORE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a Python 2 vs 3 thing? If so, instead of trying one way and catching an exception, let's explicitly check for sys.version like you do in the python deployer and then just use the right version. Throwing and catching an exception can be expensive and the code as-is has unclear semantics.
containers/python/sum_container.py
Outdated
@@ -22,6 +22,7 @@ def predict_bytes(self, inputs): | |||
return [str(sum(item)) for item in inputs] | |||
|
|||
def predict_strings(self, inputs): | |||
print(inputs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
&& git apply ../patches/make_spdlog_compile_linux.patch | ||
|
||
|
||
ENTRYPOINT ["/clipper/bin/ci_checks.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll want to modify this entrypoint command to just run the Python 3-compatible tests, not re-run everything
@@ -0,0 +1,13 @@ | |||
ARG CODE_VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Dockerfile file name should not end in .txt
dockerfiles/Py3RPCDockerfile.txt
Outdated
@@ -0,0 +1,20 @@ | |||
# This ARG isn't used but prevents warnings in the build script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Dockerfile file name should not end in .txt
#'test_set_num_replicas_for_deployed_model_succeeds', | ||
#'test_remove_inactive_containers_succeeds', | ||
#'test_stop_models', | ||
#'test_python_closure_deploys_successfully', | ||
'test_register_py_endpoint', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these all commented out?
bin/build_docker_images.sh
Outdated
@@ -245,16 +245,20 @@ build_images () { | |||
create_image query_frontend QueryFrontendDockerfile $public | |||
create_image management_frontend ManagementFrontendDockerfile $public | |||
create_image unittests ClipperTestsDockerfile $private | |||
create_image unittests ClipperPy3TestsDockerfile $private |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the name of the Py3 unittests image to py3tests
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test FAILed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super close! I added a comment that should help get the tests passing, and then this will be good to go.
.pypirc
Outdated
[test] | ||
repository = https://test.pypi.org/legacy/ | ||
username = jwirjo | ||
password = clippertest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You definitely don't want to commit this!
bin/run_unittests.sh
Outdated
@@ -197,7 +198,7 @@ case $args in | |||
-r | --rpc-container ) set_test_environment | |||
run_rpc_container_tests | |||
;; | |||
-i | --integration_tests ) set_test_environment | |||
-i | --integration_tests ) #set_test_environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this change
|
||
COPY clipper_admin/clipper_admin/python3_container_conda_deps.txt /lib/ | ||
RUN conda install -y --file /lib/python3_container_conda_deps.txt | ||
RUN conda install -c anaconda3 cloudpickle=0.5.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change lines 4-5 to:
RUN conda config --set ssl_verify no \
&& conda install -c anaconda3 cloudpickle=0.5.2 \
&& conda install -y --file /lib/python3_container_conda_deps.txt
This should fix the current test failure (see #426)
Test FAILed. |
bin/run_unittests.sh
Outdated
@@ -140,6 +140,7 @@ function run_integration_tests { | |||
python ../integration-tests/deploy_pyspark_models.py | |||
python ../integration-tests/deploy_pyspark_pipeline_models.py | |||
python ../integration-tests/deploy_pyspark_sparkml_models.py | |||
python ../integration-tests/deploy_pytorch_models.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this test seems to be failing, you can revert it and I'll add it in a separate PR.
Test FAILed. |
Test FAILed. |
jenkins test this please |
Test FAILed. |
Test FAILed. |
Test FAILed. |
jenkins test this please |
Test FAILed. |
@jwirjo @rohsuresh Any progress on this? |
Test FAILed. |
Test FAILed. |
Test FAILed. |
jenkins test this please |
Test FAILed. |
jenkins test this please |
Test FAILed. |
Test FAILed. |
Test PASSed. |
Test PASSed. |
Fixes #138. Added Python3 ClipperPy3TestsDockerfile, ran most integration_tests (run_unittests.sh) in python3 with same output as under python2, but 2 recurring errors.