-
-
Notifications
You must be signed in to change notification settings - Fork 355
Fargate/Atlantis - Trigger AWS Fargate task from AWS Lambda #19
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
Comments
I could be wrong but I think it breaks system design whereby there is unhealthy loadbalancer on weekends. Tasks schedule feature is good for tasks without service (and loabalancer). Here you need the loadbalancer to always be healthy and available to consume requests from github webhook. |
@oba11 Well, you are absolutely right IF architecture is implemented with LB and stay the same as now. I am thinking about it this in a different way:
While this solution CAN be implemented with several hacks using the current version of Atlantis, it will be better to do some architectural changes to Atlantis, which has to be discussed in more details. I think Atlantis should be divided into several services:
@lkysow, what do you think about this? Should I move this discussion to https://github.com/runatlantis/atlantis or do you have something like this already in your plans? |
No doubt this will be super nice, lets see what @lkysow thinks :) |
Hi Everyone. I'm all for cost-saving but I don't think this will work with how Atlantis currently runs. Also, the cost savings aren't that substantial. Given us-east-1 pricing, I think Atlantis costs 45 cents a day:
As to the other questions:
|
Thanks for the feedback @lkysow! I also won't be working on this feature myself in the nearest future, so I can't come up with numerous hacks which can be applied to get this to work. Let's keep this issue open and come back to it when time allows, or someone wants to contribute :) |
Where is the container_definition for the Fargate task? |
Container definition is specified as part of aws_ecs_task_definition resource: terraform-aws-atlantis/main.tf Lines 446 to 456 in 9150d5a
|
There does not appear to be anything related to running the atlantis server. You don't provide |
The Atlantis Docker image will automatically run the |
Hi, Luke; thanks for response What about arguments? I have to provide |
Can you use the ex. Sorry but I'm not too familiar with this module myself. Also maybe if you have more questions you could open up a separate issue because I think this issue is about running Atlantis on-demand via lambda so we shouldn't pollute that purpose too much. |
OK, thanks! |
@lkysow I don't think these are good defaults though. I had an apply die on me and I had to manually recover some stuff because it ran out of resources and was killed by ECS |
:( that sucks. Curious, why did ECS kill it? Maybe we can bump up the default resources so others don't have that issue. Yeah if you want to avoid that you must give it persistent disk. Either through kube or through an actual VM. |
@lkysow I don't think persistent disk would have helped me here. My state is in S3, it just left a cfn stack in a bad state. Wasn't a huge pain, at least this time, and I bumped up the resources. The problem was that it swamped the CPU enough that it took too long to respond to the health check. One possible solution is to just make the health check more forgiving. The tradeoff of course is taking longer to recover when there's a real problem. |
@smiller171 What did you bump the resources to? Current module defaults
cloudposse/terraform-aws-ecs-atlantis uses the same defaults
|
@nitrocode I ended up using:
This has worked well for me so far |
Oh wow so you quadrupled each setting. Thanks. If I see similar issues, I'll do the same. |
@nitrocode Yeah, but this almost certainly depends on how big your stack is and how many projects are running in parallel |
This issue has been automatically marked as stale because it has been open 30 days |
this coupled with #206 could work - holding from going stale |
I dont know if this would make any sense for current atlantis architecture, but as AWS Lambda allows to run containers right now, I would rather consider re-building the atlantis container and to add lambda handler API in it, so we could just deploy atlantis container into Lambda and to run it per Lambda calls, without a need to run it in ECS. |
@vitaliCoasy terraform runs can take more than 15 minutes (current limit of max duration for lambda function), so I don't think it will make much sense to migrate from ECS Fargate to pure Lambda function. |
Yeah, I think it would make more sense to trigger a Lambda which starts an ECS job |
This issue has been automatically marked as stale because it has been open 30 days |
bump :) |
This issue has been automatically marked as stale because it has been open 30 days |
This issue was automatically closed because of stale in 10 days |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
To-do:
start one Fargate Task 15 minutes before 9:00 on workdays
)The text was updated successfully, but these errors were encountered: