aws / copilot-cli

The AWS Copilot CLI is a tool for developers to build, release and operate production ready containerized applications on AWS App Runner or Amazon ECS on AWS Fargate.
https://aws.github.io/copilot-cli/
Apache License 2.0
3.42k stars 397 forks source link

Support EC2 launch type #1094

Open srrengar opened 3 years ago

srrengar commented 3 years ago

In addition to the existing Fargate pattern, I'd like to deploy my container to ECS backed by EC2 instances. This will allow me to run windows applications for example.

JohGirard commented 3 years ago

We would like to use Copilot Cli but we need to support EC2 back as well

ramnamy commented 3 years ago

EC2 support would be much appreciated

dfuentes77 commented 3 years ago

I'm not seeing this in the Roadmap at all. Is that because it's not planned or too difficult to integrate? I'm sure Fargate is great for many scenarios but EC2 launch type is still something many will want/need to use. It's like flying the jet on only 1 engine.

the-smallest-coder commented 2 years ago

I have at least 1 EC2 instance(spot or standard) attached to ECS cluster always free, ASG care about it. It is already there and ready to take load.
If instance does meat Copilot requirements, I would like Copilot to launch task/service on it. I would expect this to speedup and simplify my feature branch testing via custom CI/CD.

tomkerswill commented 2 years ago

I would really love to have this functionality. What is needed, in order for this to be considered for the roadmap? Are there any workarounds that people have, in order to use an EC2 Capacity Provider for an app / service that was launched with copilot?

gautam-nutalapati commented 1 year ago

Looking forward for this feature to avoid these custom hacks. @tomkerswill We were able to make it work with below steps.

efekarakus commented 1 year ago

@gautam-nutalapati how about for operational commands, did you find that there are any paper cuts there? for example like rolling new AMIs?

gautam-nutalapati commented 1 year ago

@efekarakus I haven't seen any paper cuts yet, but it may be too early to see any in our case as it has been just couple of months since we started implementing this. I read through the article, and I couldn’t think of any side effects. At least not yet 🙂 , will keep posting in this thread in case we do find any.

fade2black commented 1 year ago

Wasted three days until I realised it does not support EC2 launch type.

efekarakus commented 1 year ago

Hi @fade2black, I am so sorry about the loss of time 🙇

Can you tell us more about why you'd like to use the EC2 launch type over AWS Fargate? This feature has a lot of 👍 so it's definitely one of our most requested asks.

If the concern is pricing, would Fargate Spot meet your needs: https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/#count-spot?

edit:

Wasted three days until I realised

We definitely don't want folks to spend 3 days to figure out how to launch an application, if you have any feedback on frictions faced along the way, we'd really appreciate any feedback here: https://github.com/aws/copilot-cli/discussions/categories/general

ssyberg commented 1 year ago

+1 for this - our main use case would be for a flatfile CMS we use for many clients which just doesn't lend itself to being containerized

gartmeier commented 1 year ago

+1 for GPUs

bearrito commented 1 year ago

@efekarakus A major limitation of Fargate is the caching story. In the AI/Robotics domain the images produced can be very large due to the size of the libraries. For instance the Nvidia ISaaC SDK will produce minimally a 7GB image. This makes Fargate very painful to use for these types of applications.

altonotch commented 11 months ago

+1 for ECS on EC2. Especially since AWS stopped maintaining ecs-cli there is no easy and obvious way to deploy to ECS and we end up creating custom deployment scripts/tools for each client. If copilot is not the alternative to ecs-cli, then what is?

yegeniy commented 9 months ago

Can you tell us more about why you'd like to use the EC2 launch type over AWS Fargate? This feature has a lot of 👍 so it's definitely one of our most requested asks.

@efekarakus, running stateful applications that require a large amount of memory. EC2 container instances seem like a cheaper approach, if properly sized.

ssyberg commented 8 months ago

following!

pratikm13 commented 2 weeks ago

Looking forward for this feature to avoid these custom hacks. @tomkerswill We were able to make it work with below steps.

  • Create EC2 ECS ASG and Capacity Provider (Referenced from here) (VPC trunking enabed via user data- our addon -> may be a capability we can add to EnvManifest)
  • If using private subnets, ensure deployment is done to private network (so NATs are created)
  • Link capacity provider to ECS cluster manually (CFN doesn't allow to append new providers for cluster created by copilot env stack)
  • Patched copilot to use EC2 instead of FARGATE.

Thanks for this info . Possible to ellaborate on statement "patched copilot to use ec2 launch type instead of fargate " because I tried it a lot with diffeeent keys like deployment type etc in srrvice manifwst file but copilot goes for fargate launch type only