rengine icon indicating copy to clipboard operation
rengine copied to clipboard

feat: add support for Terraform/Ansible in combination with AWS

Open AnonymousWP opened this issue 7 months ago • 10 comments

Is there an existing feature or issue for this?

  • [X] I have searched the existing issues

Expected feature

For automation purposes, create an Ansible playbook and a Terraform file (tf) so that:

  1. An EC2 instance is created on AWS
  2. reNgine is automatically installed & configured

Alternative solutions

I will also research the possibility to do this using ECS, but this may be much more work and harder as well.

Anything else?

No response

AnonymousWP avatar Dec 01 '23 11:12 AnonymousWP

👋 Hi @AnonymousWP, Issues is only for reporting a bug/feature request. Please read documentation before raising an issue https://rengine.wiki For very limited support, questions, and discussions, please join reNgine Discord channel: https://discord.gg/azv6fzhNCE Please include all the requested and relevant information when opening a bug report. Improper reports will be closed without any response.

github-actions[bot] avatar Dec 01 '23 11:12 github-actions[bot]

@AnonymousWP Could I help you with that ?

ErdemOzgen avatar Dec 10 '23 21:12 ErdemOzgen

@AnonymousWP Could I help you with that ?

Yeah, you can open a PR if you want and assign me as reviewer. I'm kind of busy now, but I should have time within a week or so, depending on how things go.

AnonymousWP avatar Dec 12 '23 14:12 AnonymousWP

Hey there! I'm starting to work on this feat. I'm currently still exploring either making a tf module straight into an EC2 instance or chopping up the docker-compose into ECS. Should be done by end of quarter at latest.

cyb3rjerry avatar Jan 22 '24 16:01 cyb3rjerry

Hey there! I'm starting to work on this feat. I'm currently still exploring either making a tf module straight into an EC2 instance or chopping up the docker-compose into ECS. Should be done by end of quarter at latest.

Hi, great! Unfortunately I can't find time, but once you'll file a PR, I'll be ready to review it. I think EC2 should be relatively easy (we can use userdata to kick off some steps), but ECS will be more complicated due to all kinds of variables.

AnonymousWP avatar Jan 23 '24 08:01 AnonymousWP

ECS will be more complicated due to all kinds of variables.

I wouldn't say the variable will be complex but making sure everything still meshes together despite being split in actual different services might cause some trouble. We'll still evaluate it however as it'd make reNgine much more scalable

cyb3rjerry avatar Jan 23 '24 13:01 cyb3rjerry

Alright so after looking at this, ECS would have hs facing a few scalability and compatibility issues.

I'll start buy making a simple EC2 tf template and will work from there.

cyb3rjerry avatar Jan 24 '24 01:01 cyb3rjerry

So I've got a fairly simply infra setup but I'd need some feedback:

reNgine is currently going to be deployed in an EC2 instance. There's gonna be a slight modification to the docker-compose to essentially nerf the db docker deployment. I'll instead deploy a postgresql db in aws directly as otherwise we'd have no persistence whatsoever (without messing with the fs on an EBS on initialization which would make for some potentially weird behaviors).

My main question however is do we see a gain from also deploying a celery-beat instance via something like redis or should we let it live solely in docker and if it dies it dies?

Thoughts @AnonymousWP ?

cyb3rjerry avatar Jan 24 '24 14:01 cyb3rjerry

Why wouldn't there be any persistence with EC2? We can just setup/use AWS EBS as I think it's significantly cheaper than a PostgreSQL database in AWS. Don't think EBS would be prone for weird behaviours. We could test that.

Hmm, good question. Maybe we can make it an empty variable and let the user choose upon a terraform apply.

AnonymousWP avatar Jan 31 '24 17:01 AnonymousWP

Using an EBS feels kinda jank as I'm really not sure how rengine would react to being spawned in a docker container thats itself relying on a potentially unstable volume.

cyb3rjerry avatar Feb 06 '24 05:02 cyb3rjerry