Skip to content
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

Add high availability using redis for locking #322

Closed
nitrocode opened this issue Nov 4, 2022 · 20 comments
Closed

Add high availability using redis for locking #322

nitrocode opened this issue Nov 4, 2022 · 20 comments
Assignees
Labels

Comments

@nitrocode
Copy link
Member

nitrocode commented Nov 4, 2022

Is your request related to a new offering from AWS?

It is not

Is your request related to a problem? Please describe.

Id like an HA setup so atlantis can run plans across different projects simultaneously instead of linearly

Describe the solution you'd like.

Add option to create redis for locking, configure iam policy, add options to atlantis

Describe alternatives you've considered.

N/A

Additional context

Related runatlantis/atlantis#1571

https://www.runatlantis.io/docs/server-configuration.html#redis-host

@dynamike
Copy link
Member

dynamike commented Nov 7, 2022

Would it be possible to add some more docs for Atlantis on how to properly use Redis for high availability? That would help adding support for the functionality in this repo.

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

@github-actions github-actions bot added the stale label Dec 8, 2022
@nitrocode
Copy link
Member Author

unstale

@dynamike dynamike added on hold and removed stale labels Dec 8, 2022
@github-actions
Copy link

github-actions bot commented Jan 8, 2023

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

@github-actions github-actions bot added the stale label Jan 8, 2023
@nitrocode
Copy link
Member Author

Unstale

@github-actions
Copy link

github-actions bot commented Feb 9, 2023

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

@github-actions github-actions bot added the stale label Feb 9, 2023
@nitrocode
Copy link
Member Author

Unstale

@bryantbiggs
Copy link
Member

Do we have a design spec for this yet?

@github-actions github-actions bot removed the stale label Feb 10, 2023
@nitrocode
Copy link
Member Author

Unsure about a design spec.

Basically

  1. Create redis (elasticache)
  2. Set appropriate inputs to atlantis to access the redis instance
  3. Ensure security group on elasticache allows ingress from atlantis pod/ecs-service
  4. Spin up more than one atlantis pod/ecs-service

At least, that's how I understand it.

@andyshinn
Copy link

What do the Redis hosts do right now if they do not do locking? I'd love to scale Atlantis a bit as it can be slow with many projects and when multiple repos plan / apply at the same time. The docs are unclear if it is for running multiple instances or something else.

@nitrocode
Copy link
Member Author

@bryantbiggs
Copy link
Member

The locking seems like the least of the concerns, where do the planned outputs live?

@nitrocode
Copy link
Member Author

Hmm that's a good point. I'll reach out to the developers on this to see. Perhaps all of the instances need to share the same volume mount for this to work.

cc @lilincmu @SudoSpartanDan @jamengual

The PR that implemented this feature runatlantis/atlantis#2491

@bryantbiggs
Copy link
Member

maybe its just a naming misnomer - but it looks like the lockingDB is really storing the locks as well as the plans based on this definition #322 (comment)

@bryantbiggs
Copy link
Member

Cool - I think it looks straightforward, thanks for sharing that PR @nitrocode

We'll need a few bits before we can add this but most are already in progress:

  1. Update ECS module to include support for service, task definition, and autoscaling. We have most of that already scoped out in this fork https://github.com/clowdhaus/terraform-aws-ecs so we can test and validate on a number of examples feat: Update ECS modules to leverage terraform-aws-ecs cluster, service, and container-definition modules/functionality aws-ia/ecs-blueprints#109 - once we get this validated I'll open a PR to the main project to get those changes reviewed and merged
  2. We'll need an elasticache cluster - I started on a module for this awhile back but never finished. I can revive that and see about getting it added
  3. Once those pieces are in place we can start carving out the changes here

This is great - I know this has been a long sought after feature so I'm excited to see this get added!

@bryantbiggs bryantbiggs self-assigned this Feb 27, 2023
@nitrocode
Copy link
Member Author

To save time, could we skip step 2 and use https://registry.terraform.io/modules/cloudposse/elasticache-redis/aws/latest module?

@bryantbiggs
Copy link
Member

Possibly - the philosophy across the modules between the two groups is quite a bit different. Specifically the use of several nested sub-modules and the use of labels and context objects. We'll see

@nitrocode
Copy link
Member Author

hmm on second thought, I do not think that redis holds the plans and the feature seems to be a bit wonky. I'm hesitant to push this forward until some of the bugs are fixed with it.

runatlantis/atlantis#1571 (comment)

Thank you for considering.

@dynamike
Copy link
Member

dynamike commented Mar 3, 2023

It would also be helpful to have more documentation in the Atlantis codebase around this feature, so folks know when and why they would enable it vs just running it by default.

@github-actions
Copy link

github-actions bot commented Apr 4, 2023

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants