Skip to content
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

Cannot make GRPC calls through GRPC microservice wrapping. #762

Closed
cestxiaoxi opened this issue Aug 7, 2019 · 2 comments
Closed

Cannot make GRPC calls through GRPC microservice wrapping. #762

cestxiaoxi opened this issue Aug 7, 2019 · 2 comments

Comments

@cestxiaoxi
Copy link

cestxiaoxi commented Aug 7, 2019

Hey Guys, I wrapped my model with S2I variables
MODEL_NAME=mymodel
API_TYPE=GRPC
SERVICE_TYPE=MODEL
PERSISTENCE=0
and its deployment on Kubernetes looks OK, with outputs:

starting microservice
WARNING: Logging before flag parsing goes to stderr.
I0807 08:44:05.239376 140400944408384 microservice.py:104] Found annotation kubernetes.io/config.seen:2019-08-07T16:44:00.627686923+08:00
I0807 08:44:05.239564 140400944408384 microservice.py:104] Found annotation kubernetes.io/config.source:api
I0807 08:44:05.239646 140400944408384 microservice.py:104] Found annotation prometheus.io/path:prometheus
I0807 08:44:05.239721 140400944408384 microservice.py:104] Found annotation prometheus.io/port:8000
I0807 08:44:05.239789 140400944408384 microservice.py:104] Found annotation prometheus.io/scrape:true
I0807 08:44:05.239866 140400944408384 microservice.py:104] Found annotation seldon.io/engine-log-message-type:seldon.message.pair
I0807 08:44:05.239938 140400944408384 microservice.py:104] Found annotation seldon.io/engine-log-messages-externally:false
I0807 08:44:05.240004 140400944408384 microservice.py:104] Found annotation seldon.io/engine-log-requests:false
I0807 08:44:05.240066 140400944408384 microservice.py:104] Found annotation seldon.io/engine-log-responses:false
I0807 08:44:05.240139 140400944408384 microservice.py:104] Found annotation seldon.io/headless-svc:false
I0807 08:44:05.240225 140400944408384 microservice.py:185] Annotations: {'kubernetes.io/config.seen': '2019-08-07T16:44:00.627686923+08:00', 'kubernetes.io/config.source': 'api', 'prometheus.io/path': 'prometheus', 'prometheus.io/port': '8000', 'prometheus.io/scrape': 'true', 'seldon.io/engine-log-message-type': 'seldon.message.pair', 'seldon.io/engine-log-messages-externally': 'false', 'seldon.io/engine-log-requests': 'false', 'seldon.io/engine-log-responses': 'false', 'seldon.io/headless-svc': 'false'}
I0807 08:44:05.240376 140400944408384 microservice.py:189] Importing mymodel
I0807 08:44:14.179546 140400944408384 microservice.py:260] Starting servers
I0807 08:44:14.316350 140400944408384 microservice.py:246] GRPC microservice Running on port 9000

But I cannot make GRPC calls. (with various GRPC errors)

however, if I set S2I variables as:
API_TYPE=REST
those same GRPC calls can go through mymodel but it seems not quite right because it is on HTTP1.1 with screen prints as:

starting microservice
WARNING: Logging before flag parsing goes to stderr.
I0807 09:29:20.122451 140253427271488 microservice.py:104] Found annotation kubernetes.io/config.seen:2019-08-07T17:29:16.0014259+08:00
I0807 09:29:20.127380 140253427271488 microservice.py:104] Found annotation kubernetes.io/config.source:api
I0807 09:29:20.127532 140253427271488 microservice.py:104] Found annotation prometheus.io/path:prometheus
I0807 09:29:20.127599 140253427271488 microservice.py:104] Found annotation prometheus.io/port:8000
I0807 09:29:20.127661 140253427271488 microservice.py:104] Found annotation prometheus.io/scrape:true
I0807 09:29:20.127722 140253427271488 microservice.py:104] Found annotation seldon.io/engine-log-message-type:seldon.message.pair
I0807 09:29:20.127791 140253427271488 microservice.py:104] Found annotation seldon.io/engine-log-messages-externally:false
I0807 09:29:20.127839 140253427271488 microservice.py:104] Found annotation seldon.io/engine-log-requests:false
I0807 09:29:20.127907 140253427271488 microservice.py:104] Found annotation seldon.io/engine-log-responses:false
I0807 09:29:20.127968 140253427271488 microservice.py:104] Found annotation seldon.io/headless-svc:false
I0807 09:29:20.128030 140253427271488 microservice.py:185] Annotations: {'kubernetes.io/config.seen': '2019-08-07T17:29:16.0014259+08:00', 'kubernetes.io/config.source': 'api', 'prometheus.io/path': 'prometheus', 'prometheus.io/port': '8000', 'prometheus.io/scrape': 'true', 'seldon.io/engine-log-message-type': 'seldon.message.pair', 'seldon.io/engine-log-messages-externally': 'false', 'seldon.io/engine-log-requests': 'false', 'seldon.io/engine-log-responses': 'false', 'seldon.io/headless-svc': 'false'}
I0807 09:29:20.128185 140253427271488 microservice.py:189] Importing mymodel
I0807 09:29:29.164747 140253427271488 microservice.py:226] REST microservice running on port 9000
I0807 09:29:29.164953 140253427271488 microservice.py:260] Starting servers

  • Serving Flask app "seldon_core.wrapper" (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
    I0807 09:29:29.313139 140253427271488 _internal.py:122] * Running on http://0.0.0.0:9000/ (Press CTRL+C to quit)
    I0807 09:29:59.261802 140250897479424 _internal.py:122] 127.0.0.1 - - [07/Aug/2019 09:29:59] "POST /predict HTTP/1.1" 200 -
    I0807 09:29:59.531378 140250897479424 _internal.py:122] 127.0.0.1 - - [07/Aug/2019 09:29:59] "POST /predict HTTP/1.1" 200 -
    I0807 09:29:59.746691 140250897479424 _internal.py:122] 127.0.0.1 - - [07/Aug/2019 09:29:59] "POST /predict HTTP/1.1" 200 -

Does anybody know what went wrong? (encountered both on release 0.27 and 0.31)

@ukclivecox
Copy link
Contributor

You need to specify in the resource graph that your component is REST or GRPC. So this needs to match how you wrapped the component.
If you specify REST for your component then even an external gRPC call will be converted to REST when calling your model. So in that respect things are quite flexible.

@cestxiaoxi
Copy link
Author

cestxiaoxi commented Aug 8, 2019

Thanks clive, found that parameter in ./seldon-core-master/helm-charts/seldon-single-model/templates/model.json. It works! Thanks for sharing the knowledge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants