-
-
Notifications
You must be signed in to change notification settings - Fork 981
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Terragrunt performance improvements (#3307)
* Performance testing * Usage of common cache * Added partial parse cache * HCL cache fetching * Add cache deep copy * Fixed run_cmd cache * Run cmd cache * Add context cache * Add test for git cache * Mod update * Add tracking of cache hit/miss * Updated parse key * Dependency outputs * Add depednency caching * Dependency cleanup * Cleanup * Deps update * Code simplification * Performance improvements for dependency fetching * Cleanup * Updated cache names
- Loading branch information
Showing
27 changed files
with
307 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package config | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/gruntwork-io/terragrunt/config/hclparse" | ||
"github.com/gruntwork-io/terragrunt/internal/cache" | ||
) | ||
|
||
type configKey byte | ||
|
||
const ( | ||
HclCacheContextKey configKey = iota | ||
TerragruntConfigCacheContextKey configKey = iota | ||
RunCmdCacheContextKey configKey = iota | ||
DependencyOutputCacheContextKey configKey = iota | ||
|
||
hclCacheName = "hclCache" | ||
configCacheName = "configCache" | ||
runCmdCacheName = "runCmdCache" | ||
dependencyOutputCacheName = "dependencyOutputCache" | ||
) | ||
|
||
// WithConfigValues add to context default values for configuration. | ||
func WithConfigValues(ctx context.Context) context.Context { | ||
ctx = context.WithValue(ctx, HclCacheContextKey, cache.NewCache[*hclparse.File](hclCacheName)) | ||
ctx = context.WithValue(ctx, TerragruntConfigCacheContextKey, cache.NewCache[*TerragruntConfig](configCacheName)) | ||
ctx = context.WithValue(ctx, RunCmdCacheContextKey, cache.NewCache[string](runCmdCacheName)) | ||
ctx = context.WithValue(ctx, DependencyOutputCacheContextKey, cache.NewCache[*dependencyOutputCache](dependencyOutputCacheName)) | ||
return ctx | ||
} |
Oops, something went wrong.