-
Notifications
You must be signed in to change notification settings - Fork 686
feat: Add workflow URL to EC2 instance tags #4658
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
base: main
Are you sure you want to change the base?
feat: Add workflow URL to EC2 instance tags #4658
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. |
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.