简体   繁体   English

ecs 运行与 ecs 部署

[英]Ecs run vs ecs deploy

for example for a migrate task we do ecs run and for any long running service to deploy we do ecs deploy .例如,对于迁移任务,我们执行ecs run ,而对于要部署的任何长时间运行的服务,我们执行ecs deploy Why so?为什么这样? What is basic fundamental difference between these two.这两者之间的基本根本区别是什么。 Because ecs run doesnt give back the status of the task ran.因为ecs run不会返回任务运行的状态。 (it always returns a non zero status code on running the service). (它总是在运行服务时返回一个非零状态码)。 So we have to do polling to get the status of the deployment.所以我们必须做轮询来获取部署的状态。 So why cant we use ecs deploy instead of ecs run because ecs deploy returns the status of the deployment also?那么为什么我们不能使用ecs deploy而不是ecs run因为 ecs deploy 也会返回部署的状态呢?

What is basic fundamental difference between these two.这两者之间的基本根本区别是什么。

aws ecs run-tusks starts a single task , while aws ecs deploy deploys a new task definition to a service . aws ecs run-tusks启动单个任务,而aws ecs deploy将新任务定义部署到服务

Thus the different is that a single service can run many long-running tasks.因此不同的是,单个服务可以运行许多长时间运行的任务。 Since you are running many tasks in a service you need to have a deployment strategy (eg rolling or blue/green) for how you deploy new versions of your task definitions.由于您在服务中运行许多任务,因此您需要有一个部署策略(例如滚动或蓝/绿)来部署任务定义的新版本。

So the choice of which to use depends on your specific use cases.因此,选择使用哪个取决于您的具体用例。 For ad-hoc short running jobs, a single task can be sufficient.对于临时的短期运行作业,单个任务就足够了。 For hosting business critical containers, a service is the right choice.对于托管业务关键型容器,服务是正确的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM