[英]Deploying bot instances in AWS
I have no experience with AWS or bot deployment for production, so I'm looking for some suggestions on best practices. 我没有用于生产的AWS或机器人部署的经验,因此我正在寻找有关最佳实践的建议。
The project is a simple Twitter automation bot written as a node.js application. 该项目是一个简单的Twitter自动化机器人,编写为node.js应用程序。 Currently I am using Cloud9 in AWS to host it, but I feel this is likely not the most effective means.
目前,我正在AWS中使用Cloud9托管它,但是我认为这可能不是最有效的方法。
What I need: 我需要的:
I'd like to use AWS if possible to familiarize myself with the platform, but open to any suggestion that I can incorporate an easy workflow. 如果可能的话,我想使用AWS来熟悉该平台,但是对于任何建议我可以合并一个简单的工作流程的建议,我都持开放态度。
Current workflow to deploy new bot: 当前部署新机器人的工作流程:
This has been very easy thus far, but I just don't know if its practical. 到目前为止,这非常容易,但是我不知道它是否可行。 Appreciate any advice!
感谢任何建议!
Given that the bot needs to be constantly running (ie it can't just be spun up on-demand for a couple minutes, which rules out AWS Lambda) and that each user needs their own, I'd give AWS ECS a try. 鉴于该机器人需要持续运行(即,它不能按需启动几分钟,而这排除了AWS Lambda)并且每个用户都需要自己的机器人,因此我将尝试AWS ECS。
Your initial setup will look something like this: 您的初始设置将如下所示:
Updating the bots would just involve updating your Docker image and task definition, then restarting the tasks so they use the new image. 更新机器人仅涉及更新Docker映像和任务定义,然后重新启动任务,以便它们使用新映像。
You should be able to set up logging and monitoring/alarming with CloudWatch for your ECS tasks too. 您还应该能够使用CloudWatch为您的ECS任务设置日志记录和监视/警报。
Usage reporting depends on what exactly you want to report. 使用情况报告取决于您要报告的内容。 You may get all you need from CloudWatch events/metrics, or you may want to send data from your containers to some storage solution (RDS, DynamoDB, S3, etc.).
您可能会从CloudWatch事件/指标中获得所需的一切,或者可能希望将数据从容器发送到某个存储解决方案(RDS,DynamoDB,S3等)。
Tying a front end to the bots depends on how the bots are set up. 将前端绑定到漫游器取决于漫游器的设置方式。 If they have REST servers listening to a particular port, for example, you'd be able to hit that if they're running on ECS.
例如,如果他们的REST服务器正在侦听特定端口,那么如果它们在ECS上运行,则可以实现这一点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.