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

Expose usePluginCache configuration option to the configuration files. #3547

Open
1 task
mplzik opened this issue Jun 23, 2023 · 0 comments
Open
1 task

Expose usePluginCache configuration option to the configuration files. #3547

mplzik opened this issue Jun 23, 2023 · 0 comments
Labels
feature New functionality/enhancement Stale

Comments

@mplzik
Copy link

mplzik commented Jun 23, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Describe the user story

As a platform engineer, I use atlantis to create plans across huge numbers of modules (sometimes hundreds) in parallel. Terraform is configured in a way that it doesn't need to fetch providers from the internet -- it fetches it from a filesystem mirror instead. Since Atlantis configures TF_PLUGIN_CACHE_DIR environment variable, the providers will get symlinked to workspaces. Unfortunately, terraform init running while other modules are already running terraform plan fails because it opens the provider binaries in the cache for writing as well, making it almost impossible for most of the plans to succeed.

Describe the solution you'd like

An option to disable the shared plugin cache would allow to avoid the race condition between terraform init and terraform plan.

Describe the drawbacks of your solution

Without a shared cache, providers need to be fetched from the mirror for every workspace, consuming more disk space and I/O bandwidth. In case of misconfiguration, there is a risk of extraneous requests to network terraform mirrors.

Describe alternatives you've considered

  1. Fix the issue in Terraform codebase. Since this is documented in https://developer.hashicorp.com/terraform/cli/config/config-file as inherently not being concurrency safe with no tracking issue, I believe this is a low-priority problem or even a feature.
  2. Create a terraform wrapper that would explicitly unset TF_PLUGIN_CACHE_DIR before exec-ing into terraform. This is a fairly awkward and fragile solution.
@mplzik mplzik added the feature New functionality/enhancement label Jun 23, 2023
@dosubot dosubot bot added the Stale label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality/enhancement Stale
Projects
None yet
Development

No branches or pull requests

1 participant