Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Question: cost attribution per team/repository recommendation #3958

Open
kgoralski opened this issue Jul 1, 2024 · 3 comments
Open

Question: cost attribution per team/repository recommendation #3958

kgoralski opened this issue Jul 1, 2024 · 3 comments

Comments

@kgoralski
Copy link

kgoralski commented Jul 1, 2024

Hey,

I wonder if you got some recommendation on dynamic EC2 tagging of self-hosted runners for cost exploring. Like per team/repository.

With multiple teams and repositories setup It would be great to for example on Job got started it got tagged additionally with tags like team, repository etc. Ideally it could be some extra tags on GH workflows side that could be picked up by scale-up lambda that could update the tags dynamically?

Maybe it could be extended with usage of these variables?

https://github.com/philips-labs/terraform-aws-github-runner/blob/main/modules/multi-runner/variables.tf#L64

runner_ec2_tags = optional(map(string), {})

Thanks in advance for the answer

@npalm
Copy link
Member

npalm commented Jul 4, 2024

With ec2 tags (and multi-runners) you can tag per runner type. Tagging per job is not supported. I think this can be done by using a pre job script that is using the job event to add a tag to the instance.

For repo level runners tagging could also be done via the lambda, but not sure if this is supported by the module. For org level runners this won't work since creating a runner based on an event does not match which job got assigned by GitHub.

@kgoralski
Copy link
Author

Tagging per job is not supported

Do you think that it could be nice feature or it's something out of the scope?

I guess the code below is the right place to look for to extend that?

https://github.com/philips-labs/terraform-aws-github-runner/blob/main/modules/multi-runner/variables.tf#L64

runner_ec2_tags = optional(map(string), {})

Copy link
Contributor

github-actions bot commented Nov 5, 2024

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Nov 5, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants