Hydrospheredata / hydro-serving

MLOps Platform
http://docs.hydrosphere.io
Apache License 2.0
271 stars 42 forks source link

Application response in HTML tags and not in JSON #247

Closed ravimadhusudhan8 closed 5 years ago

ravimadhusudhan8 commented 5 years ago

We are load testing models that we have on Hydro-serving. The numbers are great!

We are using Gatling for the tests.

When we print out the response of a HTTP request we get HTML tags...

How do we get just the JSON response we are expecting?

Here is a sample response -

!doctype html>

HydroServingUi

Here is the input and output from Hydroserving UI - when testing the Application { "string": "foo is not a Ravi", "model": "foo", "feature": "ner" }

Output - { "tokens": [ "[{\"text\": \"Ravi\", \"start_char\": 11, \"end_char\": 15, \"label\": \"PERSON\"}]" ] }


Here is the cURL from Hydroserving UI -

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "string": "foo is not a Ravi", "model": "foo", "feature": "ner" }' 'http://ec2-54-**-**-**.us-west-2.compute.amazonaws.com/gateway/applications/spacy-nlp-service-2/spacy_process'

Thanks,

Ravi

KineticCookie commented 5 years ago

Hi. Servers usually return JSON response, unless there is no sidecar error. Envoy is configured to route all requests which do not match the routing table to the UI service, and looks like this is the root of the issue.

Could you please check if /gateway pattern is defined in localhost:8082/routes.

ravimadhusudhan8 commented 5 years ago

Here is the snippet -

{ "match": { "prefix": "/gateway" }, "route": { "cluster": "gateway-http", "timeout": "69s" } }

And the routes.txt output from :8082/routes

routes.txt

Below is a simple Curl output for an Application - curl-output

ravimadhusudhan8 commented 5 years ago

the internal network was not correct - port 80 was pointing to 9090 and not 8080 ...