-
Notifications
You must be signed in to change notification settings - Fork 756
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
Move from a custom tornado server to a seldon-core server for serving the model #36
Move from a custom tornado server to a seldon-core server for serving the model #36
Conversation
* Move from a custom tornado server to a seldon-core model Related to #11
/cc @jlewi |
@@ -0,0 +1,11 @@ | |||
numpy |
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.
if you don't mind please use pipenv
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.
Wrapping a seldon-core microservice requires a requirements.txt
file: https://github.com/SeldonIO/seldon-core/blob/master/docs/wrappers/python.md#create-a-model-folder
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.
@jimexist might want to open an issue in kubeflow/kubeflow or Seldon to follow up with them. @cliveseldon
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 great. So glad we were able to get Seldon integrated.
@@ -0,0 +1,11 @@ | |||
numpy |
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.
@jimexist might want to open an issue in kubeflow/kubeflow or Seldon to follow up with them. @cliveseldon
|
||
Start the server using `python server.py --port=8888`. | ||
> The model is written in Keras and when exported as a TensorFlow model seems to be incompatible with TensorFlow Serving. So we're using seldon-core to serve this model since seldon-core allows you to serve any arbitrary model. More details [here](https://github.com/kubeflow/examples/issues/11#issuecomment-371005885). |
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.
Might be good to open up an issue to track models that TFServing doesn't work with so we can loop in various folks e.g. from TFServing team. Its unfortunate that we can't use TFServing.
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.
Done #38
|
||
## Sample request | ||
Ensure that you have the following files from the [training](training_the_model.md) step in your `notebooks` directory: |
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 notebooks directory? What if we trained the model by running a TFJob and the model is stored on GCS/S3?
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.
I guess if they ran the TFJOb on GCS they could just do gsutil to copy from the bucket to their pod.
cd into the notebooks directory and run the following docker command. This will create a build/ directory. | ||
|
||
``` | ||
cd notebooks/ |
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.
Does Seldon's model wrapper support reading the model from GCS/S3?
Could we run the python wrapper as a job on K8s? Could we create a ksonnet template to make it easy to launch such a job.
I don't think we should try to address either of those issues in this PR. But might be good to open up issues to track them.
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.
Does Seldon's model wrapper support reading the model from GCS/S3?
Not that I am aware of. Looking at the instructions, it seems to require all the files in a single folder which contains the code and the model to build the serving image.
Created an issue to track the feature for serving a seldon-core model: kubeflow/kubeflow#405
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.
Looks like there is a seldon component in kubeflow. In the next PR, I'll try to deploy this image on k8s using this component
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 can specify any persistent volume in definition of the SeldonDeployment in the componentSpec as its a standard Kubernetes PodTemplateSpec. So you can load your parameters from their rather than package them as part of the model image if you wish. The kubeflow-seldon example shows an example using an NFS volume to load the trained model parameters.
./build_image.sh | ||
``` | ||
|
||
Now you should see an image named `seldonio/issuesummarization:0.1` in your docker images. To test the model, you can run it locally using |
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.
Can we tag it into a repo like GCR/DockerHub/Quay? We'll need that to deploy the model on K8s.
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.
Updated to use a GCR tag.
@jlewi: GitHub didn't allow me to request PR reviews from the following users: ahousley. Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jlewi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Related to #11
This change is