Hi all! I'm not sure if this is an Infracost probl...
# help
s
Hi all! I'm not sure if this is an Infracost problem if I'm honest, but I've come up against a problem trying to run it in GoCD on AWS ECS agents - it's just terribly slow, taking >1hr just to run a breakdown! It's running multiple Terragrunt directories that have multiple dependencies, so I'm expecting some slowness... But if I run it through Github Actions it's so much quicker, (~1min for the same breakdown command) and on my local (~10mins). I'm trying to figure out where these time differences are coming from, originally I thought it was a resource issue since all machines are using the same CLI but I've tried using bigger instances for GoCD to run the job, to no avail. I'm wondering if anyone else has come against this?
c
Hi John, sorry I haven’t heard about anything like this before. Do you have any log output that could help narrow down the bottleneck? For example if i run the example repo with
--log-level=info
i’ll get some timestamps as it goes through different phases:
Copy code
--log-level=info
time="2023-09-05T10:40:37-04:00" level=info msg="Detected Terragrunt directory at ./examples/terragrunt/"
time="2023-09-05T10:40:37-04:00" level=info msg="Starting: Downloading Terraform modules"
time="2023-09-05T10:40:37-04:00" level=info msg="Starting: Evaluating Terraform directory"
time="2023-09-05T10:40:37-04:00" level=info msg="Starting: Downloading Terraform modules"
time="2023-09-05T10:40:37-04:00" level=info msg="Starting: Evaluating Terraform directory"
time="2023-09-05T10:40:37-04:00" level=info msg="Starting: Retrieving cloud prices to calculate costs"
s
Hi Tim, thanks for the reply! This is the raw output from the GoCD job, it's a bit long so put it in a snippet. You can see that the
Detected Terragrunt directory
phase takes a significant amount of time and so do a couple of the evaluation phases:
c
Ok let me ask around
s
Thank you!
c
Ok, so the first suggestion is to try writing a config file. This should help with the project detection phase. Second, it we could see debug logs (
--log-level=debug
) that may help narrow it down a bit more.
s
A config file is already used:
Copy code
version: 0.1
projects:
  - name: ${TG_DIR} hive
    path: ${TG_DIR}
    exclude_paths:
      - test-server/*
    env:
      ENV: hive
      ACCOUNT_NAME: hive
      REGION: us-east-1
Just getting the debug log for you, sorry for the late reply!
This is the full debug logs for the breakdown command on GoCD - sorry it's pretty lengthy 😅
c
Thanks John. I’m not really seeing anything obvious, it just seems to be slow, even the terragrunt evaluation. Best guess is that it’s hitting some cpu or memory bottleneck.