claudie icon indicating copy to clipboard operation
claudie copied to clipboard

Feature: Tofu providers cache

Open Despire opened this issue 3 months ago • 3 comments

Motivation

To speed up the building of the cluster, we can shave off a few seconds, or even up-to some minutes in maintaining a tofu providers plugin cache.

Description

Explore if the env TF_PLUGIN_CACHE_DIR= is suitable to implement a provider plugin cache so that they do not need to be re-downloaded every-time a change happens inside the cluster.

Exit criteria

  • [ ] explore if TF_PLUGIN_CACHE_DIR= can be used for implementing a provider plugin cache

Despire avatar Sep 02 '25 10:09 Despire

TF_PLUGIN_CACHE_DIR= is not suitable due to

Note: The plugin cache directory is not guaranteed to be concurrency safe. The provider installer's behavior in environments with multiple terraform init calls is undefined.

https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache

Also we need to persists the .terraform.lock.hcl file for the cache to work which we currently do not do in claudie. On each workflow run it gets regenerated and then deleted.

Despire avatar Sep 03 '25 13:09 Despire

we could work around the concurrency limit of TF_PLUGIN_CACHE_DIR= by having each cluster have its own plugin cache

Despire avatar Sep 04 '25 11:09 Despire

Could you write a design doc for this feature request pls?

bernardhalas avatar Oct 03 '25 14:10 bernardhalas

Design doc for the issue : https://docs.google.com/document/d/1qv0YXomaHSEMfOZKGEv_UqC69Of0LREM8S5RI9JcUyQ/edit?tab=t.0#heading=h.ol1douhhte9n

m-brando avatar Dec 01 '25 08:12 m-brando