-
Notifications
You must be signed in to change notification settings - Fork 835
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
Java Wrapper JSON POST API regression fix #3211
Java Wrapper JSON POST API regression fix #3211
Conversation
Hi @amoldavsky. Thanks for your PR. I'm waiting for a SeldonIO or todo member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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 jenkins-x/lighthouse repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
||
@RestController | ||
@ConditionalOnExpression("${seldon.api.model.enabled:false}") | ||
public class ModelRestController { |
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.
based on our discussion here:
https://seldondev.slack.com/archives/C8Y9A8G0Y/p1621264214141000?thread_ts=1620740550.073300&cid=C8Y9A8G0Y
This is not a Rest API, this is just an HTTP API. There is no resource in question such as a user or a document. We are not event doing a query here, such as querying for a document in Solr or ElasticSearch.
The appropriate distinction to make is from an actual Rest API
and an Inference API
. A Rest API
would be an API to get or alter the state of the model - load, unload, update, get meta... etc. An Inference API
would be this exact /predict
endpoint which does some computation and spits out a result.
* @return | ||
* @deprecated | ||
*/ | ||
@Deprecated |
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 we are not doing Rest, there is no need for a call /predict?json="{...}"
and hence deserves the deprecation tag
method = {RequestMethod.POST}, | ||
consumes = { | ||
MediaType.APPLICATION_JSON_VALUE, | ||
MediaType.APPLICATION_JSON_UTF8_VALUE |
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.
APPLICATION_JSON_UTF8_VALUE
is for backward compatibility, this property is deprecated by Spring
.setData(DefaultData.newBuilder().setTensor(Tensor.newBuilder().addShape(1).addValues(1.0))) | ||
.build(); | ||
// echo payload back | ||
return payload.toBuilder().build(); |
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.
more practical to return a copy of the payload back for testing. This makes sure that the payload is not deformed along the way and allows you to target particular pathways with different payloads.
// TODO: add binData | ||
// TODO: add strData | ||
// TODO: add customData | ||
|
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.
A collection of all possible payloads for SeldonMessage.
This way all possible requests are in one location and easy to see.
This allows us to easily test all possible assemblies of SeldonMessage.
Java Wrapper JSON POST API regression fix
Fixes #3210
Special notes for your reviewer:
Fixes a regression which was not present in earlier versions
Referencing the following Slack discussion:
#3210
Does this PR introduce a user-facing change?: