Hey <@UBED6CS1Z> <@UB2EH889X> - we have more issue...
# github-actions
m
Hey @Igor Rodionov @Erik Osterman (Cloud Posse) - we have more issues with github actions. Atmos Terraform Drift Detection fails to run if we have lookups enabled in atmos. Again, it requires terraform and nodejs to be installed. It can be fixed by adding that as steps to atmos-terraform-drift-detection.yaml
Copy code
- name: Setup Terraform
        uses: hashicorp/setup-terraform@v3
        with:
          terraform_version: 1.5.7
      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 16
Another issue is - even with all of this added, lookups do not work from github actions. The lookup returns nothing.
Copy code
Error: reading IAM Instance Profile (<no value>): operation error IAM: GetInstanceProfile, https response error StatusCode: 400, RequestID: d0ab23da-fb09-4a7e-a5b8-3a34b24bdc77, api error ValidationError: 1 validation error detected: Value '<no value>' at 'instanceProfileName' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w+=,.@-]+
The lookup looks like this:
Copy code
instance_profile: '{{ (atmos.Component "iam-role/azure-agent" .stack).outputs.role.instance_profile }}'
This same code works fine locally in geodesic shell! if I run
atmos terraform output iam-role/azure-agent --stack core-apse2-auto
I can see the output I'm looking up is there:
Copy code
Terraform has been successfully initialized!
role = {
  "arn" = "arn:aws:iam::BOGUS:role/nsp-core-apse2-auto-azure-agent"
  "id" = "AROABOGUS6SEEH3A63"
  "instance_profile" = "nsp-core-apse2-auto-azure-agent"
  "name" = "nsp-core-apse2-auto-azure-agent"
  "policy" = ""
}
and local atmos picks it up
atmos terraform plan ec2-instance/agent1 --stack core-apse2-auto
e
@Gabriela Campana (Cloud Posse) please help follow up
๐Ÿ‘ 1
Re, node I have to think itโ€™s based on the self hosted runner images not containing some packages, like node. Also the node 16 is very old.
@Andriy Knysh (Cloud Posse)
i
@Marat Bakeev can you send me whole
*atmos-terraform-drift-detection.yaml*
so I will see where you added the steps. Thanks
e
Re:
atmos.Component
not working in the action, did you set
vars.ATMOS_VERSION
to the latest version?
atmos-version: ${{ vars.ATMOS_VERSION }}
a
<no value>
is a result from Go templates if it was not evaluated. Something is not configured in the GH action:
atmos.yaml
, Atmos version, etc. Since it's working locally (both components
iam-role/azure-agent
and
ec2-instance/agent1
), then someting is missing in the action config (that can be Atmos version, or path to
atmos.yaml
, or config inside
atmos.yaml
)
d
We just discussed this internally. @Jeremy G (Cloud Posse) has additional context
j
I am concerned about
azure
appearing in strings here. I have no experience with Azure and I don't know how much, if at all, our stuff has been tested with Azure. While we would like to be cloud agnostic, our stuff has been focused on AWS. I'm not exactly sure what you have. While I check on that, you should be getting Terraform installed for you. That gets configured in
rootfs/usr/local/etc/atmos/atmos.yaml
like this:
Copy code
integrations:
  github:
    gitops:
      terraform-version: 1.5.7
As for Node, we have gone through some iterations about which image to use for our self-hosted runners. Most people want to preserve the option to use containers in their workflows, so although if you don't need it, it is more efficient to not have it, we have decided to generally recommend enabling Docker-in-Docker for runners. Additionally, while it is general Cloud Posse policy to use explicit version pinning on resources like Docker images, for runners, it is counter productive, because the first thing the runner does when it starts up is check to see if an update is available, and if one its, it installs it and then restarts. So having an explicit pin does not achieve the goal of pinning which version is actually run, and adds extra workload by forcing auto updates. Putting the above together, we now recommend your runner use the following configuration snippet:
Copy code
dind_enabled: true
image: <http://ghcr.io/actions-runner-controller/actions-runner-controller/actions-runner-dind:ubuntu-20.04|ghcr.io/actions-runner-controller/actions-runner-controller/actions-runner-dind:ubuntu-20.04>
I believe we sent you a configuration that uses the default image, which is now based on Ubuntu 22.04, and I think that explains the issues you were having with Node. If you are sure you never need Docker in your runners, you can use
Copy code
dind_enabled: false
image: <http://ghcr.io/actions-runner-controller/actions-runner-controller/actions-runner:ubuntu-20.04|ghcr.io/actions-runner-controller/actions-runner-controller/actions-runner:ubuntu-20.04>
Also, I recommend upgrading
eks/actions-runner-controller
to version
1.470.1
e
@Marat Bakeev are you unblocked?
๐Ÿ‘ 1