Open nitrocode opened 1 year ago
Some users like @brandon-fryslie have been able to disable locking successfully.
https://github.com/runatlantis/atlantis/pull/3649#issuecomment-1887037135
I disabled locking successfully since Jan 2024 and have not noticed any issues.
I disabled both Atlantis and Terraform locks in dev (init/plan only) and have seen 0 problems whatsoever. The repo has multiple PRs per day. I was keeping on top of it, but I took some time off and there are 30+ open PRs now. Just to give you an idea of how much traffic this repo gets. If there were issues we'd likely have seen them.
We also have Atlantis parallelization enabled (using a "fake workflow" hack, by setting the workflow in Atlantis config then overriding the built-in commands for init/plan/apply to skip workflow switching. this gives us the folder structure needed for Atlantis parallelization without requiring us to use tf workflows). It's not uncommon to have a PR run 20-30 Atlantis projects. And no issues with locks disabled on both Atlantis and Terraform, for non-destructive operations.
Obviously you'll want locks enabled for apply
and anything else that could possibly change state or resources.
Very cool. I can say the same still, no issues after 7 months. Devs are very happy and PRs get merged quickly and painlessly.
I'll add a document for this in the website.
cc: @jamengual @GenPage
Community Note
Describe the user story
Atlantis locking is probably the least favorite feature among devs and blocks users often. I'm sure it's useful as a default. It would be good to know the configuration needed to safely disable it without compromising the workflow.
Describe the solution you'd like
Document what configuration is needed to safely disable locking without compromising workflows
Can atlantis locking be safely disabled if using the following?
Workflow scenario: simultaneous plan
-lock=false
can be set in a custom workflow for planWorkflow scenario: simultaneous apply
Workflow scenario: stale plan
env
to some resourcemain
to feature brancht3.small
main
to feature branchatlantis apply
comment applies the tf and merges PR 2 tomain
PR 1 plan is now stale
If atlantis apply is run on pr 1 now, the plan should say that it is stale and the plan needs to be rerun.
A new
atlantis plan
or commit will trigger the merge frommain
before auto planningOne caveat worth exploring from @apparentlymart
https://gist.github.com/apparentlymart/657885e730d1e5abc6ea#stale-plan-files
This method would also allow HA out of the box without having to use a separate redis cluster for locking (see https://github.com/runatlantis/atlantis/pull/2491).
Describe the drawbacks of your solution
No idea which PRs are modifying the same project
Describe alternatives you've considered
None