[英]How to deploy a machine learning model on EC2 and connect to API Gateway without Lambda?
I have trained a classifier using scikit.learn. 我已经使用scikit.learn训练了一个分类器。 I want to set up an API Gateway, so a user can submit the data using this API.
我想设置一个API网关,以便用户可以使用此API提交数据。 After data run through the trained model, return the result using the API as well.
在数据经过训练后的模型运行之后,还使用API返回结果。
Since my model requires spacy.io's big trained model as the backend, I CANNOT use Lambda due to Lambda's limitation on file size (512 MB). 由于我的模型需要spacy.io训练有素的大型模型作为后端,因此由于Lambda对文件大小(512 MB)的限制,我无法使用Lambda。 But all I Googled is related to Lambda.
但是我在Google上搜索的所有内容都与Lambda有关。
I am thinking, in my EC2 instance, I setup a Flask or Django app to receive the data from API Gateway and then run the model, return the result back to API Gateway. 我在想,在我的EC2实例中,我设置了Flask或Django应用程序以从API Gateway接收数据,然后运行模型,将结果返回给API Gateway。
But I don't know how to do it, could any one point out some resources? 但是我不知道该怎么做,有人可以指出一些资源吗?
Or is there any better solution out there? 还是那里有更好的解决方案?
It sounds like you've only discovered documentation for the Lambda integration method. 听起来您只发现了Lambda集成方法的文档。 You need to look at either the HTTP or HTTP_PROXY integration methods.
您需要查看HTTP或HTTP_PROXY集成方法。 I would start by reading this page in the documentation, and then proceed to this page .
我将从阅读文档中的此页面开始,然后继续进行至此页面 。
If you also want to prevent anything but API gateway from directly accessing your back-end system, then you will also need to setup client-side SSL certificate verification on your back-end. 如果您还希望防止API网关以外的任何其他因素直接访问您的后端系统,那么您还需要在后端上设置客户端SSL证书验证 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.