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 utils_spacelift_stack_config data source. Use gorotines for concurrent YAML stacks processing #40

Merged
merged 17 commits into from
May 17, 2021

Conversation

aknysh
Copy link
Member

@aknysh aknysh commented May 17, 2021

what

  • Add utils_spacelift_stack_config data source
  • Add examples/data-sources/utils_spacelift_stack_config example
  • Use gorotines for concurrent YAML stacks processing
  • Directly convert infrastructure YAML stack configs into Spacelift stack configs

why

  • Speed up YAML stack processing (in many cases, from tens of minutes to tens of seconds)
  • Go binary is much faster than Terraform on converting infrastructure stacks into Spacelift stacks when the complexity of computation is O(n^2) or O(n^3) (as we have in terraform-spacelift-cloud-infrastructure-automation)
  • Use goroutines and WaitGroup to process a list of infrastructure YAML stack configs concurrently to speed up processing
  • The old implementation was too slow - Spacelift terraform plan on about 260 infrastructure YAML stacks took 40-50 minutes
  • In the new implementation, which does all processing concurrently (in parallel on all CPU cores) and directly converts infrastructure stacks into Spacelift stacks, Spacelift terraform plan takes about 17-20 seconds on 260 YAML stacks
  • Backwards compatible with the previous releases
Plan: 1697 to add, 0 to change, 0 to destroy.

@aknysh aknysh self-assigned this May 17, 2021
@aknysh aknysh requested review from a team as code owners May 17, 2021 15:08
Copy link
Member

@mcalhoun mcalhoun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, I just left one question about possibly timing out the .lock() call within the goroutine

@aknysh aknysh merged commit 1f9ad82 into main May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants