feat: Add workflow URL to EC2 instance tags#4658
feat: Add workflow URL to EC2 instance tags#4658roberto-civitas wants to merge 1 commit intogithub-aws-runners:mainfrom
Conversation
8a5b66b to
b98f8bd
Compare
b98f8bd to
343f078
Compare
|
@roberto-civitas thx for the PR. Good idea, but I am afraid it won't work. Runners are indeed created based on the workflow_job event, however which job starts on the runner is orechestrated by GitHub. So the actual job running on a runner is not alwasy the event that leading to creation of the runner. The module supports XRay which allows you to see correlation between which events is causing runner creation. Next to het workflow_job event created there is a event for in_progress. This event could be used to tag an instance with the job in progress. It should not hard to correlate based ont he the event since this event contians the runner name as well. Wondering what your thoughts are. |
|
Thank you for having a look at the PR. I will modify it so that it uses the event you suggest. |
Maybe good to have a short discussion on how to implement this. This to avoid you wast time on a proposal that is not fitting. My first thought would be having an extra lambda as part of the control plane. But no time to dig in so far. |
|
This can be done the same way I implemented in Forge using runner_template_hook_job_started. Here is where to pass the runner_template_hook_job_started to runners module: |
|
@npalm @roberto-civitas It’s already working in Forge, so it could be added as part of terraform-aws-github-runner. https://github.com/cisco-open/forge/blob/main/modules/platform/ec2_deployment/lambda/update_ec2_tags.py |
|
@edersonbrilhante Yup I think that approach is much beeter. Maybe good to put this by default in the scripts provided in this repo. However I would avoid any context info in this repo that is user controlled, e..g github_ref. Others should be fine. |
|
This pull request 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. |
Add the
workflow_urlto the instance tags so that it's easier to identify which build is being run by the instance.The property is passed along from the webhook lambda, as part of the SQS event.